ARM: dts: at91: sama7g5: Add NAND support
authorTudor Ambarus <tudor.ambarus@microchip.com>
Tue, 11 Jan 2022 13:05:56 +0000 (15:05 +0200)
committerNicolas Ferre <nicolas.ferre@microchip.com>
Fri, 4 Mar 2022 14:03:53 +0000 (15:03 +0100)
Add NAND support. The sama7g5's SMC IP is the same as sama5d2's with
a slightly change: it provides a synchronous clock output (SMC clock)
that is dedicated to FPGA usage. Since this doesn't interfere with the SMC
NAND configuration, thus code will not be added in the current nand driver
to address the FPGA usage, use the sama5d2's compatible and choose not to
introduce dedicated compatibles for sama7g5.
Tested with Micron MT29F4G08ABAEAWP NAND flash.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
[nicolas.ferre@microchip.com: add the definition of PMC_MCK1 in
include/dt-bindings/clock/at91.h from another patch]
Signed-off-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Link: https://lore.kernel.org/r/20220111130556.905978-1-tudor.ambarus@microchip.com
arch/arm/boot/dts/sama7g5.dtsi
include/dt-bindings/clock/at91.h

index 8bc244c2c93cf0c8f29fe9945010fb896c404cd9..4decd3a91a764774da31f3098c7b98bef637bca4 100644 (file)
                #size-cells = <1>;
                ranges;
 
+               nfc_sram: sram@600000 {
+                       compatible = "mmio-sram";
+                       no-memory-wc;
+                       reg = <0x00600000 0x2400>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges = <0 0x00600000 0x2400>;
+               };
+
+               nfc_io: nfc-io@10000000 {
+                       compatible = "atmel,sama5d3-nfc-io", "syscon";
+                       reg = <0x10000000 0x8000000>;
+               };
+
+               ebi: ebi@40000000 {
+                       compatible = "atmel,sama5d3-ebi";
+                       #address-cells = <2>;
+                       #size-cells = <1>;
+                       atmel,smc = <&hsmc>;
+                       reg = <0x40000000 0x20000000>;
+                       ranges = <0x0 0x0 0x40000000 0x8000000
+                                 0x1 0x0 0x48000000 0x8000000
+                                 0x2 0x0 0x50000000 0x8000000
+                                 0x3 0x0 0x58000000 0x8000000>;
+                       clocks = <&pmc PMC_TYPE_CORE PMC_MCK1>;
+                       status = "disabled";
+
+                       nand_controller: nand-controller {
+                               compatible = "atmel,sama5d3-nand-controller";
+                               atmel,nfc-sram = <&nfc_sram>;
+                               atmel,nfc-io = <&nfc_io>;
+                               ecc-engine = <&pmecc>;
+                               #address-cells = <2>;
+                               #size-cells = <1>;
+                               ranges;
+                               status = "disabled";
+                       };
+               };
+
                securam: securam@e0000000 {
                        compatible = "microchip,sama7g5-securam", "atmel,sama5d2-securam", "mmio-sram";
                        reg = <0xe0000000 0x4000>;
                        clock-names = "t0_clk", "t1_clk", "t2_clk", "slow_clk";
                };
 
+               hsmc: hsmc@e0808000 {
+                       compatible = "atmel,sama5d2-smc", "syscon", "simple-mfd";
+                       reg = <0xe0808000 0x1000>;
+                       interrupts = <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>;
+                       clocks = <&pmc PMC_TYPE_PERIPHERAL 21>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       ranges;
+
+                       pmecc: ecc-engine@e0808070 {
+                               compatible = "atmel,sama5d2-pmecc";
+                               reg = <0xe0808070 0x490>,
+                                     <0xe0808500 0x200>;
+                       };
+               };
+
                qspi0: spi@e080c000 {
                        compatible = "microchip,sama7g5-ospi";
                        reg = <0xe080c000 0x400>, <0x20000000 0x10000000>;
index 98e1b2ab6403934920c89fe1219205abce10e10e..8498c0cd95fe956a5ebebfc63836acf2988e1cfb 100644 (file)
@@ -35,6 +35,7 @@
 #define PMC_AUDIOIOPLL         (PMC_MAIN + 7)
 #define PMC_ETHPLL             (PMC_MAIN + 8)
 #define PMC_CPU                        (PMC_MAIN + 9)
+#define PMC_MCK1               (PMC_MAIN + 10)
 
 #ifndef AT91_PMC_MOSCS
 #define AT91_PMC_MOSCS         0               /* MOSCS Flag */