aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2008-04-19 12:17:29 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-04-19 12:17:29 -0400
commitadf6d34e460387ee3e8f1e1875d52bff51212c7d (patch)
tree88ef100143e6184103a608f82dfd232bf6376eaf /drivers/serial
parentd1964dab60ce7c104dd21590e987a8787db18051 (diff)
parent3760d31f11bfbd0ead9eaeb8573e0602437a9d7c (diff)
Merge branch 'omap2-upstream' into devel
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/8250_pci.c7
-rw-r--r--drivers/serial/atmel_serial.c30
2 files changed, 21 insertions, 16 deletions
diff --git a/drivers/serial/8250_pci.c b/drivers/serial/8250_pci.c
index a8bec498cad6..f97224ce59da 100644
--- a/drivers/serial/8250_pci.c
+++ b/drivers/serial/8250_pci.c
@@ -1214,13 +1214,6 @@ static struct pciserial_board pci_boards[] __devinitdata = {
1214 .base_baud = 115200, 1214 .base_baud = 115200,
1215 .uart_offset = 8, 1215 .uart_offset = 8,
1216 }, 1216 },
1217 [pbn_b0_8_115200] = {
1218 .flags = FL_BASE0,
1219 .num_ports = 8,
1220 .base_baud = 115200,
1221 .uart_offset = 8,
1222 },
1223
1224 [pbn_b0_1_921600] = { 1217 [pbn_b0_1_921600] = {
1225 .flags = FL_BASE0, 1218 .flags = FL_BASE0,
1226 .num_ports = 1, 1219 .num_ports = 1,
diff --git a/drivers/serial/atmel_serial.c b/drivers/serial/atmel_serial.c
index d57bf3e708d8..430997e33fc4 100644
--- a/drivers/serial/atmel_serial.c
+++ b/drivers/serial/atmel_serial.c
@@ -96,6 +96,7 @@
96 96
97 /* PDC registers */ 97 /* PDC registers */
98#define UART_PUT_PTCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_PTCR) 98#define UART_PUT_PTCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_PTCR)
99#define UART_GET_TCR(port) __raw_readl((port)->membase + ATMEL_PDC_TCR)
99#define UART_GET_PTSR(port) __raw_readl((port)->membase + ATMEL_PDC_PTSR) 100#define UART_GET_PTSR(port) __raw_readl((port)->membase + ATMEL_PDC_PTSR)
100 101
101#define UART_PUT_RPR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_RPR) 102#define UART_PUT_RPR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_RPR)
@@ -106,6 +107,7 @@
106 107
107#define UART_PUT_TPR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_TPR) 108#define UART_PUT_TPR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_TPR)
108#define UART_PUT_TCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_TCR) 109#define UART_PUT_TCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_TCR)
110#define UART_GET_TCR(port) __raw_readl((port)->membase + ATMEL_PDC_TCR)
109 111
110static int (*atmel_open_hook)(struct uart_port *); 112static int (*atmel_open_hook)(struct uart_port *);
111static void (*atmel_close_hook)(struct uart_port *); 113static void (*atmel_close_hook)(struct uart_port *);
@@ -562,17 +564,22 @@ static void atmel_tx_dma(struct uart_port *port)
562 struct atmel_dma_buffer *pdc = &atmel_port->pdc_tx; 564 struct atmel_dma_buffer *pdc = &atmel_port->pdc_tx;
563 int count; 565 int count;
564 566
567 /* nothing left to transmit? */
568 if (UART_GET_TCR(port))
569 return;
570
565 xmit->tail += pdc->ofs; 571 xmit->tail += pdc->ofs;
566 xmit->tail &= UART_XMIT_SIZE - 1; 572 xmit->tail &= UART_XMIT_SIZE - 1;
567 573
568 port->icount.tx += pdc->ofs; 574 port->icount.tx += pdc->ofs;
569 pdc->ofs = 0; 575 pdc->ofs = 0;
570 576
571 if (!uart_circ_empty(xmit)) { 577 /* more to transmit - setup next transfer */
572 /* more to transmit - setup next transfer */
573 578
574 /* disable PDC transmit */ 579 /* disable PDC transmit */
575 UART_PUT_PTCR(port, ATMEL_PDC_TXTDIS); 580 UART_PUT_PTCR(port, ATMEL_PDC_TXTDIS);
581
582 if (!uart_circ_empty(xmit)) {
576 dma_sync_single_for_device(port->dev, 583 dma_sync_single_for_device(port->dev,
577 pdc->dma_addr, 584 pdc->dma_addr,
578 pdc->dma_size, 585 pdc->dma_size,
@@ -586,11 +593,6 @@ static void atmel_tx_dma(struct uart_port *port)
586 /* re-enable PDC transmit and interrupts */ 593 /* re-enable PDC transmit and interrupts */
587 UART_PUT_PTCR(port, ATMEL_PDC_TXTEN); 594 UART_PUT_PTCR(port, ATMEL_PDC_TXTEN);
588 UART_PUT_IER(port, ATMEL_US_ENDTX | ATMEL_US_TXBUFE); 595 UART_PUT_IER(port, ATMEL_US_ENDTX | ATMEL_US_TXBUFE);
589 } else {
590 /* nothing left to transmit - disable the transmitter */
591
592 /* disable PDC transmit */
593 UART_PUT_PTCR(port, ATMEL_PDC_TXTDIS);
594 } 596 }
595 597
596 if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) 598 if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
@@ -1274,6 +1276,7 @@ static void atmel_console_write(struct console *co, const char *s, u_int count)
1274{ 1276{
1275 struct uart_port *port = &atmel_ports[co->index].uart; 1277 struct uart_port *port = &atmel_ports[co->index].uart;
1276 unsigned int status, imr; 1278 unsigned int status, imr;
1279 unsigned int pdc_tx;
1277 1280
1278 /* 1281 /*
1279 * First, save IMR and then disable interrupts 1282 * First, save IMR and then disable interrupts
@@ -1281,6 +1284,10 @@ static void atmel_console_write(struct console *co, const char *s, u_int count)
1281 imr = UART_GET_IMR(port); 1284 imr = UART_GET_IMR(port);
1282 UART_PUT_IDR(port, ATMEL_US_RXRDY | ATMEL_US_TXRDY); 1285 UART_PUT_IDR(port, ATMEL_US_RXRDY | ATMEL_US_TXRDY);
1283 1286
1287 /* Store PDC transmit status and disable it */
1288 pdc_tx = UART_GET_PTSR(port) & ATMEL_PDC_TXTEN;
1289 UART_PUT_PTCR(port, ATMEL_PDC_TXTDIS);
1290
1284 uart_console_write(port, s, count, atmel_console_putchar); 1291 uart_console_write(port, s, count, atmel_console_putchar);
1285 1292
1286 /* 1293 /*
@@ -1290,6 +1297,11 @@ static void atmel_console_write(struct console *co, const char *s, u_int count)
1290 do { 1297 do {
1291 status = UART_GET_CSR(port); 1298 status = UART_GET_CSR(port);
1292 } while (!(status & ATMEL_US_TXRDY)); 1299 } while (!(status & ATMEL_US_TXRDY));
1300
1301 /* Restore PDC transmit status */
1302 if (pdc_tx)
1303 UART_PUT_PTCR(port, ATMEL_PDC_TXTEN);
1304
1293 /* set interrupts back the way they were */ 1305 /* set interrupts back the way they were */
1294 UART_PUT_IER(port, imr); 1306 UART_PUT_IER(port, imr);
1295} 1307}