aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-12-22 12:13:05 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-01-05 11:58:45 -0500
commitffca2b114c6a804d1307781df687e877a373a1c2 (patch)
tree976cffca5c682bcec045ab9f52456854474930a3 /drivers/serial
parentc19f12b5ef3adf3c139eabbe3d3d0201838b77b1 (diff)
ARM: PL011: Separate hardware FIFO size from TTY FIFO size
With DMA support, we need to tell the TTY subsystem that the DMA buffer is the size of the FIFO, otherwise things like tty_wait_until_sent() will time out too early. Keep (and use) the hardware value separately from the port->fifosize. This was part of a larger patch from Linus Walleij, with a little modification. Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/amba-pl011.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c
index 6afdd9b39720..f9b6b8213e77 100644
--- a/drivers/serial/amba-pl011.c
+++ b/drivers/serial/amba-pl011.c
@@ -97,6 +97,7 @@ struct uart_amba_port {
97 const struct vendor_data *vendor; 97 const struct vendor_data *vendor;
98 unsigned int im; /* interrupt mask */ 98 unsigned int im; /* interrupt mask */
99 unsigned int old_status; 99 unsigned int old_status;
100 unsigned int fifosize; /* vendor-specific */
100 unsigned int lcrh_tx; /* vendor-specific */ 101 unsigned int lcrh_tx; /* vendor-specific */
101 unsigned int lcrh_rx; /* vendor-specific */ 102 unsigned int lcrh_rx; /* vendor-specific */
102 bool autorts; 103 bool autorts;
@@ -203,7 +204,7 @@ static void pl011_tx_chars(struct uart_amba_port *uap)
203 return; 204 return;
204 } 205 }
205 206
206 count = uap->port.fifosize >> 1; 207 count = uap->fifosize >> 1;
207 do { 208 do {
208 writew(xmit->buf[xmit->tail], uap->port.membase + UART01x_DR); 209 writew(xmit->buf[xmit->tail], uap->port.membase + UART01x_DR);
209 xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); 210 xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1);
@@ -541,7 +542,7 @@ pl011_set_termios(struct uart_port *port, struct ktermios *termios,
541 if (!(termios->c_cflag & PARODD)) 542 if (!(termios->c_cflag & PARODD))
542 lcr_h |= UART01x_LCRH_EPS; 543 lcr_h |= UART01x_LCRH_EPS;
543 } 544 }
544 if (port->fifosize > 1) 545 if (uap->fifosize > 1)
545 lcr_h |= UART01x_LCRH_FEN; 546 lcr_h |= UART01x_LCRH_FEN;
546 547
547 spin_lock_irqsave(&port->lock, flags); 548 spin_lock_irqsave(&port->lock, flags);
@@ -871,12 +872,13 @@ static int pl011_probe(struct amba_device *dev, struct amba_id *id)
871 uap->vendor = vendor; 872 uap->vendor = vendor;
872 uap->lcrh_rx = vendor->lcrh_rx; 873 uap->lcrh_rx = vendor->lcrh_rx;
873 uap->lcrh_tx = vendor->lcrh_tx; 874 uap->lcrh_tx = vendor->lcrh_tx;
875 uap->fifosize = vendor->fifosize;
874 uap->port.dev = &dev->dev; 876 uap->port.dev = &dev->dev;
875 uap->port.mapbase = dev->res.start; 877 uap->port.mapbase = dev->res.start;
876 uap->port.membase = base; 878 uap->port.membase = base;
877 uap->port.iotype = UPIO_MEM; 879 uap->port.iotype = UPIO_MEM;
878 uap->port.irq = dev->irq[0]; 880 uap->port.irq = dev->irq[0];
879 uap->port.fifosize = vendor->fifosize; 881 uap->port.fifosize = uap->fifosize;
880 uap->port.ops = &amba_pl011_pops; 882 uap->port.ops = &amba_pl011_pops;
881 uap->port.flags = UPF_BOOT_AUTOCONF; 883 uap->port.flags = UPF_BOOT_AUTOCONF;
882 uap->port.line = i; 884 uap->port.line = i;