diff options
Diffstat (limited to 'drivers/serial')
-rw-r--r-- | drivers/serial/8250.c | 5 | ||||
-rw-r--r-- | drivers/serial/8250.h | 5 | ||||
-rw-r--r-- | drivers/serial/Kconfig | 8 | ||||
-rw-r--r-- | drivers/serial/bfin_5xx.c | 98 | ||||
-rw-r--r-- | drivers/serial/crisv10.c | 2 | ||||
-rw-r--r-- | drivers/serial/mcfserial.c | 1 | ||||
-rw-r--r-- | drivers/serial/sh-sci.c | 40 | ||||
-rw-r--r-- | drivers/serial/sh-sci.h | 27 |
8 files changed, 67 insertions, 119 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index a1ca9b7bf2d..1400ea6a249 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
@@ -43,6 +43,7 @@ | |||
43 | 43 | ||
44 | #include <asm/io.h> | 44 | #include <asm/io.h> |
45 | #include <asm/irq.h> | 45 | #include <asm/irq.h> |
46 | #include <asm/serial.h> | ||
46 | 47 | ||
47 | #include "8250.h" | 48 | #include "8250.h" |
48 | 49 | ||
@@ -92,8 +93,6 @@ static unsigned int nr_uarts = CONFIG_SERIAL_8250_RUNTIME_UARTS; | |||
92 | */ | 93 | */ |
93 | #define CONFIG_HUB6 1 | 94 | #define CONFIG_HUB6 1 |
94 | 95 | ||
95 | #include <asm/serial.h> | ||
96 | |||
97 | /* | 96 | /* |
98 | * SERIAL_PORT_DFNS tells us about built-in ports that have no | 97 | * SERIAL_PORT_DFNS tells us about built-in ports that have no |
99 | * standard enumeration mechanism. Platforms that can find all | 98 | * standard enumeration mechanism. Platforms that can find all |
@@ -1548,6 +1547,8 @@ static int serial_link_irq_chain(struct uart_8250_port *up) | |||
1548 | i->head = &up->list; | 1547 | i->head = &up->list; |
1549 | spin_unlock_irq(&i->lock); | 1548 | spin_unlock_irq(&i->lock); |
1550 | 1549 | ||
1550 | irq_flags |= SERIAL_EXTRA_IRQ_FLAGS; | ||
1551 | |||
1551 | ret = request_irq(up->port.irq, serial8250_interrupt, | 1552 | ret = request_irq(up->port.irq, serial8250_interrupt, |
1552 | irq_flags, "serial", i); | 1553 | irq_flags, "serial", i); |
1553 | if (ret < 0) | 1554 | if (ret < 0) |
diff --git a/drivers/serial/8250.h b/drivers/serial/8250.h index 91bd28f2bb4..a10a40cc0d9 100644 --- a/drivers/serial/8250.h +++ b/drivers/serial/8250.h | |||
@@ -78,3 +78,8 @@ struct serial8250_config { | |||
78 | #else | 78 | #else |
79 | #define ALPHA_KLUDGE_MCR 0 | 79 | #define ALPHA_KLUDGE_MCR 0 |
80 | #endif | 80 | #endif |
81 | |||
82 | #ifndef SERIAL_EXTRA_IRQ_FLAGS | ||
83 | #define SERIAL_EXTRA_IRQ_FLAGS 0 | ||
84 | #endif | ||
85 | |||
diff --git a/drivers/serial/Kconfig b/drivers/serial/Kconfig index 36acbcca2d4..9bc42763623 100644 --- a/drivers/serial/Kconfig +++ b/drivers/serial/Kconfig | |||
@@ -976,11 +976,15 @@ config SERIAL_68328_RTS_CTS | |||
976 | depends on SERIAL_68328 | 976 | depends on SERIAL_68328 |
977 | 977 | ||
978 | config SERIAL_COLDFIRE | 978 | config SERIAL_COLDFIRE |
979 | bool "ColdFire serial support" | 979 | bool "ColdFire serial support (DEPRECATED)" |
980 | depends on COLDFIRE | 980 | depends on COLDFIRE |
981 | help | 981 | help |
982 | This driver supports the built-in serial ports of the Motorola ColdFire | 982 | This driver supports the built-in serial ports of the Motorola ColdFire |
983 | family of CPUs. | 983 | family of CPUs. |
984 | This driver is deprecated because it supports only the old interface | ||
985 | for serial drivers and features like magic keys are not working. | ||
986 | Please switch to the new style driver because this driver will be | ||
987 | removed soon. | ||
984 | 988 | ||
985 | config SERIAL_MCF | 989 | config SERIAL_MCF |
986 | bool "Coldfire serial support (new style driver)" | 990 | bool "Coldfire serial support (new style driver)" |
@@ -1357,7 +1361,7 @@ config SERIAL_SC26XX_CONSOLE | |||
1357 | 1361 | ||
1358 | config SERIAL_BFIN_SPORT | 1362 | config SERIAL_BFIN_SPORT |
1359 | tristate "Blackfin SPORT emulate UART (EXPERIMENTAL)" | 1363 | tristate "Blackfin SPORT emulate UART (EXPERIMENTAL)" |
1360 | depends on BFIN && EXPERIMENTAL | 1364 | depends on BLACKFIN && EXPERIMENTAL |
1361 | select SERIAL_CORE | 1365 | select SERIAL_CORE |
1362 | help | 1366 | help |
1363 | Enble support SPORT emulate UART on Blackfin series. | 1367 | Enble support SPORT emulate UART on Blackfin series. |
diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c index 8a2f6a1baa7..d6b4ead693b 100644 --- a/drivers/serial/bfin_5xx.c +++ b/drivers/serial/bfin_5xx.c | |||
@@ -65,9 +65,6 @@ static void bfin_serial_stop_tx(struct uart_port *port) | |||
65 | { | 65 | { |
66 | struct bfin_serial_port *uart = (struct bfin_serial_port *)port; | 66 | struct bfin_serial_port *uart = (struct bfin_serial_port *)port; |
67 | struct circ_buf *xmit = &uart->port.info->xmit; | 67 | struct circ_buf *xmit = &uart->port.info->xmit; |
68 | #if !defined(CONFIG_BF54x) && !defined(CONFIG_SERIAL_BFIN_DMA) | ||
69 | unsigned short ier; | ||
70 | #endif | ||
71 | 68 | ||
72 | while (!(UART_GET_LSR(uart) & TEMT)) | 69 | while (!(UART_GET_LSR(uart) & TEMT)) |
73 | cpu_relax(); | 70 | cpu_relax(); |
@@ -82,12 +79,8 @@ static void bfin_serial_stop_tx(struct uart_port *port) | |||
82 | #ifdef CONFIG_BF54x | 79 | #ifdef CONFIG_BF54x |
83 | /* Clear TFI bit */ | 80 | /* Clear TFI bit */ |
84 | UART_PUT_LSR(uart, TFI); | 81 | UART_PUT_LSR(uart, TFI); |
85 | UART_CLEAR_IER(uart, ETBEI); | ||
86 | #else | ||
87 | ier = UART_GET_IER(uart); | ||
88 | ier &= ~ETBEI; | ||
89 | UART_PUT_IER(uart, ier); | ||
90 | #endif | 82 | #endif |
83 | UART_CLEAR_IER(uart, ETBEI); | ||
91 | #endif | 84 | #endif |
92 | } | 85 | } |
93 | 86 | ||
@@ -102,14 +95,7 @@ static void bfin_serial_start_tx(struct uart_port *port) | |||
102 | if (uart->tx_done) | 95 | if (uart->tx_done) |
103 | bfin_serial_dma_tx_chars(uart); | 96 | bfin_serial_dma_tx_chars(uart); |
104 | #else | 97 | #else |
105 | #ifdef CONFIG_BF54x | ||
106 | UART_SET_IER(uart, ETBEI); | 98 | UART_SET_IER(uart, ETBEI); |
107 | #else | ||
108 | unsigned short ier; | ||
109 | ier = UART_GET_IER(uart); | ||
110 | ier |= ETBEI; | ||
111 | UART_PUT_IER(uart, ier); | ||
112 | #endif | ||
113 | bfin_serial_tx_chars(uart); | 99 | bfin_serial_tx_chars(uart); |
114 | #endif | 100 | #endif |
115 | } | 101 | } |
@@ -120,21 +106,10 @@ static void bfin_serial_start_tx(struct uart_port *port) | |||
120 | static void bfin_serial_stop_rx(struct uart_port *port) | 106 | static void bfin_serial_stop_rx(struct uart_port *port) |
121 | { | 107 | { |
122 | struct bfin_serial_port *uart = (struct bfin_serial_port *)port; | 108 | struct bfin_serial_port *uart = (struct bfin_serial_port *)port; |
123 | #ifdef CONFIG_KGDB_UART | 109 | #ifdef CONFIG_KGDB_UART |
124 | if (uart->port.line != CONFIG_KGDB_UART_PORT) { | 110 | if (uart->port.line != CONFIG_KGDB_UART_PORT) |
125 | #endif | 111 | #endif |
126 | #ifdef CONFIG_BF54x | ||
127 | UART_CLEAR_IER(uart, ERBFI); | 112 | UART_CLEAR_IER(uart, ERBFI); |
128 | #else | ||
129 | unsigned short ier; | ||
130 | |||
131 | ier = UART_GET_IER(uart); | ||
132 | ier &= ~ERBFI; | ||
133 | UART_PUT_IER(uart, ier); | ||
134 | #endif | ||
135 | #ifdef CONFIG_KGDB_UART | ||
136 | } | ||
137 | #endif | ||
138 | } | 113 | } |
139 | 114 | ||
140 | /* | 115 | /* |
@@ -161,10 +136,7 @@ void kgdb_put_debug_char(int chr) | |||
161 | SSYNC(); | 136 | SSYNC(); |
162 | } | 137 | } |
163 | 138 | ||
164 | #ifndef CONFIG_BF54x | 139 | UART_CLEAR_DLAB(uart); |
165 | UART_PUT_LCR(uart, UART_GET_LCR(uart)&(~DLAB)); | ||
166 | SSYNC(); | ||
167 | #endif | ||
168 | UART_PUT_CHAR(uart, (unsigned char)chr); | 140 | UART_PUT_CHAR(uart, (unsigned char)chr); |
169 | SSYNC(); | 141 | SSYNC(); |
170 | } | 142 | } |
@@ -183,10 +155,7 @@ int kgdb_get_debug_char(void) | |||
183 | while(!(UART_GET_LSR(uart) & DR)) { | 155 | while(!(UART_GET_LSR(uart) & DR)) { |
184 | SSYNC(); | 156 | SSYNC(); |
185 | } | 157 | } |
186 | #ifndef CONFIG_BF54x | 158 | UART_CLEAR_DLAB(uart); |
187 | UART_PUT_LCR(uart, UART_GET_LCR(uart)&(~DLAB)); | ||
188 | SSYNC(); | ||
189 | #endif | ||
190 | chr = UART_GET_CHAR(uart); | 159 | chr = UART_GET_CHAR(uart); |
191 | SSYNC(); | 160 | SSYNC(); |
192 | 161 | ||
@@ -208,9 +177,6 @@ static void bfin_serial_rx_chars(struct bfin_serial_port *uart) | |||
208 | struct tty_struct *tty = uart->port.info->tty; | 177 | struct tty_struct *tty = uart->port.info->tty; |
209 | unsigned int status, ch, flg; | 178 | unsigned int status, ch, flg; |
210 | static struct timeval anomaly_start = { .tv_sec = 0 }; | 179 | static struct timeval anomaly_start = { .tv_sec = 0 }; |
211 | #ifdef CONFIG_KGDB_UART | ||
212 | struct pt_regs *regs = get_irq_regs(); | ||
213 | #endif | ||
214 | 180 | ||
215 | status = UART_GET_LSR(uart); | 181 | status = UART_GET_LSR(uart); |
216 | UART_CLEAR_LSR(uart); | 182 | UART_CLEAR_LSR(uart); |
@@ -220,6 +186,7 @@ static void bfin_serial_rx_chars(struct bfin_serial_port *uart) | |||
220 | 186 | ||
221 | #ifdef CONFIG_KGDB_UART | 187 | #ifdef CONFIG_KGDB_UART |
222 | if (uart->port.line == CONFIG_KGDB_UART_PORT) { | 188 | if (uart->port.line == CONFIG_KGDB_UART_PORT) { |
189 | struct pt_regs *regs = get_irq_regs(); | ||
223 | if (uart->port.cons->index == CONFIG_KGDB_UART_PORT && ch == 0x1) { /* Ctrl + A */ | 190 | if (uart->port.cons->index == CONFIG_KGDB_UART_PORT && ch == 0x1) { /* Ctrl + A */ |
224 | kgdb_breakkey_pressed(regs); | 191 | kgdb_breakkey_pressed(regs); |
225 | return; | 192 | return; |
@@ -391,7 +358,6 @@ static void bfin_serial_do_work(struct work_struct *work) | |||
391 | static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart) | 358 | static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart) |
392 | { | 359 | { |
393 | struct circ_buf *xmit = &uart->port.info->xmit; | 360 | struct circ_buf *xmit = &uart->port.info->xmit; |
394 | unsigned short ier; | ||
395 | 361 | ||
396 | uart->tx_done = 0; | 362 | uart->tx_done = 0; |
397 | 363 | ||
@@ -429,13 +395,7 @@ static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart) | |||
429 | set_dma_x_modify(uart->tx_dma_channel, 1); | 395 | set_dma_x_modify(uart->tx_dma_channel, 1); |
430 | enable_dma(uart->tx_dma_channel); | 396 | enable_dma(uart->tx_dma_channel); |
431 | 397 | ||
432 | #ifdef CONFIG_BF54x | ||
433 | UART_SET_IER(uart, ETBEI); | 398 | UART_SET_IER(uart, ETBEI); |
434 | #else | ||
435 | ier = UART_GET_IER(uart); | ||
436 | ier |= ETBEI; | ||
437 | UART_PUT_IER(uart, ier); | ||
438 | #endif | ||
439 | } | 399 | } |
440 | 400 | ||
441 | static void bfin_serial_dma_rx_chars(struct bfin_serial_port *uart) | 401 | static void bfin_serial_dma_rx_chars(struct bfin_serial_port *uart) |
@@ -513,19 +473,12 @@ static irqreturn_t bfin_serial_dma_tx_int(int irq, void *dev_id) | |||
513 | { | 473 | { |
514 | struct bfin_serial_port *uart = dev_id; | 474 | struct bfin_serial_port *uart = dev_id; |
515 | struct circ_buf *xmit = &uart->port.info->xmit; | 475 | struct circ_buf *xmit = &uart->port.info->xmit; |
516 | unsigned short ier; | ||
517 | 476 | ||
518 | spin_lock(&uart->port.lock); | 477 | spin_lock(&uart->port.lock); |
519 | if (!(get_dma_curr_irqstat(uart->tx_dma_channel)&DMA_RUN)) { | 478 | if (!(get_dma_curr_irqstat(uart->tx_dma_channel)&DMA_RUN)) { |
520 | disable_dma(uart->tx_dma_channel); | 479 | disable_dma(uart->tx_dma_channel); |
521 | clear_dma_irqstat(uart->tx_dma_channel); | 480 | clear_dma_irqstat(uart->tx_dma_channel); |
522 | #ifdef CONFIG_BF54x | ||
523 | UART_CLEAR_IER(uart, ETBEI); | 481 | UART_CLEAR_IER(uart, ETBEI); |
524 | #else | ||
525 | ier = UART_GET_IER(uart); | ||
526 | ier &= ~ETBEI; | ||
527 | UART_PUT_IER(uart, ier); | ||
528 | #endif | ||
529 | xmit->tail = (xmit->tail + uart->tx_count) & (UART_XMIT_SIZE - 1); | 482 | xmit->tail = (xmit->tail + uart->tx_count) & (UART_XMIT_SIZE - 1); |
530 | uart->port.icount.tx += uart->tx_count; | 483 | uart->port.icount.tx += uart->tx_count; |
531 | 484 | ||
@@ -701,7 +654,6 @@ static int bfin_serial_startup(struct uart_port *port) | |||
701 | # endif | 654 | # endif |
702 | } | 655 | } |
703 | 656 | ||
704 | |||
705 | if (request_irq | 657 | if (request_irq |
706 | (uart->port.irq+1, bfin_serial_tx_int, IRQF_DISABLED, | 658 | (uart->port.irq+1, bfin_serial_tx_int, IRQF_DISABLED, |
707 | "BFIN_UART_TX", uart)) { | 659 | "BFIN_UART_TX", uart)) { |
@@ -710,11 +662,7 @@ static int bfin_serial_startup(struct uart_port *port) | |||
710 | return -EBUSY; | 662 | return -EBUSY; |
711 | } | 663 | } |
712 | #endif | 664 | #endif |
713 | #ifdef CONFIG_BF54x | ||
714 | UART_SET_IER(uart, ERBFI); | 665 | UART_SET_IER(uart, ERBFI); |
715 | #else | ||
716 | UART_PUT_IER(uart, UART_GET_IER(uart) | ERBFI); | ||
717 | #endif | ||
718 | return 0; | 666 | return 0; |
719 | } | 667 | } |
720 | 668 | ||
@@ -810,26 +758,15 @@ bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios, | |||
810 | UART_PUT_IER(uart, 0); | 758 | UART_PUT_IER(uart, 0); |
811 | #endif | 759 | #endif |
812 | 760 | ||
813 | #ifndef CONFIG_BF54x | ||
814 | /* Set DLAB in LCR to Access DLL and DLH */ | 761 | /* Set DLAB in LCR to Access DLL and DLH */ |
815 | val = UART_GET_LCR(uart); | 762 | UART_SET_DLAB(uart); |
816 | val |= DLAB; | ||
817 | UART_PUT_LCR(uart, val); | ||
818 | SSYNC(); | ||
819 | #endif | ||
820 | 763 | ||
821 | UART_PUT_DLL(uart, quot & 0xFF); | 764 | UART_PUT_DLL(uart, quot & 0xFF); |
822 | SSYNC(); | ||
823 | UART_PUT_DLH(uart, (quot >> 8) & 0xFF); | 765 | UART_PUT_DLH(uart, (quot >> 8) & 0xFF); |
824 | SSYNC(); | 766 | SSYNC(); |
825 | 767 | ||
826 | #ifndef CONFIG_BF54x | ||
827 | /* Clear DLAB in LCR to Access THR RBR IER */ | 768 | /* Clear DLAB in LCR to Access THR RBR IER */ |
828 | val = UART_GET_LCR(uart); | 769 | UART_CLEAR_DLAB(uart); |
829 | val &= ~DLAB; | ||
830 | UART_PUT_LCR(uart, val); | ||
831 | SSYNC(); | ||
832 | #endif | ||
833 | 770 | ||
834 | UART_PUT_LCR(uart, lcr); | 771 | UART_PUT_LCR(uart, lcr); |
835 | 772 | ||
@@ -992,8 +929,7 @@ bfin_serial_console_get_options(struct bfin_serial_port *uart, int *baud, | |||
992 | status = UART_GET_IER(uart) & (ERBFI | ETBEI); | 929 | status = UART_GET_IER(uart) & (ERBFI | ETBEI); |
993 | if (status == (ERBFI | ETBEI)) { | 930 | if (status == (ERBFI | ETBEI)) { |
994 | /* ok, the port was enabled */ | 931 | /* ok, the port was enabled */ |
995 | unsigned short lcr, val; | 932 | u16 lcr, dlh, dll; |
996 | unsigned short dlh, dll; | ||
997 | 933 | ||
998 | lcr = UART_GET_LCR(uart); | 934 | lcr = UART_GET_LCR(uart); |
999 | 935 | ||
@@ -1010,22 +946,14 @@ bfin_serial_console_get_options(struct bfin_serial_port *uart, int *baud, | |||
1010 | case 2: *bits = 7; break; | 946 | case 2: *bits = 7; break; |
1011 | case 3: *bits = 8; break; | 947 | case 3: *bits = 8; break; |
1012 | } | 948 | } |
1013 | #ifndef CONFIG_BF54x | ||
1014 | /* Set DLAB in LCR to Access DLL and DLH */ | 949 | /* Set DLAB in LCR to Access DLL and DLH */ |
1015 | val = UART_GET_LCR(uart); | 950 | UART_SET_DLAB(uart); |
1016 | val |= DLAB; | ||
1017 | UART_PUT_LCR(uart, val); | ||
1018 | #endif | ||
1019 | 951 | ||
1020 | dll = UART_GET_DLL(uart); | 952 | dll = UART_GET_DLL(uart); |
1021 | dlh = UART_GET_DLH(uart); | 953 | dlh = UART_GET_DLH(uart); |
1022 | 954 | ||
1023 | #ifndef CONFIG_BF54x | ||
1024 | /* Clear DLAB in LCR to Access THR RBR IER */ | 955 | /* Clear DLAB in LCR to Access THR RBR IER */ |
1025 | val = UART_GET_LCR(uart); | 956 | UART_CLEAR_DLAB(uart); |
1026 | val &= ~DLAB; | ||
1027 | UART_PUT_LCR(uart, val); | ||
1028 | #endif | ||
1029 | 957 | ||
1030 | *baud = get_sclk() / (16*(dll | dlh << 8)); | 958 | *baud = get_sclk() / (16*(dll | dlh << 8)); |
1031 | } | 959 | } |
@@ -1290,11 +1218,7 @@ static int __init bfin_serial_init(void) | |||
1290 | request_irq(uart->port.irq, bfin_serial_rx_int, | 1218 | request_irq(uart->port.irq, bfin_serial_rx_int, |
1291 | IRQF_DISABLED, "BFIN_UART_RX", uart); | 1219 | IRQF_DISABLED, "BFIN_UART_RX", uart); |
1292 | pr_info("Request irq for kgdb uart port\n"); | 1220 | pr_info("Request irq for kgdb uart port\n"); |
1293 | #ifdef CONFIG_BF54x | ||
1294 | UART_SET_IER(uart, ERBFI); | 1221 | UART_SET_IER(uart, ERBFI); |
1295 | #else | ||
1296 | UART_PUT_IER(uart, UART_GET_IER(uart) | ERBFI); | ||
1297 | #endif | ||
1298 | SSYNC(); | 1222 | SSYNC(); |
1299 | t.c_cflag = CS8|B57600; | 1223 | t.c_cflag = CS8|B57600; |
1300 | t.c_iflag = 0; | 1224 | t.c_iflag = 0; |
diff --git a/drivers/serial/crisv10.c b/drivers/serial/crisv10.c index f9fa237aa94..3e0366eab41 100644 --- a/drivers/serial/crisv10.c +++ b/drivers/serial/crisv10.c | |||
@@ -3808,7 +3808,7 @@ rs_close(struct tty_struct *tty, struct file * filp) | |||
3808 | 3808 | ||
3809 | shutdown(info); | 3809 | shutdown(info); |
3810 | rs_flush_buffer(tty); | 3810 | rs_flush_buffer(tty); |
3811 | tty_ldisc_flush_buffer(tty); | 3811 | tty_ldisc_flush(tty); |
3812 | tty->closing = 0; | 3812 | tty->closing = 0; |
3813 | info->event = 0; | 3813 | info->event = 0; |
3814 | info->tty = 0; | 3814 | info->tty = 0; |
diff --git a/drivers/serial/mcfserial.c b/drivers/serial/mcfserial.c index 43af40d59b8..56007cc8a9b 100644 --- a/drivers/serial/mcfserial.c +++ b/drivers/serial/mcfserial.c | |||
@@ -1,3 +1,4 @@ | |||
1 | #warning This driver is deprecated. Check Kconfig for details. | ||
1 | /* | 2 | /* |
2 | * mcfserial.c -- serial driver for ColdFire internal UARTS. | 3 | * mcfserial.c -- serial driver for ColdFire internal UARTS. |
3 | * | 4 | * |
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index 96910618771..ce6ee92b3a1 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c | |||
@@ -42,14 +42,12 @@ | |||
42 | #include <linux/console.h> | 42 | #include <linux/console.h> |
43 | #include <linux/platform_device.h> | 43 | #include <linux/platform_device.h> |
44 | #include <linux/serial_sci.h> | 44 | #include <linux/serial_sci.h> |
45 | |||
46 | #ifdef CONFIG_CPU_FREQ | ||
47 | #include <linux/notifier.h> | 45 | #include <linux/notifier.h> |
48 | #include <linux/cpufreq.h> | 46 | #include <linux/cpufreq.h> |
49 | #endif | 47 | #include <linux/clk.h> |
50 | |||
51 | #if defined(CONFIG_SUPERH) && !defined(CONFIG_SUPERH64) | ||
52 | #include <linux/ctype.h> | 48 | #include <linux/ctype.h> |
49 | |||
50 | #ifdef CONFIG_SUPERH | ||
53 | #include <asm/clock.h> | 51 | #include <asm/clock.h> |
54 | #include <asm/sh_bios.h> | 52 | #include <asm/sh_bios.h> |
55 | #include <asm/kgdb.h> | 53 | #include <asm/kgdb.h> |
@@ -80,7 +78,7 @@ struct sci_port { | |||
80 | struct timer_list break_timer; | 78 | struct timer_list break_timer; |
81 | int break_flag; | 79 | int break_flag; |
82 | 80 | ||
83 | #if defined(CONFIG_SUPERH) && !defined(CONFIG_SUPERH64) | 81 | #ifdef CONFIG_SUPERH |
84 | /* Port clock */ | 82 | /* Port clock */ |
85 | struct clk *clk; | 83 | struct clk *clk; |
86 | #endif | 84 | #endif |
@@ -186,15 +184,15 @@ static void put_string(struct sci_port *sci_port, const char *buffer, int count) | |||
186 | int h, l; | 184 | int h, l; |
187 | 185 | ||
188 | c = *p++; | 186 | c = *p++; |
189 | h = highhex(c); | 187 | h = hex_asc_hi(c); |
190 | l = lowhex(c); | 188 | l = hex_asc_lo(c); |
191 | put_char(port, h); | 189 | put_char(port, h); |
192 | put_char(port, l); | 190 | put_char(port, l); |
193 | checksum += h + l; | 191 | checksum += h + l; |
194 | } | 192 | } |
195 | put_char(port, '#'); | 193 | put_char(port, '#'); |
196 | put_char(port, highhex(checksum)); | 194 | put_char(port, hex_asc_hi(checksum)); |
197 | put_char(port, lowhex(checksum)); | 195 | put_char(port, hex_asc_lo(checksum)); |
198 | } while (get_char(port) != '+'); | 196 | } while (get_char(port) != '+'); |
199 | } else | 197 | } else |
200 | #endif /* CONFIG_SH_STANDARD_BIOS || CONFIG_SH_KGDB */ | 198 | #endif /* CONFIG_SH_STANDARD_BIOS || CONFIG_SH_KGDB */ |
@@ -365,21 +363,19 @@ static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag) | |||
365 | static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag) | 363 | static void sci_init_pins_scif(struct uart_port *port, unsigned int cflag) |
366 | { | 364 | { |
367 | unsigned int fcr_val = 0; | 365 | unsigned int fcr_val = 0; |
366 | unsigned short data; | ||
368 | 367 | ||
369 | if (cflag & CRTSCTS) { | 368 | if (port->mapbase == 0xffe00000) { |
370 | fcr_val |= SCFCR_MCE; | 369 | data = ctrl_inw(PSCR); |
371 | 370 | data &= ~0x03cf; | |
372 | ctrl_outw(0x0000, PORT_PSCR); | 371 | if (cflag & CRTSCTS) |
373 | } else { | 372 | fcr_val |= SCFCR_MCE; |
374 | unsigned short data; | 373 | else |
375 | 374 | data |= 0x0340; | |
376 | data = ctrl_inw(PORT_PSCR); | ||
377 | data &= 0x033f; | ||
378 | data |= 0x0400; | ||
379 | ctrl_outw(data, PORT_PSCR); | ||
380 | 375 | ||
381 | ctrl_outw(ctrl_inw(SCSPTR0) & 0x17, SCSPTR0); | 376 | ctrl_outw(data, PSCR); |
382 | } | 377 | } |
378 | /* SCIF1 and SCIF2 should be setup by board code */ | ||
383 | 379 | ||
384 | sci_out(port, SCFCR, fcr_val); | 380 | sci_out(port, SCFCR, fcr_val); |
385 | } | 381 | } |
diff --git a/drivers/serial/sh-sci.h b/drivers/serial/sh-sci.h index fa8700a968f..eb84833233f 100644 --- a/drivers/serial/sh-sci.h +++ b/drivers/serial/sh-sci.h | |||
@@ -76,12 +76,13 @@ | |||
76 | # define SCSCR_INIT(port) 0x32 /* TIE=0,RIE=0,TE=1,RE=1,REIE=0,CKE=1 */ | 76 | # define SCSCR_INIT(port) 0x32 /* TIE=0,RIE=0,TE=1,RE=1,REIE=0,CKE=1 */ |
77 | # define SCIF_ONLY | 77 | # define SCIF_ONLY |
78 | #elif defined(CONFIG_CPU_SUBTYPE_SH7722) | 78 | #elif defined(CONFIG_CPU_SUBTYPE_SH7722) |
79 | # define SCPDR0 0xA405013E /* 16 bit SCIF0 PSDR */ | 79 | # define PADR 0xA4050120 |
80 | # define SCSPTR0 SCPDR0 | 80 | # define PSDR 0xA405013e |
81 | # define PWDR 0xA4050166 | ||
82 | # define PSCR 0xA405011E | ||
81 | # define SCIF_ORER 0x0001 /* overrun error bit */ | 83 | # define SCIF_ORER 0x0001 /* overrun error bit */ |
82 | # define SCSCR_INIT(port) 0x0038 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ | 84 | # define SCSCR_INIT(port) 0x0038 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ |
83 | # define SCIF_ONLY | 85 | # define SCIF_ONLY |
84 | # define PORT_PSCR 0xA405011E | ||
85 | #elif defined(CONFIG_CPU_SUBTYPE_SH7366) | 86 | #elif defined(CONFIG_CPU_SUBTYPE_SH7366) |
86 | # define SCPDR0 0xA405013E /* 16 bit SCIF0 PSDR */ | 87 | # define SCPDR0 0xA405013E /* 16 bit SCIF0 PSDR */ |
87 | # define SCSPTR0 SCPDR0 | 88 | # define SCSPTR0 SCPDR0 |
@@ -320,7 +321,7 @@ | |||
320 | unsigned int addr = port->mapbase + (offset); \ | 321 | unsigned int addr = port->mapbase + (offset); \ |
321 | if ((size) == 8) { \ | 322 | if ((size) == 8) { \ |
322 | ctrl_outb(value, addr); \ | 323 | ctrl_outb(value, addr); \ |
323 | } else { \ | 324 | } else if ((size) == 16) { \ |
324 | ctrl_outw(value, addr); \ | 325 | ctrl_outw(value, addr); \ |
325 | } | 326 | } |
326 | 327 | ||
@@ -451,7 +452,11 @@ SCIF_FNS(SCSPTR, 0, 0, 0x24, 16) | |||
451 | SCIF_FNS(SCLSR, 0, 0, 0x28, 16) | 452 | SCIF_FNS(SCLSR, 0, 0, 0x28, 16) |
452 | #else | 453 | #else |
453 | SCIF_FNS(SCFDR, 0x0e, 16, 0x1C, 16) | 454 | SCIF_FNS(SCFDR, 0x0e, 16, 0x1C, 16) |
455 | #if defined(CONFIG_CPU_SUBTYPE_SH7722) | ||
456 | SCIF_FNS(SCSPTR, 0, 0, 0, 0) | ||
457 | #else | ||
454 | SCIF_FNS(SCSPTR, 0, 0, 0x20, 16) | 458 | SCIF_FNS(SCSPTR, 0, 0, 0x20, 16) |
459 | #endif | ||
455 | SCIF_FNS(SCLSR, 0, 0, 0x24, 16) | 460 | SCIF_FNS(SCLSR, 0, 0, 0x24, 16) |
456 | #endif | 461 | #endif |
457 | #endif | 462 | #endif |
@@ -593,13 +598,25 @@ static inline int sci_rxd_in(struct uart_port *port) | |||
593 | return ctrl_inw(SCSPTR3) & 0x0001 ? 1 : 0; /* SCIF */ | 598 | return ctrl_inw(SCSPTR3) & 0x0001 ? 1 : 0; /* SCIF */ |
594 | return 1; | 599 | return 1; |
595 | } | 600 | } |
596 | #elif defined(CONFIG_CPU_SUBTYPE_SH7722) || defined(CONFIG_CPU_SUBTYPE_SH7366) | 601 | #elif defined(CONFIG_CPU_SUBTYPE_SH7366) |
597 | static inline int sci_rxd_in(struct uart_port *port) | 602 | static inline int sci_rxd_in(struct uart_port *port) |
598 | { | 603 | { |
599 | if (port->mapbase == 0xffe00000) | 604 | if (port->mapbase == 0xffe00000) |
600 | return ctrl_inb(SCPDR0) & 0x0001 ? 1 : 0; /* SCIF0 */ | 605 | return ctrl_inb(SCPDR0) & 0x0001 ? 1 : 0; /* SCIF0 */ |
601 | return 1; | 606 | return 1; |
602 | } | 607 | } |
608 | #elif defined(CONFIG_CPU_SUBTYPE_SH7722) | ||
609 | static inline int sci_rxd_in(struct uart_port *port) | ||
610 | { | ||
611 | if (port->mapbase == 0xffe00000) | ||
612 | return ctrl_inb(PSDR) & 0x02 ? 1 : 0; /* SCIF0 */ | ||
613 | if (port->mapbase == 0xffe10000) | ||
614 | return ctrl_inb(PADR) & 0x40 ? 1 : 0; /* SCIF1 */ | ||
615 | if (port->mapbase == 0xffe20000) | ||
616 | return ctrl_inb(PWDR) & 0x04 ? 1 : 0; /* SCIF2 */ | ||
617 | |||
618 | return 1; | ||
619 | } | ||
603 | #elif defined(CONFIG_CPU_SUBTYPE_SH7723) | 620 | #elif defined(CONFIG_CPU_SUBTYPE_SH7723) |
604 | static inline int sci_rxd_in(struct uart_port *port) | 621 | static inline int sci_rxd_in(struct uart_port *port) |
605 | { | 622 | { |