Commit 068500e0 authored by Anton Bondarenko's avatar Anton Bondarenko Committed by Greg Kroah-Hartman

serial: imx: initialized DMA w/o HW flow enabled

DMA mode for UART can be used even w/o HW flow control with RTS/CTS.
So it need to be initialized and enabled earlier.
Signed-off-by: default avatarAnton Bondarenko <anton_bondarenko@mentor.com>
Signed-off-by: default avatarJiada Wang <jiada_wang@mentor.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a2c718ce
...@@ -1141,12 +1141,20 @@ static int imx_startup(struct uart_port *port) ...@@ -1141,12 +1141,20 @@ static int imx_startup(struct uart_port *port)
while (!(readl(sport->port.membase + UCR2) & UCR2_SRST) && (--i > 0)) while (!(readl(sport->port.membase + UCR2) & UCR2_SRST) && (--i > 0))
udelay(1); udelay(1);
/* Can we enable the DMA support? */
if (is_imx6q_uart(sport) && !uart_console(port) &&
!sport->dma_is_inited)
imx_uart_dma_init(sport);
spin_lock_irqsave(&sport->port.lock, flags); spin_lock_irqsave(&sport->port.lock, flags);
/* /*
* Finally, clear and enable interrupts * Finally, clear and enable interrupts
*/ */
writel(USR1_RTSD, sport->port.membase + USR1); writel(USR1_RTSD, sport->port.membase + USR1);
if (sport->dma_is_inited && !sport->dma_is_enabled)
imx_enable_dma(sport);
temp = readl(sport->port.membase + UCR1); temp = readl(sport->port.membase + UCR1);
temp |= UCR1_RRDYEN | UCR1_RTSDEN | UCR1_UARTEN; temp |= UCR1_RRDYEN | UCR1_RTSDEN | UCR1_UARTEN;
...@@ -1326,11 +1334,6 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios, ...@@ -1326,11 +1334,6 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios,
if (sport->have_rtscts) { if (sport->have_rtscts) {
ucr2 &= ~UCR2_IRTS; ucr2 &= ~UCR2_IRTS;
ucr2 |= UCR2_CTSC; ucr2 |= UCR2_CTSC;
/* Can we enable the DMA support? */
if (is_imx6q_uart(sport) && !uart_console(port)
&& !sport->dma_is_inited)
imx_uart_dma_init(sport);
} else { } else {
termios->c_cflag &= ~CRTSCTS; termios->c_cflag &= ~CRTSCTS;
} }
...@@ -1452,8 +1455,6 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios, ...@@ -1452,8 +1455,6 @@ imx_set_termios(struct uart_port *port, struct ktermios *termios,
if (UART_ENABLE_MS(&sport->port, termios->c_cflag)) if (UART_ENABLE_MS(&sport->port, termios->c_cflag))
imx_enable_ms(&sport->port); imx_enable_ms(&sport->port);
if (sport->dma_is_inited && !sport->dma_is_enabled)
imx_enable_dma(sport);
spin_unlock_irqrestore(&sport->port.lock, flags); spin_unlock_irqrestore(&sport->port.lock, flags);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment