linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/16] ARM: dts: at91: sama5d2: Rework Flexcom definitions
@ 2020-05-14  5:03 Tudor.Ambarus
  2020-05-14  5:03 ` [PATCH 01/16] ARM: dts: at91: sama5d2: Fix the label numbering for flexcom functions Tudor.Ambarus
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

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(-)

-- 
2.23.0

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH 02/16] ARM: dts: at91: sama5d2: Move flx4 definitions in the SoC dtsi
  2020-05-14  5:03 [PATCH 00/16] ARM: dts: at91: sama5d2: Rework Flexcom definitions Tudor.Ambarus
  2020-05-14  5:03 ` [PATCH 01/16] ARM: dts: at91: sama5d2: Fix the label numbering for flexcom functions Tudor.Ambarus
@ 2020-05-14  5:03 ` Tudor.Ambarus
  2020-05-14  5:03 ` [PATCH 03/16] ARM: dts: at91: sama5d2: Move flx3 " Tudor.Ambarus
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

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.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 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(-)

diff --git a/arch/arm/boot/dts/at91-kizbox3_common.dtsi b/arch/arm/boot/dts/at91-kizbox3_common.dtsi
index d7a6c972bdac..ee6f036aa008 100644
--- a/arch/arm/boot/dts/at91-kizbox3_common.dtsi
+++ b/arch/arm/boot/dts/at91-kizbox3_common.dtsi
@@ -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";
 	};
 };
diff --git a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
index d215243fe163..5f4a7c8725f3 100644
--- a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
+++ b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
@@ -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. */
 				};
 			};
diff --git a/arch/arm/boot/dts/at91-sama5d2_icp.dts b/arch/arm/boot/dts/at91-sama5d2_icp.dts
index 1d9556dbbd63..7216a794f4f6 100644
--- a/arch/arm/boot/dts/at91-sama5d2_icp.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_icp.dts
@@ -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 {
diff --git a/arch/arm/boot/dts/at91-sama5d2_xplained.dts b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
index 0666708b05f9..a5046f8257ad 100644
--- a/arch/arm/boot/dts/at91-sama5d2_xplained.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
@@ -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>;
diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
index ab550d69db91..5c31e4068eb5 100644
--- a/arch/arm/boot/dts/sama5d2.dtsi
+++ b/arch/arm/boot/dts/sama5d2.dtsi
@@ -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 {
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 01/16] ARM: dts: at91: sama5d2: Fix the label numbering for flexcom functions
  2020-05-14  5:03 [PATCH 00/16] ARM: dts: at91: sama5d2: Rework Flexcom definitions Tudor.Ambarus
@ 2020-05-14  5:03 ` Tudor.Ambarus
  2020-05-14  5:03 ` [PATCH 02/16] ARM: dts: at91: sama5d2: Move flx4 definitions in the SoC dtsi Tudor.Ambarus
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

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.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 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(-)

diff --git a/arch/arm/boot/dts/at91-kizbox3-hs.dts b/arch/arm/boot/dts/at91-kizbox3-hs.dts
index 8734e7f8939e..0da1f0557eaf 100644
--- a/arch/arm/boot/dts/at91-kizbox3-hs.dts
+++ b/arch/arm/boot/dts/at91-kizbox3-hs.dts
@@ -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";
 	};
 };
diff --git a/arch/arm/boot/dts/at91-kizbox3_common.dtsi b/arch/arm/boot/dts/at91-kizbox3_common.dtsi
index 299e74d23184..d7a6c972bdac 100644
--- a/arch/arm/boot/dts/at91-kizbox3_common.dtsi
+++ b/arch/arm/boot/dts/at91-kizbox3_common.dtsi
@@ -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>;
diff --git a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
index b0853bf7901c..d215243fe163 100644
--- a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
+++ b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
@@ -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. */
 				};
 			};
 
