Skip to contentSkip to conversation

ARM: dts: at91: sama5d2: Rework Flexcom definitions

PATCH Applied [email protected] 2 participants 18 messages May 14, 2020 – May 15, 2020

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

cover ARM: dts: at91: sama5d2: Rework Flexcom definitions

From: Tudor Ambarus <[email protected]>

Rework the sama5d2 SoC flexcom definitions. The Flexcom IPs are in the SoC. Move all the flexcom nodes together with their function definitions in the SoC dtsi. Boards will just fill the pins and enable the desired functions. With this we remove the duplication of the flexcom definitions across the sama5d2 boards.

Round the flexcom support and add the missing flexcom definitions. All the flexcom functions are now defined.

Apart of the aliases and the new flx0 i2c function on sama5d2_xplained, the only functional change that this patch set adds, is that it uart5, uart6 and uart7 inherit the atmel,fifo-size = <32>; optional property. These nodes have both the FIFO size described and the DMA enabled. uart5 was tested on sama5d27-wlsom1-ek. On uart6 and uart7 a Bluetooth module can be connected. Tested BT uart7 on sama5d2-icp.

Tudor Ambarus (16):
ARM: dts: at91: sama5d2: Fix the label numbering for flexcom functions
ARM: dts: at91: sama5d2: Move flx4 definitions in the SoC dtsi
ARM: dts: at91: sama5d2: Move flx3 definitions in the SoC dtsi
ARM: dts: at91: sama5d2: Move flx2 definitions in the SoC dtsi
ARM: dts: at91: sama5d2: Move flx1 definitions in the SoC dtsi
ARM: dts: at91: sama5d2: Move flx0 definitions in the SoC dtsi
ARM: dts: at91: sama5d2: Specify the FIFO size for the Flexcom UART
ARM: dts: at91: sama5d2: Add DMA bindings for the SPI and UART flx4
functions
ARM: dts: at91: sama5d2: Add DMA bindings for the flx3 SPI function
ARM: dts: at91: sama5d2: Add DMA bindings for the flx1 I2C function
ARM: dts: at91: sama5d2: Add DMA bindings for the SPI and I2C flx0
functions
ARM: dts: at91: sama5d2: Add missing flexcom definitions
ARM: dts: at91: sama5d2: Remove i2s and tcb aliases from SoC dtsi
ARM: dts: at91: sama5d2_xplained: Add alias for DBGU
ARM: dts: at91: sama5d2_xplained: Describe the flx0 I2C function
ARM: dts: at91: sama5d2_ptc_ek: Add comments to describe the aliases

 arch/arm/boot/dts/at91-kizbox3-hs.dts         |   4 +-
 arch/arm/boot/dts/at91-kizbox3_common.dtsi    |  48 +--
 arch/arm/boot/dts/at91-sama5d27_som1_ek.dts   |  64 +---
 arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi   |  12 -
 arch/arm/boot/dts/at91-sama5d27_wlsom1_ek.dts |  12 -
 arch/arm/boot/dts/at91-sama5d2_icp.dts        |  42 +--
 arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts     |  14 +-
 arch/arm/boot/dts/at91-sama5d2_xplained.dts   |  42 ++-
 arch/arm/boot/dts/sama5d2.dtsi                | 295 +++++++++++++++++-
 9 files changed, 347 insertions(+), 186 deletions(-)
Signature · 1 line
2.23.0
#1 lore raw

PATCH 1/16 ARM: dts: at91: sama5d2: Fix the label numbering for flexcom functions

From: Tudor Ambarus <[email protected]>

The sama5d2 SoC has the following IPs: [uart0, uart4], {spi0, spi1}, {i2c0, i2c1}. Label the flexcom functions in order:
flx0: uart5, spi2, i2c2
flx1: uart6, spi3, i2c3
flx2: uart7, spi4, i2c4
flx3: uart8, spi5, i2c5
flx4: uart9, spi6, i2c6

Some boards respected this scheme, others not. Fix the ones that didn't.

---
 arch/arm/boot/dts/at91-kizbox3-hs.dts       |  4 ++--
 arch/arm/boot/dts/at91-kizbox3_common.dtsi  |  8 ++++----
 arch/arm/boot/dts/at91-sama5d27_som1_ek.dts | 20 ++++++++++----------
 arch/arm/boot/dts/at91-sama5d2_icp.dts      |  8 ++++----
 arch/arm/boot/dts/at91-sama5d2_xplained.dts |  2 +-
 5 files changed, 21 insertions(+), 21 deletions(-)
arch/arm/boot/dts/at91-kizbox3-hs.dts +2 -2
index 8734e7f8939e..0da1f0557eaf 100644
@@ -283,7 +283,7 @@
 
 &flx3 {
 	status = "okay";
-	uart6: serial@200 {
+	uart8: serial@200 {
 		status = "okay";
 	};
 };
@@ -291,7 +291,7 @@
 &flx4 {
 	status = "okay";
 
-	i2c2: i2c@600 {
+	i2c6: i2c@600 {
 		status = "okay";
 	};
 };
arch/arm/boot/dts/at91-kizbox3_common.dtsi +4 -4
index 299e74d23184..d7a6c972bdac 100644
@@ -28,7 +28,7 @@
 		serial3 = &uart3;
 		serial4 = &uart4;
 		serial5 = &uart5;
-		serial6 = &uart6;
+		serial6 = &uart8;
 	};
 
 	chosen {
@@ -207,7 +207,7 @@
 		};
 	};
 
