[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <VE1PR04MB6638F057BC8F7F38E954316F89440@VE1PR04MB6638.eurprd04.prod.outlook.com>
Date: Mon, 10 Aug 2020 10:57:42 +0000
From: Robin Gong <yibin.gong@....com>
To: Frieder Schrempf <frieder.schrempf@...tron.de>,
"mark.rutland@....com" <mark.rutland@....com>,
"broonie@...nel.org" <broonie@...nel.org>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"catalin.marinas@....com" <catalin.marinas@....com>,
"vkoul@...nel.org" <vkoul@...nel.org>,
"will.deacon@....com" <will.deacon@....com>,
"shawnguo@...nel.org" <shawnguo@...nel.org>,
"festevam@...il.com" <festevam@...il.com>,
"s.hauer@...gutronix.de" <s.hauer@...gutronix.de>,
"martin.fuzzey@...wbird.group" <martin.fuzzey@...wbird.group>,
"u.kleine-koenig@...gutronix.de" <u.kleine-koenig@...gutronix.de>,
"dan.j.williams@...el.com" <dan.j.williams@...el.com>,
"matthias.schiffer@...tq-group.com"
<matthias.schiffer@...tq-group.com>
CC: "linux-spi@...r.kernel.org" <linux-spi@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"kernel@...gutronix.de" <kernel@...gutronix.de>,
"dmaengine@...r.kernel.org" <dmaengine@...r.kernel.org>,
dl-linux-imx <linux-imx@....com>
Subject: RE: [PATCH v11 12/12] dmaengine: imx-sdma: add uart rom script
On 2020/08/10 15:33 Frieder Schrempf <frieder.schrempf@...tron.de> wrote:
> Hi Robin,
>
> This patch seems to break UART DMA in case the ROM firmware is used. In that
> case sdma->script_number is set to SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1, so
> the ROM scripts at uart_2_mcu_addr and uartsh_2_mcu_addr will never be
> added in sdma_add_scripts() as they are now moved beyond the V1 max index.
>
> Reverting this patch fixes UART DMA with ROM firmware.
> Can you please find a way to fix this or just drop this change?
>
Hi Frieder,
Thanks for your report, could you try with the additional below patch?
If that works, I'll merge it into next version.
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 5900e32..4db55b9 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -1754,6 +1754,19 @@ static void sdma_add_scripts(struct sdma_engine *sdma,
for (i = 0; i < sdma->script_number; i++)
if (addr_arr[i] > 0)
saddr_arr[i] = addr_arr[i];
+
+ /*
+ * get uart_2_mcu_addr/uartsh_2_mcu_addr rom script specially because
+ * they are now replaced by uart_2_mcu_ram_addr/uartsh_2_mcu_ram_addr
+ * to be compatible with legacy freescal/nxp sdma firmware, and they
+ * are located in the bottom part of sdma_script_start_addrs which are
+ * beyond the SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V1.
+ */
+ if (addr->uart_2_mcu_addr)
+ sdma->script_addrs->uart_2_mcu_addr = addr->uart_2_mcu_addr;
+ if (addr->uartsh_2_mcu_addr)
+ sdma->script_addrs->uartsh_2_mcu_addr = addr->uartsh_2_mcu_addr;
+
}
Powered by blists - more mailing lists