Skip to contentSkip to conversation

arm: dts: at91: sam9x60: Fix and improve flexcom 0 nodes

PATCH In review Alexander Dahl 2 participants 9 messages Nov 11, 2025

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

cover arm: dts: at91: sam9x60: Fix and improve flexcom 0 nodes

Hei hei,

have a custom board here with a SPI-NOR flash (ISSI IS25LP016D) connected to flx0. While the actual access through mtd, spi-mem, and the old atmel spi driver does not work yet, the dts changes are already ready for submission. One tiny step towards using upstream dts.

Greets
Alex

Alexander Dahl (3):
ARM: dts: at91: sam9x60: Fix flexcom/i2c node addresses
ARM: dts: at91: sam9x60: Define i2c0 node in dtsi
ARM: dts: at91: sam9x60: Add spi0 node (flexcom 0)

 arch/arm/dts/at91-sam9x60_curiosity.dts | 12 +++----
 arch/arm/dts/sam9x60.dtsi               | 21 +++++++++++-
 arch/arm/dts/sam9x60ek.dts              | 43 ++++++++++++-------------
 3 files changed, 46 insertions(+), 30 deletions(-)

base-commit: 365a7079fb918643da0f0709660a7d8ea76dd6f3

Signature · 1 line
2.39.5
#1 lore raw

PATCH 1/3 ARM: dts: at91: sam9x60: Fix flexcom/i2c node addresses

Tested on SAM9X60-Curiosity:

    U-Boot> i2c dev 0
    Setting bus to 0
    U-Boot> i2c md 0x53 0x00.1 0x100
    0000: fe ff ff ff ff ff ff ff ff ff ff 02 1e b3 12 eb    ................
    0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
    0020: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
    0030: 02 06 06 14 ff ff ff ff ff ff ff ff ff ff ff ff    ................
    0040: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
    0050: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
    0060: 20 4d 43 48 49 50 20 52 44 43 15 31 44 44 34 00     MCHIP RDC.1DD4.
    0070: 00 00 53 41 4d 39 58 36 30 43 55 52 20 34 00 00    ..SAM9X60CUR 4..
    0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
    0090: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
    00a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
    00b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
    00c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
    00d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
    00e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
    00f0: ff ff ff ff ff ff ff ff ff ff 04 91 62 f2 9c 5a    ............b..Z
    U-Boot> printenv ethaddr
    ethaddr=04:91:62:f2:9c:5a
---
 arch/arm/dts/at91-sam9x60_curiosity.dts | 7 +++++--
 arch/arm/dts/sam9x60.dtsi               | 2 +-
 arch/arm/dts/sam9x60ek.dts              | 9 ++++++---
 3 files changed, 12 insertions(+), 6 deletions(-)
arch/arm/dts/at91-sam9x60_curiosity.dts +5 -2
index f165fdadb9e..f12d774b97d 100644
@@ -15,9 +15,12 @@
 	model = "Microchip SAM9X60 Curiosity";
 	compatible = "microchip,sam9x60-curiosity", "microchip,sam9x60", "atmel,at91sam9";
 