-	pinctrl_flx4_default: flx4_i2c2_default {
+	pinctrl_flx4_default: flx4_i2c6_default {
 		pinmux = <PIN_PD12__FLEXCOM4_IO0>, //DATA
 		<PIN_PD13__FLEXCOM4_IO1>; //CLK
 		bias-disable;
@@ -324,7 +324,7 @@
 	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_USART>;
 	status = "disabled";
 
-	uart6: serial@200 {
+	uart8: serial@200 {
 		compatible = "atmel,at91sam9260-usart";
 		reg = <0x200 0x400>;
 		interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
@@ -350,7 +350,7 @@
 	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
 	status = "disabled";
 
-	i2c2: i2c@600 {
+	i2c6: i2c@600 {
 		compatible = "atmel,sama5d2-i2c";
 		reg = <0x600 0x200>;
 		interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
arch/arm/boot/dts/at91-sama5d27_som1_ek.dts +10 -10
index b0853bf7901c..d215243fe163 100644
@@ -21,7 +21,7 @@
 		serial1 = &uart4;	/* mikro BUS 1 */
 		serial2 = &uart2;	/* mikro BUS 2 */
 		i2c1	= &i2c1;
-		i2c2	= &i2c2;
+		i2c2	= &i2c3;
 	};
 
 	chosen {
@@ -125,7 +125,7 @@
 				atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
 				status = "okay";
 
-				i2c2: i2c@600 {
+				i2c3: i2c@600 {
 					compatible = "atmel,sama5d2-i2c";
 					reg = <0x600 0x200>;
 					interrupts = <20 IRQ_TYPE_LEVEL_HIGH 7>;
@@ -178,7 +178,7 @@
 				atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_SPI>;
 				status = "disabled";
 
-				uart7: serial@200 {
+				uart8: serial@200 {
 					compatible = "atmel,at91sam9260-usart";
 					reg = <0x200 0x200>;
 					interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
@@ -190,7 +190,7 @@
 					status = "disabled"; /* Conflict with isc. */
 				};
 
-				spi2: spi@400 {
+				spi5: spi@400 {
 					compatible = "atmel,at91rm9200-spi";
 					reg = <0x400 0x200>;
 					interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
@@ -207,7 +207,7 @@
 				atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_SPI>;
 				status = "okay";
 
-				uart6: serial@200 {
+				uart9: serial@200 {
 					compatible = "atmel,at91sam9260-usart";
 					reg = <0x200 0x200>;
 					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
@@ -216,10 +216,10 @@
 					pinctrl-names = "default";
 					pinctrl-0 = <&pinctrl_flx4_default>;
 					atmel,fifo-size = <32>;
-					status = "disabled"; /* Conflict with spi3 and i2c3. */
+					status = "disabled"; /* Conflict with spi6 and i2c6. */
 				};
 
-				spi3: spi@400 {
+				spi6: spi@400 {
 					compatible = "atmel,at91rm9200-spi";
 					reg = <0x400 0x200>;
 					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
@@ -228,10 +228,10 @@
 					pinctrl-names = "default";
 					pinctrl-0 = <&pinctrl_mikrobus_spi &pinctrl_mikrobus1_spi_cs &pinctrl_mikrobus2_spi_cs>;
 					atmel,fifo-size = <16>;
-					status = "okay"; /* Conflict with uart6 and i2c3. */
+					status = "okay"; /* Conflict with uart5 and i2c6. */
 				};
 
-				i2c3: i2c@600 {
+				i2c6: i2c@600 {
 					compatible = "atmel,sama5d2-i2c";
 					reg = <0x600 0x200>;
 					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
@@ -243,7 +243,7 @@
 					pinctrl-names = "default";
 					pinctrl-0 = <&pinctrl_flx4_default>;
 					atmel,fifo-size = <16>;
-					status = "disabled"; /* Conflict with uart6 and spi3. */
+					status = "disabled"; /* Conflict with uart5 and spi6. */
 				};
 			};
 
arch/arm/boot/dts/at91-sama5d2_icp.dts +4 -4
index cc9fa700eafb..1d9556dbbd63 100644
@@ -22,7 +22,7 @@
 		serial0 = &uart0;	/* debug uart0 + mikro BUS 1 */
 		serial1 = &uart1;	/* mikro BUS 3 */
 		serial3 = &uart3;	/* mikro BUS 2 */
-		serial5 = &uart5;	/* flx2 */
+		serial5 = &uart7;	/* flx2 */
 		i2c0	= &i2c0;
 		i2c1	= &i2c1;
 	};
@@ -159,7 +159,7 @@
 	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_USART>;
 	status = "okay";
 
-	uart5: serial@200 {
+	uart7: serial@200 {
 		compatible = "atmel,at91sam9260-usart";
 		reg = <0x200 0x200>;
 		interrupts = <21 IRQ_TYPE_LEVEL_HIGH 7>;
@@ -184,7 +184,7 @@
 	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_SPI>;
 	status = "okay";
 
-	spi3: spi@400 {
+	spi5: spi@400 {
 		compatible = "atmel,at91rm9200-spi";
 		reg = <0x400 0x200>;
 		interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
@@ -201,7 +201,7 @@
 	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
 	status = "okay";
 
-	i2c2: i2c@600 {
+	i2c6: i2c@600 {
 		compatible = "atmel,sama5d2-i2c";
 		reg = <0x600 0x200>;
 		interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
arch/arm/boot/dts/at91-sama5d2_xplained.dts +1 -1
index e0c6cff1a312..0666708b05f9 100644
@@ -377,7 +377,7 @@
 				atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
 				status = "okay";
 
-				i2c2: i2c@600 {
+				i2c6: i2c@600 {
 					compatible = "atmel,sama5d2-i2c";
 					reg = <0x600 0x200>;
 					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
Signature · 1 line
2.23.0
#2 lore raw

PATCH 2/16 ARM: dts: at91: sama5d2: Move flx4 definitions in the SoC dtsi

In reply to [email protected]

From: Tudor Ambarus <[email protected]>

The Flexcom IP is part of the sama5d2 SoC. Move the flx0 node together with its function definitions in sama5d2.dtsi. Boards will just fill the pins and enable the desired functions.

---
 arch/arm/boot/dts/at91-kizbox3_common.dtsi  | 14 --------
 arch/arm/boot/dts/at91-sama5d27_som1_ek.dts | 20 -----------
 arch/arm/boot/dts/at91-sama5d2_icp.dts      |  8 -----
 arch/arm/boot/dts/at91-sama5d2_xplained.dts |  8 -----
 arch/arm/boot/dts/sama5d2.dtsi              | 40 +++++++++++++++++++++
 5 files changed, 40 insertions(+), 50 deletions(-)
arch/arm/boot/dts/at91-kizbox3_common.dtsi +0 -14
index d7a6c972bdac..ee6f036aa008 100644
@@ -351,22 +351,8 @@
 	status = "disabled";
 
 	i2c6: i2c@600 {
-		compatible = "atmel,sama5d2-i2c";
-		reg = <0x600 0x200>;
-		interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
-		dmas = <&dma0
-			(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
-			| AT91_XDMAC_DT_PERID(19))>,
-		       <&dma0
-			(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
-			| AT91_XDMAC_DT_PERID(20))>;
-		dma-names = "tx", "rx";
-		#address-cells = <1>;
-		#size-cells = <0>;
-		clocks = <&pmc PMC_TYPE_PERIPHERAL 23>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_flx4_default>;
-		atmel,fifo-size = <16>;
 		status = "disabled";
 	};
 };
arch/arm/boot/dts/at91-sama5d27_som1_ek.dts +0 -20
index d215243fe163..5f4a7c8725f3 100644
@@ -208,41 +208,21 @@
 				status = "okay";
 
 				uart9: serial@200 {
-					compatible = "atmel,at91sam9260-usart";
-					reg = <0x200 0x200>;
-					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
-					clocks = <&pmc PMC_TYPE_PERIPHERAL 23>;
-					clock-names = "usart";
 					pinctrl-names = "default";
 					pinctrl-0 = <&pinctrl_flx4_default>;
-					atmel,fifo-size = <32>;
 					status = "disabled"; /* Conflict with spi6 and i2c6. */
 				};
 
 				spi6: spi@400 {
-					compatible = "atmel,at91rm9200-spi";
-					reg = <0x400 0x200>;
-					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
-					clocks = <&pmc PMC_TYPE_PERIPHERAL 23>;
-					clock-names = "spi_clk";
 					pinctrl-names = "default";
 					pinctrl-0 = <&pinctrl_mikrobus_spi &pinctrl_mikrobus1_spi_cs &pinctrl_mikrobus2_spi_cs>;
-					atmel,fifo-size = <16>;
 					status = "okay"; /* Conflict with uart5 and i2c6. */
 				};
 
 				i2c6: i2c@600 {
-					compatible = "atmel,sama5d2-i2c";
-					reg = <0x600 0x200>;
-					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
 					dmas = <0>, <0>;
-					dma-names = "tx", "rx";
-					#address-cells = <1>;
-					#size-cells = <0>;
-					clocks = <&pmc PMC_TYPE_PERIPHERAL 23>;
 					pinctrl-names = "default";
 					pinctrl-0 = <&pinctrl_flx4_default>;
-					atmel,fifo-size = <16>;
 					status = "disabled"; /* Conflict with uart5 and spi6. */
 				};
 			};
arch/arm/boot/dts/at91-sama5d2_icp.dts +0 -8
index 1d9556dbbd63..7216a794f4f6 100644
@@ -202,17 +202,9 @@
 	status = "okay";
 
 	i2c6: i2c@600 {
-		compatible = "atmel,sama5d2-i2c";
-		reg = <0x600 0x200>;
-		interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
 		dmas = <0>, <0>;
-		dma-names = "tx", "rx";
-		#address-cells = <1>;
-		#size-cells = <0>;
-		clocks = <&pmc PMC_TYPE_PERIPHERAL 23>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_flx4_default>;
-		atmel,fifo-size = <16>;
 		status = "okay";
 
 		mcp16502@5b {
arch/arm/boot/dts/at91-sama5d2_xplained.dts +0 -8
index 0666708b05f9..a5046f8257ad 100644
@@ -378,20 +378,12 @@
 				status = "okay";
 
 				i2c6: i2c@600 {
-					compatible = "atmel,sama5d2-i2c";
-					reg = <0x600 0x200>;
-					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
 					dmas = <0>, <0>;
-					dma-names = "tx", "rx";
-					#address-cells = <1>;
-					#size-cells = <0>;
-					clocks = <&pmc PMC_TYPE_PERIPHERAL 23>;
 					pinctrl-names = "default", "gpio";
 					pinctrl-0 = <&pinctrl_flx4_default>;
 					pinctrl-1 = <&pinctrl_flx4_gpio>;
 					sda-gpios = <&pioA PIN_PD12 GPIO_ACTIVE_HIGH>;
 					scl-gpios = <&pioA PIN_PD13 GPIO_ACTIVE_HIGH>;
-					atmel,fifo-size = <16>;
 					i2c-analog-filter;
 					i2c-digital-filter;
 					i2c-digital-filter-width-ns = <35>;
arch/arm/boot/dts/sama5d2.dtsi +40 -0
index ab550d69db91..5c31e4068eb5 100644
@@ -814,6 +814,46 @@
 				#size-cells = <1>;
 				ranges = <0x0 0xfc018000 0x800>;
 				status = "disabled";
+
+				uart9: serial@200 {
+					compatible = "atmel,at91sam9260-usart";
+					reg = <0x200 0x200>;
+					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 23>;
+					clock-names = "usart";
+					atmel,fifo-size = <32>;
+					status = "disabled";
+				};
+
+				spi6: spi@400 {
+					compatible = "atmel,at91rm9200-spi";
+					reg = <0x400 0x200>;
+					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 23>;
+					clock-names = "spi_clk";
+					atmel,fifo-size = <16>;
+					status = "disabled";
+				};
+
+				i2c6: i2c@600 {
+					compatible = "atmel,sama5d2-i2c";
+					reg = <0x600 0x200>;
+					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 23>;
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(19))>,
+					       <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(20))>;
+					dma-names = "tx", "rx";
+					atmel,fifo-size = <16>;
+					status = "disabled";
+				};
 			};
 
 			trng@fc01c000 {
Signature · 1 line
2.23.0
#3 lore raw

PATCH 3/16 ARM: dts: at91: sama5d2: Move flx3 definitions in the SoC dtsi

In reply to [email protected]

From: Tudor Ambarus <[email protected]>

The Flexcom IP is part of the sama5d2 SoC. Move the flx3 node together with its function definitions in sama5d2.dtsi. Boards will just fill the pins and enable the desired functions.

---
 arch/arm/boot/dts/at91-kizbox3_common.dtsi  | 13 ---------
 arch/arm/boot/dts/at91-sama5d27_som1_ek.dts | 13 +--------
 arch/arm/boot/dts/at91-sama5d2_icp.dts      |  6 -----
 arch/arm/boot/dts/sama5d2.dtsi              | 29 +++++++++++++++++++++
 4 files changed, 30 insertions(+), 31 deletions(-)
arch/arm/boot/dts/at91-kizbox3_common.dtsi +0 -13
index ee6f036aa008..4351a8d32225 100644
@@ -325,21 +325,8 @@
 	status = "disabled";
 
 	uart8: serial@200 {
-		compatible = "atmel,at91sam9260-usart";
-		reg = <0x200 0x400>;
-		interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
-		dmas = <&dma0
-			(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
-			| AT91_XDMAC_DT_PERID(17))>,
-		       <&dma0
-			(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
-			| AT91_XDMAC_DT_PERID(18))>;
-		dma-names = "tx", "rx";
-		clocks = <&pmc PMC_TYPE_PERIPHERAL 22>;
-		clock-names = "usart";
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_flx3_default>;
-		atmel,fifo-size = <32>;
 		atmel,use-dma-rx;
 		atmel,use-dma-tx;
 		status = "disabled";
arch/arm/boot/dts/at91-sama5d27_som1_ek.dts +1 -12
index 5f4a7c8725f3..abbf14e29d85 100644
@@ -179,26 +179,15 @@
 				status = "disabled";
 
 				uart8: serial@200 {
-					compatible = "atmel,at91sam9260-usart";
-					reg = <0x200 0x200>;
-					interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
-					clocks = <&pmc PMC_TYPE_PERIPHERAL 22>;
-					clock-names = "usart";
+					dmas = <0>, <0>;
 					pinctrl-names = "default";
 					pinctrl-0 = <&pinctrl_flx3_default>;
-					atmel,fifo-size = <32>;
 					status = "disabled"; /* Conflict with isc. */
 				};
 
 				spi5: spi@400 {
-					compatible = "atmel,at91rm9200-spi";
-					reg = <0x400 0x200>;
-					interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
-					clocks = <&pmc PMC_TYPE_PERIPHERAL 22>;
-					clock-names = "spi_clk";
 					pinctrl-names = "default";
 					pinctrl-0 = <&pinctrl_flx3_default>;
-					atmel,fifo-size = <16>;
 					status = "disabled"; /* Conflict with isc. */
 				};
 			};
arch/arm/boot/dts/at91-sama5d2_icp.dts +0 -6
index 7216a794f4f6..8a4336e12a60 100644
@@ -185,14 +185,8 @@
 	status = "okay";
 
 	spi5: spi@400 {
-		compatible = "atmel,at91rm9200-spi";
-		reg = <0x400 0x200>;
-		interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
-		clocks = <&pmc PMC_TYPE_PERIPHERAL 22>;
-		clock-names = "spi_clk";
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_mikrobus1_spi &pinctrl_mikrobus1_spi_cs>;
-		atmel,fifo-size = <16>;
 		status = "okay";
 	};
 };
arch/arm/boot/dts/sama5d2.dtsi +29 -0
index 5c31e4068eb5..5e84cde8226a 100644
@@ -804,6 +804,35 @@
 				#size-cells = <1>;
 				ranges = <0x0 0xfc014000 0x800>;
 				status = "disabled";
+
+				uart8: serial@200 {
+					compatible = "atmel,at91sam9260-usart";
+					reg = <0x200 0x200>;
+					interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 22>;
+					clock-names = "usart";
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(17))>,
+					       <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(18))>;
+					dma-names = "tx", "rx";
+					atmel,fifo-size = <32>;
+					status = "disabled";
+				};
+
+				spi5: spi@400 {
+					compatible = "atmel,at91rm9200-spi";
+					reg = <0x400 0x200>;
+					interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 22>;
+					clock-names = "spi_clk";
+					atmel,fifo-size = <16>;
+					status = "disabled";
+				};
 			};
 
 			flx4: flexcom@fc018000 {
Signature · 1 line
2.23.0
#4 lore raw

PATCH 4/16 ARM: dts: at91: sama5d2: Move flx2 definitions in the SoC dtsi

In reply to [email protected]

From: Tudor Ambarus <[email protected]>

The Flexcom IP is part of the sama5d2 SoC. Move the flx2 node together with its function definitions in sama5d2.dtsi. Boards will just fill the pins and enable the desired functions.

---
 arch/arm/boot/dts/at91-sama5d2_icp.dts | 12 ------------
 arch/arm/boot/dts/sama5d2.dtsi         | 18 ++++++++++++++++++
 2 files changed, 18 insertions(+), 12 deletions(-)
arch/arm/boot/dts/at91-sama5d2_icp.dts +0 -12
index 8a4336e12a60..23f413afb333 100644
@@ -160,18 +160,6 @@
 	status = "okay";
 
 	uart7: serial@200 {
-		compatible = "atmel,at91sam9260-usart";
-		reg = <0x200 0x200>;
-		interrupts = <21 IRQ_TYPE_LEVEL_HIGH 7>;
-		dmas = <&dma0
-			(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
-				AT91_XDMAC_DT_PERID(15))>,
-				<&dma0
-				(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
-				AT91_XDMAC_DT_PERID(16))>;
-		dma-names = "tx", "rx";
-		clocks = <&pmc PMC_TYPE_PERIPHERAL 21>;
-		clock-names = "usart";
 		pinctrl-0 = <&pinctrl_flx2_default>;
 		pinctrl-names = "default";
 		atmel,use-dma-rx;
arch/arm/boot/dts/sama5d2.dtsi +18 -0
index 5e84cde8226a..89064225e9aa 100644
@@ -794,6 +794,24 @@
 				#size-cells = <1>;
 				ranges = <0x0 0xfc010000 0x800>;
 				status = "disabled";
+
+				uart7: serial@200 {
+					compatible = "atmel,at91sam9260-usart";
+					reg = <0x200 0x200>;
+					interrupts = <21 IRQ_TYPE_LEVEL_HIGH 7>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 21>;
+					clock-names = "usart";
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(15))>,
+						<&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(16))>;
+					dma-names = "tx", "rx";
+					status = "disabled";
+				};
 			};
 
 			flx3: flexcom@fc014000 {
Signature · 1 line
2.23.0
#5 lore raw

PATCH 5/16 ARM: dts: at91: sama5d2: Move flx1 definitions in the SoC dtsi

In reply to [email protected]

From: Tudor Ambarus <[email protected]>

The Flexcom IP is part of the sama5d2 SoC. Move the flx0 node together with its function definitions in sama5d2.dtsi. Boards will just fill the pins and enable the desired functions.

---
 arch/arm/boot/dts/at91-sama5d27_som1_ek.dts |  7 -----
 arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi | 12 ---------
 arch/arm/boot/dts/sama5d2.dtsi              | 29 +++++++++++++++++++++
 3 files changed, 29 insertions(+), 19 deletions(-)
arch/arm/boot/dts/at91-sama5d27_som1_ek.dts +0 -7
index abbf14e29d85..a0deff15fb9a 100644
@@ -126,20 +126,13 @@
 				status = "okay";
 
 				i2c3: i2c@600 {
-					compatible = "atmel,sama5d2-i2c";
-					reg = <0x600 0x200>;
-					interrupts = <20 IRQ_TYPE_LEVEL_HIGH 7>;
 					dmas = <0>, <0>;
 					dma-names = "tx", "rx";
 					i2c-analog-filter;
 					i2c-digital-filter;
 					i2c-digital-filter-width-ns = <35>;
-					#address-cells = <1>;
-					#size-cells = <0>;
-					clocks = <&pmc PMC_TYPE_PERIPHERAL 20>;
 					pinctrl-names = "default";
 					pinctrl-0 = <&pinctrl_mikrobus_i2c>;
-					atmel,fifo-size = <16>;
 					status = "okay";
 				};
 			};
arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi +0 -12
index bea3d60b9722..a06700e53e4c 100644
@@ -36,18 +36,6 @@
 	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_USART>;
 
 	uart6: serial@200 {
-		compatible = "atmel,at91sam9260-usart";
-		reg = <0x200 0x200>;
-		interrupts = <20 IRQ_TYPE_LEVEL_HIGH 7>;
-		dmas = <&dma0
-			(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
-			 AT91_XDMAC_DT_PERID(13))>,
-		       <&dma0
-			(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
-			 AT91_XDMAC_DT_PERID(14))>;
-		dma-names = "tx", "rx";
-		clocks = <&pmc PMC_TYPE_PERIPHERAL 20>;
-		clock-names = "usart";
 		pinctrl-0 = <&pinctrl_flx1_default>;
 		pinctrl-names = "default";
 	};
arch/arm/boot/dts/sama5d2.dtsi +29 -0
index 89064225e9aa..79ed7bd02df6 100644
@@ -645,6 +645,35 @@
 				#size-cells = <1>;
 				ranges = <0x0 0xf8038000 0x800>;
 				status = "disabled";
+
+				uart6: serial@200 {
+					compatible = "atmel,at91sam9260-usart";
+					reg = <0x200 0x200>;
+					interrupts = <20 IRQ_TYPE_LEVEL_HIGH 7>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 20>;
+					clock-names = "usart";
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(13))>,
+					       <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(14))>;
+					dma-names = "tx", "rx";
+					status = "disabled";
+				};
+
+				i2c3: i2c@600 {
+					compatible = "atmel,sama5d2-i2c";
+					reg = <0x600 0x200>;
+					interrupts = <20 IRQ_TYPE_LEVEL_HIGH 7>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 20>;
+					atmel,fifo-size = <16>;
+					status = "disabled";
+				};
 			};
 
 			securam: sram@f8044000 {
Signature · 6 lines
2.23.0

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#6 lore raw

PATCH 6/16 ARM: dts: at91: sama5d2: Move flx0 definitions in the SoC dtsi

In reply to [email protected]

From: Tudor Ambarus <[email protected]>

The Flexcom IP is part of the sama5d2 SoC. Move the flx0 node together with its function definitions in sama5d2.dtsi. Boards will just fill the pins and enable the desired functions.

There is a single functional change in this patch. With the move of the flx0 uart5 definition in the SoC dtsi, the uart5 from at91-sama5d27_wlsom1_ek.dts inherits the following optional property:
atmel,fifo-size = <32>;
This particular change was tested by Codrin.

---
 arch/arm/boot/dts/at91-kizbox3_common.dtsi    | 13 ------
 arch/arm/boot/dts/at91-sama5d27_wlsom1_ek.dts | 12 ------
 arch/arm/boot/dts/at91-sama5d2_icp.dts        |  6 ---
 arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts     |  7 ----
 arch/arm/boot/dts/at91-sama5d2_xplained.dts   |  7 +---
 arch/arm/boot/dts/sama5d2.dtsi                | 40 +++++++++++++++++++
 6 files changed, 41 insertions(+), 44 deletions(-)
arch/arm/boot/dts/at91-kizbox3_common.dtsi +0 -13
index 4351a8d32225..7c3076e245ef 100644
@@ -299,21 +299,8 @@
 	status = "disabled";
 
 	uart5: serial@200  {
-		compatible = "atmel,at91sam9260-usart";
-		reg = <0x200 0x400>;
-		interrupts = <19 IRQ_TYPE_LEVEL_HIGH 7>;
-		dmas = <&dma0
-			(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
-			| AT91_XDMAC_DT_PERID(11))>,
-		       <&dma0
-			(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1)
-			| AT91_XDMAC_DT_PERID(12))>;
-		dma-names = "tx", "rx";
-		clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
-		clock-names = "usart";
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_flx0_default>;
-		atmel,fifo-size = <32>;
 		atmel,use-dma-rx;
 		atmel,use-dma-tx;
 		status = "disabled";
arch/arm/boot/dts/at91-sama5d27_wlsom1_ek.dts +0 -12
index 6b8461278950..6b38fa3f5568 100644
@@ -77,18 +77,6 @@
 	status = "okay";
 
 	uart5: serial@200 {
-		compatible = "atmel,at91sam9260-usart";
-		reg = <0x200 0x200>;
-		interrupts = <19 IRQ_TYPE_LEVEL_HIGH 7>;
-		dmas = <&dma0
-			(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
-			 AT91_XDMAC_DT_PERID(11))>,
-		       <&dma0
-			(AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) |
-			 AT91_XDMAC_DT_PERID(12))>;
-		dma-names = "tx", "rx";
-		clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
-		clock-names = "usart";
 		pinctrl-0 = <&pinctrl_flx0_default>;
 		pinctrl-names = "default";
 		atmel,use-dma-rx;
arch/arm/boot/dts/at91-sama5d2_icp.dts +0 -6
index 23f413afb333..4a01ab8e7e70 100644
@@ -105,15 +105,9 @@
 	status = "okay";
 
 	spi2: spi@400 {
-		compatible = "atmel,at91rm9200-spi";
-		reg = <0x400 0x200>;
-		interrupts = <19 IRQ_TYPE_LEVEL_HIGH 7>;
-		clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
-		clock-names = "spi_clk";
 		cs-gpios = <&pioA PIN_PC0 GPIO_ACTIVE_LOW>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_mikrobus2_spi &pinctrl_ksz_spi_cs>;
-		atmel,fifo-size = <16>;
 		status = "okay";
 		#address-cells = <1>;
 		#size-cells = <0>;
arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts +0 -7
index 32435ce1dab2..8ad3a9c6c536 100644
@@ -191,20 +191,13 @@
 				status = "okay";
 
 				i2c2: i2c@600 {
-					compatible = "atmel,sama5d2-i2c";
-					reg = <0x600 0x200>;
-					interrupts = <19 IRQ_TYPE_LEVEL_HIGH 7>;
 					dmas = <0>, <0>;
 					dma-names = "tx", "rx";
-					#address-cells = <1>;
-					#size-cells = <0>;
-					clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
 					pinctrl-names = "default", "gpio";
 					pinctrl-0 = <&pinctrl_flx0_default>;
 					pinctrl-1 = <&pinctrl_flx0_gpio>;
 					sda-gpios = <&pioA PIN_PB28 GPIO_ACTIVE_HIGH>;
 					scl-gpios = <&pioA PIN_PB29 GPIO_ACTIVE_HIGH>;
-					atmel,fifo-size = <16>;
 					status = "okay";
 				};
 			};
arch/arm/boot/dts/at91-sama5d2_xplained.dts +1 -6
index a5046f8257ad..da4442715ea5 100644
@@ -327,14 +327,9 @@
 				status = "disabled"; /* conflict with ISC_D2 & ISC_D3 data pins */
 
 				uart5: serial@200 {
-					compatible = "atmel,at91sam9260-usart";
-					reg = <0x200 0x200>;
-					interrupts = <19 IRQ_TYPE_LEVEL_HIGH 7>;
-					clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
-					clock-names = "usart";
+					dmas = <0>, <0>;
 					pinctrl-names = "default";
 					pinctrl-0 = <&pinctrl_flx0_default>;
-					atmel,fifo-size = <32>;
 					status = "okay";
 				};
 			};
arch/arm/boot/dts/sama5d2.dtsi +40 -0
index 79ed7bd02df6..acb91908bd74 100644
@@ -635,6 +635,46 @@
 				#size-cells = <1>;
 				ranges = <0x0 0xf8034000 0x800>;
 				status = "disabled";
+
+				uart5: serial@200 {
+					compatible = "atmel,at91sam9260-usart";
+					reg = <0x200 0x200>;
+					interrupts = <19 IRQ_TYPE_LEVEL_HIGH 7>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
+					clock-names = "usart";
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(11))>,
+					       <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(12))>;
+					dma-names = "tx", "rx";
+					atmel,fifo-size = <32>;
+					status = "disabled";
+				};
+
+				spi2: spi@400 {
+					compatible = "atmel,at91rm9200-spi";
+					reg = <0x400 0x200>;
+					interrupts = <19 IRQ_TYPE_LEVEL_HIGH 7>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
+					clock-names = "spi_clk";
+					atmel,fifo-size = <16>;
+					status = "disabled";
+				};
+
+				i2c2: i2c@600 {
+					compatible = "atmel,sama5d2-i2c";
+					reg = <0x600 0x200>;
+					interrupts = <19 IRQ_TYPE_LEVEL_HIGH 7>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
+					atmel,fifo-size = <16>;
+					status = "disabled";
+				};
 			};
 
 			flx1: flexcom@f8038000 {
Signature · 1 line
2.23.0
#7 lore raw

PATCH 7/16 ARM: dts: at91: sama5d2: Specify the FIFO size for the Flexcom UART

In reply to [email protected]

From: Tudor Ambarus <[email protected]>

The UART submodule in Flexcom has 32-byte Transmit and Receive FIFOs. Tested uart7 on sama5d2-icp, which has both DMA and FIFO enabled.

---
 arch/arm/boot/dts/sama5d2.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/boot/dts/sama5d2.dtsi +2 -0
index acb91908bd74..dde969a140b4 100644
@@ -701,6 +701,7 @@
 						 AT91_XDMAC_DT_PER_IF(1) |
 						 AT91_XDMAC_DT_PERID(14))>;
 					dma-names = "tx", "rx";
+					atmel,fifo-size = <32>;
 					status = "disabled";
 				};
 
@@ -879,6 +880,7 @@
 						 AT91_XDMAC_DT_PER_IF(1) |
 						 AT91_XDMAC_DT_PERID(16))>;
 					dma-names = "tx", "rx";
+					atmel,fifo-size = <32>;
 					status = "disabled";
 				};
 			};
Signature · 1 line
2.23.0
#8 lore raw

PATCH 8/16 ARM: dts: at91: sama5d2: Add DMA bindings for the SPI and UART flx4 functions

In reply to [email protected]

From: Tudor Ambarus <[email protected]>

Spare boards of duplicating the DMA bindings. Describe the flx4 DMA bindings in the SoC dtsi. Users that don't want to use DMA for their flexcom functions have to overwrite the flexcom DMA bindings in their board device tree.

---
 arch/arm/boot/dts/at91-sama5d27_som1_ek.dts |  2 ++
 arch/arm/boot/dts/sama5d2.dtsi              | 18 ++++++++++++++++++
 2 files changed, 20 insertions(+)
arch/arm/boot/dts/at91-sama5d27_som1_ek.dts +2 -0
index a0deff15fb9a..6ad66d034305 100644
@@ -190,12 +190,14 @@
 				status = "okay";
 
 				uart9: serial@200 {
+					dmas = <0>, <0>;
 					pinctrl-names = "default";
 					pinctrl-0 = <&pinctrl_flx4_default>;
 					status = "disabled"; /* Conflict with spi6 and i2c6. */
 				};
 
 				spi6: spi@400 {
+					dmas = <0>, <0>;
 					pinctrl-names = "default";
 					pinctrl-0 = <&pinctrl_mikrobus_spi &pinctrl_mikrobus1_spi_cs &pinctrl_mikrobus2_spi_cs>;
 					status = "okay"; /* Conflict with uart5 and i2c6. */
arch/arm/boot/dts/sama5d2.dtsi +18 -0
index dde969a140b4..66aa8d6502d3 100644
@@ -939,6 +939,15 @@
 					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
 					clocks = <&pmc PMC_TYPE_PERIPHERAL 23>;
 					clock-names = "usart";
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(19))>,
+					       <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(20))>;
+					dma-names = "tx", "rx";
 					atmel,fifo-size = <32>;
 					status = "disabled";
 				};
@@ -949,6 +958,15 @@
 					interrupts = <23 IRQ_TYPE_LEVEL_HIGH 7>;
 					clocks = <&pmc PMC_TYPE_PERIPHERAL 23>;
 					clock-names = "spi_clk";
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(19))>,
+					       <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(20))>;
+					dma-names = "tx", "rx";
 					atmel,fifo-size = <16>;
 					status = "disabled";
 				};
