[PATCH 0/5] ARM: dts: at91: Improve sam9x60-curiosity

Hello everyone,
currently I have the Microchip SAM9X60-Curiosity board on my desk and for evaluation purposes I'm trying to get it booting from NAND flash without SD card. This series contains a collection of patches I made on that journey. It's probably not the last set of patches, but I send it out now before my holidays so anyone who's interested has some time to look into it before I return to my desk in roughly two weeks. ;-)
Note: while I could access the I²C EEPROM populated on that board with Linux v6.4 through nvmem and the 100 bytes content seem valid including a MAC address attributed to Microchip, I could not do so in U-Boot. That also means out of the box access to Ethernet is currently broken without valid MAC address.
Note: I prepared the patches at the office, but sending them from home now. This is why I use two different mail addresses.
Greets Alex
Alexander Dahl (5): ARM: dts: at91: sam9x60: Better align with upstream dtsi ARM: dts: at91: sam9x60-curiosity: Fix EEPROM type ARM: dts: at91: sam9x60: Change i2c compatible ARM: dts: at91: sam9x60-curiosity: Improve alignment with upstream ARM: dts: at91: sam9x60-curiosity: Add raw NAND flash
.../dts/at91-sam9x60_curiosity-u-boot.dtsi | 8 +- arch/arm/dts/at91-sam9x60_curiosity.dts | 203 +++++++++++++----- arch/arm/dts/sam9x60.dtsi | 66 +++--- arch/arm/dts/sam9x60ek.dts | 2 +- 4 files changed, 190 insertions(+), 89 deletions(-)
base-commit: e1bebc16e1d9aa0ddd56c53c0b781f7186dce557

