From 74738c4b8057cbc155c3c67a1b372b1eec2e7ecc Mon Sep 17 00:00:00 2001 From: Koen Vandeputte Date: Mon, 5 Nov 2018 17:41:00 +0100 Subject: [PATCH] imx6: fix DMA transaction errors Following errors were seen in the past on imx6 when using serial: [ 22.617622] imx-uart 2020000.serial: DMA transaction error. [ 22.623228] imx-uart 2020000.serial: DMA transaction error. [ 22.628826] imx-uart 2020000.serial: DMA transaction error. [ 22.648951] imx-uart 2020000.serial: DMA transaction error. [ 22.654558] imx-uart 2020000.serial: DMA transaction error. [ 22.660156] imx-uart 2020000.serial: DMA transaction error. Which is the reason why DMA for the serial ports got disabled in commits: efb362cd93b0 ("imx6: disable dma on uart") 3b4241071dd4 ("imx6: disable UART dma") As indicated on mailinglist discussion, the cause seems to be the usage of very old SDMA firmware which is present in the soc: [ 0.624302] imx-sdma 20ec000.sdma: Direct firmware load for imx/sdma/sdma-imx6q.bin failed with error -2 [ 0.624318] imx-sdma 20ec000.sdma: Falling back to user helper [ 64.531607] imx-sdma 20ec000.sdma: external firmware not found, using ROM firmware This patch adds the new firmware binary. (2196 bytes) It is required to embed the binary into the kernel image, as it gets loaded very early in the boot process where the rootfs is not available yet: [ 0.622966] imx-sdma 20ec000.sdma: loaded firmware 3.3 Extended testing shows that the DMA errors are not seen anymore when using this newer firmware version. Signed-off-by: Koen Vandeputte --- target/linux/imx6/config-4.14 | 2 ++ .../files/firmware/imx/sdma/sdma-imx6q.bin | Bin 0 -> 2196 bytes .../patches-4.14/210-disable-uart-dma.patch | 23 ------------------ 3 files changed, 2 insertions(+), 23 deletions(-) create mode 100644 target/linux/imx6/files/firmware/imx/sdma/sdma-imx6q.bin delete mode 100644 target/linux/imx6/patches-4.14/210-disable-uart-dma.patch diff --git a/target/linux/imx6/config-4.14 b/target/linux/imx6/config-4.14 index fe975e63fe..2b87e0d545 100644 --- a/target/linux/imx6/config-4.14 +++ b/target/linux/imx6/config-4.14 @@ -185,6 +185,8 @@ CONFIG_F2FS_FS=y # CONFIG_F2FS_FS_SECURITY is not set CONFIG_F2FS_FS_XATTR=y CONFIG_F2FS_STAT_FS=y +CONFIG_EXTRA_FIRMWARE="imx/sdma/sdma-imx6q.bin" +CONFIG_EXTRA_FIRMWARE_DIR="firmware" CONFIG_FEC=y CONFIG_FIXED_PHY=y CONFIG_FIX_EARLYCON_MEM=y diff --git a/target/linux/imx6/files/firmware/imx/sdma/sdma-imx6q.bin b/target/linux/imx6/files/firmware/imx/sdma/sdma-imx6q.bin new file mode 100644 index 0000000000000000000000000000000000000000..f0b5252a6fc5f85aced28a5c43e7268340fe4d73 GIT binary patch literal 2196 zcmb7_U2GIp6oAj%ou8fA*8b77mX_9vODX>XQ3(MNVlZLROuNt)x70BW?a*%fX3@Db z!DuX2+h}>1-A%QLCYTtWG{F!O`jf~IF-q1}aV1FBhhm|U)CXlB)^lff+a-ZSx;ZoF zoVoYhZ_b%>+O#jQ#{&RNs!`UWOrZQE0lZBB(*N`Cg{sWjdEE1LWk&xb>zlyf`C-1y z#(gW#e}D%FqvWs4>45Q$pe#HN5LgK?hjHJ*JM$+e6NeX7PEV|nSJOJ<1Yd3}9O@7SDtB%*6>W>T)>gEQrrf#SEEP(H zv&7NYSe`oAf5+HklL1+C^ylqzAOlKPW4aIZ6~>L;Qp=KLno@Z@J+3<%-{`nJ0P{fz zNc0{uinat-x(d3=rj#kpzBb9YlSh-t{)9e~$Cx^lp=_jEkh0F`_mz0&o1mz}!&sj| z*6pT+tWP8B<}7Q6M5x&Ip6zd2V{x^Ndd}Tf*7OB3^GGkY$(q0I3|h=q&{mdg=JBD& zhaSnuFpJ2XJggyehWMz>ILexOB+j@tnQDJuJnm|X?TOZS%LrG@6+JfuJ15uCi8klR z!O1nopy!mBd^KHIBBX0B2)iT*RMLKL37D8Eio6Z#4f`K8(R_hiA+lk(o;mcyGad^3 ztUUx1s?*duIZJ_jYp1;z!IH}9AirGE5mJi3^p0NzV(gO2BA=7%gixlnqp<7~!^X-l zs;OpOdX^$T)gs3wYII9H?ZQ*J#~LG}EwlKI48v$}To?_Fi@lOa!;+7Z0TSdxyCW<^ zOsl`oBEi+68Uqe`F_wptV1@Zogb%H-PKl$hzmx_bs=DW(lNk6diVycm^$*9!FEXoG&w;1k?7DR2 z1^6B~<0L-0<33TQ_C}ZUn;|D^H>p8xQQc3(HbyL}2T-$Jt%E3r?HAQBd6LR{jmx&0 zeuWV$+=zcfbByBxTUCs!6pO3-7c(a!Ap{EDynU9Xym=pGgZ{UrOpQm^C)hj}^h@2# zQ!zKU%dz6CaBe$VgV`bGDqQc@w${B?yEFSQV`Yrh7QbQ5r&poQGzB$wU#cZe=D5mv zNel3|qpX%0i{tktZbdWmE^$1%+32D0)G1`mXm?Tf;C0T$k@y zg*kJa_abFqsZ?V4jun|XOEIqZd9AD6ToK#hu{aL+)|doo{GS4(HFi0hx0HG*uUj5H ibKm4;?%Y!5&OJ19gR%U~-Aue2dz8%m{(#I~jr|8{yblQg literal 0 HcmV?d00001 diff --git a/target/linux/imx6/patches-4.14/210-disable-uart-dma.patch b/target/linux/imx6/patches-4.14/210-disable-uart-dma.patch deleted file mode 100644 index 6abbb93301..0000000000 --- a/target/linux/imx6/patches-4.14/210-disable-uart-dma.patch +++ /dev/null @@ -1,23 +0,0 @@ -Based on following upstream patch by Tim Harvey (Gateworks): - -https://github.com/Gateworks/openwrt/commit/80a01b6582f94c4547f39d3a25e0a1e9b6eb9877 - -TX complete DMA messages are getting missed. -This is also currently an issue in mainline. -For now we will disable DMA in serial/imx.c. - -This resolves an issue encountered with RS485 transmit. - ---- a/drivers/tty/serial/imx.c -+++ b/drivers/tty/serial/imx.c -@@ -1268,10 +1268,6 @@ static int imx_startup(struct uart_port - - writel(temp & ~UCR4_DREN, sport->port.membase + UCR4); - -- /* Can we enable the DMA support? */ -- if (!uart_console(port) && !sport->dma_is_inited) -- imx_uart_dma_init(sport); -- - spin_lock_irqsave(&sport->port.lock, flags); - /* Reset fifo's and state machines */ - i = 100; -- 2.30.2