Signature · 1 line
2.23.0
#9 lore raw

PATCH 9/16 ARM: dts: at91: sama5d2: Add DMA bindings for the flx3 SPI function

In reply to [email protected]

From: Tudor Ambarus <[email protected]>

Spare boards of duplicating the DMA bindings. Describe the flx3 DMA bindings in the SoC dtsi. Users that don't want to use DMA for their flexcom functions have to overwrite the flexcom DMA bindings in their board device tree.

---
 arch/arm/boot/dts/at91-sama5d27_som1_ek.dts | 1 +
 arch/arm/boot/dts/at91-sama5d2_icp.dts      | 1 +
 arch/arm/boot/dts/sama5d2.dtsi              | 9 +++++++++
 3 files changed, 11 insertions(+)
arch/arm/boot/dts/at91-sama5d27_som1_ek.dts +1 -0
index 6ad66d034305..1aa8b79d618b 100644
@@ -179,6 +179,7 @@
 				};
 
 				spi5: spi@400 {
+					dmas = <0>, <0>;
 					pinctrl-names = "default";
 					pinctrl-0 = <&pinctrl_flx3_default>;
 					status = "disabled"; /* Conflict with isc. */
arch/arm/boot/dts/at91-sama5d2_icp.dts +1 -0
index 4a01ab8e7e70..559d8ae93af9 100644
@@ -167,6 +167,7 @@
 	status = "okay";
 
 	spi5: spi@400 {
+		dmas = <0>, <0>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_mikrobus1_spi &pinctrl_mikrobus1_spi_cs>;
 		status = "okay";
arch/arm/boot/dts/sama5d2.dtsi +9 -0
index 66aa8d6502d3..5a0162915ae7 100644
@@ -919,6 +919,15 @@
 					interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
 					clocks = <&pmc PMC_TYPE_PERIPHERAL 22>;
 					clock-names = "spi_clk";
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(17))>,
+					       <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(18))>;
+					dma-names = "tx", "rx";
 					atmel,fifo-size = <16>;
 					status = "disabled";
 				};
