linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robin Gong <yibin.gong@nxp.com>
To: Frieder Schrempf <frieder.schrempf@kontron.de>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"broonie@kernel.org" <broonie@kernel.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"catalin.marinas@arm.com" <catalin.marinas@arm.com>,
	"vkoul@kernel.org" <vkoul@kernel.org>,
	"will.deacon@arm.com" <will.deacon@arm.com>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	"martin.fuzzey@flowbird.group" <martin.fuzzey@flowbird.group>,
	"u.kleine-koenig@pengutronix.de" <u.kleine-koenig@pengutronix.de>,
	"dan.j.williams@intel.com" <dan.j.williams@intel.com>,
	"matthias.schiffer@ew.tq-group.com" 
	<matthias.schiffer@ew.tq-group.com>
Cc: "linux-spi@vger.kernel.org" <linux-spi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>
Subject: RE: [PATCH v11 12/12] dmaengine: imx-sdma: add uart rom script
Date: Mon, 10 Aug 2020 10:57:42 +0000	[thread overview]
Message-ID: <VE1PR04MB6638F057BC8F7F38E954316F89440@VE1PR04MB6638.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <89946dc6-6c0f-b3d5-9c9a-517f1ed7b5e1@kontron.de>

On 2020/08/10 15:33 Frieder Schrempf <frieder.schrempf@kontron.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;
+
 }



  reply	other threads:[~2020-08-10 10:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-24 18:51 [PATCH v11 00/12] add ecspi ERR009165 for i.mx6/7 soc family Robin Gong
2020-07-24 18:51 ` [PATCH v11 01/12] Revert "ARM: dts: imx6q: Use correct SDMA script for SPI5 core" Robin Gong
2020-07-24 18:51 ` [PATCH v11 02/12] Revert "ARM: dts: imx6: Use correct SDMA script for SPI cores" Robin Gong
2020-07-24 18:51 ` [PATCH v11 03/12] Revert "dmaengine: imx-sdma: refine to load context only once" Robin Gong
2020-07-24 18:51 ` [PATCH v11 04/12] dmaengine: imx-sdma: remove duplicated sdma_load_context Robin Gong
2020-07-24 18:51 ` [PATCH v11 05/12] dmaengine: dma: imx-sdma: add fw_loaded and is_ram_script Robin Gong
2020-07-24 18:51 ` [PATCH v11 06/12] dmaengine: imx-sdma: add mcu_2_ecspi script Robin Gong
2020-07-24 18:51 ` [PATCH v11 07/12] spi: imx: fix ERR009165 Robin Gong
2020-07-24 18:51 ` [PATCH v11 08/12] spi: imx: remove ERR009165 workaround on i.mx6ul Robin Gong
2020-07-24 18:51 ` [PATCH v11 09/12] spi: imx: add new i.mx6ul compatible name in binding doc Robin Gong
2020-07-24 18:51 ` [PATCH v11 10/12] dmaengine: imx-sdma: remove ERR009165 on i.mx6ul Robin Gong
2020-07-24 18:51 ` [PATCH v11 11/12] dma: imx-sdma: add i.mx6ul compatible name Robin Gong
2020-07-24 18:51 ` [PATCH v11 12/12] dmaengine: imx-sdma: add uart rom script Robin Gong
2020-08-10  7:32   ` Frieder Schrempf
2020-08-10 10:57     ` Robin Gong [this message]
2020-08-10 13:06       ` Robert Schwebel
2020-08-11  7:10       ` Frieder Schrempf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VE1PR04MB6638F057BC8F7F38E954316F89440@VE1PR04MB6638.eurprd04.prod.outlook.com \
    --to=yibin.gong@nxp.com \
    --cc=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=dan.j.williams@intel.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=frieder.schrempf@kontron.de \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=martin.fuzzey@flowbird.group \
    --cc=matthias.schiffer@ew.tq-group.com \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=vkoul@kernel.org \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).