Skip to contentSkip to conversation

ARM: dts: lpc32xx: Add DMA support to platform device tree

PATCH Applied Vladimir Zapolskiy 3 participants 8 messages Dec 31, 2025 – Jan 9

Subsystems (4)
lore
Share & tools
lore

Vladimir Zapolskiy

author maintainer
#0 lore raw

cover ARM: dts: lpc32xx: Add DMA support to platform device tree

At the moment NXP LPC32xx has basic DMA support in the platform code, it works well with NAND flash controllers, but it makes sense to extend it to other controllers.

The SoC specific dts changes were extracted and updated from an old
unapplied series, which added better DMA and I2S support to the platform:
- https://lore.kernel.org/linux-arm-kernel/[email protected]/

DMA support from the original change was dropped for a number of controllers due to driver related issues, which cause runtime regressions. While the .dtsi code seems to be correct, it cannot be tested and verified before making driver changes, this concerns:
* ARM PL180 SDHC driver does not support a single 'rx-tx' type of DMA channel,
* ARM PL022 SSP driver defers its probe instead of bailing out on DMA issues,
* HS UART driver misses a feature to support DMA operations.

This patch series obsoletes another and smipler one:
- https://lore.kernel.org/linux-arm-kernel/[email protected]

Piotr Wojtaszczyk (3):
ARM: dts: lpc32xx: Use syscon for system control block
ARM: dts: lpc32xx: Add missing DMA properties
ARM: dts: lpc32xx: Add missing properties to I2S device tree nodes

Vladimir Zapolskiy (2):
dt-bindings: mfd: nxp: Add NXP LPC32xx System Control Block
ARM: dts: lpc32xx: Declare the second AHB master support on PL080 DMA controller

 .../bindings/mfd/nxp,lpc3220-scb.yaml         | 74 +++++++++++++++++++
 arch/arm/boot/dts/nxp/lpc/lpc32xx.dtsi        | 41 +++++++++-
 2 files changed, 111 insertions(+), 4 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mfd/nxp,lpc3220-scb.yaml
Signature · 1 line
2.43.0
author maintainer
#1 lore raw

PATCH 1/5 dt-bindings: mfd: nxp: Add NXP LPC32xx System Control Block

NXP LPC32xx SoC series contains a System Control Block, which serves for a multitude of purposes including clock and power management, DMA muxing, storing SoC unique ID etc.

---
 .../bindings/mfd/nxp,lpc3220-scb.yaml         | 74 +++++++++++++++++++
 1 file changed, 74 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/nxp,lpc3220-scb.yaml
Documentation/devicetree/bindings/mfd/nxp,lpc3220-scb.yaml new file +74 -0
new file mode 100644
index 000000000000..b993dd15135a
@@ -0,0 +1,74 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/nxp,lpc3220-scb.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP LPC32xx System Control Block
+
+maintainers:
+  - Vladimir Zapolskiy <[email protected]>
+
+description:
+  NXP LPC32xx SoC series have a System Control Block, which serves for
+  a multitude of purposes including clock management, DMA muxes, storing
+  SoC unique ID etc.
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - nxp,lpc3220-scb
+      - const: syscon
+      - const: simple-mfd
+
+  reg:
+    maxItems: 1
+
+  ranges: true
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 1
+
+patternProperties:
+  "^clock-controller@[0-9a-f]+$":
+    $ref: /schemas/clock/nxp,lpc3220-clk.yaml#
+
+  "^dma-router@[0-9a-f]+$":
+    $ref: /schemas/dma/nxp,lpc3220-dmamux.yaml#
+
+required:
+  - compatible
+  - reg
+  - "#address-cells"
+  - "#size-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    syscon@400040000 {
+        compatible = "nxp,lpc3220-scb", "syscon", "simple-mfd";
+        reg = <0x40004000 0x1000>;
+        #address-cells = <1>;
+        #size-cells = <1>;
+        ranges = <0 0x40004000 0x1000>;
+
+        clock-controller@0 {
+            compatible = "nxp,lpc3220-clk";
+            reg = <0x0 0x114>;
+            clocks = <&xtal_32k>, <&xtal>;
+            clock-names = "xtal_32k", "xtal";
+            #clock-cells = <1>;
+        };
+
+        dma-router@78 {
+            compatible = "nxp,lpc3220-dmamux";
+            reg = <0x78 0x8>;
+            dma-masters = <&dma>;
+            #dma-cells = <3>;
+        };
+    };
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 1/5
#2 lore raw

Re: [PATCH 1/5] dt-bindings: mfd: nxp: Add NXP LPC32xx System Control Block

Quoted 10 lines · Vladimir Zapolskiy

NXP LPC32xx SoC series contains a System Control Block, which serves for a multitude of purposes including clock and power management, DMA muxing, storing SoC unique ID etc.