Signature · 1 line
2.23.0
#10 lore raw

PATCH 10/16 ARM: dts: at91: sama5d2: Add DMA bindings for the flx1 I2C function

In reply to [email protected]

From: Tudor Ambarus <[email protected]>

Spare boards of duplicating the DMA bindings. Describe the flx1 DMA bindings in the SoC dtsi. Users that don't want to use DMA for their flexcom functions have to overwrite the flexcom DMA bindings in their board device tree.

---
 arch/arm/boot/dts/at91-sama5d27_som1_ek.dts | 1 -
 arch/arm/boot/dts/sama5d2.dtsi              | 9 +++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)
arch/arm/boot/dts/at91-sama5d27_som1_ek.dts +0 -1
index 1aa8b79d618b..0e159f879c15 100644
@@ -127,7 +127,6 @@
 
 				i2c3: i2c@600 {
 					dmas = <0>, <0>;
-					dma-names = "tx", "rx";
 					i2c-analog-filter;
 					i2c-digital-filter;
 					i2c-digital-filter-width-ns = <35>;
arch/arm/boot/dts/sama5d2.dtsi +9 -0
index 5a0162915ae7..855846c74a32 100644
@@ -712,6 +712,15 @@
 					#address-cells = <1>;
 					#size-cells = <0>;
 					clocks = <&pmc PMC_TYPE_PERIPHERAL 20>;
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(13))>,
+					       <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(14))>;
+					dma-names = "tx", "rx";
 					atmel,fifo-size = <16>;
 					status = "disabled";
 				};
