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