diff mbox series

[v2,4/4] dmaengine: imx-sdma: Add i2c dma support

Message ID 20240307-sdma_upstream-v2-4-e97305a43cf5@nxp.com (mailing list archive)
State Superseded
Headers show
Series dmaengine: fsl-sdma: Some improvement for fsl-sdma | expand

Commit Message

Frank Li March 7, 2024, 5:32 p.m. UTC
From: Robin Gong <yibin.gong@nxp.com>

New sdma script (sdma-6q: v3.5, sdma-7d: v4.5) support i2c at imx8mp and
imx6ull. So add I2C dma support.

Signed-off-by: Robin Gong <yibin.gong@nxp.com>
Acked-by: Clark Wang <xiaoning.wang@nxp.com>
Reviewed-by: Joy Zou <joy.zou@nxp.com>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
---
 drivers/dma/imx-sdma.c      | 7 +++++++
 include/linux/dma/imx-dma.h | 1 +
 2 files changed, 8 insertions(+)

Comments

Joy Zou March 12, 2024, 8:55 a.m. UTC | #1
Hi Frank,

> -----Original Message-----
> From: Frank Li <frank.li@nxp.com>
> Sent: 2024年3月8日 1:33
> To: Vinod Koul <vkoul@kernel.org>; Shawn Guo <shawnguo@kernel.org>;
> Sascha Hauer <s.hauer@pengutronix.de>; Pengutronix Kernel Team
> <kernel@pengutronix.de>; Fabio Estevam <festevam@gmail.com>;
> dl-linux-imx <linux-imx@nxp.com>
> Cc: dmaengine@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
> linux-kernel@vger.kernel.org; imx@lists.linux.dev; Frank Li
> <frank.li@nxp.com>; Robin Gong <yibin.gong@nxp.com>; Clark Wang
> <xiaoning.wang@nxp.com>; Joy Zou <joy.zou@nxp.com>; Daniel Baluta
> <daniel.baluta@nxp.com>
> Subject: [PATCH v2 4/4] dmaengine: imx-sdma: Add i2c dma support
> 
> From: Robin Gong <yibin.gong@nxp.com>
> 
> New sdma script (sdma-6q: v3.5, sdma-7d: v4.5) support i2c at imx8mp and
> imx6ull. So add I2C dma support.
> 
> Signed-off-by: Robin Gong <yibin.gong@nxp.com>
> Acked-by: Clark Wang <xiaoning.wang@nxp.com>
> Reviewed-by: Joy Zou <joy.zou@nxp.com>
> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
>  drivers/dma/imx-sdma.c      | 7 +++++++
>  include/linux/dma/imx-dma.h | 1 +
>  2 files changed, 8 insertions(+)
> 
You are adding i2c dma support in sdma driver. Should we add new peripheral types ID for I2C in Documentation/devicetree/bindings/dma/fsl,imx-sdma.yaml? Could you help check again?

BR
Joy Zou
Fabio Estevam March 13, 2024, 10:15 a.m. UTC | #2
On Thu, Mar 7, 2024 at 2:33 PM Frank Li <Frank.Li@nxp.com> wrote:
>
> From: Robin Gong <yibin.gong@nxp.com>
>
> New sdma script (sdma-6q: v3.5, sdma-7d: v4.5) support i2c at imx8mp and

v3.5/ v4.5 is from 2019, so not "new".
https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/imx/sdma/sdma-imx6q.bin?id=55edf5202154de59ee1c6a5b6b6ba6fa54571515

I think you meant  v3.6/v4.6 that Joy Zou has just submitted:

https://lore.kernel.org/linux-firmware/20240313071332.1784885-1-joy.zou@nxp.com/T/#u
Frank Li March 14, 2024, 2:39 a.m. UTC | #3
On Wed, Mar 13, 2024 at 07:15:04AM -0300, Fabio Estevam wrote:
> On Thu, Mar 7, 2024 at 2:33 PM Frank Li <Frank.Li@nxp.com> wrote:
> >
> > From: Robin Gong <yibin.gong@nxp.com>
> >
> > New sdma script (sdma-6q: v3.5, sdma-7d: v4.5) support i2c at imx8mp and
> 
> v3.5/ v4.5 is from 2019, so not "new".
> https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/commit/imx/sdma/sdma-imx6q.bin?id=55edf5202154de59ee1c6a5b6b6ba6fa54571515
> 
> I think you meant  v3.6/v4.6 that Joy Zou has just submitted:
> 
> https://lore.kernel.org/linux-firmware/20240313071332.1784885-1-joy.zou@nxp.com/T/#u

Thank you point it out. Previous an internal git commit miss lead it. After
confirm with joy zou, it should be v3.6/v4.6. Will update next version.

Frank
diff mbox series

Patch

diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index 35fb69a84a8da..5bc4419fd45f3 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -247,6 +247,8 @@  struct sdma_script_start_addrs {
 	s32 sai_2_mcu_addr;
 	s32 uart_2_mcu_rom_addr;
 	s32 uartsh_2_mcu_rom_addr;
+	s32 i2c_2_mcu_addr;
+	s32 mcu_2_i2c_addr;
 	/* End of v3 array */
 	s32 mcu_2_zqspi_addr;
 	/* End of v4 array */
@@ -1077,6 +1079,11 @@  static int sdma_get_pc(struct sdma_channel *sdmac,
 		per_2_emi = sdma->script_addrs->sai_2_mcu_addr;
 		emi_2_per = sdma->script_addrs->mcu_2_sai_addr;
 		break;
+	case IMX_DMATYPE_I2C:
+		per_2_emi = sdma->script_addrs->i2c_2_mcu_addr;
+		emi_2_per = sdma->script_addrs->mcu_2_i2c_addr;
+		sdmac->is_ram_script = true;
+		break;
 	case IMX_DMATYPE_HDMI:
 		emi_2_per = sdma->script_addrs->hdmi_dma_addr;
 		sdmac->is_ram_script = true;
diff --git a/include/linux/dma/imx-dma.h b/include/linux/dma/imx-dma.h
index cfec5f946e237..76a8de9ae1517 100644
--- a/include/linux/dma/imx-dma.h
+++ b/include/linux/dma/imx-dma.h
@@ -41,6 +41,7 @@  enum sdma_peripheral_type {
 	IMX_DMATYPE_SAI,	/* SAI */
 	IMX_DMATYPE_MULTI_SAI,	/* MULTI FIFOs For Audio */
 	IMX_DMATYPE_HDMI,       /* HDMI Audio */
+	IMX_DMATYPE_I2C,	/* I2C */
 };
 
 enum imx_dma_prio {