Skip to contentSkip to conversation

arm64: dts: imx8mn: Add spba1 bus

PATCH In review Adam Ford 3 participants 10 messages Apr 6, 2021 – May 17, 2021

Subsystems (2)
lore
Share & tools
lore

Adam Ford

author
#0 lore raw

PATCH 1/2 arm64: dts: imx8mn: Add spba1 bus

The i.MX8MN has an SPBA bus which covers much of the audio, but there is a second SPBA bus which covers many of the serial interfaces like SPI and UARTs currently missing from the device tree. The reference manual calls the bus handling the audio peripherals SPBA2, and the bus handling the serial peripherals is called SPBA1.

Rename the existing spba bus to spba2 and add spba1.

arch/arm64/boot/dts/freescale/imx8mn.dtsi +77 -69
index 4dac4da38f4c..e961acd237a8 100644
@@ -255,7 +255,7 @@ aips1: bus@30000000 {
 			#size-cells = <1>;
 			ranges;
 
-			spba: spba-bus@30000000 {
+			spba2: spba-bus@30000000 {
 				compatible = "fsl,spba-bus", "simple-bus";
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -681,80 +681,88 @@ aips3: bus@30800000 {
 			#size-cells = <1>;
 			ranges;
 
-			ecspi1: spi@30820000 {
-				compatible = "fsl,imx8mn-ecspi", "fsl,imx51-ecspi";
+			spba1: spba-bus@30800000 {
+				compatible = "fsl,spba-bus", "simple-bus";
 				#address-cells = <1>;
-				#size-cells = <0>;
-				reg = <0x30820000 0x10000>;
-				interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clk IMX8MN_CLK_ECSPI1_ROOT>,
-					 <&clk IMX8MN_CLK_ECSPI1_ROOT>;
-				clock-names = "ipg", "per";
-				dmas = <&sdma1 0 7 1>, <&sdma1 1 7 2>;
-				dma-names = "rx", "tx";
-				status = "disabled";
-			};
+				#size-cells = <1>;
+				reg = <0x30800000 0x100000>;
+				ranges;
 
-			ecspi2: spi@30830000 {
-				compatible = "fsl,imx8mn-ecspi", "fsl,imx51-ecspi";
-				#address-cells = <1>;
-				#size-cells = <0>;
-				reg = <0x30830000 0x10000>;
-				interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clk IMX8MN_CLK_ECSPI2_ROOT>,
-					 <&clk IMX8MN_CLK_ECSPI2_ROOT>;
-				clock-names = "ipg", "per";
-				dmas = <&sdma1 2 7 1>, <&sdma1 3 7 2>;
-				dma-names = "rx", "tx";
-				status = "disabled";
-			};
+				ecspi1: spi@30820000 {
+					compatible = "fsl,imx8mn-ecspi", "fsl,imx51-ecspi";
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0x30820000 0x10000>;
+					interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
+					clocks = <&clk IMX8MN_CLK_ECSPI1_ROOT>,
+						 <&clk IMX8MN_CLK_ECSPI1_ROOT>;
+					clock-names = "ipg", "per";
+					dmas = <&sdma1 0 7 1>, <&sdma1 1 7 2>;
+					dma-names = "rx", "tx";
+					status = "disabled";
+				};
 
-			ecspi3: spi@30840000 {
-				compatible = "fsl,imx8mn-ecspi", "fsl,imx51-ecspi";
-				#address-cells = <1>;
-				#size-cells = <0>;
-				reg = <0x30840000 0x10000>;
-				interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clk IMX8MN_CLK_ECSPI3_ROOT>,
-					 <&clk IMX8MN_CLK_ECSPI3_ROOT>;
-				clock-names = "ipg", "per";
-				dmas = <&sdma1 4 7 1>, <&sdma1 5 7 2>;
-				dma-names = "rx", "tx";
-				status = "disabled";
-			};
+				ecspi2: spi@30830000 {
+					compatible = "fsl,imx8mn-ecspi", "fsl,imx51-ecspi";
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0x30830000 0x10000>;
+					interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+					clocks = <&clk IMX8MN_CLK_ECSPI2_ROOT>,
+						 <&clk IMX8MN_CLK_ECSPI2_ROOT>;
+					clock-names = "ipg", "per";
+					dmas = <&sdma1 2 7 1>, <&sdma1 3 7 2>;
+					dma-names = "rx", "tx";
+					status = "disabled";
+				};
 
-			uart1: serial@30860000 {
-				compatible = "fsl,imx8mn-uart", "fsl,imx6q-uart";
-				reg = <0x30860000 0x10000>;
-				interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clk IMX8MN_CLK_UART1_ROOT>,
-					 <&clk IMX8MN_CLK_UART1_ROOT>;
-				clock-names = "ipg", "per";
-				dmas = <&sdma1 22 4 0>, <&sdma1 23 4 0>;
-				dma-names = "rx", "tx";
-				status = "disabled";
-			};
+				ecspi3: spi@30840000 {
+					compatible = "fsl,imx8mn-ecspi", "fsl,imx51-ecspi";
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0x30840000 0x10000>;
+					interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
+					clocks = <&clk IMX8MN_CLK_ECSPI3_ROOT>,
+						 <&clk IMX8MN_CLK_ECSPI3_ROOT>;
+					clock-names = "ipg", "per";
+					dmas = <&sdma1 4 7 1>, <&sdma1 5 7 2>;
+					dma-names = "rx", "tx";
+					status = "disabled";
+				};
 
-			uart3: serial@30880000 {
-				compatible = "fsl,imx8mn-uart", "fsl,imx6q-uart";
-				reg = <0x30880000 0x10000>;
-				interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clk IMX8MN_CLK_UART3_ROOT>,
-					 <&clk IMX8MN_CLK_UART3_ROOT>;
-				clock-names = "ipg", "per";
-				dmas = <&sdma1 26 4 0>, <&sdma1 27 4 0>;
-				dma-names = "rx", "tx";
-				status = "disabled";
-			};
+				uart1: serial@30860000 {
+					compatible = "fsl,imx8mn-uart", "fsl,imx6q-uart";
+					reg = <0x30860000 0x10000>;
+					interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
+					clocks = <&clk IMX8MN_CLK_UART1_ROOT>,
+						 <&clk IMX8MN_CLK_UART1_ROOT>;
+					clock-names = "ipg", "per";
+					dmas = <&sdma1 22 4 0>, <&sdma1 23 4 0>;
+					dma-names = "rx", "tx";
+					status = "disabled";
+				};
 
-			uart2: serial@30890000 {
-				compatible = "fsl,imx8mn-uart", "fsl,imx6q-uart";
-				reg = <0x30890000 0x10000>;
-				interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clk IMX8MN_CLK_UART2_ROOT>,
-					 <&clk IMX8MN_CLK_UART2_ROOT>;
-				clock-names = "ipg", "per";
-				status = "disabled";
+				uart3: serial@30880000 {
+					compatible = "fsl,imx8mn-uart", "fsl,imx6q-uart";
+					reg = <0x30880000 0x10000>;
+					interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
+					clocks = <&clk IMX8MN_CLK_UART3_ROOT>,
+						 <&clk IMX8MN_CLK_UART3_ROOT>;
+					clock-names = "ipg", "per";
+					dmas = <&sdma1 26 4 0>, <&sdma1 27 4 0>;
+					dma-names = "rx", "tx";
+					status = "disabled";
+				};
+
+				uart2: serial@30890000 {
+					compatible = "fsl,imx8mn-uart", "fsl,imx6q-uart";
+					reg = <0x30890000 0x10000>;
+					interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>;
+					clocks = <&clk IMX8MN_CLK_UART2_ROOT>,
+						 <&clk IMX8MN_CLK_UART2_ROOT>;
+					clock-names = "ipg", "per";
+					status = "disabled";
+				};
 			};
 
 			crypto: crypto@30900000 {
Signature · 1 line
2.25.1
author
#1 lore raw

PATCH 2/2 arm64: dts: imx8mm: Add spba1 and spba2 buses

The i.MX8MM reference manual shows there are two spba busses. SPBA1 handles much of the serial interfaces, and SPBA2 covers much of the audio.

Add both of them.

arch/arm64/boot/dts/freescale/imx8mm.dtsi +189 -173
index a27e02bee6b4..64aa38fd2b6e 100644
@@ -271,117 +271,125 @@ aips1: bus@30000000 {
 			#size-cells = <1>;
 			ranges = <0x30000000 0x30000000 0x400000>;
 
-			sai1: sai@30010000 {
-				#sound-dai-cells = <0>;
-				compatible = "fsl,imx8mm-sai", "fsl,imx8mq-sai";
-				reg = <0x30010000 0x10000>;
-				interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clk IMX8MM_CLK_SAI1_IPG>,
-					 <&clk IMX8MM_CLK_SAI1_ROOT>,
-					 <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
-				clock-names = "bus", "mclk1", "mclk2", "mclk3";
-				dmas = <&sdma2 0 2 0>, <&sdma2 1 2 0>;
-				dma-names = "rx", "tx";
-				status = "disabled";
-			};
+			spba2: spba-bus@30000000 {
+				compatible = "fsl,spba-bus", "simple-bus";
+				#address-cells = <1>;
+				#size-cells = <1>;
+				reg = <0x30000000 0x100000>;
+				ranges;
+
+				sai1: sai@30010000 {
+					#sound-dai-cells = <0>;
+					compatible = "fsl,imx8mm-sai", "fsl,imx8mq-sai";
+					reg = <0x30010000 0x10000>;
+					interrupts = <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>;
+					clocks = <&clk IMX8MM_CLK_SAI1_IPG>,
+						 <&clk IMX8MM_CLK_SAI1_ROOT>,
+						 <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
+					clock-names = "bus", "mclk1", "mclk2", "mclk3";
+					dmas = <&sdma2 0 2 0>, <&sdma2 1 2 0>;
+					dma-names = "rx", "tx";
+					status = "disabled";
+				};
 
-			sai2: sai@30020000 {
-				#sound-dai-cells = <0>;
-				compatible = "fsl,imx8mm-sai", "fsl,imx8mq-sai";
-				reg = <0x30020000 0x10000>;
-				interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clk IMX8MM_CLK_SAI2_IPG>,
-					<&clk IMX8MM_CLK_SAI2_ROOT>,
-					<&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
-				clock-names = "bus", "mclk1", "mclk2", "mclk3";
-				dmas = <&sdma2 2 2 0>, <&sdma2 3 2 0>;
-				dma-names = "rx", "tx";
-				status = "disabled";
-			};
+				sai2: sai@30020000 {
+					#sound-dai-cells = <0>;
+					compatible = "fsl,imx8mm-sai", "fsl,imx8mq-sai";
+					reg = <0x30020000 0x10000>;
+					interrupts = <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;
+					clocks = <&clk IMX8MM_CLK_SAI2_IPG>,
+						<&clk IMX8MM_CLK_SAI2_ROOT>,
+						<&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
+					clock-names = "bus", "mclk1", "mclk2", "mclk3";
+					dmas = <&sdma2 2 2 0>, <&sdma2 3 2 0>;
+					dma-names = "rx", "tx";
+					status = "disabled";
+				};
 
-			sai3: sai@30030000 {
-				#sound-dai-cells = <0>;
-				compatible = "fsl,imx8mm-sai", "fsl,imx8mq-sai";
-				reg = <0x30030000 0x10000>;
-				interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clk IMX8MM_CLK_SAI3_IPG>,
-					 <&clk IMX8MM_CLK_SAI3_ROOT>,
-					 <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
-				clock-names = "bus", "mclk1", "mclk2", "mclk3";
-				dmas = <&sdma2 4 2 0>, <&sdma2 5 2 0>;
-				dma-names = "rx", "tx";
-				status = "disabled";
-			};
+				sai3: sai@30030000 {
+					#sound-dai-cells = <0>;
+					compatible = "fsl,imx8mm-sai", "fsl,imx8mq-sai";
+					reg = <0x30030000 0x10000>;
+					interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
+					clocks = <&clk IMX8MM_CLK_SAI3_IPG>,
+						 <&clk IMX8MM_CLK_SAI3_ROOT>,
+						 <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
+					clock-names = "bus", "mclk1", "mclk2", "mclk3";
+					dmas = <&sdma2 4 2 0>, <&sdma2 5 2 0>;
+					dma-names = "rx", "tx";
+					status = "disabled";
+				};
 
-			sai5: sai@30050000 {
-				#sound-dai-cells = <0>;
-				compatible = "fsl,imx8mm-sai", "fsl,imx8mq-sai";
-				reg = <0x30050000 0x10000>;
-				interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clk IMX8MM_CLK_SAI5_IPG>,
-					 <&clk IMX8MM_CLK_SAI5_ROOT>,
-					 <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
-				clock-names = "bus", "mclk1", "mclk2", "mclk3";
-				dmas = <&sdma2 8 2 0>, <&sdma2 9 2 0>;
-				dma-names = "rx", "tx";
-				status = "disabled";
-			};
+				sai5: sai@30050000 {
+					#sound-dai-cells = <0>;
+					compatible = "fsl,imx8mm-sai", "fsl,imx8mq-sai";
+					reg = <0x30050000 0x10000>;
+					interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>;
+					clocks = <&clk IMX8MM_CLK_SAI5_IPG>,
+						 <&clk IMX8MM_CLK_SAI5_ROOT>,
+						 <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
+					clock-names = "bus", "mclk1", "mclk2", "mclk3";
+					dmas = <&sdma2 8 2 0>, <&sdma2 9 2 0>;
+					dma-names = "rx", "tx";
+					status = "disabled";
+				};
 
-			sai6: sai@30060000 {
-				#sound-dai-cells = <0>;
-				compatible = "fsl,imx8mm-sai", "fsl,imx8mq-sai";
-				reg = <0x30060000 0x10000>;
-				interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clk IMX8MM_CLK_SAI6_IPG>,
-					 <&clk IMX8MM_CLK_SAI6_ROOT>,
-					 <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
-				clock-names = "bus", "mclk1", "mclk2", "mclk3";
-				dmas = <&sdma2 10 2 0>, <&sdma2 11 2 0>;
-				dma-names = "rx", "tx";
-				status = "disabled";
-			};
+				sai6: sai@30060000 {
+					#sound-dai-cells = <0>;
+					compatible = "fsl,imx8mm-sai", "fsl,imx8mq-sai";
+					reg = <0x30060000 0x10000>;
+					interrupts = <GIC_SPI 90 IRQ_TYPE_LEVEL_HIGH>;
+					clocks = <&clk IMX8MM_CLK_SAI6_IPG>,
+						 <&clk IMX8MM_CLK_SAI6_ROOT>,
+						 <&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_CLK_DUMMY>;
+					clock-names = "bus", "mclk1", "mclk2", "mclk3";
+					dmas = <&sdma2 10 2 0>, <&sdma2 11 2 0>;
+					dma-names = "rx", "tx";
+					status = "disabled";
+				};
 
-			micfil: audio-controller@30080000 {
-				compatible = "fsl,imx8mm-micfil";
-				reg = <0x30080000 0x10000>;
-				interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>,
-					     <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>,
-					     <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>,
-					     <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clk IMX8MM_CLK_PDM_IPG>,
-					 <&clk IMX8MM_CLK_PDM_ROOT>,
-					 <&clk IMX8MM_AUDIO_PLL1_OUT>,
-					 <&clk IMX8MM_AUDIO_PLL2_OUT>,
-					 <&clk IMX8MM_CLK_EXT3>;
-				clock-names = "ipg_clk", "ipg_clk_app",
-					      "pll8k", "pll11k", "clkext3";
-				dmas = <&sdma2 24 25 0x80000000>;
-				dma-names = "rx";
-				status = "disabled";
-			};
+				micfil: audio-controller@30080000 {
+					compatible = "fsl,imx8mm-micfil";
+					reg = <0x30080000 0x10000>;
+					interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>,
+						     <GIC_SPI 110 IRQ_TYPE_LEVEL_HIGH>,
+						     <GIC_SPI 44 IRQ_TYPE_LEVEL_HIGH>,
+						     <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>;
+					clocks = <&clk IMX8MM_CLK_PDM_IPG>,
+						 <&clk IMX8MM_CLK_PDM_ROOT>,
+						 <&clk IMX8MM_AUDIO_PLL1_OUT>,
+						 <&clk IMX8MM_AUDIO_PLL2_OUT>,
+						 <&clk IMX8MM_CLK_EXT3>;
+					clock-names = "ipg_clk", "ipg_clk_app",
+						      "pll8k", "pll11k", "clkext3";
+					dmas = <&sdma2 24 25 0x80000000>;
+					dma-names = "rx";
+					status = "disabled";
+				};
 
-			spdif1: spdif@30090000 {
-				compatible = "fsl,imx35-spdif";
-				reg = <0x30090000 0x10000>;
-				interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clk IMX8MM_CLK_AUDIO_AHB>, /* core */
-					 <&clk IMX8MM_CLK_24M>, /* rxtx0 */
-					 <&clk IMX8MM_CLK_SPDIF1>, /* rxtx1 */
-					 <&clk IMX8MM_CLK_DUMMY>, /* rxtx2 */
-					 <&clk IMX8MM_CLK_DUMMY>, /* rxtx3 */
-					 <&clk IMX8MM_CLK_DUMMY>, /* rxtx4 */
-					 <&clk IMX8MM_CLK_AUDIO_AHB>, /* rxtx5 */
-					 <&clk IMX8MM_CLK_DUMMY>, /* rxtx6 */
-					 <&clk IMX8MM_CLK_DUMMY>, /* rxtx7 */
-					 <&clk IMX8MM_CLK_DUMMY>; /* spba */
-				clock-names = "core", "rxtx0",
-					      "rxtx1", "rxtx2",
-					      "rxtx3", "rxtx4",
-					      "rxtx5", "rxtx6",
-					      "rxtx7", "spba";
-				dmas = <&sdma2 28 18 0>, <&sdma2 29 18 0>;
-				dma-names = "rx", "tx";
-				status = "disabled";
+				spdif1: spdif@30090000 {
+					compatible = "fsl,imx35-spdif";
+					reg = <0x30090000 0x10000>;
+					interrupts = <GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>;
+					clocks = <&clk IMX8MM_CLK_AUDIO_AHB>, /* core */
+						 <&clk IMX8MM_CLK_24M>, /* rxtx0 */
+						 <&clk IMX8MM_CLK_SPDIF1>, /* rxtx1 */
+						 <&clk IMX8MM_CLK_DUMMY>, /* rxtx2 */
+						 <&clk IMX8MM_CLK_DUMMY>, /* rxtx3 */
+						 <&clk IMX8MM_CLK_DUMMY>, /* rxtx4 */
+						 <&clk IMX8MM_CLK_AUDIO_AHB>, /* rxtx5 */
+						 <&clk IMX8MM_CLK_DUMMY>, /* rxtx6 */
+						 <&clk IMX8MM_CLK_DUMMY>, /* rxtx7 */
+						 <&clk IMX8MM_CLK_DUMMY>; /* spba */
+					clock-names = "core", "rxtx0",
+						      "rxtx1", "rxtx2",
+						      "rxtx3", "rxtx4",
+						      "rxtx5", "rxtx6",
+						      "rxtx7", "spba";
+					dmas = <&sdma2 28 18 0>, <&sdma2 29 18 0>;
+					dma-names = "rx", "tx";
+					status = "disabled";
+				};
 			};
 
 			gpio1: gpio@30200000 {
@@ -670,80 +678,88 @@ aips3: bus@30800000 {
 			ranges = <0x30800000 0x30800000 0x400000>,
 				 <0x8000000 0x8000000 0x10000000>;
 
-			ecspi1: spi@30820000 {
-				compatible = "fsl,imx8mm-ecspi", "fsl,imx51-ecspi";
+			spba1: spba-bus@30800000 {
+				compatible = "fsl,spba-bus", "simple-bus";
 				#address-cells = <1>;
-				#size-cells = <0>;
-				reg = <0x30820000 0x10000>;
-				interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clk IMX8MM_CLK_ECSPI1_ROOT>,
-					 <&clk IMX8MM_CLK_ECSPI1_ROOT>;
-				clock-names = "ipg", "per";
-				dmas = <&sdma1 0 7 1>, <&sdma1 1 7 2>;
-				dma-names = "rx", "tx";
-				status = "disabled";
-			};
+				#size-cells = <1>;
+				reg = <0x30800000 0x100000>;
+				ranges;
+
+				ecspi1: spi@30820000 {
+					compatible = "fsl,imx8mm-ecspi", "fsl,imx51-ecspi";
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0x30820000 0x10000>;
+					interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
+					clocks = <&clk IMX8MM_CLK_ECSPI1_ROOT>,
+						 <&clk IMX8MM_CLK_ECSPI1_ROOT>;
+					clock-names = "ipg", "per";
+					dmas = <&sdma1 0 7 1>, <&sdma1 1 7 2>;
+					dma-names = "rx", "tx";
+					status = "disabled";
+				};
 
-			ecspi2: spi@30830000 {
-				compatible = "fsl,imx8mm-ecspi", "fsl,imx51-ecspi";
-				#address-cells = <1>;
-				#size-cells = <0>;
-				reg = <0x30830000 0x10000>;
-				interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clk IMX8MM_CLK_ECSPI2_ROOT>,
-					 <&clk IMX8MM_CLK_ECSPI2_ROOT>;
-				clock-names = "ipg", "per";
-				dmas = <&sdma1 2 7 1>, <&sdma1 3 7 2>;
-				dma-names = "rx", "tx";
-				status = "disabled";
-			};
+				ecspi2: spi@30830000 {
+					compatible = "fsl,imx8mm-ecspi", "fsl,imx51-ecspi";
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0x30830000 0x10000>;
+					interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+					clocks = <&clk IMX8MM_CLK_ECSPI2_ROOT>,
+						 <&clk IMX8MM_CLK_ECSPI2_ROOT>;
+					clock-names = "ipg", "per";
+					dmas = <&sdma1 2 7 1>, <&sdma1 3 7 2>;
+					dma-names = "rx", "tx";
+					status = "disabled";
+				};
 
-			ecspi3: spi@30840000 {
-				compatible = "fsl,imx8mm-ecspi", "fsl,imx51-ecspi";
-				#address-cells = <1>;
-				#size-cells = <0>;
-				reg = <0x30840000 0x10000>;
-				interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clk IMX8MM_CLK_ECSPI3_ROOT>,
-					 <&clk IMX8MM_CLK_ECSPI3_ROOT>;
-				clock-names = "ipg", "per";
-				dmas = <&sdma1 4 7 1>, <&sdma1 5 7 2>;
-				dma-names = "rx", "tx";
-				status = "disabled";
-			};
+				ecspi3: spi@30840000 {
+					compatible = "fsl,imx8mm-ecspi", "fsl,imx51-ecspi";
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0x30840000 0x10000>;
+					interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
+					clocks = <&clk IMX8MM_CLK_ECSPI3_ROOT>,
+						 <&clk IMX8MM_CLK_ECSPI3_ROOT>;
+					clock-names = "ipg", "per";
+					dmas = <&sdma1 4 7 1>, <&sdma1 5 7 2>;
+					dma-names = "rx", "tx";
+					status = "disabled";
+				};
 
-			uart1: serial@30860000 {
-				compatible = "fsl,imx8mm-uart", "fsl,imx6q-uart";
-				reg = <0x30860000 0x10000>;
-				interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clk IMX8MM_CLK_UART1_ROOT>,
-					 <&clk IMX8MM_CLK_UART1_ROOT>;
-				clock-names = "ipg", "per";
-				dmas = <&sdma1 22 4 0>, <&sdma1 23 4 0>;
-				dma-names = "rx", "tx";
-				status = "disabled";
-			};
+				uart1: serial@30860000 {
+					compatible = "fsl,imx8mm-uart", "fsl,imx6q-uart";
+					reg = <0x30860000 0x10000>;
+					interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
+					clocks = <&clk IMX8MM_CLK_UART1_ROOT>,
+						 <&clk IMX8MM_CLK_UART1_ROOT>;
+					clock-names = "ipg", "per";
+					dmas = <&sdma1 22 4 0>, <&sdma1 23 4 0>;
+					dma-names = "rx", "tx";
+					status = "disabled";
+				};
 
-			uart3: serial@30880000 {
-				compatible = "fsl,imx8mm-uart", "fsl,imx6q-uart";
-				reg = <0x30880000 0x10000>;
-				interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clk IMX8MM_CLK_UART3_ROOT>,
-					 <&clk IMX8MM_CLK_UART3_ROOT>;
-				clock-names = "ipg", "per";
-				dmas = <&sdma1 26 4 0>, <&sdma1 27 4 0>;
-				dma-names = "rx", "tx";
-				status = "disabled";
-			};
+				uart3: serial@30880000 {
+					compatible = "fsl,imx8mm-uart", "fsl,imx6q-uart";
+					reg = <0x30880000 0x10000>;
+					interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
+					clocks = <&clk IMX8MM_CLK_UART3_ROOT>,
+						 <&clk IMX8MM_CLK_UART3_ROOT>;
+					clock-names = "ipg", "per";
+					dmas = <&sdma1 26 4 0>, <&sdma1 27 4 0>;
+					dma-names = "rx", "tx";
+					status = "disabled";
+				};
 
-			uart2: serial@30890000 {
-				compatible = "fsl,imx8mm-uart", "fsl,imx6q-uart";
-				reg = <0x30890000 0x10000>;
-				interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clk IMX8MM_CLK_UART2_ROOT>,
-					 <&clk IMX8MM_CLK_UART2_ROOT>;
-				clock-names = "ipg", "per";
-				status = "disabled";
+				uart2: serial@30890000 {
+					compatible = "fsl,imx8mm-uart", "fsl,imx6q-uart";
+					reg = <0x30890000 0x10000>;
+					interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>;
+					clocks = <&clk IMX8MM_CLK_UART2_ROOT>,
+						 <&clk IMX8MM_CLK_UART2_ROOT>;
+					clock-names = "ipg", "per";
+					status = "disabled";
+				};
 			};
 
 			crypto: crypto@30900000 {
Signature · 1 line
2.25.1
#2 lore raw
In reply to Adam Ford
Quoted 15 lines · Adam Ford

The i.MX8MN has an SPBA bus which covers much of the audio, but there is a second SPBA bus which covers many of the serial interfaces like SPI and UARTs currently missing from the device tree. The reference manual calls the bus handling the audio peripherals SPBA2, and the bus handling the serial peripherals is called SPBA1.

Rename the existing spba bus to spba2 and add spba1.

arch/arm64/boot/dts/freescale/imx8mn.dtsi +0 -0
index 4dac4da38f4c..e961acd237a8 100644

arch/arm64/boot/dts/freescale/imx8mn.dtsi aips1: bus@30000000 { · line 259

Quoted 6 lines
arch/arm64/boot/dts/freescale/imx8mn.dtsi +1 -1
@@ -255,7 +255,7 @@ aips1: bus@30000000 {
 			#size-cells = <1>;
 			ranges;
 
-			spba: spba-bus@30000000 {
+			spba2: spba-bus@30000000 {
 				compatible = "fsl,spba-bus", "simple-bus";

Just noticed that "fsl,spba-bus" is undocumented, no?

Also may I ask if you have a real use case for this bus node?

Shawn

Quoted 162 lines
arch/arm64/boot/dts/freescale/imx8mn.dtsi +76 -68
 				#address-cells = <1>;
 				#size-cells = <1>;
@@ -681,80 +681,88 @@ aips3: bus@30800000 {
 			#size-cells = <1>;
 			ranges;
 
-			ecspi1: spi@30820000 {
-				compatible = "fsl,imx8mn-ecspi", "fsl,imx51-ecspi";
+			spba1: spba-bus@30800000 {
+				compatible = "fsl,spba-bus", "simple-bus";
 				#address-cells = <1>;
-				#size-cells = <0>;
-				reg = <0x30820000 0x10000>;
-				interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clk IMX8MN_CLK_ECSPI1_ROOT>,
-					 <&clk IMX8MN_CLK_ECSPI1_ROOT>;
-				clock-names = "ipg", "per";
-				dmas = <&sdma1 0 7 1>, <&sdma1 1 7 2>;
-				dma-names = "rx", "tx";
-				status = "disabled";
-			};
+				#size-cells = <1>;
+				reg = <0x30800000 0x100000>;
+				ranges;
 
-			ecspi2: spi@30830000 {
-				compatible = "fsl,imx8mn-ecspi", "fsl,imx51-ecspi";
-				#address-cells = <1>;
-				#size-cells = <0>;
-				reg = <0x30830000 0x10000>;
-				interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clk IMX8MN_CLK_ECSPI2_ROOT>,
-					 <&clk IMX8MN_CLK_ECSPI2_ROOT>;
-				clock-names = "ipg", "per";
-				dmas = <&sdma1 2 7 1>, <&sdma1 3 7 2>;
-				dma-names = "rx", "tx";
-				status = "disabled";
-			};
+				ecspi1: spi@30820000 {
+					compatible = "fsl,imx8mn-ecspi", "fsl,imx51-ecspi";
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0x30820000 0x10000>;
+					interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
+					clocks = <&clk IMX8MN_CLK_ECSPI1_ROOT>,
+						 <&clk IMX8MN_CLK_ECSPI1_ROOT>;
+					clock-names = "ipg", "per";
+					dmas = <&sdma1 0 7 1>, <&sdma1 1 7 2>;
+					dma-names = "rx", "tx";
+					status = "disabled";
+				};
 
-			ecspi3: spi@30840000 {
-				compatible = "fsl,imx8mn-ecspi", "fsl,imx51-ecspi";
-				#address-cells = <1>;
-				#size-cells = <0>;
-				reg = <0x30840000 0x10000>;
-				interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clk IMX8MN_CLK_ECSPI3_ROOT>,
-					 <&clk IMX8MN_CLK_ECSPI3_ROOT>;
-				clock-names = "ipg", "per";
-				dmas = <&sdma1 4 7 1>, <&sdma1 5 7 2>;
-				dma-names = "rx", "tx";
-				status = "disabled";
-			};
+				ecspi2: spi@30830000 {
+					compatible = "fsl,imx8mn-ecspi", "fsl,imx51-ecspi";
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0x30830000 0x10000>;
+					interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+					clocks = <&clk IMX8MN_CLK_ECSPI2_ROOT>,
+						 <&clk IMX8MN_CLK_ECSPI2_ROOT>;
+					clock-names = "ipg", "per";
+					dmas = <&sdma1 2 7 1>, <&sdma1 3 7 2>;
+					dma-names = "rx", "tx";
+					status = "disabled";
+				};
 
-			uart1: serial@30860000 {
-				compatible = "fsl,imx8mn-uart", "fsl,imx6q-uart";
-				reg = <0x30860000 0x10000>;
-				interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clk IMX8MN_CLK_UART1_ROOT>,
-					 <&clk IMX8MN_CLK_UART1_ROOT>;
-				clock-names = "ipg", "per";
-				dmas = <&sdma1 22 4 0>, <&sdma1 23 4 0>;
-				dma-names = "rx", "tx";
-				status = "disabled";
-			};
+				ecspi3: spi@30840000 {
+					compatible = "fsl,imx8mn-ecspi", "fsl,imx51-ecspi";
+					#address-cells = <1>;
+					#size-cells = <0>;
+					reg = <0x30840000 0x10000>;
+					interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
+					clocks = <&clk IMX8MN_CLK_ECSPI3_ROOT>,
+						 <&clk IMX8MN_CLK_ECSPI3_ROOT>;
+					clock-names = "ipg", "per";
+					dmas = <&sdma1 4 7 1>, <&sdma1 5 7 2>;
+					dma-names = "rx", "tx";
+					status = "disabled";
+				};
 
-			uart3: serial@30880000 {
-				compatible = "fsl,imx8mn-uart", "fsl,imx6q-uart";
-				reg = <0x30880000 0x10000>;
-				interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clk IMX8MN_CLK_UART3_ROOT>,
-					 <&clk IMX8MN_CLK_UART3_ROOT>;
-				clock-names = "ipg", "per";
-				dmas = <&sdma1 26 4 0>, <&sdma1 27 4 0>;
-				dma-names = "rx", "tx";
-				status = "disabled";
-			};
+				uart1: serial@30860000 {
+					compatible = "fsl,imx8mn-uart", "fsl,imx6q-uart";
+					reg = <0x30860000 0x10000>;
+					interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
+					clocks = <&clk IMX8MN_CLK_UART1_ROOT>,
+						 <&clk IMX8MN_CLK_UART1_ROOT>;
+					clock-names = "ipg", "per";
+					dmas = <&sdma1 22 4 0>, <&sdma1 23 4 0>;
+					dma-names = "rx", "tx";
+					status = "disabled";
+				};
 
-			uart2: serial@30890000 {
-				compatible = "fsl,imx8mn-uart", "fsl,imx6q-uart";
-				reg = <0x30890000 0x10000>;
-				interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>;
-				clocks = <&clk IMX8MN_CLK_UART2_ROOT>,
-					 <&clk IMX8MN_CLK_UART2_ROOT>;
-				clock-names = "ipg", "per";
-				status = "disabled";
+				uart3: serial@30880000 {
+					compatible = "fsl,imx8mn-uart", "fsl,imx6q-uart";
+					reg = <0x30880000 0x10000>;
+					interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
+					clocks = <&clk IMX8MN_CLK_UART3_ROOT>,
+						 <&clk IMX8MN_CLK_UART3_ROOT>;
+					clock-names = "ipg", "per";
+					dmas = <&sdma1 26 4 0>, <&sdma1 27 4 0>;
+					dma-names = "rx", "tx";
+					status = "disabled";
+				};
+
+				uart2: serial@30890000 {
+					compatible = "fsl,imx8mn-uart", "fsl,imx6q-uart";
+					reg = <0x30890000 0x10000>;
+					interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>;
+					clocks = <&clk IMX8MN_CLK_UART2_ROOT>,
+						 <&clk IMX8MN_CLK_UART2_ROOT>;
+					clock-names = "ipg", "per";
+					status = "disabled";
+				};
 			};
 
 			crypto: crypto@30900000 {
Signature · 1 line
2.25.1
author
#3 lore raw
Quoted 20 lines · Shawn Guo
Quoted 18 lines · Adam Ford

The i.MX8MN has an SPBA bus which covers much of the audio, but there is a second SPBA bus which covers many of the serial interfaces like SPI and UARTs currently missing from the device tree. The reference manual calls the bus handling the audio peripherals SPBA2, and the bus handling the serial peripherals is called SPBA1.

Rename the existing spba bus to spba2 and add spba1.

arch/arm64/boot/dts/freescale/imx8mn.dtsi +0 -0
index 4dac4da38f4c..e961acd237a8 100644
@@ -255,7 +255,7 @@ aips1: bus@30000000 {
                      #size-cells = <1>;
                      ranges;
 
Quoted 5 lines

arch/arm64/boot/dts/freescale/imx8mn.dtsi aips1: bus@30000000 { · line 259

Quoted 3 lines
arch/arm64/boot/dts/freescale/imx8mn.dtsi +1 -1
-                     spba: spba-bus@30000000 {
+                     spba2: spba-bus@30000000 {
                              compatible = "fsl,spba-bus", "simple-bus";

Just noticed that "fsl,spba-bus" is undocumented, no?

I attempted to push the bindings, and I was told it was applied, but when I asked where the bindings were applied I never got a response - [1].

Do you want me to resend the bindings?

Quoted 2 lines

Also may I ask if you have a real use case for this bus node?

The reference manual shows the SPBA bus tells the DMA controller which peripherals are associated with it. Nearly all the i.MX boards use this. The boards I support have Bluetooth devices connected to a UART running high speeds, and if the DMA driver isn't loaded, I can see a performance change. In fact, if the DMA firmware isn't loaded, I often get transfer errors.

adam

[1] - https://lore.kernel.org/linux-devicetree/CAHCN7x+om4W5jqnuAW4-nMkZLc5nrYu7NUsbM36r0wyFSYa4-g@mail.gmail.com/T/

Quoted 165 lines

Shawn

Quoted 162 lines
arch/arm64/boot/dts/freescale/imx8mn.dtsi +76 -69
                              #address-cells = <1>;
                              #size-cells = <1>;
@@ -681,80 +681,88 @@ aips3: bus@30800000 {
                      #size-cells = <1>;
                      ranges;
 
-                     ecspi1: spi@30820000 {
-                             compatible = "fsl,imx8mn-ecspi", "fsl,imx51-ecspi";
+                     spba1: spba-bus@30800000 {
+                             compatible = "fsl,spba-bus", "simple-bus";
                              #address-cells = <1>;
-                             #size-cells = <0>;
-                             reg = <0x30820000 0x10000>;
-                             interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
-                             clocks = <&clk IMX8MN_CLK_ECSPI1_ROOT>,
-                                      <&clk IMX8MN_CLK_ECSPI1_ROOT>;
-                             clock-names = "ipg", "per";
-                             dmas = <&sdma1 0 7 1>, <&sdma1 1 7 2>;
-                             dma-names = "rx", "tx";
-                             status = "disabled";
-                     };
+                             #size-cells = <1>;
+                             reg = <0x30800000 0x100000>;
+                             ranges;
 
-                     ecspi2: spi@30830000 {
-                             compatible = "fsl,imx8mn-ecspi", "fsl,imx51-ecspi";
-                             #address-cells = <1>;
-                             #size-cells = <0>;
-                             reg = <0x30830000 0x10000>;
-                             interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
-                             clocks = <&clk IMX8MN_CLK_ECSPI2_ROOT>,
-                                      <&clk IMX8MN_CLK_ECSPI2_ROOT>;
-                             clock-names = "ipg", "per";
-                             dmas = <&sdma1 2 7 1>, <&sdma1 3 7 2>;
-                             dma-names = "rx", "tx";
-                             status = "disabled";
-                     };
+                             ecspi1: spi@30820000 {
+                                     compatible = "fsl,imx8mn-ecspi", "fsl,imx51-ecspi";
+                                     #address-cells = <1>;
+                                     #size-cells = <0>;
+                                     reg = <0x30820000 0x10000>;
+                                     interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
+                                     clocks = <&clk IMX8MN_CLK_ECSPI1_ROOT>,
+                                              <&clk IMX8MN_CLK_ECSPI1_ROOT>;
+                                     clock-names = "ipg", "per";
+                                     dmas = <&sdma1 0 7 1>, <&sdma1 1 7 2>;
+                                     dma-names = "rx", "tx";
+                                     status = "disabled";
+                             };
 
-                     ecspi3: spi@30840000 {
-                             compatible = "fsl,imx8mn-ecspi", "fsl,imx51-ecspi";
-                             #address-cells = <1>;
-                             #size-cells = <0>;
-                             reg = <0x30840000 0x10000>;
-                             interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
-                             clocks = <&clk IMX8MN_CLK_ECSPI3_ROOT>,
-                                      <&clk IMX8MN_CLK_ECSPI3_ROOT>;
-                             clock-names = "ipg", "per";
-                             dmas = <&sdma1 4 7 1>, <&sdma1 5 7 2>;
-                             dma-names = "rx", "tx";
-                             status = "disabled";
-                     };
+                             ecspi2: spi@30830000 {
+                                     compatible = "fsl,imx8mn-ecspi", "fsl,imx51-ecspi";
+                                     #address-cells = <1>;
+                                     #size-cells = <0>;
+                                     reg = <0x30830000 0x10000>;
+                                     interrupts = <GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>;
+                                     clocks = <&clk IMX8MN_CLK_ECSPI2_ROOT>,
+                                              <&clk IMX8MN_CLK_ECSPI2_ROOT>;
+                                     clock-names = "ipg", "per";
+                                     dmas = <&sdma1 2 7 1>, <&sdma1 3 7 2>;
+                                     dma-names = "rx", "tx";
+                                     status = "disabled";
+                             };
 
-                     uart1: serial@30860000 {
-                             compatible = "fsl,imx8mn-uart", "fsl,imx6q-uart";
-                             reg = <0x30860000 0x10000>;
-                             interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
-                             clocks = <&clk IMX8MN_CLK_UART1_ROOT>,
-                                      <&clk IMX8MN_CLK_UART1_ROOT>;
-                             clock-names = "ipg", "per";
-                             dmas = <&sdma1 22 4 0>, <&sdma1 23 4 0>;
-                             dma-names = "rx", "tx";
-                             status = "disabled";
-                     };
+                             ecspi3: spi@30840000 {
+                                     compatible = "fsl,imx8mn-ecspi", "fsl,imx51-ecspi";
+                                     #address-cells = <1>;
+                                     #size-cells = <0>;
+                                     reg = <0x30840000 0x10000>;
+                                     interrupts = <GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>;
+                                     clocks = <&clk IMX8MN_CLK_ECSPI3_ROOT>,
+                                              <&clk IMX8MN_CLK_ECSPI3_ROOT>;
+                                     clock-names = "ipg", "per";
+                                     dmas = <&sdma1 4 7 1>, <&sdma1 5 7 2>;
+                                     dma-names = "rx", "tx";
+                                     status = "disabled";
+                             };
 
-                     uart3: serial@30880000 {
-                             compatible = "fsl,imx8mn-uart", "fsl,imx6q-uart";
-                             reg = <0x30880000 0x10000>;
-                             interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
-                             clocks = <&clk IMX8MN_CLK_UART3_ROOT>,
-                                      <&clk IMX8MN_CLK_UART3_ROOT>;
-                             clock-names = "ipg", "per";
-                             dmas = <&sdma1 26 4 0>, <&sdma1 27 4 0>;
-                             dma-names = "rx", "tx";
-                             status = "disabled";
-                     };
+                             uart1: serial@30860000 {
+                                     compatible = "fsl,imx8mn-uart", "fsl,imx6q-uart";
+                                     reg = <0x30860000 0x10000>;
+                                     interrupts = <GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>;
+                                     clocks = <&clk IMX8MN_CLK_UART1_ROOT>,
+                                              <&clk IMX8MN_CLK_UART1_ROOT>;
+                                     clock-names = "ipg", "per";
+                                     dmas = <&sdma1 22 4 0>, <&sdma1 23 4 0>;
+                                     dma-names = "rx", "tx";
+                                     status = "disabled";
+                             };
 
-                     uart2: serial@30890000 {
-                             compatible = "fsl,imx8mn-uart", "fsl,imx6q-uart";
-                             reg = <0x30890000 0x10000>;
-                             interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>;
-                             clocks = <&clk IMX8MN_CLK_UART2_ROOT>,
-                                      <&clk IMX8MN_CLK_UART2_ROOT>;
-                             clock-names = "ipg", "per";
-                             status = "disabled";
+                             uart3: serial@30880000 {
+                                     compatible = "fsl,imx8mn-uart", "fsl,imx6q-uart";
+                                     reg = <0x30880000 0x10000>;
+                                     interrupts = <GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>;
+                                     clocks = <&clk IMX8MN_CLK_UART3_ROOT>,
+                                              <&clk IMX8MN_CLK_UART3_ROOT>;
+                                     clock-names = "ipg", "per";
+                                     dmas = <&sdma1 26 4 0>, <&sdma1 27 4 0>;
+                                     dma-names = "rx", "tx";
+                                     status = "disabled";
+                             };
+
+                             uart2: serial@30890000 {
+                                     compatible = "fsl,imx8mn-uart", "fsl,imx6q-uart";
+                                     reg = <0x30890000 0x10000>;
+                                     interrupts = <GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>;
+                                     clocks = <&clk IMX8MN_CLK_UART2_ROOT>,
+                                              <&clk IMX8MN_CLK_UART2_ROOT>;
+                                     clock-names = "ipg", "per";
+                                     status = "disabled";
+                             };
                      };
 
                      crypto: crypto@30900000 {
--

2.25.1

#4 lore raw
Quoted 6 lines · On 2021/05/11 18:45 Adam Ford <[email protected]> wrote:
Quoted 1 line

Also may I ask if you have a real use case for this bus node?

The reference manual shows the SPBA bus tells the DMA controller which peripherals are associated with it. Nearly all the i.MX boards use this. The boards I support have Bluetooth devices connected to a UART running high speeds, and if the DMA driver isn't loaded, I can see a performance change.

Compare PIO with DMA on UART, but not w/o this 'spba bus node ' patch?

Quoted 1 line

In fact, if the DMA firmware isn't loaded, I often get transfer errors.

UART use SDMA ROM firmware instead of RAM firmware, so it should work even without sdma RAM firmware loaded. Still curious what really happen in your board without this patch.

author
#5 lore raw
Quoted 8 lines · Robin Gong
Quoted 6 lines · On 2021/05/11 18:45 Adam Ford <[email protected]> wrote:
Quoted 1 line

Also may I ask if you have a real use case for this bus node?

The reference manual shows the SPBA bus tells the DMA controller which peripherals are associated with it. Nearly all the i.MX boards use this. The boards I support have Bluetooth devices connected to a UART running high speeds, and if the DMA driver isn't loaded, I can see a performance change.

Quoted 6 lines

Compare PIO with DMA on UART, but not w/o this 'spba bus node ' patch?

Quoted 1 line

In fact, if the DMA firmware isn't loaded, I often get transfer errors.

UART use SDMA ROM firmware instead of RAM firmware, so it should work even without sdma RAM firmware loaded. Still curious what really happen in your board without this patch.

What I am seeing is that at times, the HCI UART loading before the DMA firmware is loaded.

[   10.582037] Bluetooth: HCI UART driver ver 2.3
[   10.586867] Bluetooth: HCI UART protocol H4 registered
[   10.593566] imx-sdma 30bd0000.dma-controller: sdma firmware not ready!
[   10.594548] Bluetooth: HCI UART protocol Broadcom registered
[   10.600108] imx-uart 30860000.serial: We cannot prepare for the RX slave dma!

When I get the above message, the bluetooth chip I have throws timeouts and does not function.

[   10.615090] imx-sdma 302c0000.dma-controller: loaded firmware 4.5

Once the firmware is loaded, I can unload the HCI Uart driver and re-load Bluetooth works again.

Based on that, I've been having my system delay the loading of the Bluetooth modules until after the firmware is loaded, but this tells me there is a relationship between the DMA and UART.

adam

Quoted 4 lines
#6 lore raw
Quoted 28 lines · Adam Ford
Quoted 8 lines · Robin Gong
Quoted 6 lines · On 2021/05/11 18:45 Adam Ford <[email protected]> wrote:
Quoted 1 line

Also may I ask if you have a real use case for this bus node?

The reference manual shows the SPBA bus tells the DMA controller which peripherals are associated with it. Nearly all the i.MX boards use this. The boards I support have Bluetooth devices connected to a UART running high speeds, and if the DMA driver isn't loaded, I can see a performance change.

Quoted 6 lines

Compare PIO with DMA on UART, but not w/o this 'spba bus node ' patch?

Quoted 1 line

In fact, if the DMA firmware isn't loaded, I often get transfer errors.

UART use SDMA ROM firmware instead of RAM firmware, so it should work even without sdma RAM firmware loaded. Still curious what really happen in your board without this patch.

What I am seeing is that at times, the HCI UART loading before the DMA firmware is loaded.

[   10.582037] Bluetooth: HCI UART driver ver 2.3
[   10.586867] Bluetooth: HCI UART protocol H4 registered
[   10.593566] imx-sdma 30bd0000.dma-controller: sdma firmware not ready!
[   10.594548] Bluetooth: HCI UART protocol Broadcom registered
[   10.600108] imx-uart 30860000.serial: We cannot prepare for the RX slave dma!

When I get the above message, the bluetooth chip I have throws timeouts and does not function.

Quoted 8 lines
[   10.615090] imx-sdma 302c0000.dma-controller: loaded firmware 4.5

Once the firmware is loaded, I can unload the HCI Uart driver and re-load Bluetooth works again.

Based on that, I've been having my system delay the loading of the Bluetooth modules until after the firmware is loaded, but this tells me there is a relationship between the DMA and UART.

Yeah, I can see how DMA firmware impacts your Bluetooth device, but do not follow how this spba node change make a difference here.

Nevertheless, patches look good. Applied, thanks.

Shawn

#7 lore raw
In reply to Adam Ford
Quoted 7 lines · On 5/11/21 22:49 Adam Ford <[email protected]> wrote:
Quoted 6 lines

Compare PIO with DMA on UART, but not w/o this 'spba bus node ' patch?

Quoted 1 line

In fact, if the DMA firmware isn't loaded, I often get transfer errors.

UART use SDMA ROM firmware instead of RAM firmware, so it should work even without sdma RAM firmware loaded. Still curious what really happen in your board without this patch.

Quoted 7 lines

What I am seeing is that at times, the HCI UART loading before the DMA firmware is loaded.

[   10.582037] Bluetooth: HCI UART driver ver 2.3
[   10.586867] Bluetooth: HCI UART protocol H4 registered
[   10.593566] imx-sdma 30bd0000.dma-controller: sdma firmware not

ready!

Seems you apply my patch set ' add ecspi ERR009165 for i.mx6/7 soc family'
https://www.spinics.net/lists/linux-spi/msg26728.html
where 'sdma firmware not ready' added?

Quoted 3 lines
[   10.594548] Bluetooth: HCI UART protocol Broadcom registered
[   10.600108] imx-uart 30860000.serial: We cannot prepare for the RX slave

dma!

Why not use ROM script for UART as mailine linux-next did (even the above patch set)? If so, I don't think you could such issue on your board. What script(peripheral types) you set in uart dts such as below is 4-- MCU domain UART-> IMX_DMATYPE_UART->app_2_mcu:

dmas = <&sdma1 22 4 0>, <&sdma1 23 4 0>;

Quoted 4 lines

When I get the above message, the bluetooth chip I have throws timeouts and does not function.

Quoted 8 lines
[   10.615090] imx-sdma 302c0000.dma-controller: loaded firmware 4.5

Once the firmware is loaded, I can unload the HCI Uart driver and re-load Bluetooth works again.

Based on that, I've been having my system delay the loading of the Bluetooth modules until after the firmware is loaded, but this tells me there is a relationship between the DMA and UART.

If you use ram script, of course you should use it after firmware loaded. Actually Spba bus in dts is only used for per_2_per script judging if the peripheral address could be accessed directly by SDMA over SPBA, if yes, set SDMA_WATERMARK_LEVEL_SP to let per_2_per script access peripheral over SPBA, otherwise, access peripheral by AIPS instead like ARM side did. Please check with below commit for more. Besides, per_2_per script is used for audio data sample rate convert between ASRC and various audio input. So audio peripherals include ASRC should be in register scope of 'spba-bus' . But with your patch, there are two 'spba-bus' device node in dts, so the first Spba-bus should contain audio peripheral, otherwise, 'of_find_compatible_node (NULL, NULL, "fsl,spba-bus")' may find the wrong one so that SDMA_WATERMARK_LEVEL_SP Never be set.

BTW, do you mean the above firmware load issue you met is gone if this patch applied? If yes, that really surprised me...

commit 8391ecf465ec5c8ccef547267df6d40beb8999a4

Author: Shengjiu Wang <[email protected]>
Date:   Fri Jul 10 17:08:16 2015 +0800

dmaengine: imx-sdma: Add device to device support

author
#8 lore raw
Quoted 13 lines · Robin Gong
Quoted 10 lines · On 5/11/21 22:49 Adam Ford <[email protected]> wrote:
Quoted 6 lines

Compare PIO with DMA on UART, but not w/o this 'spba bus node ' patch?

Quoted 1 line

In fact, if the DMA firmware isn't loaded, I often get transfer errors.

UART use SDMA ROM firmware instead of RAM firmware, so it should work even without sdma RAM firmware loaded. Still curious what really happen in your board without this patch.

What I am seeing is that at times, the HCI UART loading before the DMA firmware is loaded.

Quoted 6 lines
Quoted 4 lines
[   10.582037] Bluetooth: HCI UART driver ver 2.3
[   10.586867] Bluetooth: HCI UART protocol H4 registered
[   10.593566] imx-sdma 30bd0000.dma-controller: sdma firmware not

ready!

Seems you apply my patch set ' add ecspi ERR009165 for i.mx6/7 soc family'
https://www.spinics.net/lists/linux-spi/msg26728.html

I did this on the 5.13-rc1 which appears to have this series applied.

Quoted 5 lines

where 'sdma firmware not ready' added?

Quoted 3 lines
[   10.594548] Bluetooth: HCI UART protocol Broadcom registered
[   10.600108] imx-uart 30860000.serial: We cannot prepare for the RX slave

dma!

Quoted 8 lines

Why not use ROM script for UART as mailine linux-next did (even the above patch set)?

If so, I don't think you could such issue on your board. What script(peripheral types) you set in uart dts such as below is 4-- MCU domain UART-> IMX_DMATYPE_UART->app_2_mcu:

dmas = <&sdma1 22 4 0>, <&sdma1 23 4 0>;

I didn't change the DMA references from the default, and I didn't check to verify whether they are right or not.

Quoted 13 lines
Quoted 5 lines

When I get the above message, the bluetooth chip I have throws timeouts and does not function.

Quoted 8 lines
[   10.615090] imx-sdma 302c0000.dma-controller: loaded firmware 4.5

Once the firmware is loaded, I can unload the HCI Uart driver and re-load Bluetooth works again.

Based on that, I've been having my system delay the loading of the Bluetooth modules until after the firmware is loaded, but this tells me there is a relationship between the DMA and UART.

Quoted 11 lines

If you use ram script, of course you should use it after firmware loaded. Actually Spba bus in dts is only used for per_2_per script judging if the peripheral address could be accessed directly by SDMA over SPBA, if yes, set SDMA_WATERMARK_LEVEL_SP to let per_2_per script access peripheral over SPBA, otherwise, access peripheral by AIPS instead like ARM side did. Please check with below commit for more. Besides, per_2_per script is used for audio data sample rate convert between ASRC and various audio input. So audio peripherals include ASRC should be in register scope of 'spba-bus' . But with your patch, there are two 'spba-bus' device node in dts, so the first Spba-bus should contain audio peripheral, otherwise, 'of_find_compatible_node (NULL, NULL, "fsl,spba-bus")' may find the wrong one so that SDMA_WATERMARK_LEVEL_SP Never be set.

I don't pretend to understand the details of the dma driver, but I attempted to make the patch match the address range of both spba busses from the technical reference manual,so there should be an spba bus for the audio peripherals and an spba bus for the serial peripherals like UART and SPI. I only named them spba1 and spba2 based on the memory ranges defined in the ref manual. Table 2-5 shows SBPA1 is 3080_0000 and table 2-3 shows SPBA2 starts at 3000_0000 which is what I believe I did in this patch.

Quoted 3 lines

BTW, do you mean the above firmware load issue you met is gone if this patch applied? If yes, that really surprised me...

I wasn't trying to imply that adding the spba-bus fixes my Bluetooth issue. I was just stating there is some relationship between the DMA and the UART and if the UART throws a DMA error, the Bluetooth will fail too. What I have been doing to ensure the order of operations is to make the imx_sdma and the Bluetooth system as modules. I tell my sysfs to load the imx_sdma module first, then load the Bluetooth modules. When done in that order, I never see the DMA errors. With UART baud rates at 3Mbps+, I wanted to make sure the DMA was operational to help potentially reduce the A53 workload.

adam

Quoted 11 lines

commit 8391ecf465ec5c8ccef547267df6d40beb8999a4

Author: Shengjiu Wang <[email protected]>
Date:   Fri Jul 10 17:08:16 2015 +0800

dmaengine: imx-sdma: Add device to device support

#9 lore raw
Quoted 1 line · On 5/14/21 Adam Ford <[email protected]> wrote:

I did this on the 5.13-rc1 which appears to have this series applied.

Sorry, I didn't see it on 5.13-rc2 even....

Quoted 12 lines
Quoted 5 lines

where 'sdma firmware not ready' added?

Quoted 2 lines
[   10.594548] Bluetooth: HCI UART protocol Broadcom registered
[   10.600108] imx-uart 30860000.serial: We cannot prepare for the RX

slave

Quoted 2 lines
Quoted 1 line

dma!

Why not use ROM script for UART as mailine linux-next did (even the above

patch set)?

Quoted 8 lines
Quoted 2 lines

If so, I don't think you could such issue on your board. What script(peripheral types) you set in uart dts such as below is 4-- MCU domain

UART-> IMX_DMATYPE_UART->app_2_mcu:

Quoted 2 lines

dmas = <&sdma1 22 4 0>, <&sdma1 23 4 0>;

I didn't change the DMA references from the default, and I didn't check to verify whether they are right or not.

If so, I don't think you could see the above firmware load error since UART use ROM firmware by default instead.

Quoted 28 lines
Quoted 11 lines
Quoted 11 lines

When I get the above message, the bluetooth chip I have throws timeouts and does not function.

[   10.615090] imx-sdma 302c0000.dma-controller: loaded firmware 4.5

Once the firmware is loaded, I can unload the HCI Uart driver and re-load Bluetooth works again.

Quoted 8 lines
Quoted 3 lines

Based on that, I've been having my system delay the loading of the Bluetooth modules until after the firmware is loaded, but this tells me there is a relationship between the DMA and UART.

If you use ram script, of course you should use it after firmware loaded. Actually Spba bus in dts is only used for per_2_per script judging if the peripheral address could be accessed directly by SDMA over SPBA, if yes, set SDMA_WATERMARK_LEVEL_SP to let per_2_per script access peripheral over SPBA, otherwise, access peripheral by AIPS instead

like ARM side did. Please check with below commit for more.

Quoted 6 lines

Besides, per_2_per script is used for audio data sample rate convert between ASRC and various audio input. So audio peripherals include ASRC should be in register scope of 'spba-bus' . But with your patch, there are two 'spba-bus' device node in dts, so the first Spba-bus should contain audio peripheral, otherwise, 'of_find_compatible_node (NULL, NULL, "fsl,spba-bus")' may find the wrong one so that

SDMA_WATERMARK_LEVEL_SP Never be set.

Quoted 8 lines

I don't pretend to understand the details of the dma driver, but I attempted to make the patch match the address range of both spba busses from the technical reference manual,so there should be an spba bus for the audio peripherals and an spba bus for the serial peripherals like UART and SPI. I only named them spba1 and spba2 based on the memory ranges defined in the ref manual. Table 2-5 shows
SBPA1 is 3080_0000 and table 2-3 shows SPBA2 starts at 3000_0000 which is what I believe I did in this patch.

Okay, I'm not saying your patch is not wrong, just curious about your UART issue you mentioned :)