Skip to contentSkip to conversation

ARM: DTS: am33xx: Use the new DT bindings for the eDMA3

PATCH New Peter Ujfalusi 4 participants 12 messages Dec 4, 2015 – Dec 8, 2015 Device tree bindings

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: DTS: am33xx: Use the new DT bindings for the eDMA3

Switch to use the ti,edma3-tpcc and ti,edma3-tptc binding for the eDMA3 and enable the DMA even crossbar with ti,am335x-edma-crossbar.
With the new bindings boards can customize and tweak the DMA channel priority to match their needs. With the new binding the memcpy is safe to be used since with the old binding it was not possible for a driver to know which channel is allowed to be used as non HW triggered channel.

---
 arch/arm/boot/dts/am335x-evm.dts    |  9 +---
 arch/arm/boot/dts/am335x-pepper.dts | 11 +----
 arch/arm/boot/dts/am33xx.dtsi       | 94 ++++++++++++++++++++++++++-----------
 3 files changed, 71 insertions(+), 43 deletions(-)
arch/arm/boot/dts/am335x-evm.dts +2 -7
index 4caf074063fe..a55072fb6646 100644
@@ -743,8 +743,8 @@
 &mmc3 {
 	/* these are on the crossbar and are outlined in the
 	   xbar-event-map element */
-	dmas = <&edma 12
-		&edma 13>;
+	dmas = <&edma_xbar 12 0 1
+		&edma_xbar 13 0 2>;
 	dma-names = "tx", "rx";
 	status = "okay";
 	vmmc-supply = <&wlan_en_reg>;
@@ -766,11 +766,6 @@
 	};
 };
 
-&edma {
-	ti,edma-xbar-event-map = /bits/ 16 <1 12
-					    2 13>;
-};
-
 &sham {
 	status = "okay";
 };
arch/arm/boot/dts/am335x-pepper.dts +2 -9
index 9cb77a120319..4dd4f71498e5 100644
@@ -339,13 +339,6 @@
 	ti,non-removable;
 };
 
-&edma {
-	/* Map eDMA MMC2 Events from Crossbar */
-	ti,edma-xbar-event-map = /bits/ 16 <1 12
-                                            2 13>;
-};
-
-
 &mmc3 {
 	/* Wifi & Bluetooth on MMC #3 */
 	status = "okay";
@@ -354,8 +347,8 @@
 	vmmmc-supply = <&v3v3c_reg>;
 	bus-width = <4>;
 	ti,non-removable;
-	dmas = <&edma 12
-		&edma 13>;
+	dmas = <&edma_xbar 12 0 1
+		&edma_xbar 13 0 2>;
 	dma-names = "tx", "rx";
 };
 
arch/arm/boot/dts/am33xx.dtsi +67 -27

173 lines not on this page · raw message

Signature · 1 line
2.6.3
#1 lore raw

PATCH 1/1 ARM: DTS: am33xx: Use the new DT bindings for the eDMA3

Hi,

