Skip to contentSkip to conversation

ARM: dts: socfpga: change qspi to "intel,socfpga-qspi"

PATCH Superseded Dinh Nguyen 2 participants 5 messages Nov 22, 2021 – Nov 30, 2021

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Dinh Nguyen

author maintainer
#0 lore raw

PATCH 1/2 ARM: dts: socfpga: change qspi to "intel,socfpga-qspi"

Because of commit 9cb2ff111712 ("spi: cadence-quadspi: Disable Auto-HW polling"), which does a write to the CQSPI_REG_WR_COMPLETION_CTRL register regardless of any condition. Well, the Cadence QuadSPI controller on Intel's SoCFPGA platforms does not implement the CQSPI_REG_WR_COMPLETION_CTRL register, thus a write to this register results in a crash!

So starting with v5.16, I introduced the patch
98d948eb833 ("spi: cadence-quadspi: fix write completion support"), which adds the dts property "intel,socfpga-qspi" that is specific for the QSPI on SoCFPGA that doesn't have the CQSPI_REG_WR_COMPLETION_CTRL register implemented.

---
 arch/arm/boot/dts/socfpga.dtsi                    | 2 +-
 arch/arm/boot/dts/socfpga_arria10.dtsi            | 2 +-
 arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi | 2 +-
 arch/arm64/boot/dts/intel/socfpga_agilex.dtsi     | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/boot/dts/socfpga.dtsi +1 -1
