Skip to contentSkip to conversation

dt-bindings: dma: fsl-edma: fix ls1028a-edma compatible

PATCH Applied Michael Walle 4 participants 10 messages Mar 6, 2020 – May 11, 2020

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 dt-bindings: dma: fsl-edma: fix ls1028a-edma compatible

The bootloader will fix up the IOMMU entries only on nodes with the compatible "fsl,vf610-edma". Thus make this compatible string mandatory for the ls1028a-edma.

While at it, fix the "fsl,fsl," typo.

Fixes d8c1bdb5288d ("dt-bindings: dma: fsl-edma: add new fsl,fsl,ls1028a-edma")
---
 Documentation/devicetree/bindings/dma/fsl-edma.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/dma/fsl-edma.txt +2 -1
index e77b08ebcd06..ee1754739b4b 100644
@@ -10,7 +10,8 @@ Required properties:
 - compatible :
 	- "fsl,vf610-edma" for eDMA used similar to that on Vybrid vf610 SoC
 	- "fsl,imx7ulp-edma" for eDMA2 used similar to that on i.mx7ulp
-	- "fsl,fsl,ls1028a-edma" for eDMA used similar to that on Vybrid vf610 SoC
+	- "fsl,ls1028a-edma" followed by "fsl,vf610-edma" for eDMA used on the
+	  LS1028A SoC.
 - reg : Specifies base physical address(s) and size of the eDMA registers.
 	The 1st region is eDMA control register's address and size.
 	The 2nd and the 3rd regions are programmable channel multiplexing
Signature · 1 line
2.20.1
#1 lore raw

PATCH 2/2 arm64: dts: ls1028a: add "fsl,vf610-edma" compatible

The bootloader does the IOMMU fixup and dynamically adds the "iommus" property to devices according to its compatible string. In case of the eDMA controller this property is missing. Add it. After that the IOMMU will work with the eDMA core.

---
 arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi +1 -1
