aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2018-03-02 05:07:27 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-09 13:21:01 -0500
commit81ca8e8286c48df22eb798879d99aabac663b5f1 (patch)
treeb53787d6ac61b186bcbfe7a70199d9997ef11e2b
parent76821e222c189b81d553b855ee7054340607eb46 (diff)
serial: imx: Also enable the aging timer in PIO mode
This allows to increase the RX waterlevel which allows to delay the RRDY irq. The desired effect is that less irqs are needed to handle characters and so reduce irq count of the system. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/imx.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 3c1bfe8742a4..e1f00d5aced9 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -418,6 +418,7 @@ static void imx_start_rx(struct uart_port *port)
418 ucr1 |= UCR1_RXDMAEN | UCR1_ATDMAEN; 418 ucr1 |= UCR1_RXDMAEN | UCR1_ATDMAEN;
419 } else { 419 } else {
420 ucr1 |= UCR1_RRDYEN; 420 ucr1 |= UCR1_RRDYEN;
421 ucr2 |= UCR2_ATEN;
421 } 422 }
422 423
423 /* Write UCR2 first as it includes RXEN */ 424 /* Write UCR2 first as it includes RXEN */
@@ -472,6 +473,7 @@ static void imx_stop_rx(struct uart_port *port)
472 ucr1 &= ~(UCR1_RXDMAEN | UCR1_ATDMAEN); 473 ucr1 &= ~(UCR1_RXDMAEN | UCR1_ATDMAEN);
473 } else { 474 } else {
474 ucr1 &= ~UCR1_RRDYEN; 475 ucr1 &= ~UCR1_RRDYEN;
476 ucr2 &= ~UCR2_ATEN;
475 } 477 }
476 imx_uart_writel(sport, ucr1, UCR1); 478 imx_uart_writel(sport, ucr1, UCR1);
477 479
@@ -1393,6 +1395,10 @@ static int imx_startup(struct uart_port *port)
1393 ucr1 = imx_uart_readl(sport, UCR1); 1395 ucr1 = imx_uart_readl(sport, UCR1);
1394 ucr1 |= UCR1_RRDYEN; 1396 ucr1 |= UCR1_RRDYEN;
1395 imx_uart_writel(sport, ucr1, UCR1); 1397 imx_uart_writel(sport, ucr1, UCR1);
1398
1399 ucr2 = imx_uart_readl(sport, UCR2);
1400 ucr2 |= UCR2_ATEN;
1401 imx_uart_writel(sport, ucr2, UCR2);
1396 } 1402 }
1397 1403
1398 spin_unlock_irqrestore(&sport->port.lock, flags); 1404 spin_unlock_irqrestore(&sport->port.lock, flags);
@@ -1424,7 +1430,7 @@ static void imx_shutdown(struct uart_port *port)
1424 1430
1425 spin_lock_irqsave(&sport->port.lock, flags); 1431 spin_lock_irqsave(&sport->port.lock, flags);
1426 ucr2 = imx_uart_readl(sport, UCR2); 1432 ucr2 = imx_uart_readl(sport, UCR2);
1427 ucr2 &= ~UCR2_TXEN; 1433 ucr2 &= ~(UCR2_TXEN | UCR2_ATEN);
1428 imx_uart_writel(sport, ucr2, UCR2); 1434 imx_uart_writel(sport, ucr2, UCR2);
1429 spin_unlock_irqrestore(&sport->port.lock, flags); 1435 spin_unlock_irqrestore(&sport->port.lock, flags);
1430 1436
@@ -1613,13 +1619,14 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios,
1613 imx_uart_writel(sport, 1619 imx_uart_writel(sport,
1614 old_ucr1 & ~(UCR1_TXMPTYEN | UCR1_RRDYEN | UCR1_RTSDEN), 1620 old_ucr1 & ~(UCR1_TXMPTYEN | UCR1_RRDYEN | UCR1_RTSDEN),
1615 UCR1); 1621 UCR1);
1622 old_ucr2 = imx_uart_readl(sport, UCR2);
1623 imx_uart_writel(sport, old_ucr2 & ~UCR2_ATEN, UCR2);
1616 1624
1617 while (!(imx_uart_readl(sport, USR2) & USR2_TXDC)) 1625 while (!(imx_uart_readl(sport, USR2) & USR2_TXDC))
1618 barrier(); 1626 barrier();
1619 1627
1620 /* then, disable everything */ 1628 /* then, disable everything */
1621 old_ucr2 = imx_uart_readl(sport, UCR2); 1629 imx_uart_writel(sport, old_ucr2 & ~(UCR2_TXEN | UCR2_RXEN | UCR2_ATEN), UCR2);
1622 imx_uart_writel(sport, old_ucr2 & ~(UCR2_TXEN | UCR2_RXEN), UCR2);
1623 old_ucr2 &= (UCR2_TXEN | UCR2_RXEN | UCR2_ATEN); 1630 old_ucr2 &= (UCR2_TXEN | UCR2_RXEN | UCR2_ATEN);
1624 1631
1625 /* custom-baudrate handling */ 1632 /* custom-baudrate handling */
@@ -1750,12 +1757,14 @@ static int imx_poll_init(struct uart_port *port)
1750 ucr1 &= ~(UCR1_TXMPTYEN | UCR1_RTSDEN | UCR1_RRDYEN); 1757 ucr1 &= ~(UCR1_TXMPTYEN | UCR1_RTSDEN | UCR1_RRDYEN);
1751 1758
1752 ucr2 |= UCR2_RXEN; 1759 ucr2 |= UCR2_RXEN;
1760 ucr2 &= ~UCR2_ATEN;
1753 1761
1754 imx_uart_writel(sport, ucr1, UCR1); 1762 imx_uart_writel(sport, ucr1, UCR1);
1755 imx_uart_writel(sport, ucr2, UCR2); 1763 imx_uart_writel(sport, ucr2, UCR2);
1756 1764
1757 /* now enable irqs */ 1765 /* now enable irqs */
1758 imx_uart_writel(sport, ucr1 | UCR1_RRDYEN, UCR1); 1766 imx_uart_writel(sport, ucr1 | UCR1_RRDYEN, UCR1);
1767 imx_uart_writel(sport, ucr2 | UCR2_ATEN, UCR2);
1759 1768
1760 spin_unlock_irqrestore(&sport->port.lock, flags); 1769 spin_unlock_irqrestore(&sport->port.lock, flags);
1761 1770