---
 .../bindings/mfd/nxp,lpc3220-scb.yaml         | 74 +++++++++++++++++++
 1 file changed, 74 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/nxp,lpc3220-scb.yaml
maintainer Applied
#3 lore raw

Re: (subset) [PATCH 1/5] dt-bindings: mfd: nxp: Add NXP LPC32xx System Control Block

In reply to Vladimir Zapolskiy
Quoted 5 lines · Vladimir Zapolskiy

NXP LPC32xx SoC series contains a System Control Block, which serves for a multitude of purposes including clock and power management, DMA muxing, storing SoC unique ID etc.

Applied, thanks!

[1/5] dt-bindings: mfd: nxp: Add NXP LPC32xx System Control Block

      commit: 7cbde1b4ae7aeb1789f4691f94469316f7ca12ca

--
Lee Jones [李琼斯]

author maintainer
#4 lore raw

PATCH 2/5 ARM: dts: lpc32xx: Use syscon for system control block

In reply to Vladimir Zapolskiy

From: Piotr Wojtaszczyk <[email protected]>

The clock controller is a part of NXP LPC32xx system control block (SCB), and SCB provides a number of controllers apart of the clock controller.

[vzapolskiy]:
1. kept a simple comment,
2. renamed SoC specific compatible to 'nxp,lpc3220-scb' due to the SoC UM,
3. changed size in 'ranges', since it should cover more SCB functions,
4. updated the commit message.

Link to the original change:
* https://lore.kernel.org/linux-arm-kernel/[email protected]/

---
 arch/arm/boot/dts/nxp/lpc/lpc32xx.dtsi | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/boot/dts/nxp/lpc/lpc32xx.dtsi +4 -4
