Signed-off-by: Cédric Le Goater <c...@kaod.org>
---
 arch/arm/dts/ast2500-evb.dts     | 17 ++++++++
 arch/arm/dts/ast2500-u-boot.dtsi | 12 ++++++
 arch/arm/dts/ast2500.dtsi        | 71 ++++++++++++++++++++++++++++++++
 configs/evb-ast2500_defconfig    | 10 +++++
 4 files changed, 110 insertions(+)

diff --git a/arch/arm/dts/ast2500-evb.dts b/arch/arm/dts/ast2500-evb.dts
index 723941ac0bee..609678ff7989 100644
--- a/arch/arm/dts/ast2500-evb.dts
+++ b/arch/arm/dts/ast2500-evb.dts
@@ -11,6 +11,10 @@
        chosen {
                stdout-path = &uart5;
        };
+
+       aliases {
+               spi0 = &fmc;
+       };
 };
 
 &uart5 {
@@ -36,3 +40,16 @@
        u-boot,dm-pre-reloc;
        status = "okay";
 };
+
+&fmc {
+       status = "okay";
+       flash@0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "spi-flash", "sst,w25q256";
+               status = "okay";
+               spi-max-frequency = <50000000>;
+               spi-tx-bus-width = <2>;
+               spi-rx-bus-width = <2>;
+       };
+};
diff --git a/arch/arm/dts/ast2500-u-boot.dtsi b/arch/arm/dts/ast2500-u-boot.dtsi
index 7f80bad7d050..6cfdf3ba5413 100644
--- a/arch/arm/dts/ast2500-u-boot.dtsi
+++ b/arch/arm/dts/ast2500-u-boot.dtsi
@@ -70,3 +70,15 @@
 &mac1 {
        clocks = <&scu PCLK_MAC2>, <&scu PLL_D2PLL>;
 };
+
+&fmc {
+       clocks = <&scu BCLK_HCLK>;
+};
+
+&spi1 {
+       clocks = <&scu BCLK_HCLK>;
+};
+
+&spi2 {
+       clocks = <&scu BCLK_HCLK>;
+};
diff --git a/arch/arm/dts/ast2500.dtsi b/arch/arm/dts/ast2500.dtsi
index 7e0ad3a41ac5..de7607aaafff 100644
--- a/arch/arm/dts/ast2500.dtsi
+++ b/arch/arm/dts/ast2500.dtsi
@@ -28,6 +28,77 @@
                #size-cells = <1>;
                ranges;
 
+               fmc: flash-controller@1e620000 {
+                       reg = < 0x1e620000 0xc4
+                               0x20000000 0x10000000 >;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "aspeed,ast2500-fmc";
+                       status = "disabled";
+                       interrupts = <19>;
+                       spi-max-frequency = <100000000>;
+                       flash@0 {
+                               reg = < 0 >;
+                               compatible = "jedec,spi-nor";
+                               spi-max-frequency = <50000000>;
+                               status = "disabled";
+                       };
+                       flash@1 {
+                               reg = < 1 >;
+                               compatible = "jedec,spi-nor";
+                               spi-max-frequency = <50000000>;
+                               status = "disabled";
+                       };
+                       flash@2 {
+                               reg = < 2 >;
+                               compatible = "jedec,spi-nor";
+                               spi-max-frequency = <50000000>;
+                               status = "disabled";
+                       };
+               };
+
+               spi1: flash-controller@1e630000 {
+                       reg = < 0x1e630000 0xc4
+                               0x30000000 0x08000000 >;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "aspeed,ast2500-spi";
+                       status = "disabled";
+                       flash@0 {
+                               reg = < 0 >;
+                               compatible = "jedec,spi-nor";
+                               spi-max-frequency = <50000000>;
+                               status = "disabled";
+                       };
+                       flash@1 {
+                               reg = < 1 >;
+                               compatible = "jedec,spi-nor";
+                               spi-max-frequency = <50000000>;
+                               status = "disabled";
+                       };
+               };
+
+               spi2: flash-controller@1e631000 {
+                       reg = < 0x1e631000 0xc4
+                               0x38000000 0x08000000 >;
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "aspeed,ast2500-spi";
+                       status = "disabled";
+                       flash@0 {
+                               reg = < 0 >;
+                               compatible = "jedec,spi-nor";
+                               spi-max-frequency = <50000000>;
+                               status = "disabled";
+                       };
+                       flash@1 {
+                               reg = < 1 >;
+                               compatible = "jedec,spi-nor";
+                               spi-max-frequency = <50000000>;
+                               status = "disabled";
+                       };
+               };
+
                vic: interrupt-controller@1e6c0080 {
                        compatible = "aspeed,ast2400-vic";
                        interrupt-controller;
diff --git a/configs/evb-ast2500_defconfig b/configs/evb-ast2500_defconfig
index 88230f4a12db..a418ff0e9e01 100644
--- a/configs/evb-ast2500_defconfig
+++ b/configs/evb-ast2500_defconfig
@@ -25,3 +25,13 @@ CONFIG_SYS_NS16550=y
 CONFIG_SYSRESET=y
 CONFIG_TIMER=y
 CONFIG_WDT=y
+CONFIG_SPI=y
+CONFIG_ASPEED_SPI=y
+CONFIG_DM_SPI=y
+CONFIG_DM_SPI_FLASH=y
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_MACRONIX=y
+CONFIG_SPI_FLASH_SPANSION=y
+CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_SPI_FLASH_STMICRO=y
+CONFIG_CMD_SF=y
-- 
2.17.1

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to