[PATCH v2 0/4] dmaengine: sh: rcar-dmac: add R-Car Gen5 X5H support

WARM1d

Revision v2 of 2 in this series.

9 messages, 4 authors, 1d ago · open the first message on its own page

[PATCH v2 0/4] dmaengine: sh: rcar-dmac: add R-Car Gen5 X5H support

From: Wolfram Sang <wsa+renesas@sang-engineering.com>
Date: 2026-09-09 09:40:52

Here is a small series with the needed driver updates to support R-Car
Gen5 and X5H for the SYSC-DMAC. Details are in the patch descriptions,
but it is all small stuff.

It has been tested on an Ironhide board (X5H) and a SparrowHawk (V4H)
for regression testing. The testing branch can be found here:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/x5h/i2c-experimental

The patches here are based on linux-next as of 20260908. DT checks have
also been passed.

Looking forward to comments or approval!

Changes since v1:
* tags added (Thanks Krzysztof, Geert and Frank)
* renamed the ipmmu-flag variable
* some updates to commit messages and comments


Wolfram Sang (4):
  dmaengine: sh: rcar-dmac: fix style in struct initialization
  dmaengine: sh: rcar-dmac: SMMU doesn't need IPMMU workaround
  dt-bindings: renesas,rcar-dmac: Add support for R-Car X5H SoC
  dmaengine: sh: rcar-dmac: Add support for R-Car Gen5 SoCs

 .../bindings/dma/renesas,rcar-dmac.yaml       |  6 +++++
 drivers/dma/sh/rcar-dmac.c                    | 26 ++++++++++++++-----
 2 files changed, 26 insertions(+), 6 deletions(-)

-- 
2.53.0

[PATCH v2 1/4] dmaengine: sh: rcar-dmac: fix style in struct initialization

From: Wolfram Sang <wsa+renesas@sang-engineering.com>
Date: 2026-09-09 09:40:52

A new member will be added to the struct. Before that, adhere to coding
style by using a single space when assigning values.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---

Changes since v1:
* tags added (Thanks Geert and Frank)

 drivers/dma/sh/rcar-dmac.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