diff --git a/arch/arm/boot/dts/at91-sama5d2_icp.dts b/arch/arm/boot/dts/at91-sama5d2_icp.dts
index cc9fa700eafb..1d9556dbbd63 100644
--- a/arch/arm/boot/dts/at91-sama5d2_icp.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_icp.dts
@@ -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>;
diff --git a/arch/arm/boot/dts/at91-sama5d2_xplained.dts b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
index e0c6cff1a312..0666708b05f9 100644
--- a/arch/arm/boot/dts/at91-sama5d2_xplained.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
@@ -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>;
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 03/16] ARM: dts: at91: sama5d2: Move flx3 definitions in the SoC dtsi
  2020-05-14  5:03 [PATCH 00/16] ARM: dts: at91: sama5d2: Rework Flexcom definitions Tudor.Ambarus
  2020-05-14  5:03 ` [PATCH 01/16] ARM: dts: at91: sama5d2: Fix the label numbering for flexcom functions Tudor.Ambarus
  2020-05-14  5:03 ` [PATCH 02/16] ARM: dts: at91: sama5d2: Move flx4 definitions in the SoC dtsi Tudor.Ambarus
@ 2020-05-14  5:03 ` Tudor.Ambarus
  2020-05-14  5:03 ` [PATCH 04/16] ARM: dts: at91: sama5d2: Move flx2 " Tudor.Ambarus
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

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.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 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(-)

diff --git a/arch/arm/boot/dts/at91-kizbox3_common.dtsi b/arch/arm/boot/dts/at91-kizbox3_common.dtsi
index ee6f036aa008..4351a8d32225 100644
--- a/arch/arm/boot/dts/at91-kizbox3_common.dtsi
+++ b/arch/arm/boot/dts/at91-kizbox3_common.dtsi
@@ -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";
diff --git a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
index 5f4a7c8725f3..abbf14e29d85 100644
--- a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
+++ b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
@@ -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. */
 				};
 			};
diff --git a/arch/arm/boot/dts/at91-sama5d2_icp.dts b/arch/arm/boot/dts/at91-sama5d2_icp.dts
index 7216a794f4f6..8a4336e12a60 100644
--- a/arch/arm/boot/dts/at91-sama5d2_icp.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_icp.dts
@@ -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";
 	};
 };
diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
index 5c31e4068eb5..5e84cde8226a 100644
--- a/arch/arm/boot/dts/sama5d2.dtsi
+++ b/arch/arm/boot/dts/sama5d2.dtsi
@@ -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 {
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 04/16] ARM: dts: at91: sama5d2: Move flx2 definitions in the SoC dtsi
  2020-05-14  5:03 [PATCH 00/16] ARM: dts: at91: sama5d2: Rework Flexcom definitions Tudor.Ambarus
                   ` (2 preceding siblings ...)
  2020-05-14  5:03 ` [PATCH 03/16] ARM: dts: at91: sama5d2: Move flx3 " Tudor.Ambarus
@ 2020-05-14  5:03 ` Tudor.Ambarus
  2020-05-14  5:03 ` [PATCH 05/16] ARM: dts: at91: sama5d2: Move flx1 " Tudor.Ambarus
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

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.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 arch/arm/boot/dts/at91-sama5d2_icp.dts | 12 ------------
 arch/arm/boot/dts/sama5d2.dtsi         | 18 ++++++++++++++++++
 2 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/arch/arm/boot/dts/at91-sama5d2_icp.dts b/arch/arm/boot/dts/at91-sama5d2_icp.dts
index 8a4336e12a60..23f413afb333 100644
--- a/arch/arm/boot/dts/at91-sama5d2_icp.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_icp.dts
@@ -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;
diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
index 5e84cde8226a..89064225e9aa 100644
--- a/arch/arm/boot/dts/sama5d2.dtsi
+++ b/arch/arm/boot/dts/sama5d2.dtsi
@@ -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 {
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 05/16] ARM: dts: at91: sama5d2: Move flx1 definitions in the SoC dtsi
  2020-05-14  5:03 [PATCH 00/16] ARM: dts: at91: sama5d2: Rework Flexcom definitions Tudor.Ambarus
                   ` (3 preceding siblings ...)
  2020-05-14  5:03 ` [PATCH 04/16] ARM: dts: at91: sama5d2: Move flx2 " Tudor.Ambarus