Signature · 1 line
2.23.0
#11 lore raw

PATCH 11/16 ARM: dts: at91: sama5d2: Add DMA bindings for the SPI and I2C flx0 functions

In reply to [email protected]

From: Tudor Ambarus <[email protected]>

Spare boards of duplicating the DMA bindings. Describe the flx0 DMA bindings in the SoC dtsi. Users that don't want to use DMA for their flexcom functions have to overwrite the flexcom DMA bindings in their board device tree.

---
 arch/arm/boot/dts/at91-sama5d2_icp.dts    |  1 +
 arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts |  1 -
 arch/arm/boot/dts/sama5d2.dtsi            | 18 ++++++++++++++++++
 3 files changed, 19 insertions(+), 1 deletion(-)
arch/arm/boot/dts/at91-sama5d2_icp.dts +1 -0
index 559d8ae93af9..8d19925fc09e 100644
@@ -105,6 +105,7 @@
 	status = "okay";
 
 	spi2: spi@400 {
+		dmas = <0>, <0>;
 		cs-gpios = <&pioA PIN_PC0 GPIO_ACTIVE_LOW>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_mikrobus2_spi &pinctrl_ksz_spi_cs>;
arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts +0 -1
index 8ad3a9c6c536..0e0341c83aa5 100644
@@ -192,7 +192,6 @@
 
 				i2c2: i2c@600 {
 					dmas = <0>, <0>;
-					dma-names = "tx", "rx";
 					pinctrl-names = "default", "gpio";
 					pinctrl-0 = <&pinctrl_flx0_default>;
 					pinctrl-1 = <&pinctrl_flx0_gpio>;
arch/arm/boot/dts/sama5d2.dtsi +18 -0
index 855846c74a32..5bba8024f485 100644
@@ -661,6 +661,15 @@
 					interrupts = <19 IRQ_TYPE_LEVEL_HIGH 7>;
 					clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
 					clock-names = "spi_clk";
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(11))>,
+					       <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(12))>;
+					dma-names = "tx", "rx";
 					atmel,fifo-size = <16>;
 					status = "disabled";
 				};