index 2236901a0031..89e621dfb950 100644
@@ -314,17 +314,17 @@ fab {
 			ranges = <0x20000000 0x20000000 0x30000000>;
 
 			/* System Control Block */
-			scb {
-				compatible = "simple-bus";
-				ranges = <0x0 0x40004000 0x00001000>;
+			syscon@40004000 {
+				compatible = "nxp,lpc3220-scb", "syscon", "simple-mfd";
+				reg = <0x40004000 0x1000>;
 				#address-cells = <1>;
 				#size-cells = <1>;
+				ranges = <0 0x40004000 0x1000>;
 
 				clk: clock-controller@0 {
 					compatible = "nxp,lpc3220-clk";
 					reg = <0x00 0x114>;
 					#clock-cells = <1>;
-
 					clocks = <&xtal_32k>, <&xtal>;
 					clock-names = "xtal_32k", "xtal";
 				};
Signature · 1 line
2.43.0
author maintainer
#5 lore raw

PATCH 3/5 ARM: dts: lpc32xx: Add missing DMA properties

In reply to Vladimir Zapolskiy

From: Piotr Wojtaszczyk <[email protected]>

Add properties declared in the new DT binding nxp,lpc3220-dmamux.yaml and corresponding phandles.

[vzapolskiy]:
1. rebased the change,
2. dmamux unit address shall be 0x78 instead of 0x7c,
3. removed unsupported 'dmas' properties from sd, ssp0, ssp1 and HS UARTs,
4. more non-functional updates by reordering properies,
5. minor updates to the commit message.

Link to the original change:
* https://lore.kernel.org/linux-arm-kernel/[email protected]/

---
 arch/arm/boot/dts/nxp/lpc/lpc32xx.dtsi | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
arch/arm/boot/dts/nxp/lpc/lpc32xx.dtsi +25 -0
index 89e621dfb950..4f3944d6d765 100644
@@ -66,6 +66,8 @@ slc: flash@20020000 {
 			compatible = "nxp,lpc3220-slc";
 			reg = <0x20020000 0x1000>;
 			clocks = <&clk LPC32XX_CLK_SLC>;
+			dmas = <&dma 1 1>;
+			dma-names = "rx-tx";
 			status = "disabled";
 		};
 
@@ -74,6 +76,8 @@ mlc: flash@200a8000 {
 			reg = <0x200a8000 0x11000>;
 			interrupts = <11 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&clk LPC32XX_CLK_MLC>;
+			dmas = <&dma 12 1>;
+			dma-names = "rx-tx";
 			status = "disabled";
 		};
 
@@ -83,6 +87,12 @@ dma: dma-controller@31000000 {
 			interrupts = <28 IRQ_TYPE_LEVEL_HIGH>;
 			clocks = <&clk LPC32XX_CLK_DMA>;
 			clock-names = "apb_pclk";
+			dma-channels = <8>;
+			dma-requests = <16>;
+			lli-bus-interface-ahb1;
+			mem-bus-interface-ahb1;
+			memcpy-burst-size = <256>;
+			memcpy-bus-width = <32>;
 			#dma-cells = <2>;
 		};
 
@@ -190,6 +200,8 @@ spi1: spi@20088000 {
 				compatible = "nxp,lpc3220-spi";
 				reg = <0x20088000 0x1000>;
 				clocks = <&clk LPC32XX_CLK_SPI1>;
+				dmas = <&dmamux 11 1 0>;
+				dma-names = "rx-tx";
 				#address-cells = <1>;
 				#size-cells = <0>;
 				status = "disabled";
@@ -214,6 +226,8 @@ spi2: spi@20090000 {
 				compatible = "nxp,lpc3220-spi";
 				reg = <0x20090000 0x1000>;
 				clocks = <&clk LPC32XX_CLK_SPI2>;
+				dmas = <&dmamux 3 1 0>;
+				dma-names = "rx-tx";
 				#address-cells = <1>;
 				#size-cells = <0>;
 				status = "disabled";
@@ -222,6 +236,8 @@ spi2: spi@20090000 {
 			i2s0: i2s@20094000 {
 				compatible = "nxp,lpc3220-i2s";
 				reg = <0x20094000 0x1000>;
+				dmas = <&dma 0 1>, <&dma 13 1>;
+				dma-names = "rx", "tx";
 				status = "disabled";
 			};
 
@@ -238,6 +254,8 @@ sd: mmc@20098000 {
 			i2s1: i2s@2009c000 {
 				compatible = "nxp,lpc3220-i2s";
 				reg = <0x2009c000 0x1000>;
+				dmas = <&dma 2 1>, <&dmamux 10 1 1>;
+				dma-names = "rx", "tx";
 				status = "disabled";
 			};
 
@@ -328,6 +346,13 @@ clk: clock-controller@0 {
 					clocks = <&xtal_32k>, <&xtal>;
 					clock-names = "xtal_32k", "xtal";
 				};
+
+				dmamux: dma-router@78 {
+					compatible = "nxp,lpc3220-dmamux";
+					reg = <0x78 0x8>;
+					dma-masters = <&dma>;
+					#dma-cells = <3>;
+				};
 			};
 
 			mic: interrupt-controller@40008000 {
Signature · 1 line
2.43.0
author maintainer
#6 lore raw

PATCH 4/5 ARM: dts: lpc32xx: Declare the second AHB master support on PL080 DMA controller

In reply to Vladimir Zapolskiy

Add 'lli-bus-interface-ahb2' and 'mem-bus-interface-ahb2' properties to the PL080 DMA controller device tree node, tested with dmatest utility.

---
 arch/arm/boot/dts/nxp/lpc/lpc32xx.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/boot/dts/nxp/lpc/lpc32xx.dtsi +2 -0
index 4f3944d6d765..389777ee6850 100644
@@ -90,7 +90,9 @@ dma: dma-controller@31000000 {
 			dma-channels = <8>;
 			dma-requests = <16>;
 			lli-bus-interface-ahb1;
+			lli-bus-interface-ahb2;
 			mem-bus-interface-ahb1;
+			mem-bus-interface-ahb2;
 			memcpy-burst-size = <256>;
 			memcpy-bus-width = <32>;
 			#dma-cells = <2>;
Signature · 1 line
2.43.0
author maintainer
#7 lore raw

PATCH 5/5 ARM: dts: lpc32xx: Add missing properties to I2S device tree nodes

In reply to Vladimir Zapolskiy

From: Piotr Wojtaszczyk <[email protected]>

Add NXP LPC32xx I2S controller device tree properties in accordance to nxp,lpc3220-i2s.yaml.

Link to the original change:
* https://lore.kernel.org/linux-arm-kernel/[email protected]/

[vzapolskiy: changes to the commit message]
---
 arch/arm/boot/dts/nxp/lpc/lpc32xx.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/boot/dts/nxp/lpc/lpc32xx.dtsi +6 -0
index 389777ee6850..53e12679ba5b 100644
@@ -238,8 +238,11 @@ spi2: spi@20090000 {
 			i2s0: i2s@20094000 {
 				compatible = "nxp,lpc3220-i2s";
 				reg = <0x20094000 0x1000>;
+				interrupts = <22 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clk LPC32XX_CLK_I2S0>;
 				dmas = <&dma 0 1>, <&dma 13 1>;
 				dma-names = "rx", "tx";
+				#sound-dai-cells = <0>;
 				status = "disabled";
 			};
 
@@ -256,8 +259,11 @@ sd: mmc@20098000 {
 			i2s1: i2s@2009c000 {
 				compatible = "nxp,lpc3220-i2s";
 				reg = <0x2009c000 0x1000>;
+				interrupts = <23 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clk LPC32XX_CLK_I2S1>;
 				dmas = <&dma 2 1>, <&dmamux 10 1 1>;
 				dma-names = "rx", "tx";
+				#sound-dai-cells = <0>;
 				status = "disabled";
 			};
 
Signature · 1 line
2.43.0