Skip to content

Commit 74e0c9f

Browse files
Robin Gonggregkh
authored andcommitted
tty: serial: imx: keep dma request disabled before dma transfer setup
Since sdma hardware configure postpone to transfer phase, have to disable dma request before dma transfer setup because there is a hardware limitation on sdma event enable(ENBLn) as below. Refer SDMA 2.6.28 Channel Enable RAM (SDMAARMx_CHNENBLn) section: "It is thus essential for the Arm platform to program them before any DMA request is triggered to the SDMA, otherwise an unpredictable combination of channels may be started." Signed-off-by: Robin Gong <yibin.gong@nxp.com> Signed-off-by: Sherry Sun <sherry.sun@nxp.com> Link: https://patch.msgid.link/20260312094526.297348-1-sherry.sun@nxp.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 072ce48 commit 74e0c9f

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

drivers/tty/serial/imx.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,9 +1442,9 @@ static void imx_uart_enable_dma(struct imx_port *sport)
14421442

14431443
imx_uart_setup_ufcr(sport, TXTL_DMA, RXTL_DMA);
14441444

1445-
/* set UCR1 */
1445+
/* set UCR1 except TXDMAEN which would be enabled in imx_uart_dma_tx */
14461446
ucr1 = imx_uart_readl(sport, UCR1);
1447-
ucr1 |= UCR1_RXDMAEN | UCR1_TXDMAEN | UCR1_ATDMAEN;
1447+
ucr1 |= UCR1_RXDMAEN | UCR1_ATDMAEN;
14481448
imx_uart_writel(sport, ucr1, UCR1);
14491449

14501450
sport->dma_is_enabled = 1;
@@ -1567,8 +1567,9 @@ static int imx_uart_startup(struct uart_port *port)
15671567
imx_uart_enable_ms(&sport->port);
15681568

15691569
if (dma_is_inited) {
1570-
imx_uart_enable_dma(sport);
1570+
/* Note: enable dma request after transfer start! */
15711571
imx_uart_start_rx_dma(sport);
1572+
imx_uart_enable_dma(sport);
15721573
} else {
15731574
ucr1 = imx_uart_readl(sport, UCR1);
15741575
ucr1 |= UCR1_RRDYEN;

0 commit comments

Comments
 (0)