index 0b021eef0b53..108c3610bf52 100644
@@ -782,7 +782,7 @@ ocram: sram@ffff0000 {
 		};
 
 		qspi: spi@ff705000 {
-			compatible = "cdns,qspi-nor";
+			compatible = "intel,socfpga-qpsi";
 			#address-cells = <1>;
 			#size-cells = <0>;
 			reg = <0xff705000 0x1000>,
arch/arm/boot/dts/socfpga_arria10.dtsi +1 -1
index a574ea91d9d3..e1a70f3a641d 100644
@@ -756,7 +756,7 @@ usb0-ecc@ff8c8800 {
 		};
 
 		qspi: spi@ff809000 {
-			compatible = "cdns,qspi-nor";
+			compatible = "intel,socfpga-qspi";
 			#address-cells = <1>;
 			#size-cells = <0>;
 			reg = <0xff809000 0x100>,
arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi +1 -1
index d301ac0d406b..d391153c9e6d 100644
@@ -594,7 +594,7 @@ emac0-tx-ecc@ff8c0400 {
 		};
 
 		qspi: spi@ff8d2000 {
-			compatible = "cdns,qspi-nor";
+			compatible = "intel,socfpga-qspi";
 			#address-cells = <1>;
 			#size-cells = <0>;
 			reg = <0xff8d2000 0x100>,
arch/arm64/boot/dts/intel/socfpga_agilex.dtsi +1 -1
index 163f33b46e4f..de6dd2189e74 100644
@@ -628,7 +628,7 @@ sdmmca-ecc@ff8c8c00 {
 		};
 
 		qspi: spi@ff8d2000 {
-			compatible = "cdns,qspi-nor";
+			compatible = "intel,socfpga-qspi";
 			#address-cells = <1>;
 			#size-cells = <0>;
 			reg = <0xff8d2000 0x100>,
Signature · 1 line
2.25.1
author maintainer
#1 lore raw

PATCH 2/2 dt-bindings: spi: cadence-quadspi: document "intel,socfpga-qspi"

The QSPI controller on Intel's SoCFPGA platform does not implement the CQSPI_REG_WR_COMPLETION_CTRL register, thus a write to this register results in a crash.

Introduce the dts binding "intel,socfpga-qspi" to differentiate the hardware.

---
 Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml +1 -0
index ca155abbda7a..037f41f58503 100644
@@ -29,6 +29,7 @@ properties:
               - ti,am654-ospi
               - intel,lgm-qspi
               - xlnx,versal-ospi-1.0
+              - intel,socfpga-qspi
           - const: cdns,qspi-nor
       - const: cdns,qspi-nor
 
Signature · 1 line
2.25.1
maintainer
#2 lore raw

Re: [PATCH 2/2] dt-bindings: spi: cadence-quadspi: document "intel,socfpga-qspi"

Quoted 17 lines · Dinh Nguyen

The QSPI controller on Intel's SoCFPGA platform does not implement the CQSPI_REG_WR_COMPLETION_CTRL register, thus a write to this register results in a crash.

Introduce the dts binding "intel,socfpga-qspi" to differentiate the hardware.

---
 Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml +0 -0
index ca155abbda7a..037f41f58503 100644

Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml properties: · line 33

Quoted 5 lines
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml +1 -0
@@ -29,6 +29,7 @@ properties:
               - ti,am654-ospi
               - intel,lgm-qspi
               - xlnx,versal-ospi-1.0
+              - intel,socfpga-qspi
           - const: cdns,qspi-nor

Doesn't match what you changed in the dts files.

Please run schema validation so YOU find this issue and typos instead of me.

Rob

maintainer
#3 lore raw
In reply to Dinh Nguyen
Quoted 10 lines · Dinh Nguyen

Because of commit 9cb2ff111712 ("spi: cadence-quadspi: Disable Auto-HW polling"), which does a write to the CQSPI_REG_WR_COMPLETION_CTRL register regardless of any condition. Well, the Cadence QuadSPI controller on Intel's SoCFPGA platforms does not implement the CQSPI_REG_WR_COMPLETION_CTRL register, thus a write to this register results in a crash!

So starting with v5.16, I introduced the patch
98d948eb833 ("spi: cadence-quadspi: fix write completion support"), which adds the dts property "intel,socfpga-qspi" that is specific for

'intel,socfpga-qspi' is not a DT property. It's a value for 'compatible'.

Is this change going to stable? That would at least fix old kernels with new DT (assuming they get stable updates). But new kernels with old DT are still broken. Not a great story here.

Quoted 16 lines

the QSPI on SoCFPGA that doesn't have the CQSPI_REG_WR_COMPLETION_CTRL register implemented.

---
 arch/arm/boot/dts/socfpga.dtsi                    | 2 +-
 arch/arm/boot/dts/socfpga_arria10.dtsi            | 2 +-
 arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi | 2 +-
 arch/arm64/boot/dts/intel/socfpga_agilex.dtsi     | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/boot/dts/socfpga.dtsi +0 -0
index 0b021eef0b53..108c3610bf52 100644

arch/arm/boot/dts/socfpga.dtsi ocram: sram@ffff0000 { · line 785

Quoted 5 lines
arch/arm/boot/dts/socfpga.dtsi +1 -1
@@ -782,7 +782,7 @@ ocram: sram@ffff0000 {
 		};
 
 		qspi: spi@ff705000 {
-			compatible = "cdns,qspi-nor";
+			compatible = "intel,socfpga-qpsi";

Obviously not tested.

Quoted 46 lines
arch/arm/boot/dts/socfpga.dtsi +0 -0
 			#address-cells = <1>;
 			#size-cells = <0>;
 			reg = <0xff705000 0x1000>,
arch/arm/boot/dts/socfpga_arria10.dtsi +1 -1
index a574ea91d9d3..e1a70f3a641d 100644
@@ -756,7 +756,7 @@ usb0-ecc@ff8c8800 {
 		};
 
 		qspi: spi@ff809000 {
-			compatible = "cdns,qspi-nor";
+			compatible = "intel,socfpga-qspi";
 			#address-cells = <1>;
 			#size-cells = <0>;
 			reg = <0xff809000 0x100>,
arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi +1 -1
index d301ac0d406b..d391153c9e6d 100644
@@ -594,7 +594,7 @@ emac0-tx-ecc@ff8c0400 {
 		};
 
 		qspi: spi@ff8d2000 {
-			compatible = "cdns,qspi-nor";
+			compatible = "intel,socfpga-qspi";
 			#address-cells = <1>;
 			#size-cells = <0>;
 			reg = <0xff8d2000 0x100>,
arch/arm64/boot/dts/intel/socfpga_agilex.dtsi +1 -1
index 163f33b46e4f..de6dd2189e74 100644
@@ -628,7 +628,7 @@ sdmmca-ecc@ff8c8c00 {
 		};
 
 		qspi: spi@ff8d2000 {
-			compatible = "cdns,qspi-nor";
+			compatible = "intel,socfpga-qspi";
 			#address-cells = <1>;
 			#size-cells = <0>;
 			reg = <0xff8d2000 0x100>,
Signature · 1 line
2.25.1
maintainer
#4 lore raw
In reply to Dinh Nguyen
Quoted 65 lines · Dinh Nguyen

Because of commit 9cb2ff111712 ("spi: cadence-quadspi: Disable Auto-HW polling"), which does a write to the CQSPI_REG_WR_COMPLETION_CTRL register regardless of any condition. Well, the Cadence QuadSPI controller on Intel's SoCFPGA platforms does not implement the CQSPI_REG_WR_COMPLETION_CTRL register, thus a write to this register results in a crash!

So starting with v5.16, I introduced the patch
98d948eb833 ("spi: cadence-quadspi: fix write completion support"), which adds the dts property "intel,socfpga-qspi" that is specific for the QSPI on SoCFPGA that doesn't have the CQSPI_REG_WR_COMPLETION_CTRL register implemented.

---
 arch/arm/boot/dts/socfpga.dtsi                    | 2 +-
 arch/arm/boot/dts/socfpga_arria10.dtsi            | 2 +-
 arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi | 2 +-
 arch/arm64/boot/dts/intel/socfpga_agilex.dtsi     | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/boot/dts/socfpga.dtsi +1 -1
index 0b021eef0b53..108c3610bf52 100644
@@ -782,7 +782,7 @@ ocram: sram@ffff0000 {
 		};
 
 		qspi: spi@ff705000 {
-			compatible = "cdns,qspi-nor";
+			compatible = "intel,socfpga-qpsi";
 			#address-cells = <1>;
 			#size-cells = <0>;
 			reg = <0xff705000 0x1000>,
arch/arm/boot/dts/socfpga_arria10.dtsi +1 -1
index a574ea91d9d3..e1a70f3a641d 100644
@@ -756,7 +756,7 @@ usb0-ecc@ff8c8800 {
 		};
 
 		qspi: spi@ff809000 {
-			compatible = "cdns,qspi-nor";
+			compatible = "intel,socfpga-qspi";
 			#address-cells = <1>;
 			#size-cells = <0>;
 			reg = <0xff809000 0x100>,
arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi +1 -1
index d301ac0d406b..d391153c9e6d 100644
@@ -594,7 +594,7 @@ emac0-tx-ecc@ff8c0400 {
 		};
 
 		qspi: spi@ff8d2000 {
-			compatible = "cdns,qspi-nor";
+			compatible = "intel,socfpga-qspi";
 			#address-cells = <1>;
 			#size-cells = <0>;
 			reg = <0xff8d2000 0x100>,
arch/arm64/boot/dts/intel/socfpga_agilex.dtsi +0 -0
index 163f33b46e4f..de6dd2189e74 100644

arch/arm64/boot/dts/intel/socfpga_agilex.dtsi sdmmca-ecc@ff8c8c00 { · line 631

Quoted 5 lines
arch/arm64/boot/dts/intel/socfpga_agilex.dtsi +1 -1
@@ -628,7 +628,7 @@ sdmmca-ecc@ff8c8c00 {
 		};
 
 		qspi: spi@ff8d2000 {
-			compatible = "cdns,qspi-nor";
+			compatible = "intel,socfpga-qspi";

A few more comments...

Now instead of reusing the same generic compatible, you are reusing the same compatible across 4 different SoCs and setting yourself up for the same compatibility breakage again if there is some difference among these SoCs.

Also, keep "cdns,qspi-nor" as a fall back and you will solve the new DT
+ old kernel combination and the schema errors.

Rob