From: Alexander Dahl ada@thorsis.com
No functional changes, but this:
- reorder nodes (ordered by memory offset as in Linux) - add label to pinctrl node name for easier reference in board files - fix whitespace
Diff to sam9x60.dtsi in Linux is much better readable now.
Signed-off-by: Alexander Dahl ada@thorsis.com --- arch/arm/dts/sam9x60.dtsi | 66 +++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 33 deletions(-)
diff --git a/arch/arm/dts/sam9x60.dtsi b/arch/arm/dts/sam9x60.dtsi index 2b93d08938..3b684fc63d 100644 --- a/arch/arm/dts/sam9x60.dtsi +++ b/arch/arm/dts/sam9x60.dtsi @@ -27,6 +27,18 @@ spi0 = &qspi; };
+ cpus { + #address-cells = <1>; + #size-cells = <0>; + + ARM9260_0: cpu@0 { + device_type = "cpu"; + compatible = "arm,arm926ej-s"; + clocks = <&pmc PMC_TYPE_CORE 19>, <&pmc PMC_TYPE_CORE 11>, <&main_xtal>; + clock-names = "cpu", "master", "xtal"; + }; + }; + clocks { slow_rc_osc: slow_rc_osc { compatible = "fixed-clock"; @@ -51,18 +63,6 @@ }; };
- cpus { - #address-cells = <1>; - #size-cells = <0>; - - ARM9260_0: cpu@0 { - device_type = "cpu"; - compatible = "arm,arm926ej-s"; - clocks = <&pmc PMC_TYPE_CORE 19>, <&pmc PMC_TYPE_CORE 11>, <&main_xtal>; - clock-names = "cpu", "master", "xtal"; - }; - }; - ahb { compatible = "simple-bus"; #address-cells = <1>; @@ -149,13 +149,20 @@ compatible = "microchip,sam9x60-qspi"; reg = <0xf0014000 0x100>, <0x70000000 0x10000000>; reg-names = "qspi_base", "qspi_mmap"; - clocks = <&pmc PMC_TYPE_PERIPHERAL 35>, <&pmc PMC_TYPE_SYSTEM 18>; /* ID_QSPI */ + clocks = <&pmc PMC_TYPE_PERIPHERAL 35>, <&pmc PMC_TYPE_SYSTEM 18>; /* ID_QSPI */ clock-names = "pclk", "qspick"; #address-cells = <1>; #size-cells = <0>; status = "disabled"; };
+ pit64b0: timer@f0028000 { + compatible = "microchip,sam9x60-pit64b"; + reg = <0xf0028000 0xec>; + clocks = <&pmc PMC_TYPE_PERIPHERAL 37>, <&pmc PMC_TYPE_GCK 37>; + clock-names = "pclk", "gclk"; + }; + flx0: flexcom@f801c600 { compatible = "atmel,sama5d2-flexcom"; reg = <0xf801c000 0x200>; @@ -181,6 +188,17 @@ reg = <0xf8050000 0x100>; };
+ pmecc: ecc-engine@ffffe000 { + compatible = "microchip,sam9x60-pmecc", "atmel,at91sam9g45-pmecc"; + reg = <0xffffe000 0x300>, + <0xffffe600 0x100>; + }; + + smc: smc@ffffea00 { + compatible = "microchip,sam9x60-smc", "atmel,at91sam9260-smc", "syscon"; + reg = <0xffffea00 0x100>; + }; + dbgu: serial@fffff200 { compatible = "atmel,at91sam9260-dbgu", "atmel,at91sam9260-usart"; reg = <0xfffff200 0x200>; @@ -190,7 +208,7 @@ clock-names = "usart"; };
- pinctrl { + pinctrl: pinctrl@fffff400 { #address-cells = <1>; #size-cells = <1>; compatible = "microchip,sam9x60-pinctrl", "simple-bus"; @@ -205,7 +223,7 @@ pinctrl_dbgu: dbgu-0 { atmel,pins = <AT91_PIOA 9 AT91_PERIPH_A AT91_PINCTRL_PULL_UP - AT91_PIOA 10 AT91_PERIPH_A AT91_PINCTRL_NONE>; + AT91_PIOA 10 AT91_PERIPH_A AT91_PINCTRL_NONE>; }; };
@@ -256,17 +274,6 @@ }; };
- pmecc: ecc-engine@ffffe000 { - compatible = "microchip,sam9x60-pmecc", "atmel,at91sam9g45-pmecc"; - reg = <0xffffe000 0x300>, - <0xffffe600 0x100>; - }; - - smc: smc@ffffea00 { - compatible = "microchip,sam9x60-smc", "atmel,at91sam9260-smc", "syscon"; - reg = <0xffffea00 0x100>; - }; - pioA: gpio@fffff400 { compatible = "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio"; reg = <0xfffff400 0x200>; @@ -320,13 +327,6 @@ clocks = <&pmc PMC_TYPE_CORE 11>; /* ID_MCK. */ };
- pit64b0: timer@f0028000 { - compatible = "microchip,sam9x60-pit64b"; - reg = <0xf0028000 0xec>; - clocks = <&pmc PMC_TYPE_PERIPHERAL 37>, <&pmc PMC_TYPE_GCK 37>; - clock-names = "pclk", "gclk"; - }; - clk32: sckc@fffffe50 { compatible = "microchip,sam9x60-sckc"; reg = <0xfffffe50 0x4>;

From: Alexander Dahl ada@thorsis.com
The user guide says it's a Microchip 24AA025E48 serial EEPROM, which is a 2-Kbit I2C Serial EEPROM with EUI-48™ Identity. This is the chip actually populated on board EV40E67A rev 4.
Signed-off-by: Alexander Dahl ada@thorsis.com ---
Notes: Sadly this did not fix the problem, that I could not access that eeprom through I²C.
arch/arm/dts/at91-sam9x60_curiosity.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/dts/at91-sam9x60_curiosity.dts b/arch/arm/dts/at91-sam9x60_curiosity.dts index d6ae3d648d..da5e19b66b 100644 --- a/arch/arm/dts/at91-sam9x60_curiosity.dts +++ b/arch/arm/dts/at91-sam9x60_curiosity.dts @@ -31,7 +31,7 @@ status = "okay";
eeprom@53 { - compatible = "atmel,24c32"; + compatible = "atmel,24c02"; reg = <0x53>; pagesize = <16>; };

On 7/5/23 23:16, Alexander Dahl wrote:
From: Alexander Dahl ada@thorsis.com
The user guide says it's a Microchip 24AA025E48 serial EEPROM, which is a 2-Kbit I2C Serial EEPROM with EUI-48™ Identity. This is the chip actually populated on board EV40E67A rev 4.
Signed-off-by: Alexander Dahl ada@thorsis.com
Notes: Sadly this did not fix the problem, that I could not access that eeprom through I²C.
arch/arm/dts/at91-sam9x60_curiosity.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/dts/at91-sam9x60_curiosity.dts b/arch/arm/dts/at91-sam9x60_curiosity.dts index d6ae3d648d..da5e19b66b 100644 --- a/arch/arm/dts/at91-sam9x60_curiosity.dts +++ b/arch/arm/dts/at91-sam9x60_curiosity.dts @@ -31,7 +31,7 @@ status = "okay";
eeprom@53 {
compatible = "atmel,24c32";
compatible = "atmel,24c02"; reg = <0x53>; pagesize = <16>; };
Hello Alexander,
Thank you for the patch.
I remember I tested this a while back and I remember that the 24c32 compatible is not correct for this eeprom.
I have this commit that fixed it for sam9x60ek board:
commit 5ae89b3cfe842ecbb5153a95e2e3ac404abe543c Author: Eugen Hristev eugen.hristev@collabora.com Date: Thu May 26 17:04:56 2022 +0300
ARM: dts: at91: sam9x60ek: fix eeprom compatible
24c32 should be 32K and 24c02 is 2K .
I remember that with 24c32 it works, but when you read , the offset changes, and then you read the same data multiple times, as if the 2K is multiplied to have the 32K the driver thinks it has.
Do you have any reasoning for wanting to change the compatible to 24c32 ? I am trying to understand how you found that 24c32 is better.
Eugen

On 7/6/23 11:06, Eugen Hristev wrote:
On 7/5/23 23:16, Alexander Dahl wrote:
From: Alexander Dahl ada@thorsis.com
The user guide says it's a Microchip 24AA025E48 serial EEPROM, which is a 2-Kbit I2C Serial EEPROM with EUI-48™ Identity. This is the chip actually populated on board EV40E67A rev 4.
Signed-off-by: Alexander Dahl ada@thorsis.com
Notes: Sadly this did not fix the problem, that I could not access that eeprom through I²C.
arch/arm/dts/at91-sam9x60_curiosity.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/dts/at91-sam9x60_curiosity.dts b/arch/arm/dts/at91-sam9x60_curiosity.dts index d6ae3d648d..da5e19b66b 100644 --- a/arch/arm/dts/at91-sam9x60_curiosity.dts +++ b/arch/arm/dts/at91-sam9x60_curiosity.dts @@ -31,7 +31,7 @@ status = "okay"; eeprom@53 { - compatible = "atmel,24c32"; + compatible = "atmel,24c02"; reg = <0x53>; pagesize = <16>; };
Hello Alexander,
Thank you for the patch.
I remember I tested this a while back and I remember that the 24c32 compatible is not correct for this eeprom.
I have this commit that fixed it for sam9x60ek board:
commit 5ae89b3cfe842ecbb5153a95e2e3ac404abe543c Author: Eugen Hristev eugen.hristev@collabora.com Date: Thu May 26 17:04:56 2022 +0300
ARM: dts: at91: sam9x60ek: fix eeprom compatible
24c32 should be 32K and 24c02 is 2K .
I remember that with 24c32 it works, but when you read , the offset changes, and then you read the same data multiple times, as if the 2K is multiplied to have the 32K the driver thinks it has.
Do you have any reasoning for wanting to change the compatible to 24c32 ? I am trying to understand how you found that 24c32 is better.
Eugen
I am sorry, I misread your patch. You are doing the exact opposite, which appears to be correct ! Ignore the noise.

Hi Alexander,
I hope these changes are already present in upstream branch linux-6.4.y
On 06/07/23 01:46, Alexander Dahl wrote:
[Some people who received this message don't often get email from post@lespocky.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
From: Alexander Dahl ada@thorsis.com
The user guide says it's a Microchip 24AA025E48 serial EEPROM, which is a 2-Kbit I2C Serial EEPROM with EUI-48™ Identity. This is the chip actually populated on board EV40E67A rev 4.
Signed-off-by: Alexander Dahl ada@thorsis.com
Notes: Sadly this did not fix the problem, that I could not access that eeprom through I²C.
arch/arm/dts/at91-sam9x60_curiosity.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/dts/at91-sam9x60_curiosity.dts b/arch/arm/dts/at91-sam9x60_curiosity.dts index d6ae3d648d..da5e19b66b 100644 --- a/arch/arm/dts/at91-sam9x60_curiosity.dts +++ b/arch/arm/dts/at91-sam9x60_curiosity.dts @@ -31,7 +31,7 @@ status = "okay";
eeprom@53 {
compatible = "atmel,24c32";
compatible = "atmel,24c02"; reg = <0x53>; pagesize = <16>; };
-- 2.30.2

Sorry! misunderstood as kernel. Ignore this comment.
On 06/07/23 14:00, Durai Manickam KR wrote:
Hi Alexander,
I hope these changes are already present in upstream branch linux-6.4.y
On 06/07/23 01:46, Alexander Dahl wrote:
[Some people who received this message don't often get email from post@lespocky.de. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
From: Alexander Dahl ada@thorsis.com
The user guide says it's a Microchip 24AA025E48 serial EEPROM, which is a 2-Kbit I2C Serial EEPROM with EUI-48™ Identity. This is the chip actually populated on board EV40E67A rev 4.
Signed-off-by: Alexander Dahl ada@thorsis.com
Notes: Sadly this did not fix the problem, that I could not access that eeprom through I²C.
arch/arm/dts/at91-sam9x60_curiosity.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/dts/at91-sam9x60_curiosity.dts b/arch/arm/dts/at91-sam9x60_curiosity.dts index d6ae3d648d..da5e19b66b 100644 --- a/arch/arm/dts/at91-sam9x60_curiosity.dts +++ b/arch/arm/dts/at91-sam9x60_curiosity.dts @@ -31,7 +31,7 @@ status = "okay";
eeprom@53 { - compatible = "atmel,24c32"; + compatible = "atmel,24c02"; reg = <0x53>; pagesize = <16>; }; -- 2.30.2

From: Alexander Dahl ada@thorsis.com
There's a more specific compatible string for the i2c interface, use it.
Signed-off-by: Alexander Dahl ada@thorsis.com ---
Notes: I²C access to the eeprom did not work though, neither before nor after this change.
arch/arm/dts/at91-sam9x60_curiosity.dts | 2 +- arch/arm/dts/sam9x60ek.dts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/at91-sam9x60_curiosity.dts b/arch/arm/dts/at91-sam9x60_curiosity.dts index da5e19b66b..ae707dd64b 100644 --- a/arch/arm/dts/at91-sam9x60_curiosity.dts +++ b/arch/arm/dts/at91-sam9x60_curiosity.dts @@ -21,7 +21,7 @@ status = "okay";
i2c@600 { - compatible = "atmel,sama5d2-i2c"; + compatible = "microchip,sam9x60-i2c"; reg = <0x600 0x200>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_flx0>; diff --git a/arch/arm/dts/sam9x60ek.dts b/arch/arm/dts/sam9x60ek.dts index 45e2f4cc40..74016f5e28 100644 --- a/arch/arm/dts/sam9x60ek.dts +++ b/arch/arm/dts/sam9x60ek.dts @@ -62,7 +62,7 @@ status = "okay";
i2c@600 { - compatible = "atmel,sama5d2-i2c"; + compatible = "microchip,sam9x60-i2c"; reg = <0x600 0x200>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_flx0>;

Hi Alexander,
sam9x60_curiosity and sam9x60ek belongs to same SOC family. So the compatible string is updated as "microchip,sam9x60-i2c" in the sam9x60.dtsi file. These changes are available in linux-6.4.y branch.
On 06/07/23 01:46, Alexander Dahl wrote:
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
From: Alexander Dahl ada@thorsis.com
There's a more specific compatible string for the i2c interface, use it.
Signed-off-by: Alexander Dahl ada@thorsis.com
Notes: I²C access to the eeprom did not work though, neither before nor after this change.
arch/arm/dts/at91-sam9x60_curiosity.dts | 2 +- arch/arm/dts/sam9x60ek.dts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/at91-sam9x60_curiosity.dts b/arch/arm/dts/at91-sam9x60_curiosity.dts index da5e19b66b..ae707dd64b 100644 --- a/arch/arm/dts/at91-sam9x60_curiosity.dts +++ b/arch/arm/dts/at91-sam9x60_curiosity.dts @@ -21,7 +21,7 @@ status = "okay";
i2c@600 {
compatible = "atmel,sama5d2-i2c";
compatible = "microchip,sam9x60-i2c"; reg = <0x600 0x200>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_flx0>;
diff --git a/arch/arm/dts/sam9x60ek.dts b/arch/arm/dts/sam9x60ek.dts index 45e2f4cc40..74016f5e28 100644 --- a/arch/arm/dts/sam9x60ek.dts +++ b/arch/arm/dts/sam9x60ek.dts @@ -62,7 +62,7 @@ status = "okay";
i2c@600 {
compatible = "atmel,sama5d2-i2c";
compatible = "microchip,sam9x60-i2c"; reg = <0x600 0x200>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_flx0>;
-- 2.30.2

Hello,
Am Thu, Jul 06, 2023 at 08:32:41AM +0000 schrieb Durai.ManickamKR@microchip.com:
Hi Alexander,
sam9x60_curiosity and sam9x60ek belongs to same SOC family. So the compatible string is updated as "microchip,sam9x60-i2c" in the sam9x60.dtsi file. These changes are available in linux-6.4.y branch.
Maybe I was not clear enough. We are talking about U-Boot here. The whole patch series is for U-Boot and based on U-Boot v2023.07-rc6. I'm on Linux v6.4 already and things work in Linux. The problem I have is with EEPROM access in U-Boot.
Greets Alex
On 06/07/23 01:46, Alexander Dahl wrote:
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
From: Alexander Dahl ada@thorsis.com
There's a more specific compatible string for the i2c interface, use it.
Signed-off-by: Alexander Dahl ada@thorsis.com
Notes: I²C access to the eeprom did not work though, neither before nor after this change.
arch/arm/dts/at91-sam9x60_curiosity.dts | 2 +- arch/arm/dts/sam9x60ek.dts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/at91-sam9x60_curiosity.dts b/arch/arm/dts/at91-sam9x60_curiosity.dts index da5e19b66b..ae707dd64b 100644 --- a/arch/arm/dts/at91-sam9x60_curiosity.dts +++ b/arch/arm/dts/at91-sam9x60_curiosity.dts @@ -21,7 +21,7 @@ status = "okay";
i2c@600 {
compatible = "atmel,sama5d2-i2c";
compatible = "microchip,sam9x60-i2c"; reg = <0x600 0x200>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_flx0>;
diff --git a/arch/arm/dts/sam9x60ek.dts b/arch/arm/dts/sam9x60ek.dts index 45e2f4cc40..74016f5e28 100644 --- a/arch/arm/dts/sam9x60ek.dts +++ b/arch/arm/dts/sam9x60ek.dts @@ -62,7 +62,7 @@ status = "okay";
i2c@600 {
compatible = "atmel,sama5d2-i2c";
compatible = "microchip,sam9x60-i2c"; reg = <0x600 0x200>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_flx0>;
-- 2.30.2

Sorry! misunderstood as kernel. Ignore this comment.
On 06/07/23 14:02, Durai Manickam KR wrote:
Hi Alexander,
sam9x60_curiosity and sam9x60ek belongs to same SOC family. So the compatible string is updated as "microchip,sam9x60-i2c" in the sam9x60.dtsi file. These changes are available in linux-6.4.y branch.
On 06/07/23 01:46, Alexander Dahl wrote:
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
From: Alexander Dahl ada@thorsis.com
There's a more specific compatible string for the i2c interface, use it.
Signed-off-by: Alexander Dahl ada@thorsis.com
Notes: I²C access to the eeprom did not work though, neither before nor after this change.
arch/arm/dts/at91-sam9x60_curiosity.dts | 2 +- arch/arm/dts/sam9x60ek.dts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/at91-sam9x60_curiosity.dts b/arch/arm/dts/at91-sam9x60_curiosity.dts index da5e19b66b..ae707dd64b 100644 --- a/arch/arm/dts/at91-sam9x60_curiosity.dts +++ b/arch/arm/dts/at91-sam9x60_curiosity.dts @@ -21,7 +21,7 @@ status = "okay";
i2c@600 { - compatible = "atmel,sama5d2-i2c"; + compatible = "microchip,sam9x60-i2c"; reg = <0x600 0x200>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_flx0>; diff --git a/arch/arm/dts/sam9x60ek.dts b/arch/arm/dts/sam9x60ek.dts index 45e2f4cc40..74016f5e28 100644 --- a/arch/arm/dts/sam9x60ek.dts +++ b/arch/arm/dts/sam9x60ek.dts @@ -62,7 +62,7 @@ status = "okay";
i2c@600 { - compatible = "atmel,sama5d2-i2c"; + compatible = "microchip,sam9x60-i2c"; reg = <0x600 0x200>; pinctrl-names = "default"; pinctrl-0 = <&pinctrl_flx0>; -- 2.30.2

From: Alexander Dahl ada@thorsis.com
- nodes moved - using node references by label instead of dulicating the node tree
Makes it easier to compare with the dts file from Linux kernel.
Signed-off-by: Alexander Dahl ada@thorsis.com --- .../dts/at91-sam9x60_curiosity-u-boot.dtsi | 8 +- arch/arm/dts/at91-sam9x60_curiosity.dts | 100 +++++++++--------- 2 files changed, 53 insertions(+), 55 deletions(-)
diff --git a/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi b/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi index 0c3c0406b4..a1b76e94d1 100644 --- a/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi +++ b/arch/arm/dts/at91-sam9x60_curiosity-u-boot.dtsi @@ -14,10 +14,6 @@
apb { bootph-all; - - pinctrl { - bootph-all; - }; }; };
@@ -42,6 +38,10 @@ bootph-all; };
+&pinctrl { + bootph-all; +}; + &pinctrl_dbgu { bootph-all; }; diff --git a/arch/arm/dts/at91-sam9x60_curiosity.dts b/arch/arm/dts/at91-sam9x60_curiosity.dts index ae707dd64b..fb59405b24 100644 --- a/arch/arm/dts/at91-sam9x60_curiosity.dts +++ b/arch/arm/dts/at91-sam9x60_curiosity.dts @@ -11,60 +11,18 @@ #include "sam9x60.dtsi"
/ { - model = "Microchip SAM9X60 CURIOSITY"; + model = "Microchip SAM9X60 Curiosity"; compatible = "microchip,sam9x60-curiosity", "microchip,sam9x60", "atmel,at91sam9";
- ahb { - apb { - flx0: flexcom@f801c600 { - atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>; - status = "okay"; - - 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"; - reg = <0x53>; - pagesize = <16>; - }; - }; - }; - - pinctrl { - pinctrl_flx0: flx0_default { - atmel,pins = - <AT91_PIOA 0 AT91_PERIPH_A AT91_PINCTRL_NONE - AT91_PIOA 1 AT91_PERIPH_A AT91_PINCTRL_NONE>; - }; - - pinctrl_onewire_tm_default: onewire_tm_default { - atmel,pins = - <AT91_PIOD 14 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP>; - }; - - usb1 { - pinctrl_usb_default: usb_default { - atmel,pins = <AT91_PIOD 15 AT91_PERIPH_GPIO AT91_PINCTRL_NONE - AT91_PIOD 18 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; - }; - }; - }; - }; - }; - chosen { stdout-path = &dbgu; i2c0 = &flx0; };
+ memory { + reg = <0x20000000 0x8000000>; + }; + clocks { slow_xtal: slow_xtal { clock-frequency = <32768>; @@ -75,10 +33,6 @@ }; };
- memory { - reg = <0x20000000 0x8000000>; - }; - onewire_tm: onewire { gpios = <&pioD 14 GPIO_ACTIVE_HIGH>; pinctrl-names = "default"; @@ -92,11 +46,55 @@ }; };
+&flx0 { + atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>; + status = "okay"; + + 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"; + reg = <0x53>; + pagesize = <16>; + }; + }; +}; + &macb0 { phy-mode = "rmii"; status = "okay"; };
+&pinctrl { + flexcom { + pinctrl_flx0: flx0_default { + atmel,pins = + <AT91_PIOA 0 AT91_PERIPH_A AT91_PINCTRL_NONE + AT91_PIOA 1 AT91_PERIPH_A AT91_PINCTRL_NONE>; + }; + }; + + pinctrl_onewire_tm_default: onewire_tm_default { + atmel,pins = + <AT91_PIOD 14 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP>; + }; + + usb1 { + pinctrl_usb_default: usb_default { + atmel,pins = <AT91_PIOD 15 AT91_PERIPH_GPIO AT91_PINCTRL_NONE + AT91_PIOD 18 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; + }; + }; +}; + &usb1 { num-ports = <3>; atmel,vbus-gpio = <0

From: Alexander Dahl ada@thorsis.com
Basically the same as on sam9x60-ek. Same as in Linux. NAND flash is correctly detected when booting into U-Boot:
U-Boot 2023.07-rc6-00005-g12719f75dc-dirty (Jul 05 2023 - 13:06:35 +0000)
CPU: SAM9X60 128MiB DDR2 SiP Crystal frequency: 24 MHz CPU clock : 600 MHz Master clock : 200 MHz
Model: Microchip SAM9X60 Curiosity DRAM: 128 MiB Core: 145 devices, 22 uclasses, devicetree: separate NAND: 512 MiB MMC: sdhci-host@80000000: 0, sdhci-host@90000000: 1 Loading Environment from FAT... Unable to read "uboot.env" from mmc0:1... In: serial Out: serial Err: serial Net: eth0: ethernet@f802c000 Hit any key to stop autoboot: 0
Signed-off-by: Alexander Dahl ada@thorsis.com --- arch/arm/dts/at91-sam9x60_curiosity.dts | 103 ++++++++++++++++++++++++ 1 file changed, 103 insertions(+)
diff --git a/arch/arm/dts/at91-sam9x60_curiosity.dts b/arch/arm/dts/at91-sam9x60_curiosity.dts index fb59405b24..2547b4527c 100644 --- a/arch/arm/dts/at91-sam9x60_curiosity.dts +++ b/arch/arm/dts/at91-sam9x60_curiosity.dts @@ -46,6 +46,71 @@ }; };
+&ebi { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_ebi_addr_nand &pinctrl_ebi_data_0_7>; + status = "okay"; + + nand_controller: nand-controller { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_nand_oe_we &pinctrl_nand_cs &pinctrl_nand_rb>; + status = "okay"; + + nand@3 { + reg = <0x3 0x0 0x800000>; + rb-gpios = <&pioD 5 GPIO_ACTIVE_HIGH>; + cs-gpios = <&pioD 4 GPIO_ACTIVE_HIGH>; + nand-bus-width = <8>; + nand-ecc-mode = "hw"; + nand-ecc-strength = <8>; + nand-ecc-step-size = <512>; + nand-on-flash-bbt; + label = "atmel_nand"; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + at91bootstrap@0 { + label = "at91bootstrap"; + reg = <0x0 0x40000>; + }; + + uboot@40000 { + label = "u-boot"; + reg = <0x40000 0xc0000>; + }; + + ubootenvred@100000 { + label = "U-Boot Env Redundant"; + reg = <0x100000 0x40000>; + }; + + ubootenv@140000 { + label = "U-Boot Env"; + reg = <0x140000 0x40000>; + }; + + dtb@180000 { + label = "device tree"; + reg = <0x180000 0x80000>; + }; + + kernel@200000 { + label = "kernel"; + reg = <0x200000 0x600000>; + }; + + rootfs@800000 { + label = "rootfs"; + reg = <0x800000 0x1f800000>; + }; + }; + }; + }; +}; + &flx0 { atmel,flexcom-mode = <ATMEL_FLEXCOM_MODE_TWI>; status = "okay"; @@ -74,6 +139,26 @@ };
&pinctrl { + ebi { + pinctrl_ebi_data_0_7: ebi-data-lsb-0 { + atmel,pins = + <AT91_PIOD 6 AT91_PERIPH_A (AT91_PINCTRL_NONE | AT91_PINCTRL_SLEWRATE_DIS) + AT91_PIOD 7 AT91_PERIPH_A (AT91_PINCTRL_NONE | AT91_PINCTRL_SLEWRATE_DIS) + AT91_PIOD 8 AT91_PERIPH_A (AT91_PINCTRL_NONE | AT91_PINCTRL_SLEWRATE_DIS) + AT91_PIOD 9 AT91_PERIPH_A (AT91_PINCTRL_NONE | AT91_PINCTRL_SLEWRATE_DIS) + AT91_PIOD 10 AT91_PERIPH_A (AT91_PINCTRL_NONE | AT91_PINCTRL_SLEWRATE_DIS) + AT91_PIOD 11 AT91_PERIPH_A (AT91_PINCTRL_NONE | AT91_PINCTRL_SLEWRATE_DIS) + AT91_PIOD 12 AT91_PERIPH_A (AT91_PINCTRL_NONE | AT91_PINCTRL_SLEWRATE_DIS) + AT91_PIOD 13 AT91_PERIPH_A (AT91_PINCTRL_NONE | AT91_PINCTRL_SLEWRATE_DIS)>; + }; + + pinctrl_ebi_addr_nand: ebi-addr-0 { + atmel,pins = + <AT91_PIOD 2 AT91_PERIPH_A (AT91_PINCTRL_NONE | AT91_PINCTRL_SLEWRATE_DIS) + AT91_PIOD 3 AT91_PERIPH_A (AT91_PINCTRL_NONE | AT91_PINCTRL_SLEWRATE_DIS)>; + }; + }; + flexcom { pinctrl_flx0: flx0_default { atmel,pins = @@ -82,6 +167,24 @@ }; };
+ nand { + pinctrl_nand_oe_we: nand-oe-we-0 { + atmel,pins = + <AT91_PIOD 0 AT91_PERIPH_A (AT91_PINCTRL_NONE | AT91_PINCTRL_SLEWRATE_DIS) + AT91_PIOD 1 AT91_PERIPH_A (AT91_PINCTRL_NONE | AT91_PINCTRL_SLEWRATE_DIS)>; + }; + + pinctrl_nand_rb: nand-rb-0 { + atmel,pins = + <AT91_PIOD 5 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP>; + }; + + pinctrl_nand_cs: nand-cs-0 { + atmel,pins = + <AT91_PIOD 4 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP>; + }; + }; + pinctrl_onewire_tm_default: onewire_tm_default { atmel,pins = <AT91_PIOD 14 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP>;

On 7/5/23 23:16, Alexander Dahl wrote:
Hello everyone,
currently I have the Microchip SAM9X60-Curiosity board on my desk and for evaluation purposes I'm trying to get it booting from NAND flash without SD card. This series contains a collection of patches I made on that journey. It's probably not the last set of patches, but I send it out now before my holidays so anyone who's interested has some time to look into it before I return to my desk in roughly two weeks. ;-)
Note: while I could access the I²C EEPROM populated on that board with Linux v6.4 through nvmem and the 100 bytes content seem valid including a MAC address attributed to Microchip, I could not do so in U-Boot. That also means out of the box access to Ethernet is currently broken without valid MAC address.
Note: I prepared the patches at the office, but sending them from home now. This is why I use two different mail addresses.
Greets Alex
Alexander Dahl (5): ARM: dts: at91: sam9x60: Better align with upstream dtsi ARM: dts: at91: sam9x60-curiosity: Fix EEPROM type ARM: dts: at91: sam9x60: Change i2c compatible ARM: dts: at91: sam9x60-curiosity: Improve alignment with upstream ARM: dts: at91: sam9x60-curiosity: Add raw NAND flash
.../dts/at91-sam9x60_curiosity-u-boot.dtsi | 8 +- arch/arm/dts/at91-sam9x60_curiosity.dts | 203 +++++++++++++----- arch/arm/dts/sam9x60.dtsi | 66 +++--- arch/arm/dts/sam9x60ek.dts | 2 +- 4 files changed, 190 insertions(+), 89 deletions(-)
base-commit: e1bebc16e1d9aa0ddd56c53c0b781f7186dce557
Applied to u-boot-at91/next , thanks !
participants (3)
-
Alexander Dahl
-
Durai.ManickamKR@microchip.com
-
Eugen Hristev