wdenk | 7ac1610 | 2004-08-01 22:48:16 +0000 | [diff] [blame] | 1 | /* |
| 2 | * (C) Copyright 2002 |
Detlev Zundel | f1b3f2b | 2009-05-13 10:54:10 +0200 | [diff] [blame] | 3 | * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de> |
wdenk | 7ac1610 | 2004-08-01 22:48:16 +0000 | [diff] [blame] | 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or |
| 8 | * (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 18 | * |
| 19 | */ |
| 20 | |
| 21 | #include <common.h> |
kevin.morfitt@fearnside-systems.co.uk | e0d8131 | 2009-11-17 18:30:34 +0900 | [diff] [blame] | 22 | #include <asm/arch/s3c24x0_cpu.h> |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 23 | |
Wolfgang Denk | 6405a15 | 2006-03-31 18:32:53 +0200 | [diff] [blame] | 24 | DECLARE_GLOBAL_DATA_PTR; |
| 25 | |
wdenk | 7539dea | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 26 | #ifdef CONFIG_SERIAL1 |
| 27 | #define UART_NR S3C24X0_UART0 |
| 28 | |
wdenk | c35ba4e | 2004-03-14 22:25:36 +0000 | [diff] [blame] | 29 | #elif defined(CONFIG_SERIAL2) |
wdenk | 7539dea | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 30 | # if defined(CONFIG_TRAB) |
wdenk | f6a6ac1 | 2003-09-17 15:10:32 +0000 | [diff] [blame] | 31 | # error "TRAB supports only CONFIG_SERIAL1" |
wdenk | 7539dea | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 32 | # endif |
| 33 | #define UART_NR S3C24X0_UART1 |
| 34 | |
wdenk | c35ba4e | 2004-03-14 22:25:36 +0000 | [diff] [blame] | 35 | #elif defined(CONFIG_SERIAL3) |
wdenk | 7539dea | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 36 | # if defined(CONFIG_TRAB) |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 37 | # error "TRAB supports only CONFIG_SERIAL1" |
wdenk | 7539dea | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 38 | # endif |
| 39 | #define UART_NR S3C24X0_UART2 |
| 40 | |
| 41 | #else |
| 42 | #error "Bad: you didn't configure serial ..." |
| 43 | #endif |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 44 | |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 45 | #include <asm/io.h> |
| 46 | |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 47 | #if defined(CONFIG_SERIAL_MULTI) |
| 48 | #include <serial.h> |
| 49 | |
| 50 | /* Multi serial device functions */ |
| 51 | #define DECLARE_S3C_SERIAL_FUNCTIONS(port) \ |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 52 | int s3serial##port##_init(void) \ |
| 53 | { \ |
| 54 | return serial_init_dev(port); \ |
| 55 | } \ |
| 56 | void s3serial##port##_setbrg(void) \ |
| 57 | { \ |
| 58 | serial_setbrg_dev(port); \ |
| 59 | } \ |
| 60 | int s3serial##port##_getc(void) \ |
| 61 | { \ |
| 62 | return serial_getc_dev(port); \ |
| 63 | } \ |
| 64 | int s3serial##port##_tstc(void) \ |
| 65 | { \ |
| 66 | return serial_tstc_dev(port); \ |
| 67 | } \ |
| 68 | void s3serial##port##_putc(const char c) \ |
| 69 | { \ |
| 70 | serial_putc_dev(port, c); \ |
| 71 | } \ |
| 72 | void s3serial##port##_puts(const char *s) \ |
| 73 | { \ |
| 74 | serial_puts_dev(port, s); \ |
| 75 | } |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 76 | |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 77 | #define INIT_S3C_SERIAL_STRUCTURE(port, name, bus) { \ |
| 78 | name, \ |
| 79 | bus, \ |
| 80 | s3serial##port##_init, \ |
| 81 | s3serial##port##_setbrg, \ |
| 82 | s3serial##port##_getc, \ |
| 83 | s3serial##port##_tstc, \ |
| 84 | s3serial##port##_putc, \ |
| 85 | s3serial##port##_puts, \ |
| 86 | } |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 87 | |
| 88 | #endif /* CONFIG_SERIAL_MULTI */ |
| 89 | |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 90 | #ifdef CONFIG_HWFLOW |
| 91 | static int hwflow; |
| 92 | #endif |
| 93 | |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 94 | void _serial_setbrg(const int dev_index) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 95 | { |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 96 | struct s3c24x0_uart *uart = s3c24x0_get_base_uart(dev_index); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 97 | unsigned int reg = 0; |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 98 | int i; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 99 | |
| 100 | /* value is calculated so : (int)(PCLK/16./baudrate) -1 */ |
| 101 | reg = get_PCLK() / (16 * gd->baudrate) - 1; |
| 102 | |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 103 | writel(reg, &uart->UBRDIV); |
| 104 | for (i = 0; i < 100; i++) |
| 105 | /* Delay */ ; |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 106 | } |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 107 | |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 108 | #if defined(CONFIG_SERIAL_MULTI) |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 109 | static inline void serial_setbrg_dev(unsigned int dev_index) |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 110 | { |
| 111 | _serial_setbrg(dev_index); |
| 112 | } |
| 113 | #else |
| 114 | void serial_setbrg(void) |
| 115 | { |
| 116 | _serial_setbrg(UART_NR); |
| 117 | } |
| 118 | #endif |
| 119 | |
| 120 | |
| 121 | /* Initialise the serial port. The settings are always 8 data bits, no parity, |
| 122 | * 1 stop bit, no start bits. |
| 123 | */ |
| 124 | static int serial_init_dev(const int dev_index) |
| 125 | { |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 126 | struct s3c24x0_uart *uart = s3c24x0_get_base_uart(dev_index); |
| 127 | |
| 128 | #ifdef CONFIG_HWFLOW |
| 129 | hwflow = 0; /* turned off by default */ |
| 130 | #endif |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 131 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 132 | /* FIFO enable, Tx/Rx FIFO clear */ |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 133 | writel(0x07, &uart->UFCON); |
| 134 | writel(0x0, &uart->UMCON); |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 135 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 136 | /* Normal,No parity,1 stop,8 bit */ |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 137 | writel(0x3, &uart->ULCON); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 138 | /* |
| 139 | * tx=level,rx=edge,disable timeout int.,enable rx error int., |
| 140 | * normal,interrupt or polling |
| 141 | */ |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 142 | writel(0x245, &uart->UCON); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 143 | |
| 144 | #ifdef CONFIG_HWFLOW |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 145 | writel(0x1, &uart->UMCON); /* RTS up */ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 146 | #endif |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 147 | |
| 148 | /* FIXME: This is sooooooooooooooooooo ugly */ |
| 149 | #if defined(CONFIG_ARCH_GTA02_v1) || defined(CONFIG_ARCH_GTA02_v2) |
| 150 | /* we need auto hw flow control on the gsm and gps port */ |
| 151 | if (dev_index == 0 || dev_index == 1) |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 152 | writel(0x10, &uart->UMCON); |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 153 | #endif |
| 154 | _serial_setbrg(dev_index); |
| 155 | |
| 156 | return (0); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 157 | } |
| 158 | |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 159 | #if !defined(CONFIG_SERIAL_MULTI) |
| 160 | /* Initialise the serial port. The settings are always 8 data bits, no parity, |
| 161 | * 1 stop bit, no start bits. |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 162 | */ |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 163 | int serial_init(void) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 164 | { |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 165 | return serial_init_dev(UART_NR); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 166 | } |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 167 | #endif |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 168 | |
| 169 | /* |
| 170 | * Read a single byte from the serial port. Returns 1 on success, 0 |
| 171 | * otherwise. When the function is succesfull, the character read is |
| 172 | * written into its argument c. |
| 173 | */ |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 174 | int _serial_getc(const int dev_index) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 175 | { |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 176 | struct s3c24x0_uart *uart = s3c24x0_get_base_uart(dev_index); |
wdenk | 57b2d80 | 2003-06-27 21:31:46 +0000 | [diff] [blame] | 177 | |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 178 | while (!(readl(&uart->UTRSTAT) & 0x1)) |
| 179 | /* wait for character to arrive */ ; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 180 | |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 181 | return readb(&uart->URXH) & 0xff; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 182 | } |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 183 | |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 184 | #if defined(CONFIG_SERIAL_MULTI) |
| 185 | static inline int serial_getc_dev(unsigned int dev_index) |
| 186 | { |
| 187 | return _serial_getc(dev_index); |
| 188 | } |
| 189 | #else |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 190 | int serial_getc(void) |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 191 | { |
| 192 | return _serial_getc(UART_NR); |
| 193 | } |
| 194 | #endif |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 195 | |
| 196 | #ifdef CONFIG_HWFLOW |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 197 | int hwflow_onoff(int on) |
| 198 | { |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 199 | switch (on) { |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 200 | case 0: |
| 201 | default: |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 202 | break; /* return current */ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 203 | case 1: |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 204 | hwflow = 1; /* turn on */ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 205 | break; |
| 206 | case -1: |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 207 | hwflow = 0; /* turn off */ |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 208 | break; |
| 209 | } |
| 210 | return hwflow; |
| 211 | } |
| 212 | #endif |
| 213 | |
| 214 | #ifdef CONFIG_MODEM_SUPPORT |
| 215 | static int be_quiet = 0; |
| 216 | void disable_putc(void) |
| 217 | { |
| 218 | be_quiet = 1; |
| 219 | } |
| 220 | |
| 221 | void enable_putc(void) |
| 222 | { |
| 223 | be_quiet = 0; |
| 224 | } |
| 225 | #endif |
| 226 | |
| 227 | |
| 228 | /* |
| 229 | * Output a single byte to the serial port. |
| 230 | */ |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 231 | void _serial_putc(const char c, const int dev_index) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 232 | { |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 233 | struct s3c24x0_uart *uart = s3c24x0_get_base_uart(dev_index); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 234 | #ifdef CONFIG_MODEM_SUPPORT |
| 235 | if (be_quiet) |
| 236 | return; |
| 237 | #endif |
| 238 | |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 239 | while (!(readl(&uart->UTRSTAT) & 0x2)) |
| 240 | /* wait for room in the tx FIFO */ ; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 241 | |
| 242 | #ifdef CONFIG_HWFLOW |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 243 | while (hwflow && !(readl(&uart->UMSTAT) & 0x1)) |
| 244 | /* Wait for CTS up */ ; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 245 | #endif |
| 246 | |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 247 | writeb(c, &uart->UTXH); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 248 | |
| 249 | /* If \n, also do \r */ |
| 250 | if (c == '\n') |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 251 | serial_putc('\r'); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 252 | } |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 253 | |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 254 | #if defined(CONFIG_SERIAL_MULTI) |
| 255 | static inline void serial_putc_dev(unsigned int dev_index, const char c) |
| 256 | { |
| 257 | _serial_putc(c, dev_index); |
| 258 | } |
| 259 | #else |
| 260 | void serial_putc(const char c) |
| 261 | { |
| 262 | _serial_putc(c, UART_NR); |
| 263 | } |
| 264 | #endif |
| 265 | |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 266 | |
| 267 | /* |
| 268 | * Test whether a character is in the RX buffer |
| 269 | */ |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 270 | int _serial_tstc(const int dev_index) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 271 | { |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 272 | struct s3c24x0_uart *uart = s3c24x0_get_base_uart(dev_index); |
wdenk | 7539dea | 2003-06-19 23:01:32 +0000 | [diff] [blame] | 273 | |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 274 | return readl(&uart->UTRSTAT) & 0x1; |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 275 | } |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 276 | |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 277 | #if defined(CONFIG_SERIAL_MULTI) |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 278 | static inline int serial_tstc_dev(unsigned int dev_index) |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 279 | { |
| 280 | return _serial_tstc(dev_index); |
| 281 | } |
| 282 | #else |
| 283 | int serial_tstc(void) |
| 284 | { |
| 285 | return _serial_tstc(UART_NR); |
| 286 | } |
| 287 | #endif |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 288 | |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 289 | void _serial_puts(const char *s, const int dev_index) |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 290 | { |
| 291 | while (*s) { |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 292 | _serial_putc(*s++, dev_index); |
wdenk | c609719 | 2002-11-03 00:24:07 +0000 | [diff] [blame] | 293 | } |
| 294 | } |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 295 | |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 296 | #if defined(CONFIG_SERIAL_MULTI) |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 297 | static inline void serial_puts_dev(int dev_index, const char *s) |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 298 | { |
| 299 | _serial_puts(s, dev_index); |
| 300 | } |
| 301 | #else |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 302 | void serial_puts(const char *s) |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 303 | { |
| 304 | _serial_puts(s, UART_NR); |
| 305 | } |
| 306 | #endif |
| 307 | |
| 308 | #if defined(CONFIG_SERIAL_MULTI) |
| 309 | DECLARE_S3C_SERIAL_FUNCTIONS(0); |
| 310 | struct serial_device s3c24xx_serial0_device = |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 311 | INIT_S3C_SERIAL_STRUCTURE(0, "s3ser0", "S3UART1"); |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 312 | DECLARE_S3C_SERIAL_FUNCTIONS(1); |
| 313 | struct serial_device s3c24xx_serial1_device = |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 314 | INIT_S3C_SERIAL_STRUCTURE(1, "s3ser1", "S3UART2"); |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 315 | DECLARE_S3C_SERIAL_FUNCTIONS(2); |
| 316 | struct serial_device s3c24xx_serial2_device = |
kevin.morfitt@fearnside-systems.co.uk | 1464f4d | 2009-10-10 13:33:11 +0900 | [diff] [blame] | 317 | INIT_S3C_SERIAL_STRUCTURE(2, "s3ser2", "S3UART3"); |
Harald Welte | da41262 | 2007-12-19 14:24:40 +0100 | [diff] [blame] | 318 | #endif /* CONFIG_SERIAL_MULTI */ |