Skip to contentSkip to conversation

arm: dts: Stratix10: Add QSPI node

PATCH RESEND Superseded Ley Foon Tan 4 participants 10 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 RESEND 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      | 15 +++++++++++++++
 arch/arm/dts/socfpga_stratix10_socdk.dts | 21 +++++++++++++++++++++
 2 files changed, 36 insertions(+)
arch/arm/dts/socfpga_stratix10.dtsi +15 -0
index ee93725d64..9998bb1ba3 100644
@@ -391,5 +391,20 @@
 			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>;
+			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 RESEND 1/1 arm: dts: Stratix10: Add QSPI node

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      | 15 +++++++++++++++
 arch/arm/dts/socfpga_stratix10_socdk.dts | 21 +++++++++++++++++++++
 2 files changed, 36 insertions(+)
arch/arm/dts/socfpga_stratix10.dtsi +15 -0
index ee93725d64..9998bb1ba3 100644
@@ -391,5 +391,20 @@
 			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>;
+			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 100

Quoted 10 lines
arch/arm/dts/socfpga_stratix10_socdk.dts +10 -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>;

The other SoCFPGAs use 100 MHz for the CQSPI , why would S10 use 50 MHz ?

Quoted 13 lines
arch/arm/dts/socfpga_stratix10_socdk.dts +9 -0
+		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 · 2 lines
Best regards,
Marek Vasut
#2 lore raw

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

Quoted 56 lines · Marek Vasut
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      | 15 +++++++++++++++
 arch/arm/dts/socfpga_stratix10_socdk.dts | 21 +++++++++++++++++++++
 2 files changed, 36 insertions(+)
arch/arm/dts/socfpga_stratix10.dtsi +15 -0
index ee93725d64..9998bb1ba3 100644
@@ -391,5 +391,20 @@
                      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>;
+                     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 12 lines

arch/arm/dts/socfpga_stratix10_socdk.dts line 100

Quoted 10 lines
arch/arm/dts/socfpga_stratix10_socdk.dts +10 -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>;

The other SoCFPGAs use 100 MHz for the CQSPI , why would S10 use 50 MHz ?

I wonder who, when and why they were switched to 100 MHz, as they were at 50 MHz in the past as well, or am I wrong?

Regards,
Simon

Quoted 19 lines
Quoted 4 lines
arch/arm/dts/socfpga_stratix10_socdk.dts +2 -0
+             page-size = <256>;
+             block-size = <16>; /* 2^16, 64KB */

arch/arm/dts/socfpga_stratix10_socdk.dts line 113

Quoted 10 lines
arch/arm/dts/socfpga_stratix10_socdk.dts +7 -0
+             cdns,tshsl-ns = <50>;
+             cdns,tsd2d-ns = <50>;
+             cdns,tchsh-ns = <4>;
+             cdns,tslch-ns = <4>;
+     };
+};
+
 &uart0 {
      status = "okay";
 };

--
Best regards,
Marek Vasut

#3 lore raw

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

Quoted 70 lines · Simon Goldschmidt
Quoted 56 lines · Marek Vasut
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      | 15 +++++++++++++++
 arch/arm/dts/socfpga_stratix10_socdk.dts | 21 +++++++++++++++++++++
 2 files changed, 36 insertions(+)
arch/arm/dts/socfpga_stratix10.dtsi +15 -0
index ee93725d64..9998bb1ba3 100644
@@ -391,5 +391,20 @@
                      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>;
+                     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 12 lines

arch/arm/dts/socfpga_stratix10_socdk.dts line 100

Quoted 10 lines
arch/arm/dts/socfpga_stratix10_socdk.dts +10 -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>;

The other SoCFPGAs use 100 MHz for the CQSPI , why would S10 use 50 MHz ?

Quoted 2 lines

I wonder who, when and why they were switched to 100 MHz, as they were at 50 MHz in the past as well, or am I wrong?

I was under the impression they were 100 since the beginning of times. Where did you find 50 MHz ?

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

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

Quoted 72 lines · Marek Vasut
Quoted 70 lines · Simon Goldschmidt
Quoted 68 lines · Marek Vasut
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      | 15 +++++++++++++++
 arch/arm/dts/socfpga_stratix10_socdk.dts | 21 +++++++++++++++++++++
 2 files changed, 36 insertions(+)
arch/arm/dts/socfpga_stratix10.dtsi +15 -0
index ee93725d64..9998bb1ba3 100644
@@ -391,5 +391,20 @@
                      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>;
+                     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 100

Quoted 10 lines
arch/arm/dts/socfpga_stratix10_socdk.dts +10 -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>;

The other SoCFPGAs use 100 MHz for the CQSPI , why would S10 use 50 MHz ?

Quoted 5 lines
Quoted 2 lines

I wonder who, when and why they were switched to 100 MHz, as they were at 50 MHz in the past as well, or am I wrong?

I was under the impression they were 100 since the beginning of times. Where did you find 50 MHz ?

Good question, let me dig on that.

Regards,
Simon

#5 lore raw

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

