aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/mxs-auart.c
diff options
context:
space:
mode:
authorHector Palacios <hector.palacios@digi.com>2013-10-03 03:32:03 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-05 21:03:01 -0400
commit9987f76ad286887978803ece6cdcf34582279a29 (patch)
tree0b460cf2eabac905945cd3609799bd8177569a36 /drivers/tty/serial/mxs-auart.c
parent7ea816a0c353b668688ee6c79f5bbc5223d73f41 (diff)
serial: mxs-auart: set the FIFO size to DMA buffer size
When DMA is enabled (with hardware flow control enabled) the FIFO size must be set to the size of the DMA buffer, as this is the size the tty subsystem can use. Signed-off-by: Hector Palacios <hector.palacios@digi.com> Reviewed-by: Marek Vasut <marex@denx.de> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/mxs-auart.c')
-rw-r--r--drivers/tty/serial/mxs-auart.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index 10e9d70b5c40..d8b6fee77a03 100644
--- a/drivers/tty/serial/mxs-auart.c
+++ b/drivers/tty/serial/mxs-auart.c
@@ -39,6 +39,7 @@
39#include <asm/cacheflush.h> 39#include <asm/cacheflush.h>
40 40
41#define MXS_AUART_PORTS 5 41#define MXS_AUART_PORTS 5
42#define MXS_AUART_FIFO_SIZE 16
42 43
43#define AUART_CTRL0 0x00000000 44#define AUART_CTRL0 0x00000000
44#define AUART_CTRL0_SET 0x00000004 45#define AUART_CTRL0_SET 0x00000004
@@ -548,6 +549,9 @@ static int mxs_auart_dma_init(struct mxs_auart_port *s)
548 s->flags |= MXS_AUART_DMA_ENABLED; 549 s->flags |= MXS_AUART_DMA_ENABLED;
549 dev_dbg(s->dev, "enabled the DMA support."); 550 dev_dbg(s->dev, "enabled the DMA support.");
550 551
552 /* The DMA buffer is now the FIFO the TTY subsystem can use */
553 s->port.fifosize = UART_XMIT_SIZE;
554
551 return 0; 555 return 0;
552 556
553err_out: 557err_out:
@@ -741,6 +745,9 @@ static int mxs_auart_startup(struct uart_port *u)
741 writel(AUART_INTR_RXIEN | AUART_INTR_RTIEN | AUART_INTR_CTSMIEN, 745 writel(AUART_INTR_RXIEN | AUART_INTR_RTIEN | AUART_INTR_CTSMIEN,
742 u->membase + AUART_INTR); 746 u->membase + AUART_INTR);
743 747
748 /* Reset FIFO size (it could have changed if DMA was enabled) */
749 u->fifosize = MXS_AUART_FIFO_SIZE;
750
744 /* 751 /*
745 * Enable fifo so all four bytes of a DMA word are written to 752 * Enable fifo so all four bytes of a DMA word are written to
746 * output (otherwise, only the LSB is written, ie. 1 in 4 bytes) 753 * output (otherwise, only the LSB is written, ie. 1 in 4 bytes)
@@ -1056,7 +1063,7 @@ static int mxs_auart_probe(struct platform_device *pdev)
1056 s->port.membase = ioremap(r->start, resource_size(r)); 1063 s->port.membase = ioremap(r->start, resource_size(r));
1057 s->port.ops = &mxs_auart_ops; 1064 s->port.ops = &mxs_auart_ops;
1058 s->port.iotype = UPIO_MEM; 1065 s->port.iotype = UPIO_MEM;
1059 s->port.fifosize = 16; 1066 s->port.fifosize = MXS_AUART_FIFO_SIZE;
1060 s->port.uartclk = clk_get_rate(s->clk); 1067 s->port.uartclk = clk_get_rate(s->clk);
1061 s->port.type = PORT_IMX; 1068 s->port.type = PORT_IMX;
1062 s->port.dev = s->dev = &pdev->dev; 1069 s->port.dev = s->dev = &pdev->dev;