@ 2020-05-14  5:03 ` Tudor.Ambarus
  2020-05-14  5:03 ` [PATCH 06/16] ARM: dts: at91: sama5d2: Move flx0 " Tudor.Ambarus
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

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.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 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(-)

diff --git a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
index abbf14e29d85..a0deff15fb9a 100644
--- a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
+++ b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
@@ -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";
 				};
 			};
diff --git a/arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi b/arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi
index bea3d60b9722..a06700e53e4c 100644
--- a/arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi
+++ b/arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi
@@ -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";
 	};
diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
index 89064225e9aa..79ed7bd02df6 100644
--- a/arch/arm/boot/dts/sama5d2.dtsi
+++ b/arch/arm/boot/dts/sama5d2.dtsi
@@ -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 {
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 06/16] ARM: dts: at91: sama5d2: Move flx0 definitions in the SoC dtsi
  2020-05-14  5:03 [PATCH 00/16] ARM: dts: at91: sama5d2: Rework Flexcom definitions Tudor.Ambarus
                   ` (4 preceding siblings ...)
  2020-05-14  5:03 ` [PATCH 05/16] ARM: dts: at91: sama5d2: Move flx1 " Tudor.Ambarus
@ 2020-05-14  5:03 ` Tudor.Ambarus
  2020-05-14  5:03 ` [PATCH 07/16] ARM: dts: at91: sama5d2: Specify the FIFO size for the Flexcom UART Tudor.Ambarus
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

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.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Tested-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
---
 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(-)

diff --git a/arch/arm/boot/dts/at91-kizbox3_common.dtsi b/arch/arm/boot/dts/at91-kizbox3_common.dtsi
index 4351a8d32225..7c3076e245ef 100644
--- a/arch/arm/boot/dts/at91-kizbox3_common.dtsi
+++ b/arch/arm/boot/dts/at91-kizbox3_common.dtsi
@@ -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";
diff --git a/arch/arm/boot/dts/at91-sama5d27_wlsom1_ek.dts b/arch/arm/boot/dts/at91-sama5d27_wlsom1_ek.dts
index 6b8461278950..6b38fa3f5568 100644
--- a/arch/arm/boot/dts/at91-sama5d27_wlsom1_ek.dts
+++ b/arch/arm/boot/dts/at91-sama5d27_wlsom1_ek.dts
@@ -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;
diff --git a/arch/arm/boot/dts/at91-sama5d2_icp.dts b/arch/arm/boot/dts/at91-sama5d2_icp.dts
index 23f413afb333..4a01ab8e7e70 100644
--- a/arch/arm/boot/dts/at91-sama5d2_icp.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_icp.dts
@@ -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>;
diff --git a/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
index 32435ce1dab2..8ad3a9c6c536 100644
--- a/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
@@ -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";
 				};
 			};
diff --git a/arch/arm/boot/dts/at91-sama5d2_xplained.dts b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
index a5046f8257ad..da4442715ea5 100644
--- a/arch/arm/boot/dts/at91-sama5d2_xplained.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
@@ -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";
 				};
 			};
diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
index 79ed7bd02df6..acb91908bd74 100644
--- a/arch/arm/boot/dts/sama5d2.dtsi
+++ b/arch/arm/boot/dts/sama5d2.dtsi
@@ -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 {
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 07/16] ARM: dts: at91: sama5d2: Specify the FIFO size for the Flexcom UART
  2020-05-14  5:03 [PATCH 00/16] ARM: dts: at91: sama5d2: Rework Flexcom definitions Tudor.Ambarus
                   ` (5 preceding siblings ...)
  2020-05-14  5:03 ` [PATCH 06/16] ARM: dts: at91: sama5d2: Move flx0 " Tudor.Ambarus