Quoted 74 lines · Simon Goldschmidt
Quoted 72 lines · Marek Vasut
Quoted 70 lines · Simon Goldschmidt
Quoted 68 lines · Marek Vasut
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      | 15 +++++++++++++++
 arch/arm/dts/socfpga_stratix10_socdk.dts | 21 +++++++++++++++++++++
 2 files changed, 36 insertions(+)
arch/arm/dts/socfpga_stratix10.dtsi +15 -0
index ee93725d64..9998bb1ba3 100644
@@ -391,5 +391,20 @@
                      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>;
+                     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 100

Quoted 10 lines
arch/arm/dts/socfpga_stratix10_socdk.dts +10 -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>;

The other SoCFPGAs use 100 MHz for the CQSPI , why would S10 use 50 MHz ?

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

I wonder who, when and why they were switched to 100 MHz, as they were at 50 MHz in the past as well, or am I wrong?

I was under the impression they were 100 since the beginning of times. Where did you find 50 MHz ?

Good question, let me dig on that.

Some boards were at 50 MHz before I merged the dt files from Linux:
https://github.com/u-boot/u-boot/commit/c402e8170245a0ca2b9398185638b349eeff10a3

In contrast to the U-Boot dts, the Linux dts for e.g. the socrates board has been
at 100 MHz from the beginning.

I don't know if that is due to a limitation of the flash chips on those boards or if
it has been an error when reading those specs...

Regards,
Simon

#6 lore raw

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

Quoted 87 lines · Simon Goldschmidt
Quoted 74 lines · Simon Goldschmidt
Quoted 72 lines · Marek Vasut
Quoted 70 lines · Simon Goldschmidt
Quoted 68 lines · Marek Vasut
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      | 15 +++++++++++++++
 arch/arm/dts/socfpga_stratix10_socdk.dts | 21 +++++++++++++++++++++
 2 files changed, 36 insertions(+)
arch/arm/dts/socfpga_stratix10.dtsi +15 -0
index ee93725d64..9998bb1ba3 100644
@@ -391,5 +391,20 @@
                      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>;
+                     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 100

Quoted 10 lines
arch/arm/dts/socfpga_stratix10_socdk.dts +10 -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>;

The other SoCFPGAs use 100 MHz for the CQSPI , why would S10 use 50 MHz ?

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

I wonder who, when and why they were switched to 100 MHz, as they were at 50 MHz in the past as well, or am I wrong?

I was under the impression they were 100 since the beginning of times. Where did you find 50 MHz ?

Good question, let me dig on that.

Some boards were at 50 MHz before I merged the dt files from Linux:
https://github.com/u-boot/u-boot/commit/c402e8170245a0ca2b9398185638b349eeff10a3

Quoted 7 lines

In contrast to the U-Boot dts, the Linux dts for e.g. the socrates board has been
at 100 MHz from the beginning.

I don't know if that is due to a limitation of the flash chips on those boards or if
it has been an error when reading those specs...

So it's a per-board thing then ? Let's see what Ley has to say about the S10 then .

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

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

Marek Vasut <[email protected]> schrieb am Fr., 22. März 2019, 13:35:

Quoted 98 lines · Simon Goldschmidt
Quoted 8 lines
Quoted 6 lines · Simon Goldschmidt
Quoted 4 lines · Marek Vasut
Quoted 2 lines · Simon Goldschmidt
Quoted 1 line · Marek Vasut
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines · Ley Foon Tan
Quoted 6 lines

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

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Review

Quoted 8 lines
---
 arch/arm/dts/socfpga_stratix10.dtsi      | 15 +++++++++++++++
 arch/arm/dts/socfpga_stratix10_socdk.dts | 21 +++++++++++++++++++++
 2 files changed, 36 insertions(+)
(quoted diff) +0 -0

b/arch/arm/dts/socfpga_stratix10.dtsi

Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines

index ee93725d64..9998bb1ba3 100644

arch/arm/dts/socfpga_stratix10.dtsi +10 -0
@@ -391,5 +391,20 @@
                      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>;
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Review

Quoted 8 lines
arch/arm/dts/socfpga_stratix10.dtsi +5 -0
+                     cdns,trigger-address = <0x00000000>;
+                     bus-num = <0>;
+                     status = "disabled";
+                     u-boot,dm-pre-reloc;
+             };
      };
 };
(quoted diff) +0 -0

b/arch/arm/dts/socfpga_stratix10_socdk.dts

Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines

index c59b77d829..4c47415b51 100644

arch/arm/dts/socfpga_stratix10_socdk.dts +1 -0
@@ -10,6 +10,7 @@
 
      aliases {
              serial0 = &uart0;
+             spi0 = &qspi;
      };
 
      chosen {
@@ -87,6 +88,26 @@
      smplsel = <0>;
 };
 
Quoted 12 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
arch/arm/dts/socfpga_stratix10_socdk.dts +10 -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>;
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

The other SoCFPGAs use 100 MHz for the CQSPI , why would S10 use 50

MHz ?

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

I wonder who, when and why they were switched to 100 MHz, as they