@@ -672,6 +681,15 @@
 					#address-cells = <1>;
 					#size-cells = <0>;
 					clocks = <&pmc PMC_TYPE_PERIPHERAL 19>;
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(11))>,
+					       <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(12))>;
+					dma-names = "tx", "rx";
 					atmel,fifo-size = <16>;
 					status = "disabled";
 				};
Signature · 1 line
2.23.0
#12 lore raw

PATCH 12/16 ARM: dts: at91: sama5d2: Add missing flexcom definitions

In reply to [email protected]

From: Tudor Ambarus <[email protected]>

Describe all the flexcom functions for all the flexcom nodes.

---
 arch/arm/boot/dts/sama5d2.dtsi | 79 ++++++++++++++++++++++++++++++++++
 1 file changed, 79 insertions(+)
arch/arm/boot/dts/sama5d2.dtsi +79 -0
index 5bba8024f485..b8cdeedee6bc 100644
@@ -723,6 +723,25 @@
 					status = "disabled";
 				};
 
+				spi3: spi@400 {
+					compatible = "atmel,at91rm9200-spi";
+					reg = <0x400 0x200>;
+					interrupts = <20 IRQ_TYPE_LEVEL_HIGH 7>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 20>;
+					clock-names = "spi_clk";
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(13))>,
+					       <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(14))>;
+					dma-names = "tx", "rx";
+					atmel,fifo-size = <16>;
+					status = "disabled";
+				};
+
 				i2c3: i2c@600 {
 					compatible = "atmel,sama5d2-i2c";
 					reg = <0x600 0x200>;
@@ -910,6 +929,45 @@
 					atmel,fifo-size = <32>;
 					status = "disabled";
 				};