Quoted 13 lines · Peter Ujfalusi
arch/arm/boot/dts/am33xx.dtsi +4 -4
@@ -174,12 +182,44 @@
 		};
 
 		edma: edma at 49000000 {
-			compatible = "ti,edma3";
-			ti,hwmods = "tpcc", "tptc0", "tptc1", "tptc2";
-			reg =	<0x49000000 0x10000>,
-				<0x44e10f90 0x40>;
+			compatible = "ti,edma3-tpcc";
+			ti,hwmods = "tpcc";
+			reg =	<0x49000000 0x10000>;
+			reg-names = "edma3_cc";
 			interrupts = <12 13 14>;

arch/arm/boot/dts/am33xx.dtsi line 198

Quoted 10 lines
arch/arm/boot/dts/am33xx.dtsi +9 -1
-			#dma-cells = <1>;
+			interrupt-names = "edma3_ccint", "emda3_mperr",
+					  "edma3_ccerrint";
+			dma-requests = <64>;
+			#dma-cells = <2>;
+
+			ti,tptcs = <&edma_tptc0 7>, <&edma_tptc1 5>,
+				   <&edma_tptc2 0>;
+
+			ti,edma-memcpy-channels = /bits/ 16 <20 21>;

can you explain this property here ? Are you setting bits 20 and 21 on a 16-bit field ?

Signature · 8 lines
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20151204/a4ae2f4a/attachment-0001.sig>
#2 lore raw

PATCH 1/1 ARM: DTS: am33xx: Use the new DT bindings for the eDMA3

Quoted 22 lines · Felipe Balbi

Hi,

Quoted 18 lines · Peter Ujfalusi
arch/arm/boot/dts/am33xx.dtsi +8 -5
@@ -174,12 +182,44 @@
 		};
 
 		edma: edma at 49000000 {
-			compatible = "ti,edma3";
-			ti,hwmods = "tpcc", "tptc0", "tptc1", "tptc2";
-			reg =	<0x49000000 0x10000>,
-				<0x44e10f90 0x40>;
+			compatible = "ti,edma3-tpcc";
+			ti,hwmods = "tpcc";
+			reg =	<0x49000000 0x10000>;
+			reg-names = "edma3_cc";
 			interrupts = <12 13 14>;
-			#dma-cells = <1>;
+			interrupt-names = "edma3_ccint", "emda3_mperr",
+					  "edma3_ccerrint";
+			dma-requests = <64>;
+			#dma-cells = <2>;
Quoted 8 lines

arch/arm/boot/dts/am33xx.dtsi line 198

Quoted 5 lines
arch/arm/boot/dts/am33xx.dtsi +5 -0
+
+			ti,tptcs = <&edma_tptc0 7>, <&edma_tptc1 5>,
+				   <&edma_tptc2 0>;
+
+			ti,edma-memcpy-channels = /bits/ 16 <20 21>;

can you explain this property here ? Are you setting bits 20 and 21 on a 16-bit field ?

I think it's an arry of u16 dma channels.. But could it be just /bits/ 8 instead of /bits/ 16?

Regards,

Tony

#3 lore raw

PATCH 1/1 ARM: DTS: am33xx: Use the new DT bindings for the eDMA3

Quoted 28 lines · On Friday 04 December 2015 10:47:07 Tony Lindgren wrote:
Quoted 19 lines
Quoted 18 lines · Peter Ujfalusi
arch/arm/boot/dts/am33xx.dtsi +8 -5
@@ -174,12 +182,44 @@
            };
 
            edma: edma at 49000000 {
-                   compatible = "ti,edma3";
-                   ti,hwmods = "tpcc", "tptc0", "tptc1", "tptc2";
-                   reg =   <0x49000000 0x10000>,
-                           <0x44e10f90 0x40>;
+                   compatible = "ti,edma3-tpcc";
+                   ti,hwmods = "tpcc";
+                   reg =   <0x49000000 0x10000>;
+                   reg-names = "edma3_cc";
                    interrupts = <12 13 14>;
-                   #dma-cells = <1>;
+                   interrupt-names = "edma3_ccint", "emda3_mperr",
+                                     "edma3_ccerrint";
+                   dma-requests = <64>;
+                   #dma-cells = <2>;
Quoted 8 lines

arch/arm/boot/dts/am33xx.dtsi line 198

Quoted 5 lines
arch/arm/boot/dts/am33xx.dtsi +5 -0
+
+                   ti,tptcs = <&edma_tptc0 7>, <&edma_tptc1 5>,
+                              <&edma_tptc2 0>;
+
+                   ti,edma-memcpy-channels = /bits/ 16 <20 21>;

can you explain this property here ? Are you setting bits 20 and 21 on a 16-bit field ?

Quoted 3 lines

I think it's an arry of u16 dma channels.. But could it be just /bits/ 8 instead of /bits/ 16?

Please just drop the /bits/ 16 and use normal cells.

Arnd

#4 lore raw

PATCH 1/1 ARM: DTS: am33xx: Use the new DT bindings for the eDMA3

Quoted 29 lines · Arnd Bergmann
Quoted 28 lines · On Friday 04 December 2015 10:47:07 Tony Lindgren wrote:
Quoted 27 lines
Quoted 13 lines · Peter Ujfalusi
arch/arm/boot/dts/am33xx.dtsi +4 -4
@@ -174,12 +182,44 @@
            };
 
            edma: edma at 49000000 {
-                   compatible = "ti,edma3";
-                   ti,hwmods = "tpcc", "tptc0", "tptc1", "tptc2";
-                   reg =   <0x49000000 0x10000>,
-                           <0x44e10f90 0x40>;
+                   compatible = "ti,edma3-tpcc";
+                   ti,hwmods = "tpcc";
+                   reg =   <0x49000000 0x10000>;
+                   reg-names = "edma3_cc";
                    interrupts = <12 13 14>;

arch/arm/boot/dts/am33xx.dtsi line 198

Quoted 10 lines
arch/arm/boot/dts/am33xx.dtsi +9 -1
-                   #dma-cells = <1>;
+                   interrupt-names = "edma3_ccint", "emda3_mperr",
+                                     "edma3_ccerrint";
+                   dma-requests = <64>;
+                   #dma-cells = <2>;
+
+                   ti,tptcs = <&edma_tptc0 7>, <&edma_tptc1 5>,
+                              <&edma_tptc2 0>;
+
+                   ti,edma-memcpy-channels = /bits/ 16 <20 21>;

can you explain this property here ? Are you setting bits 20 and 21 on a 16-bit field ?

Quoted 5 lines
Quoted 3 lines

I think it's an arry of u16 dma channels.. But could it be just /bits/ 8 instead of /bits/ 16?

Please just drop the /bits/ 16 and use normal cells.

Yeah agreed, makes things less confusing for sure :)