@ 2020-05-14  5:03 ` Tudor.Ambarus
  2020-05-14  5:03 ` [PATCH 09/16] ARM: dts: at91: sama5d2: Add DMA bindings for the flx3 SPI function Tudor.Ambarus
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

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

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 arch/arm/boot/dts/sama5d2.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
index acb91908bd74..dde969a140b4 100644
--- a/arch/arm/boot/dts/sama5d2.dtsi
+++ b/arch/arm/boot/dts/sama5d2.dtsi
@@ -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";
 				};
 			};
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 09/16] ARM: dts: at91: sama5d2: Add DMA bindings for the flx3 SPI function
  2020-05-14  5:03 [PATCH 00/16] ARM: dts: at91: sama5d2: Rework Flexcom definitions Tudor.Ambarus
                   ` (6 preceding siblings ...)
  2020-05-14  5:03 ` [PATCH 07/16] ARM: dts: at91: sama5d2: Specify the FIFO size for the Flexcom UART Tudor.Ambarus
@ 2020-05-14  5:03 ` Tudor.Ambarus
  2020-05-14  5:03 ` [PATCH 08/16] ARM: dts: at91: sama5d2: Add DMA bindings for the SPI and UART flx4 functions Tudor.Ambarus
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

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.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 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(+)

diff --git a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
index 6ad66d034305..1aa8b79d618b 100644
--- a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
+++ b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
@@ -179,6 +179,7 @@
 				};
 
 				spi5: spi@400 {
+					dmas = <0>, <0>;
 					pinctrl-names = "default";
 					pinctrl-0 = <&pinctrl_flx3_default>;
 					status = "disabled"; /* Conflict with isc. */
diff --git a/arch/arm/boot/dts/at91-sama5d2_icp.dts b/arch/arm/boot/dts/at91-sama5d2_icp.dts
index 4a01ab8e7e70..559d8ae93af9 100644
--- a/arch/arm/boot/dts/at91-sama5d2_icp.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_icp.dts
@@ -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";
diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
index 66aa8d6502d3..5a0162915ae7 100644
--- a/arch/arm/boot/dts/sama5d2.dtsi
+++ b/arch/arm/boot/dts/sama5d2.dtsi
@@ -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";
 				};
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 08/16] ARM: dts: at91: sama5d2: Add DMA bindings for the SPI and UART flx4 functions
  2020-05-14  5:03 [PATCH 00/16] ARM: dts: at91: sama5d2: Rework Flexcom definitions Tudor.Ambarus
                   ` (7 preceding siblings ...)
  2020-05-14  5:03 ` [PATCH 09/16] ARM: dts: at91: sama5d2: Add DMA bindings for the flx3 SPI function Tudor.Ambarus
@ 2020-05-14  5:03 ` Tudor.Ambarus
  2020-05-14  5:03 ` [PATCH 10/16] ARM: dts: at91: sama5d2: Add DMA bindings for the flx1 I2C function Tudor.Ambarus
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

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.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 arch/arm/boot/dts/at91-sama5d27_som1_ek.dts |  2 ++
 arch/arm/boot/dts/sama5d2.dtsi              | 18 ++++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
index a0deff15fb9a..6ad66d034305 100644
--- a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
+++ b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
@@ -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. */
diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
index dde969a140b4..66aa8d6502d3 100644
--- a/arch/arm/boot/dts/sama5d2.dtsi
+++ b/arch/arm/boot/dts/sama5d2.dtsi
@@ -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";
 				};
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 10/16] ARM: dts: at91: sama5d2: Add DMA bindings for the flx1 I2C function
  2020-05-14  5:03 [PATCH 00/16] ARM: dts: at91: sama5d2: Rework Flexcom definitions Tudor.Ambarus
                   ` (8 preceding siblings ...)
  2020-05-14  5:03 ` [PATCH 08/16] ARM: dts: at91: sama5d2: Add DMA bindings for the SPI and UART flx4 functions Tudor.Ambarus
@ 2020-05-14  5:03 ` Tudor.Ambarus
  2020-05-14  5:03 ` [PATCH 11/16] ARM: dts: at91: sama5d2: Add DMA bindings for the SPI and I2C flx0 functions Tudor.Ambarus
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

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.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 arch/arm/boot/dts/at91-sama5d27_som1_ek.dts | 1 -
 arch/arm/boot/dts/sama5d2.dtsi              | 9 +++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