index 44eab2d21d54..cf07c17847d0 100644
--- a/drivers/dma/sh/rcar-dmac.c
+++ b/drivers/dma/sh/rcar-dmac.c
@@ -1998,13 +1998,13 @@ static void rcar_dmac_shutdown(struct platform_device *pdev)
 }
 
 static const struct rcar_dmac_of_data rcar_dmac_data = {
-	.chan_offset_base	= 0x8000,
-	.chan_offset_stride	= 0x80,
+	.chan_offset_base = 0x8000,
+	.chan_offset_stride = 0x80,
 };
 
 static const struct rcar_dmac_of_data rcar_gen4_dmac_data = {
-	.chan_offset_base	= 0x0,
-	.chan_offset_stride	= 0x1000,
+	.chan_offset_base = 0x0,
+	.chan_offset_stride = 0x1000,
 };
 
 static const struct of_device_id rcar_dmac_of_ids[] = {
-- 
2.53.0

[PATCH v2 2/4] dmaengine: sh: rcar-dmac: SMMU doesn't need IPMMU workaround

From: Wolfram Sang <wsa+renesas@sang-engineering.com>
Date: 2026-09-09 09:40:53

R-Car Gen5 doesn't use an IPMMU anymore, but a SMMU. So, the workaround
for the IPMMU becomes optional. Add a flag to distinguish. No functional
change.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
---

Changes since v1:
* tags added (Thanks Frank)
* renamed the flag-variable (Thanks Geert)
* added a comment that Gen4 might not be affected

 drivers/dma/sh/rcar-dmac.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
index cf07c17847d0..4eca52aeec02 100644
--- a/drivers/dma/sh/rcar-dmac.c
+++ b/drivers/dma/sh/rcar-dmac.c
@@ -219,10 +219,12 @@ struct rcar_dmac {
  * struct rcar_dmac_of_data - This driver's OF data
  * @chan_offset_base: DMAC channels base offset
  * @chan_offset_stride: DMAC channels offset stride
+ * @broken_ipmmu_microTLB0: flag if the connected IPMMU has microTLB0 issues
  */
 struct rcar_dmac_of_data {
 	u32 chan_offset_base;
 	u32 chan_offset_stride;
+	unsigned int broken_ipmmu_microTLB0:1;
 };
 
 /* -----------------------------------------------------------------------------
@@ -1877,8 +1879,9 @@ static int rcar_dmac_probe(struct platform_device *pdev)
 	 * can't use it with the IPMMU. As the IOMMU API operates at the device
 	 * level we can't disable it selectively, so ignore channel 0 for now if
 	 * the device is part of an IOMMU group.
+	 * Not applicable if system uses something else than IPMMU like SMMU.
 	 */
-	if (device_iommu_mapped(&pdev->dev))
+	if (data->broken_ipmmu_microTLB0 && device_iommu_mapped(&pdev->dev))
 		dmac->channels_mask &= ~BIT(0);
 
 	dmac->channels = devm_kcalloc(&pdev->dev, dmac->n_channels,
@@ -2000,11 +2003,14 @@ static void rcar_dmac_shutdown(struct platform_device *pdev)
 static const struct rcar_dmac_of_data rcar_dmac_data = {
 	.chan_offset_base = 0x8000,
 	.chan_offset_stride = 0x80,
+	.broken_ipmmu_microTLB0 = 1,
 };
 
 static const struct rcar_dmac_of_data rcar_gen4_dmac_data = {
 	.chan_offset_base = 0x0,
 	.chan_offset_stride = 0x1000,
+	/* Set to play safe. Needs testing if Gen4 is really affected */
+	.broken_ipmmu_microTLB0 = 1,
 };
 
 static const struct of_device_id rcar_dmac_of_ids[] = {
-- 
2.53.0

[PATCH v2 3/4] dt-bindings: renesas,rcar-dmac: Add support for R-Car X5H SoC

From: Wolfram Sang <wsa+renesas@sang-engineering.com>
Date: 2026-09-09 09:41:00

Also add the familiy compatible because X5H is the first R-Car Gen5 SoC.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Acked-by: Krzysztof Kozlowski <redacted>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---

Changes since v1:
* tags added (Thanks Krzysztof and Geert)

 .../devicetree/bindings/dma/renesas,rcar-dmac.yaml          | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/Documentation/devicetree/bindings/dma/renesas,rcar-dmac.yaml b/Documentation/devicetree/bindings/dma/renesas,rcar-dmac.yaml
index 04fc4a99a7cb..d3d521c927e1 100644
--- a/Documentation/devicetree/bindings/dma/renesas,rcar-dmac.yaml
+++ b/Documentation/devicetree/bindings/dma/renesas,rcar-dmac.yaml
@@ -49,6 +49,11 @@ properties:
               - renesas,dmac-r8a779h0     # R-Car V4M
           - const: renesas,rcar-gen4-dmac # R-Car Gen4
 
+      - items:
+          - enum:
+              - renesas,dmac-r8a78000     # R-Car X5H
+          - const: renesas,rcar-gen5-dmac # R-Car Gen5
+
   reg: true
 
   interrupts:
@@ -123,6 +128,7 @@ if:
       contains:
         enum:
           - renesas,rcar-gen4-dmac
+          - renesas,rcar-gen5-dmac
 then:
   properties:
     reg:
-- 
2.53.0

[PATCH v2 4/4] dmaengine: sh: rcar-dmac: Add support for R-Car Gen5 SoCs

From: Wolfram Sang <wsa+renesas@sang-engineering.com>
Date: 2026-09-09 09:41:04

Gen5 is very similar to Gen4. Of interest here is that it has a SMMU
instead of an IPMMU, so there is no need to set the flag for a
workaround. Make the module description more generic while here.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---

Changes since v1:
* reworded commit message to not include "we" (Frank)
* tags added (Thanks Geert)

 drivers/dma/sh/rcar-dmac.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
index 4eca52aeec02..3ad8aba5dcd4 100644
--- a/drivers/dma/sh/rcar-dmac.c
+++ b/drivers/dma/sh/rcar-dmac.c
@@ -2013,6 +2013,11 @@ static const struct rcar_dmac_of_data rcar_gen4_dmac_data = {
 	.broken_ipmmu_microTLB0 = 1,
 };
 
+static const struct rcar_dmac_of_data rcar_gen5_dmac_data = {
+	.chan_offset_base = 0x0,
+	.chan_offset_stride = 0x1000,
+};
+
 static const struct of_device_id rcar_dmac_of_ids[] = {
 	{
 		.compatible = "renesas,rcar-dmac",
@@ -2020,6 +2025,9 @@ static const struct of_device_id rcar_dmac_of_ids[] = {
 	}, {
 		.compatible = "renesas,rcar-gen4-dmac",
 		.data = &rcar_gen4_dmac_data,
+	}, {
+		.compatible = "renesas,rcar-gen5-dmac",
+		.data = &rcar_gen5_dmac_data,
 	}, {
 		/*
 		 * Backward compatibility for between v5.12 - v5.19
@@ -2045,6 +2053,6 @@ static struct platform_driver rcar_dmac_driver = {
 
 module_platform_driver(rcar_dmac_driver);
 
-MODULE_DESCRIPTION("R-Car Gen2 DMA Controller Driver");
+MODULE_DESCRIPTION("R-Car DMA Controller Driver");
 MODULE_AUTHOR("Laurent Pinchart <laurent.pinchart@ideasonboard.com>");
 MODULE_LICENSE("GPL v2");
-- 
2.53.0

Re: [PATCH v2 2/4] dmaengine: sh: rcar-dmac: SMMU doesn't need IPMMU workaround

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2026-09-09 13:02:26

On Wed, 9 Sept 2026 at 11:40, Wolfram Sang
[off-list ref] wrote:
R-Car Gen5 doesn't use an IPMMU anymore, but a SMMU. So, the workaround
for the IPMMU becomes optional. Add a flag to distinguish. No functional
change.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
---

Changes since v1:
* tags added (Thanks Frank)
* renamed the flag-variable (Thanks Geert)
* added a comment that Gen4 might not be affected
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Re: [PATCH v2 4/4] dmaengine: sh: rcar-dmac: Add support for R-Car Gen5 SoCs

From: Frank Li <hidden>
Date: 2026-09-15 16:30:19

On Wed, Sep 09, 2026 at 11:40:13AM +0200, Wolfram Sang wrote:
Gen5 is very similar to Gen4. Of interest here is that it has a SMMU
instead of an IPMMU, so there is no need to set the flag for a
workaround. Make the module description more generic while here.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
quoted hunk
Changes since v1:
* reworded commit message to not include "we" (Frank)
* tags added (Thanks Geert)

 drivers/dma/sh/rcar-dmac.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/sh/rcar-dmac.c b/drivers/dma/sh/rcar-dmac.c
index 4eca52aeec02..3ad8aba5dcd4 100644
--- a/drivers/dma/sh/rcar-dmac.c
+++ b/drivers/dma/sh/rcar-dmac.c
@@ -2013,6 +2013,11 @@ static const struct rcar_dmac_of_data rcar_gen4_dmac_data = {
 	.broken_ipmmu_microTLB0 = 1,
 };

+static const struct rcar_dmac_of_data rcar_gen5_dmac_data = {
+	.chan_offset_base = 0x0,
+	.chan_offset_stride = 0x1000,
+};
+
 static const struct of_device_id rcar_dmac_of_ids[] = {
 	{
 		.compatible = "renesas,rcar-dmac",
@@ -2020,6 +2025,9 @@ static const struct of_device_id rcar_dmac_of_ids[] = {
 	}, {
 		.compatible = "renesas,rcar-gen4-dmac",
 		.data = &rcar_gen4_dmac_data,
+	}, {
+		.compatible = "renesas,rcar-gen5-dmac",
+		.data = &rcar_gen5_dmac_data,
 	}, {
 		/*
 		 * Backward compatibility for between v5.12 - v5.19
@@ -2045,6 +2053,6 @@ static struct platform_driver rcar_dmac_driver = {

 module_platform_driver(rcar_dmac_driver);

-MODULE_DESCRIPTION("R-Car Gen2 DMA Controller Driver");
+MODULE_DESCRIPTION("R-Car DMA Controller Driver");
 MODULE_AUTHOR("Laurent Pinchart <laurent.pinchart@ideasonboard.com>");
 MODULE_LICENSE("GPL v2");
--
2.53.0

Re: [PATCH v2 0/4] dmaengine: sh: rcar-dmac: add R-Car Gen5 X5H support

From: Wolfram Sang <wsa+renesas@sang-engineering.com>
Date: 2026-10-08 18:46:50

On Wed, Sep 09, 2026 at 11:40:09AM +0200, Wolfram Sang wrote:
Here is a small series with the needed driver updates to support R-Car
Gen5 and X5H for the SYSC-DMAC. Details are in the patch descriptions,
but it is all small stuff.

It has been tested on an Ironhide board (X5H) and a SparrowHawk (V4H)
for regression testing. The testing branch can be found here:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/x5h/i2c-experimental

The patches here are based on linux-next as of 20260908. DT checks have
also been passed.

Looking forward to comments or approval!
Every patch reviewed and tagged twice (thank you, guys!), no complaints
from Sashiko even - can we have this in 7.4 pretty please?

Re: [PATCH v2 0/4] dmaengine: sh: rcar-dmac: add R-Car Gen5 X5H support

From: Vinod Koul <vkoul@kernel.org>
Date: 2026-10-08 19:46:55

On Wed, 09 Sep 2026 11:40:09 +0200, Wolfram Sang wrote:
Here is a small series with the needed driver updates to support R-Car
Gen5 and X5H for the SYSC-DMAC. Details are in the patch descriptions,
but it is all small stuff.

It has been tested on an Ironhide board (X5H) and a SparrowHawk (V4H)
for regression testing. The testing branch can be found here:

[...]
Applied, thanks!

[1/4] dmaengine: sh: rcar-dmac: fix style in struct initialization
      commit: a416b656798317f1c6eb69d7a034b4dc392b3781
[2/4] dmaengine: sh: rcar-dmac: SMMU doesn't need IPMMU workaround
      commit: 73812307647a90234cbc1e474f2dec4bfa4ad34f
[3/4] dt-bindings: renesas,rcar-dmac: Add support for R-Car X5H SoC
      commit: 8d4237d153174af7cda2b3e45f4f47586a04dc95
[4/4] dmaengine: sh: rcar-dmac: Add support for R-Car Gen5 SoCs
      commit: 1d8ae2003de08f61095e4e928b1b8cce6c23cabd

Best regards,
-- 
~Vinod

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help