index b152fa90cf5c..aa467bff2209 100644
@@ -447,7 +447,7 @@
 
 		edma0: dma-controller@22c0000 {
 			#dma-cells = <2>;
-			compatible = "fsl,ls1028a-edma";
+			compatible = "fsl,ls1028a-edma", "fsl,vf610-edma";
 			reg = <0x0 0x22c0000 0x0 0x10000>,
 			      <0x0 0x22d0000 0x0 0x10000>,
 			      <0x0 0x22e0000 0x0 0x10000>;
Signature · 1 line
2.20.1
#2 lore raw

RE: [EXT] [PATCH 2/2] arm64: dts: ls1028a: add "fsl,vf610-edma" compatible

Quoted 32 lines

-----Original Message-----
From: Michael Walle <[email protected]>
Sent: 2020年3月7日 4:54
To: [email protected]; [email protected]; [email protected]; [email protected]
Cc: Vinod Koul <[email protected]>; Rob Herring <[email protected]>; Mark Rutland <[email protected]>; Shawn Guo <[email protected]>; Leo Li <[email protected]>; Peng Ma <[email protected]>; Michael Walle <[email protected]>
Subject: [EXT] [PATCH 2/2] arm64: dts: ls1028a: add "fsl,vf610-edma" compatible

Caution: EXT Email

The bootloader does the IOMMU fixup and dynamically adds the "iommus" property to devices according to its compatible string. In case of the eDMA controller this property is missing. Add it. After that the IOMMU will work with the eDMA core.

---
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi +0 -0
index b152fa90cf5c..aa467bff2209 100644

arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi line 451

Quoted 6 lines
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi +2 -1
@@ -447,7 +447,7 @@
 
               edma0: dma-controller@22c0000 {
                       #dma-cells = <2>;
-                       compatible = "fsl,ls1028a-edma";
+                       compatible = "fsl,ls1028a-edma",
+ "fsl,vf610-edma";

Hi Michael,

You should change it on bootloader instead of kernel, Some Reg of LS1028a is different from others, So we used compatible "fsl,ls1028a-edm" to distinguish " fsl,vf610-edma".

Thanks,
Peng

Quoted 5 lines
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi +0 -1
                       reg = <0x0 0x22c0000 0x0 0x10000>,
                             <0x0 0x22d0000 0x0 0x10000>,
                             <0x0 0x22e0000 0x0 0x10000>;
--

2.20.1

#3 lore raw

Re: [EXT] [PATCH 2/2] arm64: dts: ls1028a: add "fsl,vf610-edma" compatible

Hi Peng,

Am 2020-03-07 03:09, schrieb Peng Ma:

Quoted 38 lines
Quoted 30 lines

-----Original Message-----
From: Michael Walle <[email protected]>
Sent: 2020年3月7日 4:54
To: [email protected]; [email protected]; [email protected]; [email protected]
Cc: Vinod Koul <[email protected]>; Rob Herring <[email protected]>; Mark Rutland <[email protected]>; Shawn Guo <[email protected]>; Leo Li <[email protected]>; Peng Ma <[email protected]>; Michael Walle <[email protected]>
Subject: [EXT] [PATCH 2/2] arm64: dts: ls1028a: add "fsl,vf610-edma" compatible

Caution: EXT Email

The bootloader does the IOMMU fixup and dynamically adds the "iommus" property to devices according to its compatible string. In case of the eDMA controller this property is missing. Add it. After that the IOMMU will work with the eDMA core.

---
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi +0 -0
index b152fa90cf5c..aa467bff2209 100644

arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi line 451

Quoted 6 lines
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi +2 -1
@@ -447,7 +447,7 @@
 
               edma0: dma-controller@22c0000 {
                       #dma-cells = <2>;
-                       compatible = "fsl,ls1028a-edma";
+                       compatible = "fsl,ls1028a-edma",
+ "fsl,vf610-edma";

Hi Michael,

Quoted 4 lines

You should change it on bootloader instead of kernel, Some Reg of LS1028a is different
from others, So we used compatible "fsl,ls1028a-edm" to distinguish " fsl,vf610-edma".

Yes this might be the right thing to do. So since it is NXPs bootloader feel free to fix that ;) Looking at the u-boot code right now, I don't even know it that is the right fix at all. The fixup code in u-boot is SoC independent (its in fsl_icid.h and is enabled with CONFIG_LSCH3, ie your chassis version). For example, the sdhc fixup will scan the nodes for "compatible = fsl,esdhc", which is also the secondary compatible for the "ls1028a-esdhc" compatible.

And here is another reason to have it this way: we need backwards compatibility, the are already boards out there whose bootloader will fix-up the "old" node. Thus I don't see any other possibilty.

-michael

Quoted 8 lines

Thanks,
Peng

Quoted 5 lines
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi +0 -1
                       reg = <0x0 0x22c0000 0x0 0x10000>,
                             <0x0 0x22d0000 0x0 0x10000>,
                             <0x0 0x22e0000 0x0 0x10000>;
--

2.20.1

#4 lore raw

RE: [EXT] [PATCH 2/2] arm64: dts: ls1028a: add "fsl,vf610-edma" compatible

Quoted 70 lines

-----Original Message-----
From: Michael Walle <[email protected]>
Sent: 2020年3月7日 17:26
To: Peng Ma <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Vinod Koul <[email protected]>; Rob Herring <[email protected]>; Mark Rutland <[email protected]>; Shawn Guo <[email protected]>; Leo Li <[email protected]>
Subject: Re: [EXT] [PATCH 2/2] arm64: dts: ls1028a: add "fsl,vf610-edma" compatible

Caution: EXT Email

Hi Peng,

Am 2020-03-07 03:09, schrieb Peng Ma:

Quoted 7 lines
Quoted 7 lines

-----Original Message-----
From: Michael Walle <[email protected]>
Sent: 2020年3月7日 4:54
To: [email protected]; [email protected]; [email protected]; [email protected]
Cc: Vinod Koul <[email protected]>; Rob Herring <[email protected]>; Mark Rutland <[email protected]>; Shawn Guo

<[email protected]>;

Quoted 31 lines
Quoted 23 lines

Leo Li <[email protected]>; Peng Ma <[email protected]>; Michael Walle <[email protected]>
Subject: [EXT] [PATCH 2/2] arm64: dts: ls1028a: add "fsl,vf610-edma" compatible

Caution: EXT Email

The bootloader does the IOMMU fixup and dynamically adds the "iommus" property to devices according to its compatible string. In case of the eDMA controller this property is missing. Add it. After that the IOMMU will work with the eDMA core.

---
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi +0 -0
index b152fa90cf5c..aa467bff2209 100644

arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi line 451

Quoted 6 lines
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi +2 -1
@@ -447,7 +447,7 @@
 
               edma0: dma-controller@22c0000 {
                       #dma-cells = <2>;
-                       compatible = "fsl,ls1028a-edma";
+                       compatible = "fsl,ls1028a-edma",
+ "fsl,vf610-edma";

Hi Michael,

Quoted 4 lines

You should change it on bootloader instead of kernel, Some Reg of LS1028a is different from others, So we used compatible "fsl,ls1028a-edm" to distinguish "
fsl,vf610-edma".

Yes this might be the right thing to do. So since it is NXPs bootloader feel free to fix that ;) Looking at the u-boot code right now, I don't even know it that is the right fix at all. The fixup code in u-boot is SoC independent (its in fsl_icid.h and is enabled with CONFIG_LSCH3, ie your chassis version). For example, the sdhc fixup will scan the nodes for "compatible = fsl,esdhc", which is also the secondary compatible for the "ls1028a-esdhc" compatible.

Quoted 4 lines

And here is another reason to have it this way: we need backwards compatibility, the are already boards out there whose bootloader will fix-up the "old" node. Thus I don't see any other possibilty.

[Peng Ma] OK, There is non fixed on uboot.
I will fix it on uboot, if you want to use now, please change the uboot as below:

arch/arm/cpu/armv8/fsl-layerscape/ls1028_ids.c +1 -1
index d9d125e8ba..db9dd69548 100644
@@ -14,7 +14,7 @@ struct icid_id_table icid_tbl[] = {
        SET_SDHC_ICID(1, FSL_SDMMC_STREAM_ID),
        SET_SDHC_ICID(2, FSL_SDMMC2_STREAM_ID),
        SET_SATA_ICID(1, "fsl,ls1028a-ahci", FSL_SATA1_STREAM_ID),
-       SET_EDMA_ICID(FSL_EDMA_STREAM_ID),
+       SET_EDMA_ICID_LS1028(FSL_EDMA_STREAM_ID),
        SET_QDMA_ICID("fsl,ls1028a-qdma", FSL_DMA_STREAM_ID),
        SET_GPU_ICID("fsl,ls1028a-gpu", FSL_GPU_STREAM_ID),
        SET_DISPLAY_ICID(FSL_DISPLAY_STREAM_ID),
arch/arm/include/asm/arch-fsl-layerscape/fsl_icid.h +4 -0
index 37e2fe4e66..15d0b60dbe 100644
@@ -144,6 +144,10 @@ extern int fman_icid_tbl_sz;
        SET_GUR_ICID("fsl,vf610-edma", streamid, spare3_amqr,\
                EDMA_BASE_ADDR)
 
+#define SET_EDMA_ICID_LS1028(streamid) \
+       SET_GUR_ICID("fsl,ls1028a-edma", streamid, spare3_amqr,\
+               EDMA_BASE_ADDR)
+
 #define SET_GPU_ICID(compat, streamid) \
        SET_GUR_ICID(compat, streamid, misc1_amqr,\
                GPU_BASE_ADDR)

BR,
Peng

Quoted 10 lines

-michael

Quoted 8 lines

Thanks,
Peng

Quoted 5 lines
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi +0 -1
                       reg = <0x0 0x22c0000 0x0 0x10000>,
                             <0x0 0x22d0000 0x0 0x10000>,
                             <0x0 0x22e0000 0x0 0x10000>;
--

2.20.1

#5 lore raw

Re: [EXT] [PATCH 2/2] arm64: dts: ls1028a: add "fsl,vf610-edma" compatible

Hi Peng,

Am 2020-03-07 11:32, schrieb Peng Ma:

Quoted 68 lines
Quoted 68 lines

-----Original Message-----
From: Michael Walle <[email protected]>
Sent: 2020年3月7日 17:26
To: Peng Ma <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; Vinod Koul <[email protected]>; Rob Herring <[email protected]>; Mark Rutland <[email protected]>; Shawn Guo <[email protected]>; Leo Li <[email protected]>
Subject: Re: [EXT] [PATCH 2/2] arm64: dts: ls1028a: add "fsl,vf610-edma" compatible

Caution: EXT Email

Hi Peng,

Am 2020-03-07 03:09, schrieb Peng Ma:

Quoted 7 lines
Quoted 7 lines

-----Original Message-----
From: Michael Walle <[email protected]>
Sent: 2020年3月7日 4:54
To: [email protected]; [email protected]; [email protected]; [email protected]
Cc: Vinod Koul <[email protected]>; Rob Herring <[email protected]>; Mark Rutland <[email protected]>; Shawn Guo

<[email protected]>;

Quoted 31 lines
Quoted 23 lines

Leo Li <[email protected]>; Peng Ma <[email protected]>; Michael Walle <[email protected]>
Subject: [EXT] [PATCH 2/2] arm64: dts: ls1028a: add "fsl,vf610-edma" compatible

Caution: EXT Email

The bootloader does the IOMMU fixup and dynamically adds the "iommus" property to devices according to its compatible string. In case of the eDMA controller this property is missing. Add it. After that the IOMMU will work with the eDMA core.

---
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi +0 -0
index b152fa90cf5c..aa467bff2209 100644

arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi line 451

Quoted 6 lines
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi +2 -1
@@ -447,7 +447,7 @@
 
               edma0: dma-controller@22c0000 {
                       #dma-cells = <2>;
-                       compatible = "fsl,ls1028a-edma";
+                       compatible = "fsl,ls1028a-edma",
+ "fsl,vf610-edma";

Hi Michael,

Quoted 4 lines

You should change it on bootloader instead of kernel, Some Reg of LS1028a is different from others, So we used compatible "fsl,ls1028a-edm" to distinguish "
fsl,vf610-edma".

Yes this might be the right thing to do. So since it is NXPs bootloader feel free to fix that ;) Looking at the u-boot code right now, I don't even know it that is the right fix at all. The fixup code in u-boot is SoC independent (its in fsl_icid.h and is enabled with CONFIG_LSCH3, ie your chassis version). For example, the sdhc fixup will scan the nodes for "compatible = fsl,esdhc", which is also the secondary compatible for the "ls1028a-esdhc" compatible.

Quoted 7 lines
Quoted 4 lines

And here is another reason to have it this way: we need backwards compatibility, the are already boards out there whose bootloader will fix-up the "old" node. Thus I don't see any other possibilty.

[Peng Ma] OK, There is non fixed on uboot.
I will fix it on uboot, if you want to use now, please change the uboot as below:

As I told you, I cannot be changed for shipped bootloaders. While it can be changed for newer ones, I would really like to retain backwards compatibility. And so should you.

That being said, I don't see a problem in having both compatibles. Linux will use the ls1028a-emda one and u-boot will fix up the "older" vf610-edma one.

Unfortunately, this patch will not only affect eDMA but all other drivers which uses eDMA, eg. sound, lpuart, i2c and maybe DSPI.

-michael

Quoted 44 lines
arch/arm/cpu/armv8/fsl-layerscape/ls1028_ids.c +1 -1
index d9d125e8ba..db9dd69548 100644
@@ -14,7 +14,7 @@ struct icid_id_table icid_tbl[] = {
        SET_SDHC_ICID(1, FSL_SDMMC_STREAM_ID),
        SET_SDHC_ICID(2, FSL_SDMMC2_STREAM_ID),
        SET_SATA_ICID(1, "fsl,ls1028a-ahci", FSL_SATA1_STREAM_ID),
-       SET_EDMA_ICID(FSL_EDMA_STREAM_ID),
+       SET_EDMA_ICID_LS1028(FSL_EDMA_STREAM_ID),
        SET_QDMA_ICID("fsl,ls1028a-qdma", FSL_DMA_STREAM_ID),
        SET_GPU_ICID("fsl,ls1028a-gpu", FSL_GPU_STREAM_ID),
        SET_DISPLAY_ICID(FSL_DISPLAY_STREAM_ID),
arch/arm/include/asm/arch-fsl-layerscape/fsl_icid.h +4 -0
index 37e2fe4e66..15d0b60dbe 100644
@@ -144,6 +144,10 @@ extern int fman_icid_tbl_sz;
        SET_GUR_ICID("fsl,vf610-edma", streamid, spare3_amqr,\
                EDMA_BASE_ADDR)
 
+#define SET_EDMA_ICID_LS1028(streamid) \
+       SET_GUR_ICID("fsl,ls1028a-edma", streamid, spare3_amqr,\
+               EDMA_BASE_ADDR)
+
 #define SET_GPU_ICID(compat, streamid) \
        SET_GUR_ICID(compat, streamid, misc1_amqr,\
                GPU_BASE_ADDR)

BR,
Peng

Quoted 10 lines

-michael

Quoted 8 lines

Thanks,
Peng

Quoted 5 lines
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi +0 -1
                       reg = <0x0 0x22c0000 0x0 0x10000>,
                             <0x0 0x22d0000 0x0 0x10000>,
                             <0x0 0x22e0000 0x0 0x10000>;
--

2.20.1

#6 lore raw

Re: [PATCH 2/2] arm64: dts: ls1028a: add "fsl,vf610-edma" compatible

In reply to Michael Walle

Hi all,

Am 2020-03-06 21:54, schrieb Michael Walle:

Quoted 6 lines

The bootloader does the IOMMU fixup and dynamically adds the "iommus" property to devices according to its compatible string. In case of the eDMA controller this property is missing. Add it. After that the IOMMU will work with the eDMA core.

Is it possible to have this merged, so it gets into the merge window for 5.7? As I explained in this thread [1], without this compatible all boards with enabled IOMMU (and who have either sound, lpuart or i2c enabled), doesn't work.

-michael

[1] https://lore.kernel.org/linux-devicetree/[email protected]/

Quoted 18 lines
---
 arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi +1 -1
index b152fa90cf5c..aa467bff2209 100644
@@ -447,7 +447,7 @@
 
 		edma0: dma-controller@22c0000 {
 			#dma-cells = <2>;
-			compatible = "fsl,ls1028a-edma";
+			compatible = "fsl,ls1028a-edma", "fsl,vf610-edma";
 			reg = <0x0 0x22c0000 0x0 0x10000>,
 			      <0x0 0x22d0000 0x0 0x10000>,
 			      <0x0 0x22e0000 0x0 0x10000>;
maintainer Reviewed-by on v1 1/2
#7 lore raw
In reply to Michael Walle
Quoted 4 lines · Michael Walle

The bootloader will fix up the IOMMU entries only on nodes with the compatible "fsl,vf610-edma". Thus make this compatible string mandatory for the ls1028a-edma.

Quoted 8 lines

While at it, fix the "fsl,fsl," typo.

Fixes d8c1bdb5288d ("dt-bindings: dma: fsl-edma: add new fsl,fsl,ls1028a-edma")
---
 Documentation/devicetree/bindings/dma/fsl-edma.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Applied
#8 lore raw
In reply to Michael Walle
Quoted 8 lines · Michael Walle

The bootloader will fix up the IOMMU entries only on nodes with the compatible "fsl,vf610-edma". Thus make this compatible string mandatory for the ls1028a-edma.

While at it, fix the "fsl,fsl," typo.

Fixes d8c1bdb5288d ("dt-bindings: dma: fsl-edma: add new fsl,fsl,ls1028a-edma")

Applied both. Will try to send for 5.7-rc inclusion.

Shawn

#9 lore raw

Hi Shawn Guo,

Am 2020-04-13 16:18, schrieb Shawn Guo:

Quoted 11 lines · Michael Walle
Quoted 8 lines

The bootloader will fix up the IOMMU entries only on nodes with the compatible "fsl,vf610-edma". Thus make this compatible string mandatory for the ls1028a-edma.

While at it, fix the "fsl,fsl," typo.

Fixes d8c1bdb5288d ("dt-bindings: dma: fsl-edma: add new fsl,fsl,ls1028a-edma")

Applied both. Will try to send for 5.7-rc inclusion.

Are there any news on the inclusion? Unfortunately, I also forgot the fixes tag on patch 2/2, so it won't end up in v5.7.x.

-michael