+	aliases {
+		i2c0 = &i2c0;
+	};
+
 	chosen {
 		stdout-path = &dbgu;
-		i2c0 = &flx0;
 	};
 
 	memory {
@@ -156,7 +159,7 @@
 	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
 	status = "okay";
 
-	i2c@600 {
+	i2c0: i2c@600 {
 		compatible = "microchip,sam9x60-i2c";
 		reg = <0x600 0x200>;
 		pinctrl-names = "default";
arch/arm/dts/sam9x60.dtsi +1 -1
index 79449042c24..a0db3dd132d 100644
@@ -173,7 +173,7 @@
 				clock-names = "pclk", "gclk";
 			};
 
-			flx0: flexcom@f801c600 {
+			flx0: flexcom@f801c000 {
 				compatible = "atmel,sama5d2-flexcom";
 				reg = <0xf801c000 0x200>;
 				clocks = <&pmc PMC_TYPE_PERIPHERAL 5>;
arch/arm/dts/sam9x60ek.dts +6 -3
index 6521585ee9c..6e9dd4035de 100644
@@ -14,9 +14,12 @@
 	model = "Microchip SAM9X60-Ek";
 	compatible = "microchip,sam9x60ek", "microchip,sam9x60", "atmel,at91sam9";
 
+	aliases {
+		i2c0 = &i2c0;
+	};
+
 	chosen {
 		stdout-path = &dbgu;
-		i2c0 = &flx0;
 	};
 
 	clocks {
@@ -57,11 +60,11 @@
 				};
 			};
 
-			flx0: flexcom@f801c600 {
+			flx0: flexcom@f801c000 {
 				atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
 				status = "okay";
 
-				i2c@600 {
+				i2c0: i2c@600 {
 					compatible = "microchip,sam9x60-i2c";
 					reg = <0x600 0x200>;
 					pinctrl-names = "default";
Signature · 1 line
2.39.5
#2 lore raw

PATCH 2/3 ARM: dts: at91: sam9x60: Define i2c0 node in dtsi

In reply to Alexander Dahl

Same is done upstream in linux kernel. Allows to leave out common attributes in dts. Reduces diff to upstream dts.

---
 arch/arm/dts/at91-sam9x60_curiosity.dts |  5 ----
 arch/arm/dts/sam9x60.dtsi               |  9 ++++++
 arch/arm/dts/sam9x60ek.dts              | 38 +++++++++++--------------
 3 files changed, 26 insertions(+), 26 deletions(-)
arch/arm/dts/at91-sam9x60_curiosity.dts +0 -5
index f12d774b97d..4c4039cb5eb 100644
@@ -160,13 +160,8 @@
 	status = "okay";
 
 	i2c0: i2c@600 {
-		compatible = "microchip,sam9x60-i2c";
-		reg = <0x600 0x200>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&pinctrl_flx0>;
-		#address-cells = <1>;
-		#size-cells = <0>;
-		clocks = <&pmc PMC_TYPE_PERIPHERAL 5>;
 		status = "okay";
 
 		eeprom@53 {
arch/arm/dts/sam9x60.dtsi +9 -0
index a0db3dd132d..a33c0d57398 100644
@@ -181,6 +181,15 @@
 				#size-cells = <1>;
 				ranges = <0x0 0xf801c000 0x800>;
 				status = "disabled";
+
+				i2c0: i2c@600 {
+					compatible = "microchip,sam9x60-i2c";
+					reg = <0x600 0x200>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 5>;
+					status = "disabled";
+				};
 			};
 
 			macb0: ethernet@f802c000 {
arch/arm/dts/sam9x60ek.dts +17 -21
index 6e9dd4035de..8d52e91e7e2 100644
@@ -60,27 +60,6 @@
 				};
 			};
 
-			flx0: flexcom@f801c000 {
-				atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
-				status = "okay";
-
-				i2c0: i2c@600 {
-					compatible = "microchip,sam9x60-i2c";
-					reg = <0x600 0x200>;
-					pinctrl-names = "default";
-					pinctrl-0 = <&pinctrl_flx0>;
-					#address-cells = <1>;
-					#size-cells = <0>;
-					clocks = <&pmc PMC_TYPE_PERIPHERAL 5>;
-					status = "okay";
-
-					eeprom@53 {
-						compatible = "atmel,24c02"; /* EEPROM is 2Kbits microchip 24aa025e48, an at24c02 with page size of 16 */
-						reg = <0x53>;
-						pagesize = <16>;
-					};
-				};
-			};
 		};
 	};
 };
@@ -155,6 +134,23 @@
 	};
 };
 
+&flx0 {
+	atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>;
+	status = "okay";
+
+	i2c0: i2c@600 {
+		pinctrl-names = "default";
+		pinctrl-0 = <&pinctrl_flx0>;
+		status = "okay";
+
+		eeprom@53 {
+			compatible = "atmel,24c02"; /* EEPROM is 2Kbits microchip 24aa025e48, an at24c02 with page size of 16 */
+			reg = <0x53>;
+			pagesize = <16>;
+		};
+	};
+};
+
 &macb0 {
 	phy-mode = "rmii";
 	pinctrl-names = "default";
Signature · 1 line
2.39.5
#3 lore raw

PATCH 3/3 ARM: dts: at91: sam9x60: Add spi0 node (flexcom 0)

In reply to Alexander Dahl

Copied from linux kernel v6.18-rc4. Stripped attributes not supported by U-Boot drivers (dma, interrupt, fifo-size).

---
 arch/arm/dts/sam9x60.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/dts/sam9x60.dtsi +10 -0
index a33c0d57398..1ee30422518 100644
@@ -182,6 +182,16 @@
 				ranges = <0x0 0xf801c000 0x800>;
 				status = "disabled";
 
+				spi0: spi@400 {
+					compatible = "microchip,sam9x60-spi", "atmel,at91rm9200-spi";
+					reg = <0x400 0x200>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 5>;
+					clock-names = "spi_clk";
+					status = "disabled";
+				};
+
 				i2c0: i2c@600 {
 					compatible = "microchip,sam9x60-i2c";
 					reg = <0x600 0x200>;
Signature · 1 line
2.39.5
#4 lore raw

Re: [PATCH 3/3] ARM: dts: at91: sam9x60: Add spi0 node (flexcom 0)

Quoted 2 lines · Alexander Dahl

Copied from linux kernel v6.18-rc4. Stripped attributes not supported by U-Boot drivers (dma, interrupt, fifo-size).

Hello Alexander,

Have you tried to configure the build to use upstream DTS ? this should be available in the U-boot dir. CONFIG_OF_UPSTREAM I believe.

Also, if you really want to update this u-boot DT, you would have to copy it as-is, no stripping. Even if the props are unused. The only real issue would be if Uboot stops working or gets confused by these extra props

Eugen>

Quoted 26 lines
---
 arch/arm/dts/sam9x60.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/dts/sam9x60.dtsi +10 -0
index a33c0d57398..1ee30422518 100644
@@ -182,6 +182,16 @@
 				ranges = <0x0 0xf801c000 0x800>;
 				status = "disabled";
 
+				spi0: spi@400 {
+					compatible = "microchip,sam9x60-spi", "atmel,at91rm9200-spi";
+					reg = <0x400 0x200>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 5>;
+					clock-names = "spi_clk";
+					status = "disabled";
+				};
+
 				i2c0: i2c@600 {
 					compatible = "microchip,sam9x60-i2c";
 					reg = <0x600 0x200>;
#5 lore raw

Re: [PATCH 3/3] ARM: dts: at91: sam9x60: Add spi0 node (flexcom 0)

Hello Eugen,

Am Tue, Nov 11, 2025 at 01:34:35PM +0200 schrieb Eugen Hristev:

Quoted 10 lines · Alexander Dahl
Quoted 2 lines

Copied from linux kernel v6.18-rc4. Stripped attributes not supported by U-Boot drivers (dma, interrupt, fifo-size).

Hello Alexander,

Have you tried to configure the build to use upstream DTS ? this should be available in the U-boot dir. CONFIG_OF_UPSTREAM I believe.

Quick try with _just_ enabling CONFIG_OF_UPSTREAM and adding the obligatory folder to CONFIG_DEFAULT_DEVICE_TREE leads to the expected build errors:

DTC dts/upstream/src/arm/microchip/at91-sam9x60_curiosity.dtb
Error: …/u-boot/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi:43.1-7 Label or path clk32 not found
Error: …/u-boot/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi:51.1-9 Label or path main_rc not found
Error: …/u-boot/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi:67.1-16 Label or path pinctrl_sdhci0 not found
Error: …/u-boot/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi:79.1-9 Label or path pit64b0 not found
Error: …/u-boot/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi:87.1-8 Label or path sdhci0 not found
Error: …/u-boot/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi:91.1-13 Label or path slow_rc_osc not found FATAL ERROR: Syntax error parsing input tree

Not bad for the first shot, but I guess at least the clock related issues might get challenging. However I need to put this aside for later.

One question though, while we are at it: Would it be possible to define a custom dts in U-Boot and include an upstream .dtsi?

Greets
Alex

Quoted 33 lines

Also, if you really want to update this u-boot DT, you would have to copy it as-is, no stripping. Even if the props are unused. The only real issue would be if Uboot stops working or gets confused by these extra props

Eugen>

Quoted 26 lines
---
 arch/arm/dts/sam9x60.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/dts/sam9x60.dtsi +10 -0
index a33c0d57398..1ee30422518 100644
@@ -182,6 +182,16 @@
 				ranges = <0x0 0xf801c000 0x800>;
 				status = "disabled";
 
+				spi0: spi@400 {
+					compatible = "microchip,sam9x60-spi", "atmel,at91rm9200-spi";
+					reg = <0x400 0x200>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 5>;
+					clock-names = "spi_clk";
+					status = "disabled";
+				};
+
 				i2c0: i2c@600 {
 					compatible = "microchip,sam9x60-i2c";
 					reg = <0x600 0x200>;
Signature · 7 lines
Alexander Dahl           Thorsis Technologies GmbH   T +49 391 544 563 1000
Industrieautomation      Oststr. 18                  F +49 391 544 563 9099
T +49 391 544 563 3036   39114 Magdeburg             https://www.thorsis.com/

Sitz der Gesellschaft: Magdeburg
Amtsgericht Stendal HRB 30646
Geschäftsführer: Dipl.-Inf. Michael Huschke
#6 lore raw

Re: [PATCH 3/3] ARM: dts: at91: sam9x60: Add spi0 node (flexcom 0)

Quoted 27 lines · Alexander Dahl

Hello Eugen,

Am Tue, Nov 11, 2025 at 01:34:35PM +0200 schrieb Eugen Hristev:

Quoted 10 lines · Alexander Dahl
Quoted 2 lines

Copied from linux kernel v6.18-rc4. Stripped attributes not supported by U-Boot drivers (dma, interrupt, fifo-size).

Hello Alexander,

Have you tried to configure the build to use upstream DTS ? this should be available in the U-boot dir. CONFIG_OF_UPSTREAM I believe.

Quick try with _just_ enabling CONFIG_OF_UPSTREAM and adding the obligatory folder to CONFIG_DEFAULT_DEVICE_TREE leads to the expected build errors:

DTC dts/upstream/src/arm/microchip/at91-sam9x60_curiosity.dtb
Error: …/u-boot/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi:43.1-7 Label or path clk32 not found
Error: …/u-boot/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi:51.1-9 Label or path main_rc not found
Error: …/u-boot/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi:67.1-16 Label or path pinctrl_sdhci0 not found
Error: …/u-boot/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi:79.1-9 Label or path pit64b0 not found
Error: …/u-boot/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi:87.1-8 Label or path sdhci0 not found
Error: …/u-boot/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi:91.1-13 Label or path slow_rc_osc not found FATAL ERROR: Syntax error parsing input tree

Quoted 5 lines

Not bad for the first shot, but I guess at least the clock related issues might get challenging. However I need to put this aside for later.

One question though, while we are at it: Would it be possible to define a custom dts in U-Boot and include an upstream .dtsi?

There is a custom dts in U-boot, in your case sam9x60-u-boot.dtsi, and this should be automatically included by the build tool. This applies on top of the upstream dts if you select it, or, the in-tree DTS.
You want to do some combo of both or something ? I didn't fully understand it.

In the case of the above errors, it appears the *-u-boot.dtsi is at fault for referencing non-upstream nodes

Quoted 38 lines

Greets
Alex

Quoted 33 lines

Also, if you really want to update this u-boot DT, you would have to copy it as-is, no stripping. Even if the props are unused. The only real issue would be if Uboot stops working or gets confused by these extra props

Eugen>

Quoted 26 lines
---
 arch/arm/dts/sam9x60.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/dts/sam9x60.dtsi +10 -0
index a33c0d57398..1ee30422518 100644
@@ -182,6 +182,16 @@
 				ranges = <0x0 0xf801c000 0x800>;
 				status = "disabled";
 
+				spi0: spi@400 {
+					compatible = "microchip,sam9x60-spi", "atmel,at91rm9200-spi";
+					reg = <0x400 0x200>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 5>;
+					clock-names = "spi_clk";
+					status = "disabled";
+				};
+
 				i2c0: i2c@600 {
 					compatible = "microchip,sam9x60-i2c";
 					reg = <0x600 0x200>;
#7 lore raw

Re: [PATCH 3/3] ARM: dts: at91: sam9x60: Add spi0 node (flexcom 0)

Hello Eugen,

Am Tue, Nov 11, 2025 at 02:33:31PM +0200 schrieb Eugen Hristev:

Quoted 36 lines · Alexander Dahl
Quoted 27 lines

Hello Eugen,

Am Tue, Nov 11, 2025 at 01:34:35PM +0200 schrieb Eugen Hristev:

Quoted 10 lines · Alexander Dahl
Quoted 2 lines

Copied from linux kernel v6.18-rc4. Stripped attributes not supported by U-Boot drivers (dma, interrupt, fifo-size).

Hello Alexander,

Have you tried to configure the build to use upstream DTS ? this should be available in the U-boot dir. CONFIG_OF_UPSTREAM I believe.

Quick try with _just_ enabling CONFIG_OF_UPSTREAM and adding the obligatory folder to CONFIG_DEFAULT_DEVICE_TREE leads to the expected build errors:

DTC dts/upstream/src/arm/microchip/at91-sam9x60_curiosity.dtb
Error: …/u-boot/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi:43.1-7 Label or path clk32 not found
Error: …/u-boot/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi:51.1-9 Label or path main_rc not found
Error: …/u-boot/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi:67.1-16 Label or path pinctrl_sdhci0 not found
Error: …/u-boot/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi:79.1-9 Label or path pit64b0 not found
Error: …/u-boot/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi:87.1-8 Label or path sdhci0 not found
Error: …/u-boot/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi:91.1-13 Label or path slow_rc_osc not found FATAL ERROR: Syntax error parsing input tree

Quoted 5 lines

Not bad for the first shot, but I guess at least the clock related issues might get challenging. However I need to put this aside for later.

One question though, while we are at it: Would it be possible to define a custom dts in U-Boot and include an upstream .dtsi?

Quoted 6 lines

There is a custom dts in U-boot, in your case sam9x60-u-boot.dtsi, and this should be automatically included by the build tool. This applies on top of the upstream dts if you select it, or, the in-tree DTS.
You want to do some combo of both or something ? I didn't fully understand it.

Sorry, was not clear enough. For the sam9x60_curiosity case of course at91-sam9x60_curiosity.dts _and_ sam9x60.dtsi should come from UPSTREAM, with u-boot specific quirks coming from in-tree …-u-boot.dtsi files as usual, for both parts.

A custom board dts missing in upstream, would be added to (downstream) U-Boot in-tree, but it should pick up upstream sam9x60.dtsi, especially if U-Boot in-tree dtsi gets removed eventually. Wonder if that's possible? Alas, one could simply try, later. ;-)

Quoted 2 lines

In the case of the above errors, it appears the *-u-boot.dtsi is at fault for referencing non-upstream nodes

Probably.

Greets
Alex

Quoted 40 lines
Quoted 39 lines

Greets
Alex

Quoted 33 lines

Also, if you really want to update this u-boot DT, you would have to copy it as-is, no stripping. Even if the props are unused. The only real issue would be if Uboot stops working or gets confused by these extra props

Eugen>

Quoted 26 lines
---
 arch/arm/dts/sam9x60.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/dts/sam9x60.dtsi +10 -0
index a33c0d57398..1ee30422518 100644
@@ -182,6 +182,16 @@
 				ranges = <0x0 0xf801c000 0x800>;
 				status = "disabled";
 
+				spi0: spi@400 {
+					compatible = "microchip,sam9x60-spi", "atmel,at91rm9200-spi";
+					reg = <0x400 0x200>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 5>;
+					clock-names = "spi_clk";
+					status = "disabled";
+				};
+
 				i2c0: i2c@600 {
 					compatible = "microchip,sam9x60-i2c";
 					reg = <0x600 0x200>;
#8 lore raw

Re: [PATCH 3/3] ARM: dts: at91: sam9x60: Add spi0 node (flexcom 0)

Quoted 51 lines · Alexander Dahl

Hello Eugen,

Am Tue, Nov 11, 2025 at 02:33:31PM +0200 schrieb Eugen Hristev:

Quoted 36 lines · Alexander Dahl
Quoted 27 lines

Hello Eugen,

Am Tue, Nov 11, 2025 at 01:34:35PM +0200 schrieb Eugen Hristev:

Quoted 10 lines · Alexander Dahl
Quoted 2 lines

Copied from linux kernel v6.18-rc4. Stripped attributes not supported by U-Boot drivers (dma, interrupt, fifo-size).

Hello Alexander,

Have you tried to configure the build to use upstream DTS ? this should be available in the U-boot dir. CONFIG_OF_UPSTREAM I believe.

Quick try with _just_ enabling CONFIG_OF_UPSTREAM and adding the obligatory folder to CONFIG_DEFAULT_DEVICE_TREE leads to the expected build errors:

DTC dts/upstream/src/arm/microchip/at91-sam9x60_curiosity.dtb
Error: …/u-boot/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi:43.1-7 Label or path clk32 not found
Error: …/u-boot/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi:51.1-9 Label or path main_rc not found
Error: …/u-boot/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi:67.1-16 Label or path pinctrl_sdhci0 not found
Error: …/u-boot/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi:79.1-9 Label or path pit64b0 not found
Error: …/u-boot/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi:87.1-8 Label or path sdhci0 not found
Error: …/u-boot/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi:91.1-13 Label or path slow_rc_osc not found FATAL ERROR: Syntax error parsing input tree

Quoted 5 lines

Not bad for the first shot, but I guess at least the clock related issues might get challenging. However I need to put this aside for later.

One question though, while we are at it: Would it be possible to define a custom dts in U-Boot and include an upstream .dtsi?

Quoted 6 lines

There is a custom dts in U-boot, in your case sam9x60-u-boot.dtsi, and this should be automatically included by the build tool. This applies on top of the upstream dts if you select it, or, the in-tree DTS.
You want to do some combo of both or something ? I didn't fully understand it.

Sorry, was not clear enough. For the sam9x60_curiosity case of course at91-sam9x60_curiosity.dts _and_ sam9x60.dtsi should come from UPSTREAM, with u-boot specific quirks coming from in-tree …-u-boot.dtsi files as usual, for both parts.

Quoted 4 lines

A custom board dts missing in upstream, would be added to (downstream) U-Boot in-tree, but it should pick up upstream sam9x60.dtsi, especially if U-Boot in-tree dtsi gets removed eventually. Wonder if that's possible? Alas, one could simply try, later. ;-)

I suppose you could add some-new-board-u-boot.dts even if some-new-board.dts does not exist upstream, and then you can build some-new-board as you would normally do ?

Anyway , I added Sumit to the thread as he might know better the answer to that

Eugen

Quoted 51 lines
Quoted 3 lines

In the case of the above errors, it appears the *-u-boot.dtsi is at fault for referencing non-upstream nodes

Probably.

Greets
Alex

Quoted 40 lines
Quoted 39 lines

Greets
Alex

Quoted 33 lines

Also, if you really want to update this u-boot DT, you would have to copy it as-is, no stripping. Even if the props are unused. The only real issue would be if Uboot stops working or gets confused by these extra props

Eugen>

Quoted 26 lines
---
 arch/arm/dts/sam9x60.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)
arch/arm/dts/sam9x60.dtsi +10 -0
index a33c0d57398..1ee30422518 100644
@@ -182,6 +182,16 @@
 				ranges = <0x0 0xf801c000 0x800>;
 				status = "disabled";
 
+				spi0: spi@400 {
+					compatible = "microchip,sam9x60-spi", "atmel,at91rm9200-spi";
+					reg = <0x400 0x200>;
+					#address-cells = <1>;
+					#size-cells = <0>;
+					clocks = <&pmc PMC_TYPE_PERIPHERAL 5>;
+					clock-names = "spi_clk";
+					status = "disabled";
+				};
+
 				i2c0: i2c@600 {
 					compatible = "microchip,sam9x60-i2c";
 					reg = <0x600 0x200>;