+
+				spi4: spi@400 {
+					compatible = "atmel,at91rm9200-spi";
+					reg = <0x400 0x200>;
+					interrupts = <21 IRQ_TYPE_LEVEL_HIGH 7>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 21>;
+					clock-names = "spi_clk";
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(15))>,
+						<&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(16))>;
+					dma-names = "tx", "rx";
+					atmel,fifo-size = <16>;
+					status = "disabled";
+				};
+
+				i2c4: i2c@600 {
+					compatible = "atmel,sama5d2-i2c";
+					reg = <0x600 0x200>;
+					interrupts = <21 IRQ_TYPE_LEVEL_HIGH 7>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 21>;
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(15))>,
+						<&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(16))>;
+					dma-names = "tx", "rx";
+					atmel,fifo-size = <16>;
+					status = "disabled";
+				};
 			};
 
 			flx3: flexcom@fc014000 {
@@ -958,6 +1016,27 @@
 					atmel,fifo-size = <16>;
 					status = "disabled";
 				};
+
+				i2c5: i2c@600 {
+					compatible = "atmel,sama5d2-i2c";
+					reg = <0x600 0x200>;
+					interrupts = <22 IRQ_TYPE_LEVEL_HIGH 7>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 22>;
+					dmas = <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(17))>,
+					       <&dma0
+						(AT91_XDMAC_DT_MEM_IF(0) |
+						 AT91_XDMAC_DT_PER_IF(1) |
+						 AT91_XDMAC_DT_PERID(18))>;
+					dma-names = "tx", "rx";
+					atmel,fifo-size = <16>;
+					status = "disabled";
+				};
+
 			};
 
 			flx4: flexcom@fc018000 {
Signature · 1 line
2.23.0
#13 lore raw

PATCH 13/16 ARM: dts: at91: sama5d2: Remove i2s and tcb aliases from SoC dtsi

In reply to [email protected]

From: Tudor Ambarus <[email protected]>

Device aliases are board-specific, if needed one should define them in board dts rather than in the SoC dtsi. If an alias from the SoC dtsi is addressed by a driver that does not use any of the of_alias*() methods, we can drop it. This is the case for the i2s aliases, drop them. tcb aliases point to nodes that are not enabled in any of the sama5d2 based platforms. atmel_tclib.c is scheduled to go away, any board using that alias is already broken, so get rid of the tcb aliases too.

---
 arch/arm/boot/dts/sama5d2.dtsi | 4 ----
 1 file changed, 4 deletions(-)
arch/arm/boot/dts/sama5d2.dtsi +0 -4
index b8cdeedee6bc..c0a3ca8f9bf7 100644
@@ -21,10 +21,6 @@
 	aliases {
 		serial0 = &uart1;
 		serial1 = &uart3;
-		tcb0 = &tcb0;
-		tcb1 = &tcb1;
-		i2s0 = &i2s0;
-		i2s1 = &i2s1;
 	};
 
 	cpus {
Signature · 1 line
2.23.0
#14 lore raw

PATCH 14/16 ARM: dts: at91: sama5d2_xplained: Add alias for DBGU

In reply to [email protected]

From: Tudor Ambarus <[email protected]>

The aliases should be defined in the board dts rather than in the SoC dtsi. Don't rely on the aliases defined in the SoC dtsi and define the alias for the Serial DBGU in the board dts file. sama5d2 boards use the "serial0" alias for the Serial DBGU, do the same for sama5d2_xplained.

---
 arch/arm/boot/dts/at91-sama5d2_xplained.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/boot/dts/at91-sama5d2_xplained.dts +4 -0
index da4442715ea5..01ffbddd4ab8 100644
@@ -16,6 +16,10 @@
 	model = "Atmel SAMA5D2 Xplained";
 	compatible = "atmel,sama5d2-xplained", "atmel,sama5d2", "atmel,sama5";
 
+	aliases {
+		serial0 = &uart1;	/* DBGU */
+	};
+
 	chosen {
 		stdout-path = "serial0:115200n8";
 	};
Signature · 1 line
2.23.0
#15 lore raw

PATCH 15/16 ARM: dts: at91: sama5d2_xplained: Describe the flx0 I2C function

In reply to [email protected]

From: Tudor Ambarus <[email protected]>

Users can choose which flexcom function to use. Describe the I2C Flexcom0 function. Add alias for the i2c2 node in order to not rely on probe order for the i2c device numbering. The sama5d2 SoC has two dedicated i2c buses and five flexcoms that can function as i2c. The i2c0 and i2c1 aliases are kept for the dedicated i2c buses, the i2c flexcom functions can be numbered in order starting from i2c2.

---
 arch/arm/boot/dts/at91-sama5d2_xplained.dts | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
arch/arm/boot/dts/at91-sama5d2_xplained.dts +21 -0
index 01ffbddd4ab8..77e5d4f5a102 100644
@@ -18,6 +18,7 @@
 
 	aliases {
 		serial0 = &uart1;	/* DBGU */
+		i2c2 = &i2c2;		/* XPRO EXT2 */
 	};
 
 	chosen {
@@ -336,6 +337,20 @@
 					pinctrl-0 = <&pinctrl_flx0_default>;
 					status = "okay";
 				};
+
+				i2c2: i2c@600 {
+					dmas = <0>, <0>;
+					pinctrl-names = "default", "gpio";
+					pinctrl-0 = <&pinctrl_flx0_default>;
+					pinctrl-1 = <&pinctrl_i2c2_gpio>;
+					sda-gpios = <&pioA PIN_PB28 GPIO_ACTIVE_HIGH>;
+					scl-gpios = <&pioA PIN_PB29 GPIO_ACTIVE_HIGH>;
+					i2c-sda-hold-time-ns = <350>;
+					i2c-analog-filter;
+					i2c-digital-filter;
+					i2c-digital-filter-width-ns = <35>;
+					status = "disabled"; /* conflict with ISC_D2 & ISC_D3 data pins */
+				};
 			};
 
 			shdwc@f8048010 {
@@ -523,6 +538,12 @@
 					bias-disable;
 				};
 
+				pinctrl_i2c2_gpio: i2c2_gpio {
+					pinmux = <PIN_PB28__GPIO>,
+						 <PIN_PB29__GPIO>;
+					bias-disable;
+				};
+
 				pinctrl_i2s0_default: i2s0_default {
 					pinmux = <PIN_PC1__I2SC0_CK>,
 						 <PIN_PC2__I2SC0_MCK>,
Signature · 1 line
2.23.0
#16 lore raw

PATCH 16/16 ARM: dts: at91: sama5d2_ptc_ek: Add comments to describe the aliases

In reply to [email protected]

From: Tudor Ambarus <[email protected]>

Indicate which i2c alias is for which connector on the board. Specify that serial0 is for DBGU. This eases tester's life.

---
 arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts +3 -3
index 0e0341c83aa5..45c671a2bcf2 100644
@@ -18,9 +18,9 @@
 	compatible = "atmel,sama5d2-ptc_ek", "atmel,sama5d2", "atmel,sama5";
 
 	aliases {
-		serial0 = &uart0;
-		i2c0	= &i2c0;
-		i2c1	= &i2c1;
+		serial0 = &uart0;	/* DBGU */
+		i2c0	= &i2c0;	/* mikroBUS 1 */
+		i2c1	= &i2c1;	/* XPRO EXT1 */
 		i2c2	= &i2c2;
 	};
 
Signature · 1 line
2.23.0
maintainer Applied
#17 lore raw
In reply to [email protected]
Quoted 29 lines · On 14/05/2020 05:03:06+0000, [email protected] wrote:

From: Tudor Ambarus <[email protected]>

Rework the sama5d2 SoC flexcom definitions. The Flexcom IPs are in the SoC. Move all the flexcom nodes together with their function definitions in the SoC dtsi. Boards will just fill the pins and enable the desired functions. With this we remove the duplication of the flexcom definitions across the sama5d2 boards.

Round the flexcom support and add the missing flexcom definitions. All the flexcom functions are now defined.

Apart of the aliases and the new flx0 i2c function on sama5d2_xplained, the only functional change that this patch set adds, is that it uart5, uart6 and uart7 inherit the atmel,fifo-size = <32>; optional property. These nodes have both the FIFO size described and the DMA enabled. uart5 was tested on sama5d27-wlsom1-ek. On uart6 and uart7 a Bluetooth module can be connected. Tested BT uart7 on sama5d2-icp.

Tudor Ambarus (16):
ARM: dts: at91: sama5d2: Fix the label numbering for flexcom functions
ARM: dts: at91: sama5d2: Move flx4 definitions in the SoC dtsi
ARM: dts: at91: sama5d2: Move flx3 definitions in the SoC dtsi
ARM: dts: at91: sama5d2: Move flx2 definitions in the SoC dtsi
ARM: dts: at91: sama5d2: Move flx1 definitions in the SoC dtsi
ARM: dts: at91: sama5d2: Move flx0 definitions in the SoC dtsi
ARM: dts: at91: sama5d2: Specify the FIFO size for the Flexcom UART
ARM: dts: at91: sama5d2: Add DMA bindings for the SPI and UART flx4
functions
ARM: dts: at91: sama5d2: Add DMA bindings for the flx3 SPI function

Quoted 9 lines

ARM: dts: at91: sama5d2: Add DMA bindings for the flx1 I2C function
ARM: dts: at91: sama5d2: Add DMA bindings for the SPI and I2C flx0
functions
ARM: dts: at91: sama5d2: Add missing flexcom definitions
ARM: dts: at91: sama5d2: Remove i2s and tcb aliases from SoC dtsi
ARM: dts: at91: sama5d2_xplained: Add alias for DBGU
ARM: dts: at91: sama5d2_xplained: Describe the flx0 I2C function
ARM: dts: at91: sama5d2_ptc_ek: Add comments to describe the aliases

Applied, thanks.

Signature · 3 lines
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com