index 1aa8b79d618b..0e159f879c15 100644
--- a/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
+++ b/arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
@@ -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>;
diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
index 5a0162915ae7..855846c74a32 100644
--- a/arch/arm/boot/dts/sama5d2.dtsi
+++ b/arch/arm/boot/dts/sama5d2.dtsi
@@ -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";
 				};
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 11/16] ARM: dts: at91: sama5d2: Add DMA bindings for the SPI and I2C flx0 functions
  2020-05-14  5:03 [PATCH 00/16] ARM: dts: at91: sama5d2: Rework Flexcom definitions Tudor.Ambarus
                   ` (9 preceding siblings ...)
  2020-05-14  5:03 ` [PATCH 10/16] ARM: dts: at91: sama5d2: Add DMA bindings for the flx1 I2C function Tudor.Ambarus
@ 2020-05-14  5:03 ` Tudor.Ambarus
  2020-05-14  5:03 ` [PATCH 13/16] ARM: dts: at91: sama5d2: Remove i2s and tcb aliases from SoC dtsi Tudor.Ambarus
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

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.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 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(-)

diff --git a/arch/arm/boot/dts/at91-sama5d2_icp.dts b/arch/arm/boot/dts/at91-sama5d2_icp.dts
index 559d8ae93af9..8d19925fc09e 100644
--- a/arch/arm/boot/dts/at91-sama5d2_icp.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_icp.dts
@@ -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>;
diff --git a/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
index 8ad3a9c6c536..0e0341c83aa5 100644
--- a/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
@@ -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>;
diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
index 855846c74a32..5bba8024f485 100644
--- a/arch/arm/boot/dts/sama5d2.dtsi
+++ b/arch/arm/boot/dts/sama5d2.dtsi
@@ -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";
 				};
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 12/16] ARM: dts: at91: sama5d2: Add missing flexcom definitions
  2020-05-14  5:03 [PATCH 00/16] ARM: dts: at91: sama5d2: Rework Flexcom definitions Tudor.Ambarus
                   ` (11 preceding siblings ...)
  2020-05-14  5:03 ` [PATCH 13/16] ARM: dts: at91: sama5d2: Remove i2s and tcb aliases from SoC dtsi Tudor.Ambarus
@ 2020-05-14  5:03 ` Tudor.Ambarus
  2020-05-14  5:03 ` [PATCH 14/16] ARM: dts: at91: sama5d2_xplained: Add alias for DBGU Tudor.Ambarus
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

Describe all the flexcom functions for all the flexcom nodes.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 arch/arm/boot/dts/sama5d2.dtsi | 79 ++++++++++++++++++++++++++++++++++
 1 file changed, 79 insertions(+)

diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
index 5bba8024f485..b8cdeedee6bc 100644
--- a/arch/arm/boot/dts/sama5d2.dtsi
+++ b/arch/arm/boot/dts/sama5d2.dtsi
@@ -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 {
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 13/16] ARM: dts: at91: sama5d2: Remove i2s and tcb aliases from SoC dtsi
  2020-05-14  5:03 [PATCH 00/16] ARM: dts: at91: sama5d2: Rework Flexcom definitions Tudor.Ambarus
                   ` (10 preceding siblings ...)
  2020-05-14  5:03 ` [PATCH 11/16] ARM: dts: at91: sama5d2: Add DMA bindings for the SPI and I2C flx0 functions Tudor.Ambarus