were at 50 MHz

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

in the past as well, or am I wrong?

I was under the impression they were 100 since the beginning of times. Where did you find 50 MHz ?

Good question, let me dig on that.

Some boards were at 50 MHz before I merged the dt files from Linux:

https://github.com/u-boot/u-boot/commit/c402e8170245a0ca2b9398185638b349eeff10a3

Quoted 5 lines

In contrast to the U-Boot dts, the Linux dts for e.g. the socrates board has been
at 100 MHz from the beginning.

Quoted 7 lines
Quoted 3 lines

I don't know if that is due to a limitation of the flash chips on those boards or if
it has been an error when reading those specs...

So it's a per-board thing then ? Let's see what Ley has to say about the S10 then .

From a devicetree point of view, it's a per-board thing. And it describes the flash chip, so yes, board specific. But it still seemed inconsistent.

Regards,
Simon

#8 lore raw

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

Quoted 105 lines · Simon Goldschmidt

Marek Vasut <[email protected]> schrieb am Fr., 22. März 2019, 13:35:

Quoted 102 lines · Simon Goldschmidt
Quoted 8 lines
Quoted 6 lines · Simon Goldschmidt
Quoted 4 lines · Marek Vasut
Quoted 2 lines · Simon Goldschmidt
Quoted 1 line · Marek Vasut
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines · Ley Foon Tan
Quoted 6 lines

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

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Review

Quoted 8 lines
---
 arch/arm/dts/socfpga_stratix10.dtsi      | 15 +++++++++++++++
 arch/arm/dts/socfpga_stratix10_socdk.dts | 21 +++++++++++++++++++++
 2 files changed, 36 insertions(+)
(quoted diff) +0 -0

b/arch/arm/dts/socfpga_stratix10.dtsi

Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines

index ee93725d64..9998bb1ba3 100644

arch/arm/dts/socfpga_stratix10.dtsi +10 -0
@@ -391,5 +391,20 @@
                      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>;
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Review

Quoted 8 lines
arch/arm/dts/socfpga_stratix10.dtsi +5 -0
+                     cdns,trigger-address = <0x00000000>;
+                     bus-num = <0>;
+                     status = "disabled";
+                     u-boot,dm-pre-reloc;
+             };
      };
 };
(quoted diff) +0 -0

b/arch/arm/dts/socfpga_stratix10_socdk.dts

Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines
Quoted 15 lines

index c59b77d829..4c47415b51 100644

arch/arm/dts/socfpga_stratix10_socdk.dts +1 -0
@@ -10,6 +10,7 @@
 
      aliases {
              serial0 = &uart0;
+             spi0 = &qspi;
      };
 
      chosen {
@@ -87,6 +88,26 @@
      smplsel = <0>;
 };
 
Quoted 12 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
arch/arm/dts/socfpga_stratix10_socdk.dts +10 -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>;
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

The other SoCFPGAs use 100 MHz for the CQSPI , why would S10 use 50

MHz ?

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

I wonder who, when and why they were switched to 100 MHz, as they

were at 50 MHz

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

in the past as well, or am I wrong?

I was under the impression they were 100 since the beginning of times. Where did you find 50 MHz ?

Good question, let me dig on that.

Some boards were at 50 MHz before I merged the dt files from Linux:

https://github.com/u-boot/u-boot/commit/c402e8170245a0ca2b9398185638b349eeff10a3

Quoted 8 lines

In contrast to the U-Boot dts, the Linux dts for e.g. the socrates board has been
at 100 MHz from the beginning.

I don't know if that is due to a limitation of the flash chips on those boards or if
it has been an error when reading those specs...

Quoted 7 lines
Quoted 3 lines

So it's a per-board thing then ? Let's see what Ley has to say about the S10 then .

From a devicetree point of view, it's a per-board thing. And it describes the flash chip, so yes, board specific. But it still seemed inconsistent.

It should be 100MHz. QSPI reference clock is 400MHz. SPI flash clock can up to 100MHz.

Dinh, Linux dts need to update this too. Please take note.

Regards

Ley Foon

#9 lore raw

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

In reply to Ley Foon Tan
Quoted 53 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      | 15 +++++++++++++++
 arch/arm/dts/socfpga_stratix10_socdk.dts | 21 +++++++++++++++++++++
 2 files changed, 36 insertions(+)
arch/arm/dts/socfpga_stratix10.dtsi +15 -0
index ee93725d64..9998bb1ba3 100644
@@ -391,5 +391,20 @@
                        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>;
+                       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";

"jedec,spi-nor", see my comment to in the other thread.

arch/arm/dts/socfpga_stratix10_socdk.dts line 100

Quoted 2 lines
arch/arm/dts/socfpga_stratix10_socdk.dts +2 -0
+               reg = <0>;      /* chip select */
+               spi-max-frequency = <50000000>;

This has changed to the one sent 10 minutes ago, so it should be a v2, right?

Quoted 15 lines
arch/arm/dts/socfpga_stratix10_socdk.dts +10 -1
+
+               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