From 4d7a5593f6b3bdd182e8c14162d769cc11879ac3 Mon Sep 17 00:00:00 2001 From: Alexander Dahl Date: Wed, 5 Jul 2023 22:17:01 +0200 Subject: [PATCH] ARM: dts: at91: sam9x60-curiosity: Add raw NAND flash 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 --- 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 = ; status = "okay"; @@ -74,6 +139,26 @@ }; &pinctrl { + ebi { + pinctrl_ebi_data_0_7: ebi-data-lsb-0 { + atmel,pins = + ; + }; + + pinctrl_ebi_addr_nand: ebi-addr-0 { + atmel,pins = + ; + }; + }; + flexcom { pinctrl_flx0: flx0_default { atmel,pins = @@ -82,6 +167,24 @@ }; }; + nand { + pinctrl_nand_oe_we: nand-oe-we-0 { + atmel,pins = + ; + }; + + pinctrl_nand_rb: nand-rb-0 { + atmel,pins = + ; + }; + + pinctrl_nand_cs: nand-cs-0 { + atmel,pins = + ; + }; + }; + pinctrl_onewire_tm_default: onewire_tm_default { atmel,pins = ; -- 2.39.5