@ 2020-05-14  5:03 ` Tudor.Ambarus
  2020-05-14  5:03 ` [PATCH 12/16] ARM: dts: at91: sama5d2: Add missing flexcom definitions Tudor.Ambarus
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

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.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 arch/arm/boot/dts/sama5d2.dtsi | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
index b8cdeedee6bc..c0a3ca8f9bf7 100644
--- a/arch/arm/boot/dts/sama5d2.dtsi
+++ b/arch/arm/boot/dts/sama5d2.dtsi
@@ -21,10 +21,6 @@
 	aliases {
 		serial0 = &uart1;
 		serial1 = &uart3;
-		tcb0 = &tcb0;
-		tcb1 = &tcb1;
-		i2s0 = &i2s0;
-		i2s1 = &i2s1;
 	};
 
 	cpus {
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 14/16] ARM: dts: at91: sama5d2_xplained: Add alias for DBGU
  2020-05-14  5:03 [PATCH 00/16] ARM: dts: at91: sama5d2: Rework Flexcom definitions Tudor.Ambarus
                   ` (12 preceding siblings ...)
  2020-05-14  5:03 ` [PATCH 12/16] ARM: dts: at91: sama5d2: Add missing flexcom definitions Tudor.Ambarus
@ 2020-05-14  5:03 ` Tudor.Ambarus
  2020-05-14  5:03 ` [PATCH 16/16] ARM: dts: at91: sama5d2_ptc_ek: Add comments to describe the aliases Tudor.Ambarus
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 18+ messages in thread
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

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.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 arch/arm/boot/dts/at91-sama5d2_xplained.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/at91-sama5d2_xplained.dts b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
index da4442715ea5..01ffbddd4ab8 100644
--- a/arch/arm/boot/dts/at91-sama5d2_xplained.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
@@ -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";
 	};
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 15/16] ARM: dts: at91: sama5d2_xplained: Describe the flx0 I2C function
  2020-05-14  5:03 [PATCH 00/16] ARM: dts: at91: sama5d2: Rework Flexcom definitions Tudor.Ambarus
                   ` (14 preceding siblings ...)
  2020-05-14  5:03 ` [PATCH 16/16] ARM: dts: at91: sama5d2_ptc_ek: Add comments to describe the aliases Tudor.Ambarus
@ 2020-05-14  5:03 ` Tudor.Ambarus
  2020-05-15 14:51 ` [PATCH 00/16] ARM: dts: at91: sama5d2: Rework Flexcom definitions Alexandre Belloni
  16 siblings, 0 replies; 18+ messages in thread
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

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.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 arch/arm/boot/dts/at91-sama5d2_xplained.dts | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/arch/arm/boot/dts/at91-sama5d2_xplained.dts b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
index 01ffbddd4ab8..77e5d4f5a102 100644
--- a/arch/arm/boot/dts/at91-sama5d2_xplained.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_xplained.dts
@@ -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>,
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [PATCH 16/16] ARM: dts: at91: sama5d2_ptc_ek: Add comments to describe the aliases
  2020-05-14  5:03 [PATCH 00/16] ARM: dts: at91: sama5d2: Rework Flexcom definitions Tudor.Ambarus
                   ` (13 preceding siblings ...)
  2020-05-14  5:03 ` [PATCH 14/16] ARM: dts: at91: sama5d2_xplained: Add alias for DBGU Tudor.Ambarus
@ 2020-05-14  5:03 ` Tudor.Ambarus
  2020-05-14  5:03 ` [PATCH 15/16] ARM: dts: at91: sama5d2_xplained: Describe the flx0 I2C function Tudor.Ambarus
  2020-05-15 14:51 ` [PATCH 00/16] ARM: dts: at91: sama5d2: Rework Flexcom definitions Alexandre Belloni
  16 siblings, 0 replies; 18+ messages in thread
From: Tudor.Ambarus @ 2020-05-14  5:03 UTC (permalink / raw)
  To: alexandre.belloni, Ludovic.Desroches, Nicolas.Ferre
  Cc: robh+dt, devicetree, linux-arm-kernel, linux-kernel,
	Codrin.Ciubotariu, Tudor.Ambarus

From: Tudor Ambarus <tudor.ambarus@microchip.com>

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

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
index 0e0341c83aa5..45c671a2bcf2 100644
--- a/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
+++ b/arch/arm/boot/dts/at91-sama5d2_ptc_ek.dts
@@ -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;
 	};
 
-- 
2.23.0

^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH 00/16] ARM: dts: at91: sama5d2: Rework Flexcom definitions
  2020-05-14  5:03 [PATCH 00/16] ARM: dts: at91: sama5d2: Rework Flexcom definitions Tudor.Ambarus
                   ` (15 preceding siblings ...)
  2020-05-14  5:03 ` [PATCH 15/16] ARM: dts: at91: sama5d2_xplained: Describe the flx0 I2C function Tudor.Ambarus
@ 2020-05-15 14:51 ` Alexandre Belloni
  16 siblings, 0 replies; 18+ messages in thread
