diff options
Diffstat (limited to 'drivers/serial/bfin_5xx.c')
-rw-r--r-- | drivers/serial/bfin_5xx.c | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c index 5039e2675abc..3f39e1814693 100644 --- a/drivers/serial/bfin_5xx.c +++ b/drivers/serial/bfin_5xx.c | |||
@@ -86,10 +86,8 @@ static void bfin_serial_stop_tx(struct uart_port *port) | |||
86 | { | 86 | { |
87 | struct bfin_serial_port *uart = (struct bfin_serial_port *)port; | 87 | struct bfin_serial_port *uart = (struct bfin_serial_port *)port; |
88 | 88 | ||
89 | #ifdef CONFIG_BF54x | ||
90 | while (!(UART_GET_LSR(uart) & TEMT)) | 89 | while (!(UART_GET_LSR(uart) & TEMT)) |
91 | continue; | 90 | continue; |
92 | #endif | ||
93 | 91 | ||
94 | #ifdef CONFIG_SERIAL_BFIN_DMA | 92 | #ifdef CONFIG_SERIAL_BFIN_DMA |
95 | disable_dma(uart->tx_dma_channel); | 93 | disable_dma(uart->tx_dma_channel); |
@@ -128,8 +126,8 @@ static void bfin_serial_start_tx(struct uart_port *port) | |||
128 | ier = UART_GET_IER(uart); | 126 | ier = UART_GET_IER(uart); |
129 | ier |= ETBEI; | 127 | ier |= ETBEI; |
130 | UART_PUT_IER(uart, ier); | 128 | UART_PUT_IER(uart, ier); |
131 | bfin_serial_tx_chars(uart); | ||
132 | #endif | 129 | #endif |
130 | bfin_serial_tx_chars(uart); | ||
133 | #endif | 131 | #endif |
134 | } | 132 | } |
135 | 133 | ||
@@ -139,18 +137,21 @@ static void bfin_serial_start_tx(struct uart_port *port) | |||
139 | static void bfin_serial_stop_rx(struct uart_port *port) | 137 | static void bfin_serial_stop_rx(struct uart_port *port) |
140 | { | 138 | { |
141 | struct bfin_serial_port *uart = (struct bfin_serial_port *)port; | 139 | struct bfin_serial_port *uart = (struct bfin_serial_port *)port; |
140 | #ifdef CONFIG_KGDB_UART | ||
141 | if (uart->port.line != CONFIG_KGDB_UART_PORT) { | ||
142 | #endif | ||
142 | #ifdef CONFIG_BF54x | 143 | #ifdef CONFIG_BF54x |
143 | UART_CLEAR_IER(uart, ERBFI); | 144 | UART_CLEAR_IER(uart, ERBFI); |
144 | #else | 145 | #else |
145 | unsigned short ier; | 146 | unsigned short ier; |
146 | 147 | ||
147 | ier = UART_GET_IER(uart); | 148 | ier = UART_GET_IER(uart); |
148 | #ifdef CONFIG_KGDB_UART | ||
149 | if (uart->port.line != CONFIG_KGDB_UART_PORT) | ||
150 | #endif | ||
151 | ier &= ~ERBFI; | 149 | ier &= ~ERBFI; |
152 | UART_PUT_IER(uart, ier); | 150 | UART_PUT_IER(uart, ier); |
153 | #endif | 151 | #endif |
152 | #ifdef CONFIG_KGDB_UART | ||
153 | } | ||
154 | #endif | ||
154 | } | 155 | } |
155 | 156 | ||
156 | /* | 157 | /* |
@@ -175,8 +176,11 @@ void kgdb_put_debug_char(int chr) | |||
175 | while (!(UART_GET_LSR(uart) & THRE)) { | 176 | while (!(UART_GET_LSR(uart) & THRE)) { |
176 | SSYNC(); | 177 | SSYNC(); |
177 | } | 178 | } |
179 | |||
180 | #ifndef CONFIG_BF54x | ||
178 | UART_PUT_LCR(uart, UART_GET_LCR(uart)&(~DLAB)); | 181 | UART_PUT_LCR(uart, UART_GET_LCR(uart)&(~DLAB)); |
179 | SSYNC(); | 182 | SSYNC(); |
183 | #endif | ||
180 | UART_PUT_CHAR(uart, (unsigned char)chr); | 184 | UART_PUT_CHAR(uart, (unsigned char)chr); |
181 | SSYNC(); | 185 | SSYNC(); |
182 | } | 186 | } |
@@ -194,8 +198,10 @@ int kgdb_get_debug_char(void) | |||
194 | while(!(UART_GET_LSR(uart) & DR)) { | 198 | while(!(UART_GET_LSR(uart) & DR)) { |
195 | SSYNC(); | 199 | SSYNC(); |
196 | } | 200 | } |
201 | #ifndef CONFIG_BF54x | ||
197 | UART_PUT_LCR(uart, UART_GET_LCR(uart)&(~DLAB)); | 202 | UART_PUT_LCR(uart, UART_GET_LCR(uart)&(~DLAB)); |
198 | SSYNC(); | 203 | SSYNC(); |
204 | #endif | ||
199 | chr = UART_GET_CHAR(uart); | 205 | chr = UART_GET_CHAR(uart); |
200 | SSYNC(); | 206 | SSYNC(); |
201 | 207 | ||
@@ -697,17 +703,19 @@ static int bfin_serial_startup(struct uart_port *port) | |||
697 | uart->rx_dma_timer.expires = jiffies + DMA_RX_FLUSH_JIFFIES; | 703 | uart->rx_dma_timer.expires = jiffies + DMA_RX_FLUSH_JIFFIES; |
698 | add_timer(&(uart->rx_dma_timer)); | 704 | add_timer(&(uart->rx_dma_timer)); |
699 | #else | 705 | #else |
706 | if (request_irq(uart->port.irq, bfin_serial_rx_int, IRQF_DISABLED, | ||
707 | "BFIN_UART_RX", uart)) { | ||
700 | # ifdef CONFIG_KGDB_UART | 708 | # ifdef CONFIG_KGDB_UART |
701 | if (uart->port.line != CONFIG_KGDB_UART_PORT && request_irq | 709 | if (uart->port.line != CONFIG_KGDB_UART_PORT) { |
702 | # else | ||
703 | if (request_irq | ||
704 | # endif | 710 | # endif |
705 | (uart->port.irq, bfin_serial_rx_int, IRQF_DISABLED, | ||
706 | "BFIN_UART_RX", uart)) { | ||
707 | printk(KERN_NOTICE "Unable to attach BlackFin UART RX interrupt\n"); | 711 | printk(KERN_NOTICE "Unable to attach BlackFin UART RX interrupt\n"); |
708 | return -EBUSY; | 712 | return -EBUSY; |
713 | # ifdef CONFIG_KGDB_UART | ||
714 | } | ||
715 | # endif | ||
709 | } | 716 | } |
710 | 717 | ||
718 | |||
711 | if (request_irq | 719 | if (request_irq |
712 | (uart->port.irq+1, bfin_serial_tx_int, IRQF_DISABLED, | 720 | (uart->port.irq+1, bfin_serial_tx_int, IRQF_DISABLED, |
713 | "BFIN_UART_TX", uart)) { | 721 | "BFIN_UART_TX", uart)) { |
@@ -1154,10 +1162,6 @@ struct console __init *bfin_earlyserial_init(unsigned int port, | |||
1154 | port = 0; | 1162 | port = 0; |
1155 | bfin_serial_init_ports(); | 1163 | bfin_serial_init_ports(); |
1156 | bfin_early_serial_console.index = port; | 1164 | bfin_early_serial_console.index = port; |
1157 | #ifdef CONFIG_KGDB_UART | ||
1158 | kgdb_entry_state = 0; | ||
1159 | init_kgdb_uart(); | ||
1160 | #endif | ||
1161 | uart = &bfin_serial_ports[port]; | 1165 | uart = &bfin_serial_ports[port]; |
1162 | t.c_cflag = cflag; | 1166 | t.c_cflag = cflag; |
1163 | t.c_iflag = 0; | 1167 | t.c_iflag = 0; |
@@ -1255,7 +1259,7 @@ static int __init bfin_serial_init(void) | |||
1255 | int ret; | 1259 | int ret; |
1256 | #ifdef CONFIG_KGDB_UART | 1260 | #ifdef CONFIG_KGDB_UART |
1257 | struct bfin_serial_port *uart = &bfin_serial_ports[CONFIG_KGDB_UART_PORT]; | 1261 | struct bfin_serial_port *uart = &bfin_serial_ports[CONFIG_KGDB_UART_PORT]; |
1258 | struct termios t; | 1262 | struct ktermios t; |
1259 | #endif | 1263 | #endif |
1260 | 1264 | ||
1261 | pr_info("Serial: Blackfin serial driver\n"); | 1265 | pr_info("Serial: Blackfin serial driver\n"); |
@@ -1272,10 +1276,14 @@ static int __init bfin_serial_init(void) | |||
1272 | } | 1276 | } |
1273 | #ifdef CONFIG_KGDB_UART | 1277 | #ifdef CONFIG_KGDB_UART |
1274 | if (uart->port.cons->index != CONFIG_KGDB_UART_PORT) { | 1278 | if (uart->port.cons->index != CONFIG_KGDB_UART_PORT) { |
1275 | request_irq(uart->port.irq, bfin_serial_int, | 1279 | request_irq(uart->port.irq, bfin_serial_rx_int, |
1276 | IRQF_DISABLED, "BFIN_UART_RX", uart); | 1280 | IRQF_DISABLED, "BFIN_UART_RX", uart); |
1277 | pr_info("Request irq for kgdb uart port\n"); | 1281 | pr_info("Request irq for kgdb uart port\n"); |
1282 | #ifdef CONFIG_BF54x | ||
1283 | UART_SET_IER(uart, ERBFI); | ||
1284 | #else | ||
1278 | UART_PUT_IER(uart, UART_GET_IER(uart) | ERBFI); | 1285 | UART_PUT_IER(uart, UART_GET_IER(uart) | ERBFI); |
1286 | #endif | ||
1279 | SSYNC(); | 1287 | SSYNC(); |
1280 | t.c_cflag = CS8|B57600; | 1288 | t.c_cflag = CS8|B57600; |
1281 | t.c_iflag = 0; | 1289 | t.c_iflag = 0; |