Skip to contentSkip to conversation

arm: dts: Stratix10: Add QSPI node

PATCH Superseded Ley Foon Tan 4 participants 5 messages Mar 22, 2019 – Mar 25, 2019 Arm (32-bit)

v1 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: dts: Stratix10: Add QSPI node

Add QSPI device tree to Stratix 10. Sync from Linux Stratix 10 dts.

Tested on Stratix 10 SoC devkit.
SOCFPGA_STRATIX10 # sf probe 0:0
SF: Detected mt25qu02g with page size 256 Bytes, erase size 64 KiB, total 256 MiB

---
 arch/arm/dts/socfpga_stratix10.dtsi      | 16 ++++++++++++++++
 arch/arm/dts/socfpga_stratix10_socdk.dts | 21 +++++++++++++++++++++
 2 files changed, 37 insertions(+)
arch/arm/dts/socfpga_stratix10.dtsi +16 -0
index ee93725d64..1690f0e0bb 100644
@@ -391,5 +391,21 @@
 			resets = <&rst WATCHDOG3_RESET>;
 			status = "disabled";
 		};
+
+		qspi: spi at ff8d2000 {
+			compatible = "cdns,qspi-nor";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0xff8d2000 0x100>,
+			      <0xff900000 0x100000>;
+			interrupts = <0 3 4>;
+			cdns,fifo-depth = <128>;
+			cdns,fifo-width = <4>;
+			cdns,trigger-address = <0x00000000>;
+			bus-num = <0>;
+			/*spi-max-frequency = <50000000>;*/
+			status = "disabled";
+			u-boot,dm-pre-reloc;
+		};
 	};
 };
arch/arm/dts/socfpga_stratix10_socdk.dts +21 -0
index c59b77d829..4c47415b51 100644
@@ -10,6 +10,7 @@
 
 	aliases {
 		serial0 = &uart0;
+		spi0 = &qspi;
 	};
 
 	chosen {
@@ -87,6 +88,26 @@
 	smplsel = <0>;
 };
 
+&qspi {
+	status = "okay";
+
+	flash at 0 {
+		u-boot,dm-pre-reloc;
+		#address-cells = <1>;
+		#size-cells = <1>;
+		compatible = "spi-flash";
+		reg = <0>;      /* chip select */
+		spi-max-frequency = <50000000>;
+
+		page-size = <256>;
+		block-size = <16>; /* 2^16, 64KB */
+		cdns,tshsl-ns = <50>;
+		cdns,tsd2d-ns = <50>;
+		cdns,tchsh-ns = <4>;
+		cdns,tslch-ns = <4>;
+	};
+};
+
 &uart0 {
 	status = "okay";
 };
Signature · 1 line
2.19.0
#1 lore raw

PATCH 1/1 arm: dts: Stratix10: Add QSPI node

Quoted 25 lines · Ley Foon Tan

Add QSPI device tree to Stratix 10. Sync from Linux Stratix 10 dts.

Tested on Stratix 10 SoC devkit.
SOCFPGA_STRATIX10 # sf probe 0:0
SF: Detected mt25qu02g with page size 256 Bytes, erase size 64 KiB, total 256 MiB

---
 arch/arm/dts/socfpga_stratix10.dtsi      | 16 ++++++++++++++++
 arch/arm/dts/socfpga_stratix10_socdk.dts | 21 +++++++++++++++++++++
 2 files changed, 37 insertions(+)
arch/arm/dts/socfpga_stratix10.dtsi +3 -0
index ee93725d64..1690f0e0bb 100644
@@ -391,5 +391,21 @@
                        resets = <&rst WATCHDOG3_RESET>;
                        status = "disabled";
                };