Tony

#5 lore raw

PATCH 1/1 ARM: DTS: am33xx: Use the new DT bindings for the eDMA3

Quoted 30 lines · Tony Lindgren
Quoted 29 lines · Arnd Bergmann
Quoted 28 lines · On Friday 04 December 2015 10:47:07 Tony Lindgren wrote:
Quoted 27 lines
Quoted 13 lines · Peter Ujfalusi
arch/arm/boot/dts/am33xx.dtsi +4 -4
@@ -174,12 +182,44 @@
            };
 
            edma: edma at 49000000 {
-                   compatible = "ti,edma3";
-                   ti,hwmods = "tpcc", "tptc0", "tptc1", "tptc2";
-                   reg =   <0x49000000 0x10000>,
-                           <0x44e10f90 0x40>;
+                   compatible = "ti,edma3-tpcc";
+                   ti,hwmods = "tpcc";
+                   reg =   <0x49000000 0x10000>;
+                   reg-names = "edma3_cc";
                    interrupts = <12 13 14>;

arch/arm/boot/dts/am33xx.dtsi line 198

Quoted 10 lines
arch/arm/boot/dts/am33xx.dtsi +9 -1
-                   #dma-cells = <1>;
+                   interrupt-names = "edma3_ccint", "emda3_mperr",
+                                     "edma3_ccerrint";
+                   dma-requests = <64>;
+                   #dma-cells = <2>;
+
+                   ti,tptcs = <&edma_tptc0 7>, <&edma_tptc1 5>,
+                              <&edma_tptc2 0>;
+
+                   ti,edma-memcpy-channels = /bits/ 16 <20 21>;

can you explain this property here ? Are you setting bits 20 and 21 on a 16-bit field ?

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

I think it's an arry of u16 dma channels.. But could it be just /bits/ 8 instead of /bits/ 16?

Please just drop the /bits/ 16 and use normal cells.

Yeah agreed, makes things less confusing for sure :)

4.4 will be the first kernel where we will have the new eDMA bindings. I have chosen to use 16bit array for specifying the channels used for memcpy (ti,edma-memcpy-channels) and for the reserving paRAM slots (ti,edma-reserved-slot-ranges). As of now we have maximum of 64 channels and 512 paRAM slots. 16bit is more than enough to store this information and it even gives us enough room if ever in the future these numbers are going to increase (which they are not).

But in order to change them to 32bit the driver needs to be changed as well. Currently we do not have drivers (in 4.4) using the new bindings, 4.4 is not yet out, so it might be possible to change the binding document and the driver to use 32bit arrays. The driver internally uses 16bit type for these which I'm not going to change, but the code parsing the DT needs to be adjusted for the new data type.

If Vinod is willing to take update for the DT binding of eDMA for 4.4-rc, I can cook up the patch(es) to do so.

Signature · 1 line
P?ter
#6 lore raw

PATCH 1/1 ARM: DTS: am33xx: Use the new DT bindings for the eDMA3

Quoted 21 lines · On Tuesday 08 December 2015 09:42:26 Peter Ujfalusi wrote:
Quoted 4 lines · Tony Lindgren
Quoted 2 lines