From: Alexandre Belloni @ 2020-05-15 14:51 UTC (permalink / raw)
  To: Tudor.Ambarus
  Cc: Ludovic.Desroches, Nicolas.Ferre, robh+dt, devicetree,
	linux-arm-kernel, linux-kernel, Codrin.Ciubotariu

On 14/05/2020 05:03:06+0000, Tudor.Ambarus@microchip.com wrote:
> From: Tudor Ambarus <tudor.ambarus@microchip.com>
> 
> 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
> 
Applied, thanks.

-- 
Alexandre Belloni, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2020-05-15 14:51 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-14  5:03 [PATCH 00/16] ARM: dts: at91: sama5d2: Rework Flexcom definitions Tudor.Ambarus
2020-05-14  5:03 ` [PATCH 01/16] ARM: dts: at91: sama5d2: Fix the label numbering for flexcom functions Tudor.Ambarus
2020-05-14  5:03 ` [PATCH 02/16] ARM: dts: at91: sama5d2: Move flx4 definitions in the SoC dtsi Tudor.Ambarus
2020-05-14  5:03 ` [PATCH 03/16] ARM: dts: at91: sama5d2: Move flx3 " Tudor.Ambarus
2020-05-14  5:03 ` [PATCH 04/16] ARM: dts: at91: sama5d2: Move flx2 " Tudor.Ambarus
2020-05-14  5:03 ` [PATCH 05/16] ARM: dts: at91: sama5d2: Move flx1 " Tudor.Ambarus
2020-05-14  5:03 ` [PATCH 06/16] ARM: dts: at91: sama5d2: Move flx0 " Tudor.Ambarus
2020-05-14  5:03 ` [PATCH 07/16] ARM: dts: at91: sama5d2: Specify the FIFO size for the Flexcom UART Tudor.Ambarus
2020-05-14  5:03 ` [PATCH 09/16] ARM: dts: at91: sama5d2: Add DMA bindings for the flx3 SPI function Tudor.Ambarus
2020-05-14  5:03 ` [PATCH 08/16] ARM: dts: at91: sama5d2: Add DMA bindings for the SPI and UART flx4 functions Tudor.Ambarus
2020-05-14  5:03 ` [PATCH 10/16] ARM: dts: at91: sama5d2: Add DMA bindings for the flx1 I2C function Tudor.Ambarus
2020-05-14  5:03 ` [PATCH 11/16] ARM: dts: at91: sama5d2: Add DMA bindings for the SPI and I2C flx0 functions Tudor.Ambarus
2020-05-14  5:03 ` [PATCH 13/16] ARM: dts: at91: sama5d2: Remove i2s and tcb aliases from SoC dtsi Tudor.Ambarus
2020-05-14  5:03 ` [PATCH 12/16] ARM: dts: at91: sama5d2: Add missing flexcom definitions Tudor.Ambarus
2020-05-14  5:03 ` [PATCH 14/16] ARM: dts: at91: sama5d2_xplained: Add alias for DBGU Tudor.Ambarus
2020-05-14  5:03 ` [PATCH 16/16] ARM: dts: at91: sama5d2_ptc_ek: Add comments to describe the aliases Tudor.Ambarus
2020-05-14  5:03 ` [PATCH 15/16] ARM: dts: at91: sama5d2_xplained: Describe the flx0 I2C function Tudor.Ambarus
2020-05-15 14:51 ` [PATCH 00/16] ARM: dts: at91: sama5d2: Rework Flexcom definitions Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).