Skip to contentSkip to conversation

dt-bindings: spi: cadence-quadspi: document "cdns,qspi-nor-ver-00-10"

PATCH Superseded Dinh Nguyen 1 participant 3 messages Dec 3, 2021

Subsystems (3)
lore
Share & tools
lore

Dinh Nguyen

author maintainer
#0 lore raw

PATCH v2 1/3 dt-bindings: spi: cadence-quadspi: document "cdns,qspi-nor-ver-00-10"

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.

The module/revision ID is written in the MODULE_ID register. For this variance, bits 23-8 is 0x0010.

Introduce the dts binding "cdns,qspi-nor-ver-00-10" to differentiate the hardware.

---
v2: change binding to "cdns,qspi-nor-0010" to be more generic for other
platforms

---
 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..2833e1c8841d 100644
@@ -29,6 +29,7 @@ properties:
               - ti,am654-ospi
               - intel,lgm-qspi
               - xlnx,versal-ospi-1.0
+              - cdns,qspi-nor-ver-00-10
           - const: cdns,qspi-nor
       - const: cdns,qspi-nor
 
Signature · 1 line
2.25.1
author maintainer
#1 lore raw

PATCH 3/3 spi: cadence-quadspi: change socfpga-qspi to "cdns,qspi-nor-ver-00-10"

To make the "intel,socfpga-qspi" more generic, change the binding to "cdns,qspi-nor-ver-00-10". The "0010" represents the Module/Revision ID number that is in the MODULE_ID register.

Fixes f0234e62e4 ("spi: cadence-quadspi: fix write completion support")
---
 drivers/spi/spi-cadence-quadspi.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/spi/spi-cadence-quadspi.c +3 -3
index b808c94641fa..b1421bcce67f 100644
@@ -1869,7 +1869,7 @@ static const struct cqspi_driver_platdata intel_lgm_qspi = {
 	.quirks = CQSPI_DISABLE_DAC_MODE,
 };
 
-static const struct cqspi_driver_platdata socfpga_qspi = {
+static const struct cqspi_driver_platdata cdns_qspi_0010 = {
 	.quirks = CQSPI_NO_SUPPORT_WR_COMPLETION,
 };
 
@@ -1902,8 +1902,8 @@ static const struct of_device_id cqspi_dt_ids[] = {
 		.data = (void *)&versal_ospi,
 	},
 	{
-		.compatible = "intel,socfpga-qspi",
-		.data = (void *)&socfpga_qspi,
+		.compatible = "cdns,qspi-nor-ver-00-10",
+		.data = (void *)&cdns_qspi_0010,
 	},
 	{ /* end of table */ }
 };
Signature · 1 line
2.25.1
author maintainer
#2 lore raw

PATCH v2 2/3 ARM: dts: socfpga: change qspi to "cdns,qspi-nor-ver-00-10"

In reply to 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 "cdns,qspi-nor-ver-00-10" that is specific for versions that doesn't have the CQSPI_REG_WR_COMPLETION_CTRL register implemented.

---
v2: use both "cdns,qspi-nor" and "cdns,qspi-nor-0010"

---
 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..c1f85d57ee96 100644
@@ -782,7 +782,7 @@ ocram: sram@ffff0000 {
 		};
 
 		qspi: spi@ff705000 {
-			compatible = "cdns,qspi-nor";
+			compatible = "cdns,qspi-nor-ver-00-10", "cdns,qspi-nor";
 			#address-cells = <1>;
 			#size-cells = <0>;
 			reg = <0xff705000 0x1000>,
arch/arm/boot/dts/socfpga_arria10.dtsi +1 -1
index a574ea91d9d3..98166ad0b098 100644
@@ -756,7 +756,7 @@ usb0-ecc@ff8c8800 {
 		};
 
 		qspi: spi@ff809000 {
-			compatible = "cdns,qspi-nor";
+			compatible = "cdns,qspi-nor-ver-00-10", "cdns,qspi-nor";
 			#address-cells = <1>;
 			#size-cells = <0>;
 			reg = <0xff809000 0x100>,
arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi +1 -1
index d301ac0d406b..aac29503a3a3 100644
@@ -594,7 +594,7 @@ emac0-tx-ecc@ff8c0400 {
 		};
 
 		qspi: spi@ff8d2000 {
-			compatible = "cdns,qspi-nor";
+			compatible =  "cdns,qspi-nor-ver-00-10", "cdns,qspi-nor";
 			#address-cells = <1>;
 			#size-cells = <0>;
 			reg = <0xff8d2000 0x100>,
arch/arm64/boot/dts/intel/socfpga_agilex.dtsi +1 -1
index 163f33b46e4f..c72d5c9253fb 100644
@@ -628,7 +628,7 @@ sdmmca-ecc@ff8c8c00 {
 		};
 
 		qspi: spi@ff8d2000 {
-			compatible = "cdns,qspi-nor";
+			compatible = "cdns,qspi-nor-ver-00-10", "cdns,qspi-nor";
 			#address-cells = <1>;
 			#size-cells = <0>;
 			reg = <0xff8d2000 0x100>,
Signature · 1 line
2.25.1