Please just drop the /bits/ 16 and use normal cells.

Yeah agreed, makes things less confusing for sure

4.4 will be the first kernel where we will have the new eDMA bindings. I have chosen to use 16bit array for specifying the channels used for memcpy (ti,edma-memcpy-channels) and for the reserving paRAM slots (ti,edma-reserved-slot-ranges). As of now we have maximum of 64 channels and 512 paRAM slots. 16bit is more than enough to store this information and it even gives us enough room if ever in the future these numbers are going to increase (which they are not).

But in order to change them to 32bit the driver needs to be changed as well. Currently we do not have drivers (in 4.4) using the new bindings, 4.4 is not yet out, so it might be possible to change the binding document and the driver to use 32bit arrays. The driver internally uses 16bit type for these which I'm not going to change, but the code parsing the DT needs to be adjusted for the new data type.

Quoted 2 lines

If Vinod is willing to take update for the DT binding of eDMA for 4.4-rc, I can cook up the patch(es) to do so.

I hadn't realized that it was already in 4.4-rc. The change should be trivial enough though, so I'd still do it. If Vinod would rather not change it now, it's not overly important though.

Arnd

#7 lore raw

PATCH 1/1 ARM: DTS: am33xx: Use the new DT bindings for the eDMA3

Quoted 22 lines · Arnd Bergmann
Quoted 21 lines · On Tuesday 08 December 2015 09:42:26 Peter Ujfalusi wrote:
Quoted 4 lines · Tony Lindgren
Quoted 2 lines

Please just drop the /bits/ 16 and use normal cells.

Yeah agreed, makes things less confusing for sure

4.4 will be the first kernel where we will have the new eDMA bindings. I have chosen to use 16bit array for specifying the channels used for memcpy (ti,edma-memcpy-channels) and for the reserving paRAM slots (ti,edma-reserved-slot-ranges). As of now we have maximum of 64 channels and 512 paRAM slots. 16bit is more than enough to store this information and it even gives us enough room if ever in the future these numbers are going to increase (which they are not).

But in order to change them to 32bit the driver needs to be changed as well. Currently we do not have drivers (in 4.4) using the new bindings, 4.4 is not yet out, so it might be possible to change the binding document and the driver to use 32bit arrays. The driver internally uses 16bit type for these which I'm not going to change, but the code parsing the DT needs to be adjusted for the new data type.

Quoted 6 lines
Quoted 2 lines

If Vinod is willing to take update for the DT binding of eDMA for 4.4-rc, I can cook up the patch(es) to do so.

I hadn't realized that it was already in 4.4-rc. The change should be trivial enough though, so I'd still do it. If Vinod would rather not change it now, it's not overly important though.

But this change must be done before we have actual users of these properties, which is the am33xx, am437x and the da850 conversion series I have sent recently. We might want to have this changed for 4.4 since it is going to be an LTS release...

Signature · 1 line
P?ter
#8 lore raw

PATCH 1/1 ARM: DTS: am33xx: Use the new DT bindings for the eDMA3

Quoted 26 lines · On Tuesday 08 December 2015 12:22:09 Peter Ujfalusi wrote:
Quoted 25 lines · Arnd Bergmann
Quoted 23 lines · On Tuesday 08 December 2015 09:42:26 Peter Ujfalusi wrote:
Quoted 4 lines · Tony Lindgren
Quoted 2 lines

Please just drop the /bits/ 16 and use normal cells.

Yeah agreed, makes things less confusing for sure

4.4 will be the first kernel where we will have the new eDMA bindings. I have chosen to use 16bit array for specifying the channels used for memcpy (ti,edma-memcpy-channels) and for the reserving paRAM slots (ti,edma-reserved-slot-ranges). As of now we have maximum of 64 channels and 512 paRAM slots. 16bit is more than enough to store this information and it even gives us enough room if ever in the future these numbers are going to increase (which they are not).

But in order to change them to 32bit the driver needs to be changed as well. Currently we do not have drivers (in 4.4) using the new bindings, 4.4 is not yet out, so it might be possible to change the binding document and the driver to use 32bit arrays. The driver internally uses 16bit type for these which I'm not going to change, but the code parsing the DT needs to be adjusted for the new data type.