+
+               qspi: spi at ff8d2000 {
+                       compatible = "cdns,qspi-nor";

arch/arm/dts/socfpga_stratix10.dtsi line 406

Quoted 10 lines
arch/arm/dts/socfpga_stratix10.dtsi +10 -0
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0xff8d2000 0x100>,
+                             <0xff900000 0x100000>;
+                       interrupts = <0 3 4>;
+                       cdns,fifo-depth = <128>;
+                       cdns,fifo-width = <4>;
+                       cdns,trigger-address = <0x00000000>;
+                       bus-num = <0>;
+                       /*spi-max-frequency = <50000000>;*/

Please ignore this patch. Just noticed add this unused /* */ line here. Will resend again.

Regards
Ley Foon

#2 lore raw

PATCH 1/1 arm: dts: Stratix10: Add QSPI node

Quoted 30 lines · Ley Foon Tan
Quoted 29 lines · Ley Foon Tan

Add QSPI device tree to Stratix 10. Sync from Linux Stratix 10 dts.

Tested on Stratix 10 SoC devkit.
SOCFPGA_STRATIX10 # sf probe 0:0
SF: Detected mt25qu02g with page size 256 Bytes, erase size 64 KiB, total 256 MiB

---
 arch/arm/dts/socfpga_stratix10.dtsi      | 16 ++++++++++++++++
 arch/arm/dts/socfpga_stratix10_socdk.dts | 21 +++++++++++++++++++++
 2 files changed, 37 insertions(+)
arch/arm/dts/socfpga_stratix10.dtsi +7 -0
index ee93725d64..1690f0e0bb 100644
@@ -391,5 +391,21 @@
                        resets = <&rst WATCHDOG3_RESET>;
                        status = "disabled";
                };
+
+               qspi: spi at ff8d2000 {
+                       compatible = "cdns,qspi-nor";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0xff8d2000 0x100>,
+                             <0xff900000 0x100000>;
Quoted 8 lines

arch/arm/dts/socfpga_stratix10.dtsi line 406

Quoted 6 lines
arch/arm/dts/socfpga_stratix10.dtsi +6 -0
+                       interrupts = <0 3 4>;
+                       cdns,fifo-depth = <128>;
+                       cdns,fifo-width = <4>;
+                       cdns,trigger-address = <0x00000000>;
+                       bus-num = <0>;
+                       /*spi-max-frequency = <50000000>;*/

Please ignore this patch. Just noticed add this unused /* */ line here. Will resend again.

Then it'd be V2 .

Signature · 2 lines
Best regards,
Marek Vasut
#3 lore raw

PATCH 1/1 arm: dts: Stratix10: Add QSPI node

In reply to Ley Foon Tan
Quoted 54 lines · Ley Foon Tan

Add QSPI device tree to Stratix 10. Sync from Linux Stratix 10 dts.

Tested on Stratix 10 SoC devkit.
SOCFPGA_STRATIX10 # sf probe 0:0
SF: Detected mt25qu02g with page size 256 Bytes, erase size 64 KiB, total 256 MiB

---
 arch/arm/dts/socfpga_stratix10.dtsi      | 16 ++++++++++++++++
 arch/arm/dts/socfpga_stratix10_socdk.dts | 21 +++++++++++++++++++++
 2 files changed, 37 insertions(+)
arch/arm/dts/socfpga_stratix10.dtsi +16 -0
index ee93725d64..1690f0e0bb 100644
@@ -391,5 +391,21 @@
                        resets = <&rst WATCHDOG3_RESET>;
                        status = "disabled";
                };
+
+               qspi: spi at ff8d2000 {
+                       compatible = "cdns,qspi-nor";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0xff8d2000 0x100>,
+                             <0xff900000 0x100000>;
+                       interrupts = <0 3 4>;
+                       cdns,fifo-depth = <128>;
+                       cdns,fifo-width = <4>;
+                       cdns,trigger-address = <0x00000000>;
+                       bus-num = <0>;
+                       /*spi-max-frequency = <50000000>;*/
+                       status = "disabled";
+                       u-boot,dm-pre-reloc;
+               };
        };
 };
