aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty
diff options
context:
space:
mode:
authorSuneel <suneelg@xilinx.com>2013-10-17 17:08:08 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-19 22:47:37 -0400
commit85baf542d54ec321642194b0ebfa7316e3190dc2 (patch)
tree86de09fe8c8d435f263f3cf2ebb110047f67007e /drivers/tty
parent6ee04c6c5488b2b7fdfa22c771c127411f86e610 (diff)
tty: xuartps: support 64 byte FIFO size
Changes to use the 64 byte FIFO depth and fix the issue by clearing the txempty interrupt in isr status for tx after filling in data in start_tx function Signed-off-by: Suneel Garapati <suneelg@xilinx.com> Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r--drivers/tty/serial/xilinx_uartps.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index 62259f37ddda..6e8ec6e9d5a2 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -33,12 +33,22 @@
33#define XUARTPS_MAJOR 0 /* use dynamic node allocation */ 33#define XUARTPS_MAJOR 0 /* use dynamic node allocation */
34#define XUARTPS_MINOR 0 /* works best with devtmpfs */ 34#define XUARTPS_MINOR 0 /* works best with devtmpfs */
35#define XUARTPS_NR_PORTS 2 35#define XUARTPS_NR_PORTS 2
36#define XUARTPS_FIFO_SIZE 16 /* FIFO size */ 36#define XUARTPS_FIFO_SIZE 64 /* FIFO size */
37#define XUARTPS_REGISTER_SPACE 0xFFF 37#define XUARTPS_REGISTER_SPACE 0xFFF
38 38
39#define xuartps_readl(offset) ioread32(port->membase + offset) 39#define xuartps_readl(offset) ioread32(port->membase + offset)
40#define xuartps_writel(val, offset) iowrite32(val, port->membase + offset) 40#define xuartps_writel(val, offset) iowrite32(val, port->membase + offset)
41 41
42/* Rx Trigger level */
43static int rx_trigger_level = 56;
44module_param(rx_trigger_level, uint, S_IRUGO);
45MODULE_PARM_DESC(rx_trigger_level, "Rx trigger level, 1-63 bytes");
46
47/* Rx Timeout */
48static int rx_timeout = 10;
49module_param(rx_timeout, uint, S_IRUGO);
50MODULE_PARM_DESC(rx_timeout, "Rx timeout, 1-255");
51
42/********************************Register Map********************************/ 52/********************************Register Map********************************/
43/** UART 53/** UART
44 * 54 *
@@ -394,7 +404,7 @@ static void xuartps_start_tx(struct uart_port *port)
394 port->state->xmit.tail = (port->state->xmit.tail + 1) & 404 port->state->xmit.tail = (port->state->xmit.tail + 1) &
395 (UART_XMIT_SIZE - 1); 405 (UART_XMIT_SIZE - 1);
396 } 406 }
397 407 xuartps_writel(XUARTPS_IXR_TXEMPTY, XUARTPS_ISR_OFFSET);
398 /* Enable the TX Empty interrupt */ 408 /* Enable the TX Empty interrupt */
399 xuartps_writel(XUARTPS_IXR_TXEMPTY, XUARTPS_IER_OFFSET); 409 xuartps_writel(XUARTPS_IXR_TXEMPTY, XUARTPS_IER_OFFSET);
400 410
@@ -528,7 +538,7 @@ static void xuartps_set_termios(struct uart_port *port,
528 | (XUARTPS_CR_TX_EN | XUARTPS_CR_RX_EN), 538 | (XUARTPS_CR_TX_EN | XUARTPS_CR_RX_EN),
529 XUARTPS_CR_OFFSET); 539 XUARTPS_CR_OFFSET);
530 540
531 xuartps_writel(10, XUARTPS_RXTOUT_OFFSET); 541 xuartps_writel(rx_timeout, XUARTPS_RXTOUT_OFFSET);
532 542
533 port->read_status_mask = XUARTPS_IXR_TXEMPTY | XUARTPS_IXR_RXTRIG | 543 port->read_status_mask = XUARTPS_IXR_TXEMPTY | XUARTPS_IXR_RXTRIG |
534 XUARTPS_IXR_OVERRUN | XUARTPS_IXR_TOUT; 544 XUARTPS_IXR_OVERRUN | XUARTPS_IXR_TOUT;
@@ -631,11 +641,17 @@ static int xuartps_startup(struct uart_port *port)
631 | XUARTPS_MR_PARITY_NONE | XUARTPS_MR_CHARLEN_8_BIT, 641 | XUARTPS_MR_PARITY_NONE | XUARTPS_MR_CHARLEN_8_BIT,
632 XUARTPS_MR_OFFSET); 642 XUARTPS_MR_OFFSET);
633 643
634 /* Set the RX FIFO Trigger level to 14 assuming FIFO size as 16 */ 644 /*
635 xuartps_writel(14, XUARTPS_RXWM_OFFSET); 645 * Set the RX FIFO Trigger level to use most of the FIFO, but it
646 * can be tuned with a module parameter
647 */
648 xuartps_writel(rx_trigger_level, XUARTPS_RXWM_OFFSET);
636 649
637 /* Receive Timeout register is enabled with value of 10 */ 650 /*
638 xuartps_writel(10, XUARTPS_RXTOUT_OFFSET); 651 * Receive Timeout register is enabled but it
652 * can be tuned with a module parameter
653 */
654 xuartps_writel(rx_timeout, XUARTPS_RXTOUT_OFFSET);
639 655
640 /* Clear out any pending interrupts before enabling them */ 656 /* Clear out any pending interrupts before enabling them */
641 xuartps_writel(xuartps_readl(XUARTPS_ISR_OFFSET), XUARTPS_ISR_OFFSET); 657 xuartps_writel(xuartps_readl(XUARTPS_ISR_OFFSET), XUARTPS_ISR_OFFSET);