If Vinod is willing to take update for the DT binding of eDMA for 4.4-rc, I can cook up the patch(es) to do so.

Quoted 8 lines
Quoted 3 lines

I hadn't realized that it was already in 4.4-rc. The change should be trivial enough though, so I'd still do it. If Vinod would rather not change it now, it's not overly important though.

But this change must be done before we have actual users of these properties, which is the am33xx, am437x and the da850 conversion series I have sent recently. We might want to have this changed for 4.4 since it is going to be an LTS release...

Yes, that's what I meant: We either get the patch into 4.4 by creating a branch for Vinod to pull with this change, and base all other changes in your 4.5 series on the same branch, or we don't change it at all.

Arnd

#9 lore raw

PATCH 1/1 ARM: DTS: am33xx: Use the new DT bindings for the eDMA3

Quoted 31 lines · Arnd Bergmann
Quoted 30 lines · On Tuesday 08 December 2015 12:22:09 Peter Ujfalusi wrote:
Quoted 28 lines · Arnd Bergmann
Quoted 21 lines · On Tuesday 08 December 2015 09:42:26 Peter Ujfalusi wrote:
Quoted 4 lines · Tony Lindgren
Quoted 2 lines

Please just drop the /bits/ 16 and use normal cells.

Yeah agreed, makes things less confusing for sure

4.4 will be the first kernel where we will have the new eDMA bindings. I have chosen to use 16bit array for specifying the channels used for memcpy (ti,edma-memcpy-channels) and for the reserving paRAM slots (ti,edma-reserved-slot-ranges). As of now we have maximum of 64 channels and 512 paRAM slots. 16bit is more than enough to store this information and it even gives us enough room if ever in the future these numbers are going to increase (which they are not).

But in order to change them to 32bit the driver needs to be changed as well. Currently we do not have drivers (in 4.4) using the new bindings, 4.4 is not yet out, so it might be possible to change the binding document and the driver to use 32bit arrays. The driver internally uses 16bit type for these which I'm not going to change, but the code parsing the DT needs to be adjusted for the new data type.

Quoted 2 lines

If Vinod is willing to take update for the DT binding of eDMA for 4.4-rc, I can cook up the patch(es) to do so.

I hadn't realized that it was already in 4.4-rc. The change should be trivial enough though, so I'd still do it. If Vinod would rather not change it now, it's not overly important though.

Quoted 8 lines
Quoted 4 lines

But this change must be done before we have actual users of these properties, which is the am33xx, am437x and the da850 conversion series I have sent recently. We might want to have this changed for 4.4 since it is going to be an LTS release...

Yes, that's what I meant: We either get the patch into 4.4 by creating a branch for Vinod to pull with this change, and base all other changes in your 4.5 series on the same branch, or we don't change it at all.

Sounds good to me. If there's an immutable branch against v4.4-rc1 with just that change in it will make our lives easier.

Regards,

Tony

#10 lore raw

PATCH 1/1 ARM: DTS: am33xx: Use the new DT bindings for the eDMA3

In reply to Peter Ujfalusi

arch/arm/boot/dts/am33xx.dtsi line 198

Quoted 5 lines · Peter Ujfalusi
arch/arm/boot/dts/am33xx.dtsi +5 -0
+
+			ti,tptcs = <&edma_tptc0 7>, <&edma_tptc1 5>,
+				   <&edma_tptc2 0>;
+
+			ti,edma-memcpy-channels = /bits/ 16 <20 21>;

Is this safe to change to just ti,edma-memcpy-channels = <20 21> as suggested by Arnd?

Regards,

Tony

#11 lore raw

PATCH 1/1 ARM: DTS: am33xx: Use the new DT bindings for the eDMA3

Quoted 9 lines · Tony Lindgren

arch/arm/boot/dts/am33xx.dtsi line 198

Quoted 5 lines · Peter Ujfalusi
arch/arm/boot/dts/am33xx.dtsi +5 -0
+
+			ti,tptcs = <&edma_tptc0 7>, <&edma_tptc1 5>,
+				   <&edma_tptc2 0>;
+
+			ti,edma-memcpy-channels = /bits/ 16 <20 21>;

Is this safe to change to just ti,edma-memcpy-channels = <20 21> as suggested by Arnd?

The binding document for the eDMA and the driver also needs update to be able to handle this change.

Signature · 1 line
P?ter