arch/arm/dts/socfpga_stratix10_socdk.dts +1 -0
index c59b77d829..4c47415b51 100644
@@ -10,6 +10,7 @@
 
        aliases {
                serial0 = &uart0;
+               spi0 = &qspi;
        };
 
        chosen {
@@ -87,6 +88,26 @@
        smplsel = <0>;

arch/arm/dts/socfpga_stratix10_socdk.dts line 98

Quoted 10 lines
arch/arm/dts/socfpga_stratix10_socdk.dts +8 -0
 };
 
+&qspi {
+       status = "okay";
+
+       flash at 0 {
+               u-boot,dm-pre-reloc;
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "spi-flash";

"spi-flash" is u-boot specific and about to be deprecated. You should use the linux-compatible "jedec,spi-nor" binding.

Regards,
Simon

Quoted 17 lines
arch/arm/dts/socfpga_stratix10_socdk.dts +12 -1
+               reg = <0>;      /* chip select */
+               spi-max-frequency = <50000000>;
+
+               page-size = <256>;
+               block-size = <16>; /* 2^16, 64KB */
+               cdns,tshsl-ns = <50>;
+               cdns,tsd2d-ns = <50>;
+               cdns,tchsh-ns = <4>;
+               cdns,tslch-ns = <4>;
+       };
+};
+
 &uart0 {
        status = "okay";
 };
--

2.19.0

#4 lore raw

PATCH 1/1 arm: dts: Stratix10: Add QSPI node

Quoted 58 lines · Simon Goldschmidt
Quoted 56 lines · Ley Foon Tan

Add QSPI device tree to Stratix 10. Sync from Linux Stratix 10 dts.

Tested on Stratix 10 SoC devkit.
SOCFPGA_STRATIX10 # sf probe 0:0
SF: Detected mt25qu02g with page size 256 Bytes, erase size 64 KiB, total 256 MiB

---
 arch/arm/dts/socfpga_stratix10.dtsi      | 16 ++++++++++++++++
 arch/arm/dts/socfpga_stratix10_socdk.dts | 21 +++++++++++++++++++++
 2 files changed, 37 insertions(+)
arch/arm/dts/socfpga_stratix10.dtsi +16 -0
index ee93725d64..1690f0e0bb 100644
@@ -391,5 +391,21 @@
                        resets = <&rst WATCHDOG3_RESET>;
                        status = "disabled";
                };
+
+               qspi: spi at ff8d2000 {
+                       compatible = "cdns,qspi-nor";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0xff8d2000 0x100>,
+                             <0xff900000 0x100000>;
+                       interrupts = <0 3 4>;
+                       cdns,fifo-depth = <128>;
+                       cdns,fifo-width = <4>;
+                       cdns,trigger-address = <0x00000000>;
+                       bus-num = <0>;
+                       /*spi-max-frequency = <50000000>;*/
+                       status = "disabled";
+                       u-boot,dm-pre-reloc;
+               };
        };
 };
arch/arm/dts/socfpga_stratix10_socdk.dts +1 -0
index c59b77d829..4c47415b51 100644
@@ -10,6 +10,7 @@
 
        aliases {
                serial0 = &uart0;
+               spi0 = &qspi;
        };
 
        chosen {
@@ -87,6 +88,26 @@
        smplsel = <0>;
 };
 
Quoted 11 lines

arch/arm/dts/socfpga_stratix10_socdk.dts line 98

Quoted 8 lines
arch/arm/dts/socfpga_stratix10_socdk.dts +8 -0
+&qspi {
+       status = "okay";
+
+       flash at 0 {
+               u-boot,dm-pre-reloc;
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "spi-flash";

"spi-flash" is u-boot specific and about to be deprecated. You should use the linux-compatible "jedec,spi-nor" binding.

Okay, will change in next revision.

Regards
Ley Foon