Skip to contentSkip to conversation

spi: cadence-quadpsi: Add support for the Cadence QSPI controller

PATCH Superseded Ramuthevar,Vadivel MuruganX 4 participants 14 messages Feb 19, 2020 – Feb 27, 2020

Subsystems (4)

v10 of 12 Superseded Latest is v12 →

lore
Share & tools
lore
#0 lore raw

v10 cover spi: cadence-quadpsi: Add support for the Cadence QSPI controller

Add support for the Cadence QSPI controller. This controller is present in the Intel Lightning Mountain(LGM) SoCs, Altera and TI SoCs. This driver has been tested on the Intel LGM SoCs.

This driver does not support generic SPI and also the implementation only supports spi-mem interface to replace the existing driver in mtd/spi-nor/cadence-quadspi.c, the existing driver only support SPI-NOR flash memory.

Thanks Mark and Vignesh for the review, suggestion to optimize the patch. Tested with mx25u12835f on LGM platform.

changes from v9:
-- Mark's review comments address
-- add check to shared interrupt handler
-- add check decoder if present
-- add error check for quirks capability data
-- remove the existing cadence_quadspi.c from drivers/mtd/spi-nor path -- remove CONFIG macro from Kconfig in the above path
-- remove cadence_quadspi.o build option from Makefile in the above path

changes from v8:
-- remove the depends MTD macro
-- comment into C++ style
-- remove spaces and tabs where not applicable.
-- align the macro string as same as existing one. -- replace QUAD to op->data.buswidth variable.
-- add CQSPI_NEEDS_ADDR_SWAP instead of soc_selection variable

changes from v7:
-- remove addr_buf kept like as original
-- drop bus-num, chipselect variable
-- add soc_selection varible to differetiate the features -- replace dev->ddev in dma function
-- add seperate function to handle the 24bit slave device address
translation for lgm soc
-- correct sentence seems incomplete in Kconfig
-- add cqspi->soc_selection check to keep the original TI platform
working code.

changes from v6:
-- Add the Signed-off-by Vignesh in commit message
-- bus_num, num_chipselect added to avoid the garbage bus number
during the probe and spi_register.
-- master mode bits updated
-- address sequence is different from TI and Intel SoC Ip handling
so modified as per Intel and differentiating by use_dac_mode variable.
-- dummy cycles also different b/w two platforms, so keeping separate check -- checkpatch errors which are intentional left as is for better readability

changes from v5:
-- kbuild test robot warnings fixed
-- Add Reported-By: Dan Carpenter <[email protected]>

changes from v4:
-- kbuild test robot warnings fixed
-- Add Reborted-by: tag

changes from v3:
spi-cadence-quadspi.c
-- static to all functions wrt to local to the file.
-- Prefix cqspi_ and make the function static
-- cmd_ops, data_ops and dummy_ops dropped
-- addr_ops kept since it is required for address calculation.
-- devm_ used for supported functions , removed legacy API's
-- removed "indirect" name from functions
-- replaced by master->mode_bits = SPI_RX_QUAD | SPI_TX_DUAL | SPI_RX_DUAL | SPI_RX_OCTAL;
as per Vignesh susggestion
-- removed free functions since devm_ handles automatically.
-- dropped all unused Macros

YAML file update:
-- cadence,qspi.yaml file name replace by cdns,qspi-nor.yaml
-- compatible string updated as per Vignesh suggestion
-- for single entry, removed descriptions
-- removed optional parameters
Build Result:
linux$ make DT_SCHEMA_FILES=Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml dt_binding_check

    CHKDT   Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
    SCHEMA  Documentation/devicetree/bindings/processed-schema.yaml
    DTC     Documentation/devicetree/bindings/spi/cdns,qspi-nor.example.dt.yaml
    CHECK   Documentation/devicetree/bindings/spi/cdns,qspi-nor.example.dt.yaml

Ramuthevar Vadivel Murugan (2):
dt-bindings: spi: Add schema for Cadence QSPI Controller driver
spi: cadence-quadpsi: Add support for the Cadence QSPI controller

 .../devicetree/bindings/spi/cdns,qspi-nor.yaml     | 147 +++++
 drivers/mtd/spi-nor/Kconfig                        |  11 -
 drivers/mtd/spi-nor/Makefile                       |   1 -
 drivers/spi/Kconfig                                |   8 +
 drivers/spi/Makefile                               |   1 +
 .../spi-cadence-quadspi.c}                         | 641 ++++++++++-----------
 6 files changed, 459 insertions(+), 350 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
 rename drivers/{mtd/spi-nor/cadence-quadspi.c => spi/spi-cadence-quadspi.c} (73%)
Signature · 1 line
2.11.0
#1 lore raw

PATCH v10 1/2 dt-bindings: spi: Add schema for Cadence QSPI Controller driver

From: Ramuthevar Vadivel Murugan <vadivel.muruganx.ramuthevar-VuQAYsv1563Yd54FQh9/[email protected]>

Add dt-bindings documentation for Cadence-QSPI controller to support spi based flash memories.

---
 .../devicetree/bindings/spi/cdns,qspi-nor.yaml     | 147 +++++++++++++++++++++
 1 file changed, 147 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +147 -0
new file mode 100644
index 000000000000..1a4d6e8d0d0b
@@ -0,0 +1,147 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/spi/cdns,qspi-nor.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Cadence QSPI Flash Controller support
+
+maintainers:
+  - Ramuthevar Vadivel Murugan <vadivel.muruganx.ramuthevar-VuQAYsv1563Yd54FQh9/[email protected]>
+
+allOf:
+  - $ref: "spi-controller.yaml#"
+
+description: |
+  Binding Documentation for Cadence QSPI controller,This controller is
+  present in the Intel LGM, Altera SoCFPGA and TI SoCs and this driver
+  has been tested On Intel's LGM SoC.
+
+  - compatible : should be one of the following:
+        Generic default - "cdns,qspi-nor".
+        For TI 66AK2G SoC - "ti,k2g-qspi", "cdns,qspi-nor".
+        For TI AM654 SoC  - "ti,am654-ospi", "cdns,qspi-nor".
+        For Intel LGM SoC - "intel,lgm-qspi", "cdns,qspi-nor".
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+        - enum:
+           - ti,k2g-qspi
+        - const: cdns,qspi-nor
+
+      - items:
+        - enum:
+           - ti,am654-ospi
+        - const: cdns,qspi-nor
+
+      - items:
+        - enum:
+           - intel,lgm-qspi
+        - const: cdns,qspi-nor
+
+      - items:
+        - const: cdns,qspi-nor
+
+  reg:
+    maxItems: 2
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  cdns,fifo-depth:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Size of the data FIFO in words.
+
+  cdns,fifo-width:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Bus width of the data FIFO in bytes.
+
+  cdns,trigger-address:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      32-bit indirect AHB trigger address.
+
+  cdns,rclk-en:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Flag to indicate that QSPI return clock is used to latch the read data
+      rather than the QSPI clock. Make sure that QSPI return clock is populated
+      on the board before using this property.
+
+# subnode's properties
+patternProperties:
+  "^.*@[0-9a-fA-F]+$":
+    type: object
+    description:
+      flash device uses the subnodes below defined properties.
+
+  cdns,read-delay:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Delay for read capture logic, in clock cycles.
+
+  cdns,tshsl-ns:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Delay in nanoseconds for the length that the master mode chip select
+      outputs are de-asserted between transactions.
+
+  cdns,tsd2d-ns:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Delay in nanoseconds between one chip select being de-activated
+      and the activation of another.
+
+  cdns,tchsh-ns:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Delay in nanoseconds between last bit of current transaction and
+      deasserting the device chip select (qspi_n_ss_out).
+
+  cdns,tslch-ns:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Delay in nanoseconds between setting qspi_n_ss_out low and
+      first bit transfer.
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - cdns,fifo-depth
+  - cdns,fifo-width
+  - cdns,trigger-address
+
+examples:
+  - |
+    qspi: spi@ff705000 {
+          compatible = "cdns,qspi-nor";
+          #address-cells = <1>;
+          #size-cells = <0>;
+          reg = <0xff705000 0x1000>,
+                <0xffa00000 0x1000>;
+          interrupts = <0 151 4>;
+          clocks = <&qspi_clk>;
+          cdns,fifo-depth = <128>;
+          cdns,fifo-width = <4>;
+          cdns,trigger-address = <0x00000000>;
+
+          flash0: n25q00@0 {
+              compatible = "jedec,spi-nor";
+              reg = <0x0>;
+              cdns,read-delay = <4>;
+              cdns,tshsl-ns = <50>;
+              cdns,tsd2d-ns = <50>;
+              cdns,tchsh-ns = <4>;
+              cdns,tslch-ns = <4>;
+          };
+    };
+
Signature · 1 line
2.11.0
#2 lore raw

Re: [PATCH v10 1/2] dt-bindings: spi: Add schema for Cadence QSPI Controller driver

Quoted 2 lines · Ramuthevar,Vadivel MuruganX

From: Ramuthevar Vadivel Murugan <vadivel.muruganx.ramuthevar-VuQAYsv1563Yd54FQh9/[email protected]>

Cc the DT list if you want this reviewed.

Quoted 65 lines

Add dt-bindings documentation for Cadence-QSPI controller to support spi based flash memories.

---
 .../devicetree/bindings/spi/cdns,qspi-nor.yaml     | 147 +++++++++++++++++++++
 1 file changed, 147 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +49 -0
new file mode 100644
index 000000000000..1a4d6e8d0d0b
@@ -0,0 +1,147 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/spi/cdns,qspi-nor.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Cadence QSPI Flash Controller support
+
+maintainers:
+  - Ramuthevar Vadivel Murugan <vadivel.muruganx.ramuthevar-VuQAYsv1563Yd54FQh9/[email protected]>
+
+allOf:
+  - $ref: "spi-controller.yaml#"
+
+description: |
+  Binding Documentation for Cadence QSPI controller,This controller is
+  present in the Intel LGM, Altera SoCFPGA and TI SoCs and this driver
+  has been tested On Intel's LGM SoC.
+
+  - compatible : should be one of the following:
+        Generic default - "cdns,qspi-nor".
+        For TI 66AK2G SoC - "ti,k2g-qspi", "cdns,qspi-nor".
+        For TI AM654 SoC  - "ti,am654-ospi", "cdns,qspi-nor".
+        For Intel LGM SoC - "intel,lgm-qspi", "cdns,qspi-nor".
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+        - enum:
+           - ti,k2g-qspi
+        - const: cdns,qspi-nor
+
+      - items:
+        - enum:
+           - ti,am654-ospi
+        - const: cdns,qspi-nor
+
+      - items:
+        - enum:
+           - intel,lgm-qspi
+        - const: cdns,qspi-nor
+
+      - items:
+        - const: cdns,qspi-nor
+
+  reg:
+    maxItems: 2
+

Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml line 59

Quoted 10 lines
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +10 -0
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  cdns,fifo-depth:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Size of the data FIFO in words.

A 4GB fifo is valid? Add some constraints.

Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml line 64

Quoted 5 lines
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +5 -0
+
+  cdns,fifo-width:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Bus width of the data FIFO in bytes.

Add some constraints.

Quoted 14 lines
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +14 -0
+
+  cdns,trigger-address:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      32-bit indirect AHB trigger address.
+
+  cdns,rclk-en:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Flag to indicate that QSPI return clock is used to latch the read data
+      rather than the QSPI clock. Make sure that QSPI return clock is populated
+      on the board before using this property.
+
+# subnode's properties

Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml line 88

Quoted 10 lines
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +10 -0
+patternProperties:
+  "^.*@[0-9a-fA-F]+$":
+    type: object
+    description:
+      flash device uses the subnodes below defined properties.
+
+  cdns,read-delay:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Delay for read capture logic, in clock cycles.

4 billion clock delay is valid?

Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml line 91

Quoted 3 lines
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +3 -0
+
+  cdns,tshsl-ns:
+    $ref: /schemas/types.yaml#/definitions/uint32

You can drop this, anything with a standard unit suffix already has a type.

Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml line 94

Quoted 3 lines
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +3 -0
+    description: |
+      Delay in nanoseconds for the length that the master mode chip select
+      outputs are de-asserted between transactions.

Constraints...?

Quoted 56 lines
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +53 -1
+
+  cdns,tsd2d-ns:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Delay in nanoseconds between one chip select being de-activated
+      and the activation of another.
+
+  cdns,tchsh-ns:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Delay in nanoseconds between last bit of current transaction and
+      deasserting the device chip select (qspi_n_ss_out).
+
+  cdns,tslch-ns:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Delay in nanoseconds between setting qspi_n_ss_out low and
+      first bit transfer.
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - cdns,fifo-depth
+  - cdns,fifo-width
+  - cdns,trigger-address
+
+examples:
+  - |
+    qspi: spi@ff705000 {
+          compatible = "cdns,qspi-nor";
+          #address-cells = <1>;
+          #size-cells = <0>;
+          reg = <0xff705000 0x1000>,
+                <0xffa00000 0x1000>;
+          interrupts = <0 151 4>;
+          clocks = <&qspi_clk>;
+          cdns,fifo-depth = <128>;
+          cdns,fifo-width = <4>;
+          cdns,trigger-address = <0x00000000>;
+
+          flash0: n25q00@0 {
+              compatible = "jedec,spi-nor";
+              reg = <0x0>;
+              cdns,read-delay = <4>;
+              cdns,tshsl-ns = <50>;
+              cdns,tsd2d-ns = <50>;
+              cdns,tchsh-ns = <4>;
+              cdns,tslch-ns = <4>;
+          };
+    };
+
--

2.11.0

#3 lore raw

Re: [PATCH v10 1/2] dt-bindings: spi: Add schema for Cadence QSPI Controller driver

Hi Rob,

     Thank you for the review comments...

Quoted 4 lines · Rob Herring
Quoted 1 line · Ramuthevar,Vadivel MuruganX

From: Ramuthevar Vadivel Murugan <vadivel.muruganx.ramuthevar-VuQAYsv1563Yd54FQh9/[email protected]>

Cc the DT list if you want this reviewed.

Sorry,  next patch will add DT list in CC.

Quoted 67 lines
Quoted 67 lines

Add dt-bindings documentation for Cadence-QSPI controller to support spi based flash memories.

---
  .../devicetree/bindings/spi/cdns,qspi-nor.yaml     | 147 +++++++++++++++++++++
  1 file changed, 147 insertions(+)

create mode 100644 Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml

Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +52 -0
new file mode 100644
index 000000000000..1a4d6e8d0d0b
@@ -0,0 +1,147 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/spi/cdns,qspi-nor.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Cadence QSPI Flash Controller support
+
+maintainers:
+  - Ramuthevar Vadivel Murugan <vadivel.muruganx.ramuthevar-VuQAYsv1563Yd54FQh9/[email protected]>
+
+allOf:
+  - $ref: "spi-controller.yaml#"
+
+description: |
+  Binding Documentation for Cadence QSPI controller,This controller is
+  present in the Intel LGM, Altera SoCFPGA and TI SoCs and this driver
+  has been tested On Intel's LGM SoC.
+
+  - compatible : should be one of the following:
+        Generic default - "cdns,qspi-nor".
+        For TI 66AK2G SoC - "ti,k2g-qspi", "cdns,qspi-nor".
+        For TI AM654 SoC  - "ti,am654-ospi", "cdns,qspi-nor".
+        For Intel LGM SoC - "intel,lgm-qspi", "cdns,qspi-nor".
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+        - enum:
+           - ti,k2g-qspi
+        - const: cdns,qspi-nor
+
+      - items:
+        - enum:
+           - ti,am654-ospi
+        - const: cdns,qspi-nor
+
+      - items:
+        - enum:
+           - intel,lgm-qspi
+        - const: cdns,qspi-nor
+
+      - items:
+        - const: cdns,qspi-nor
+
+  reg:
+    maxItems: 2
+
+  interrupts:
+    maxItems: 1
+
Quoted 8 lines

Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml line 59

Quoted 7 lines
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +7 -0
+  clocks:
+    maxItems: 1
+
+  cdns,fifo-depth:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Size of the data FIFO in words.

A 4GB fifo is valid? Add some constraints.

128 is valid, will update.

Quoted 6 lines

Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml line 64

Quoted 5 lines
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +5 -0
+
+  cdns,fifo-width:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Bus width of the data FIFO in bytes.

Add some constraints.

4 is valid , will fix it.

Quoted 17 lines
Quoted 17 lines
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +17 -0
+
+  cdns,trigger-address:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      32-bit indirect AHB trigger address.
+
+  cdns,rclk-en:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Flag to indicate that QSPI return clock is used to latch the read data
+      rather than the QSPI clock. Make sure that QSPI return clock is populated
+      on the board before using this property.
+
+# subnode's properties
+patternProperties:
+  "^.*@[0-9a-fA-F]+$":
+    type: object
Quoted 8 lines

Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml line 88

Quoted 7 lines
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +7 -0
+    description:
+      flash device uses the subnodes below defined properties.
+
+  cdns,read-delay:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Delay for read capture logic, in clock cycles.

4 billion clock delay is valid?

based on the ref_clk , will add it.

Quoted 4 lines

Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml line 91

Quoted 3 lines
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +3 -0
+
+  cdns,tshsl-ns:
+    $ref: /schemas/types.yaml#/definitions/uint32

You can drop this, anything with a standard unit suffix already has a type.

sure , will drop it.

Quoted 4 lines

Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml line 94

Quoted 3 lines
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +3 -0
+    description: |
+      Delay in nanoseconds for the length that the master mode chip select
+      outputs are de-asserted between transactions.

Constraints...?

50ns, will add it.

Regards
Vadivel

Quoted 56 lines
Quoted 56 lines
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +53 -1
+
+  cdns,tsd2d-ns:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Delay in nanoseconds between one chip select being de-activated
+      and the activation of another.
+
+  cdns,tchsh-ns:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Delay in nanoseconds between last bit of current transaction and
+      deasserting the device chip select (qspi_n_ss_out).
+
+  cdns,tslch-ns:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Delay in nanoseconds between setting qspi_n_ss_out low and
+      first bit transfer.
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - cdns,fifo-depth
+  - cdns,fifo-width
+  - cdns,trigger-address
+
+examples:
+  - |
+    qspi: spi@ff705000 {
+          compatible = "cdns,qspi-nor";
+          #address-cells = <1>;
+          #size-cells = <0>;
+          reg = <0xff705000 0x1000>,
+                <0xffa00000 0x1000>;
+          interrupts = <0 151 4>;
+          clocks = <&qspi_clk>;
+          cdns,fifo-depth = <128>;
+          cdns,fifo-width = <4>;
+          cdns,trigger-address = <0x00000000>;
+
+          flash0: n25q00@0 {
+              compatible = "jedec,spi-nor";
+              reg = <0x0>;
+              cdns,read-delay = <4>;
+              cdns,tshsl-ns = <50>;
+              cdns,tsd2d-ns = <50>;
+              cdns,tchsh-ns = <4>;
+              cdns,tslch-ns = <4>;
+          };
+    };
+
--

2.11.0

#4 lore raw

Re: [PATCH v10 1/2] dt-bindings: spi: Add schema for Cadence QSPI Controller driver

Quoted 91 lines · Vadivel MuruganX

Hi Rob,

     Thank you for the review comments...

Quoted 5 lines · Rob Herring
Quoted 2 lines · Ramuthevar,Vadivel MuruganX

From: Ramuthevar Vadivel Murugan
<[email protected]>

Cc the DT list if you want this reviewed.

Sorry,  next patch will add DT list in CC.

Quoted 72 lines
Quoted 72 lines

Add dt-bindings documentation for Cadence-QSPI controller to support spi based flash memories.

Signed-off-by: Ramuthevar Vadivel Murugan <[email protected]>
---
  .../devicetree/bindings/spi/cdns,qspi-nor.yaml     | 147
+++++++++++++++++++++

  1 file changed, 147 insertions(+)

  create mode 100644 Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml

Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +10 -0
new file mode 100644
index 000000000000..1a4d6e8d0d0b
@@ -0,0 +1,147 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/spi/cdns,qspi-nor.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Cadence QSPI Flash Controller support
+
+maintainers:
+  - Ramuthevar Vadivel Murugan

<[email protected]>

Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +42 -0
+
+allOf:
+  - $ref: "spi-controller.yaml#"
+
+description: |
+  Binding Documentation for Cadence QSPI controller,This controller is
+  present in the Intel LGM, Altera SoCFPGA and TI SoCs and this driver
+  has been tested On Intel's LGM SoC.
+
+  - compatible : should be one of the following:
+        Generic default - "cdns,qspi-nor".
+        For TI 66AK2G SoC - "ti,k2g-qspi", "cdns,qspi-nor".
+        For TI AM654 SoC  - "ti,am654-ospi", "cdns,qspi-nor".
+        For Intel LGM SoC - "intel,lgm-qspi", "cdns,qspi-nor".
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+        - enum:
+           - ti,k2g-qspi
+        - const: cdns,qspi-nor
+
+      - items:
+        - enum:
+           - ti,am654-ospi
+        - const: cdns,qspi-nor
+
+      - items:
+        - enum:
+           - intel,lgm-qspi
+        - const: cdns,qspi-nor
+
+      - items:
+        - const: cdns,qspi-nor
+
+  reg:
+    maxItems: 2
+
+  interrupts:
+    maxItems: 1
+
Quoted 8 lines
Quoted 7 lines

+  clocks:
+    maxItems: 1
+
+  cdns,fifo-depth:
+    $ref: /schemas/types.yaml#/definitions/uint32 +    description:
+      Size of the data FIFO in words.

A 4GB fifo is valid? Add some constraints.

Quoted 1 line

128 is valid, will update.

Nope, the width of this field is 8bits -> 256 bytes

Quoted 40 lines
Quoted 6 lines
Quoted 5 lines

+
+  cdns,fifo-width:
+    $ref: /schemas/types.yaml#/definitions/uint32 +    description:
+      Bus width of the data FIFO in bytes.

Add some constraints.

4 is valid , will fix it.

Quoted 19 lines
Quoted 19 lines
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +10 -0
+
+  cdns,trigger-address:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      32-bit indirect AHB trigger address.
+
+  cdns,rclk-en:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Flag to indicate that QSPI return clock is used to latch the

read data
+      rather than the QSPI clock. Make sure that QSPI return clock is populated
+      on the board before using this property.

Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +5 -0
+
+# subnode's properties
+patternProperties:
+  "^.*@[0-9a-fA-F]+$":
+    type: object
Quoted 8 lines
Quoted 7 lines

+    description:
+      flash device uses the subnodes below defined properties. +
+  cdns,read-delay:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Delay for read capture logic, in clock cycles.

4 billion clock delay is valid?

based on the ref_clk , will add it.

Quoted 5 lines
Quoted 3 lines

+
+  cdns,tshsl-ns:
+    $ref: /schemas/types.yaml#/definitions/uint32

You can drop this, anything with a standard unit suffix already has a type.

Quoted 9 lines

sure , will drop it.

Quoted 5 lines
Quoted 4 lines

+    description: |
+      Delay in nanoseconds for the length that the master mode chip select
+      outputs are de-asserted between transactions.

Constraints...?

50ns, will add it.

This really depends on the input clk:

Clock Delay for Chip Select Deassert:

Delay in master reference clocks for the length that the master mode

chip select outputs are de-asserted between transactions The

minimum delay is always SCLK period to ensure the chip select is

never re-asserted within an SCLK period.

I don't see a easy way of verifying constraints in yaml.

Same applies for below 3 properties as well.

Regards
Vignesh

Quoted 58 lines

Regards
Vadivel

Quoted 56 lines
Quoted 56 lines
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +53 -0
+
+  cdns,tsd2d-ns:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Delay in nanoseconds between one chip select being de-activated
+      and the activation of another.
+
+  cdns,tchsh-ns:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Delay in nanoseconds between last bit of current transaction and
+      deasserting the device chip select (qspi_n_ss_out).
+
+  cdns,tslch-ns:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Delay in nanoseconds between setting qspi_n_ss_out low and
+      first bit transfer.
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - cdns,fifo-depth
+  - cdns,fifo-width
+  - cdns,trigger-address
+
+examples:
+  - |
+    qspi: spi@ff705000 {
+          compatible = "cdns,qspi-nor";
+          #address-cells = <1>;
+          #size-cells = <0>;
+          reg = <0xff705000 0x1000>,
+                <0xffa00000 0x1000>;
+          interrupts = <0 151 4>;
+          clocks = <&qspi_clk>;
+          cdns,fifo-depth = <128>;
+          cdns,fifo-width = <4>;
+          cdns,trigger-address = <0x00000000>;
+
+          flash0: n25q00@0 {
+              compatible = "jedec,spi-nor";
+              reg = <0x0>;
+              cdns,read-delay = <4>;
+              cdns,tshsl-ns = <50>;
+              cdns,tsd2d-ns = <50>;
+              cdns,tchsh-ns = <4>;
+              cdns,tslch-ns = <4>;
+          };
+    };
+
Signature · 1 line
2.11.0
Signature · 2 lines
Regards
Vignesh
#5 lore raw

Re: [PATCH v10 1/2] dt-bindings: spi: Add schema for Cadence QSPI Controller driver

Hi,

Quoted 93 lines · Vignesh Raghavendra
Quoted 91 lines · Vadivel MuruganX

Hi Rob,

     Thank you for the review comments...

Quoted 5 lines · Rob Herring
Quoted 2 lines · Ramuthevar,Vadivel MuruganX

From: Ramuthevar Vadivel Murugan <vadivel.muruganx.ramuthevar-VuQAYsv1563Yd54FQh9/[email protected]>

Cc the DT list if you want this reviewed.

Sorry,  next patch will add DT list in CC.

Quoted 80 lines
Quoted 69 lines

Add dt-bindings documentation for Cadence-QSPI controller to support spi based flash memories.

Signed-off-by: Ramuthevar Vadivel Murugan <vadivel.muruganx.ramuthevar-VuQAYsv1563Yd54FQh9/[email protected]>

---
   .../devicetree/bindings/spi/cdns,qspi-nor.yaml     | 147
+++++++++++++++++++++
   1 file changed, 147 insertions(+)

  create mode 100644
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml

Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +10 -0
new file mode 100644
index 000000000000..1a4d6e8d0d0b
@@ -0,0 +1,147 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/spi/cdns,qspi-nor.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Cadence QSPI Flash Controller support
+
+maintainers:
+  - Ramuthevar Vadivel Murugan

<vadivel.muruganx.ramuthevar-VuQAYsv1563Yd54FQh9/[email protected]>

Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +39 -0
+
+allOf:
+  - $ref: "spi-controller.yaml#"
+
+description: |
+  Binding Documentation for Cadence QSPI controller,This controller is
+  present in the Intel LGM, Altera SoCFPGA and TI SoCs and this driver
+  has been tested On Intel's LGM SoC.
+
+  - compatible : should be one of the following:
+        Generic default - "cdns,qspi-nor".
+        For TI 66AK2G SoC - "ti,k2g-qspi", "cdns,qspi-nor".
+        For TI AM654 SoC  - "ti,am654-ospi", "cdns,qspi-nor".
+        For Intel LGM SoC - "intel,lgm-qspi", "cdns,qspi-nor".
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+        - enum:
+           - ti,k2g-qspi
+        - const: cdns,qspi-nor
+
+      - items:
+        - enum:
+           - ti,am654-ospi
+        - const: cdns,qspi-nor
+
+      - items:
+        - enum:
+           - intel,lgm-qspi
+        - const: cdns,qspi-nor
+
+      - items:
+        - const: cdns,qspi-nor
+
+  reg:
+    maxItems: 2
+

Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml line 59

Quoted 10 lines
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +10 -0
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  cdns,fifo-depth:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Size of the data FIFO in words.

A 4GB fifo is valid? Add some constraints.

Quoted 2 lines
Quoted 1 line

128 is valid, will update.

Nope, the width of this field is 8bits -> 256 bytes

correct me if I am wrong, the width of this field is 4bits -> 128 bytes (based on QUAD mode) .

Quoted 56 lines
Quoted 40 lines
Quoted 6 lines
Quoted 5 lines

+
+  cdns,fifo-width:
+    $ref: /schemas/types.yaml#/definitions/uint32 +    description:
+      Bus width of the data FIFO in bytes.

Add some constraints.

4 is valid , will fix it.

Quoted 19 lines
Quoted 19 lines
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +10 -0
+
+  cdns,trigger-address:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      32-bit indirect AHB trigger address.
+
+  cdns,rclk-en:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Flag to indicate that QSPI return clock is used to latch the

read data
+      rather than the QSPI clock. Make sure that QSPI return clock is populated
+      on the board before using this property.

Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +5 -0
+
+# subnode's properties
+patternProperties:
+  "^.*@[0-9a-fA-F]+$":
+    type: object
Quoted 8 lines
Quoted 7 lines

+    description:
+      flash device uses the subnodes below defined properties. +
+  cdns,read-delay:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Delay for read capture logic, in clock cycles.

4 billion clock delay is valid?

based on the ref_clk , will add it.

Quoted 5 lines
Quoted 3 lines

+
+  cdns,tshsl-ns:
+    $ref: /schemas/types.yaml#/definitions/uint32

You can drop this, anything with a standard unit suffix already has a type.

Quoted 8 lines

sure , will drop it.

Quoted 5 lines
Quoted 4 lines

+    description: |
+      Delay in nanoseconds for the length that the master mode chip select
+      outputs are de-asserted between transactions.

Constraints...?

50ns, will add it.

This really depends on the input clk:

Clock Delay for Chip Select Deassert:

Delay in master reference clocks for the length that the master mode

chip select outputs are de-asserted between transactions The

Quoted 7 lines

minimum delay is always SCLK period to ensure the chip select is

never re-asserted within an SCLK period.

I don't see a easy way of verifying constraints in yaml.

Same applies for below 3 properties as well.

Thank you vignesh for  the detailed explanation.

Regards
Vadivel

Quoted 61 lines

Regards
Vignesh

Quoted 58 lines

Regards
Vadivel

Quoted 56 lines
Quoted 56 lines
Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml new file +53 -0
+
+  cdns,tsd2d-ns:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Delay in nanoseconds between one chip select being de-activated
+      and the activation of another.
+
+  cdns,tchsh-ns:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Delay in nanoseconds between last bit of current transaction and
+      deasserting the device chip select (qspi_n_ss_out).
+
+  cdns,tslch-ns:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Delay in nanoseconds between setting qspi_n_ss_out low and
+      first bit transfer.
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - cdns,fifo-depth
+  - cdns,fifo-width
+  - cdns,trigger-address
+
+examples:
+  - |
+    qspi: spi@ff705000 {
+          compatible = "cdns,qspi-nor";
+          #address-cells = <1>;
+          #size-cells = <0>;
+          reg = <0xff705000 0x1000>,
+                <0xffa00000 0x1000>;
+          interrupts = <0 151 4>;
+          clocks = <&qspi_clk>;
+          cdns,fifo-depth = <128>;
+          cdns,fifo-width = <4>;
+          cdns,trigger-address = <0x00000000>;
+
+          flash0: n25q00@0 {
+              compatible = "jedec,spi-nor";
+              reg = <0x0>;
+              cdns,read-delay = <4>;
+              cdns,tshsl-ns = <50>;
+              cdns,tsd2d-ns = <50>;
+              cdns,tchsh-ns = <4>;
+              cdns,tslch-ns = <4>;
+          };
+    };
+
Signature · 1 line
2.11.0
#6 lore raw

Re: [PATCH v10 1/2] dt-bindings: spi: Add schema for Cadence QSPI Controller driver

Quoted 11 lines · Vadivel MuruganX
Quoted 8 lines
Quoted 7 lines
Quoted 6 lines
Quoted 5 lines

+
+  cdns,fifo-depth:
+    $ref: /schemas/types.yaml#/definitions/uint32 +    description:
+      Size of the data FIFO in words.

A 4GB fifo is valid? Add some constraints.

128 is valid, will update.

Nope, the width of this field is 8bits -> 256 bytes

correct me if I am wrong, the width of this field is 4bits -> 128 bytes (based on QUAD mode) .

This has nothing to do with quad-mode. Its about how much SRAM amount of SRAM is present to buffer INDAC mode data. For TI platforms this is 256 bytes.
See CQSPI_REG_SRAMPARTITION definition in your datasheet.

Signature · 2 lines
Regards
Vignesh
#7 lore raw

Re: [PATCH v10 1/2] dt-bindings: spi: Add schema for Cadence QSPI Controller driver

Hi,

Quoted 8 lines · Vignesh Raghavendra
Quoted 6 lines · Vadivel MuruganX
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

+
+  cdns,fifo-depth:
+    $ref: /schemas/types.yaml#/definitions/uint32 +    description:
+      Size of the data FIFO in words.

A 4GB fifo is valid? Add some constraints.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Quoted 1 line

128 is valid, will update.

Nope, the width of this field is 8bits -> 256 bytes

correct me if I am wrong, the width of this field is 4bits -> 128 bytes (based on QUAD mode) .

This has nothing to do with quad-mode. Its about how much SRAM amount of SRAM is present to buffer INDAC mode data. For TI platforms this is 256 bytes.
See CQSPI_REG_SRAMPARTITION definition in your datasheet.

Agreed, Thanks!
Yes , I have gone through it , Intel and Altera SoC's SRAM(act as FIFO)size is 128 bytes and TI has 256 . BTW old legacy DT binding mentioned size is 128, as per your earlier suggestion you have mention that keep the contents from old dt bindings as it is, so shall I keep 128/256?

Regards
Vadivel

#8 lore raw

Re: [PATCH v10 1/2] dt-bindings: spi: Add schema for Cadence QSPI Controller driver

Quoted 19 lines · Vadivel MuruganX

Hi,

Quoted 8 lines · Vignesh Raghavendra
Quoted 6 lines · Vadivel MuruganX
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

+
+  cdns,fifo-depth:
+    $ref: /schemas/types.yaml#/definitions/uint32 +    description:
+      Size of the data FIFO in words.

A 4GB fifo is valid? Add some constraints.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Quoted 1 line

128 is valid, will update.

Nope, the width of this field is 8bits -> 256 bytes

correct me if I am wrong, the width of this field is 4bits -> 128 bytes (based on QUAD mode) .

This has nothing to do with quad-mode. Its about how much SRAM amount of SRAM is present to buffer INDAC mode data. For TI platforms this is 256 bytes.
See CQSPI_REG_SRAMPARTITION definition in your datasheet.

Quoted 6 lines

Agreed, Thanks!
Yes , I have gone through it , Intel and Altera SoC's SRAM(act as FIFO)size is 128 bytes and TI has 256 .
BTW old legacy DT binding mentioned size is 128, as per your earlier suggestion you have mention that
keep the contents from old dt bindings as it is, so shall I keep 128/256?

Old bindings does not impose a restriction that this needs to be 128 bytes always (Its just the example that shows this property to be set to
128)

What Rob is asking for is to add range of values that is valid for this field and not single value. So, both 128 and 256 bytes should be allowed as valid values for this property.

Signature · 2 lines
Regards
Vignesh
#9 lore raw

Re: [PATCH v10 1/2] dt-bindings: spi: Add schema for Cadence QSPI Controller driver

Hi,

Quoted 26 lines · Vignesh Raghavendra
Quoted 18 lines · Vadivel MuruganX

Hi,

Quoted 7 lines · Vignesh Raghavendra
Quoted 6 lines · Vadivel MuruganX
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

+
+  cdns,fifo-depth:
+    $ref: /schemas/types.yaml#/definitions/uint32 +    description:
+      Size of the data FIFO in words.

A 4GB fifo is valid? Add some constraints.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Quoted 1 line

128 is valid, will update.

Nope, the width of this field is 8bits -> 256 bytes

correct me if I am wrong, the width of this field is 4bits -> 128 bytes (based on QUAD mode) .

This has nothing to do with quad-mode. Its about how much SRAM amount of SRAM is present to buffer INDAC mode data. For TI platforms this is 256 bytes.
See CQSPI_REG_SRAMPARTITION definition in your datasheet.

Quoted 6 lines

Agreed, Thanks!
Yes , I have gone through it , Intel and Altera SoC's SRAM(act as FIFO)size is 128 bytes and TI has 256 .
BTW old legacy DT binding mentioned size is 128, as per your earlier suggestion you have mention that
keep the contents from old dt bindings as it is, so shall I keep 128/256?

Quoted 7 lines

Old bindings does not impose a restriction that this needs to be 128 bytes always (Its just the example that shows this property to be set to
128)

What Rob is asking for is to add range of values that is valid for this field and not single value. So, both 128 and 256 bytes should be allowed as valid values for this property.

Thank you Vignesh, will add both.

Regards
Vadivel

Quoted 1 line
#10 lore raw

PATCH v10 2/2 spi: cadence-quadpsi: Add support for the Cadence QSPI controller

In reply to Ramuthevar,Vadivel MuruganX

From: Ramuthevar Vadivel Murugan <vadivel.muruganx.ramuthevar-VuQAYsv1563Yd54FQh9/[email protected]>

Add support for the Cadence QSPI controller. This controller is present in the Intel Lightning Mountain(LGM) SoCs, Altera and TI SoCs. This driver has been tested on the Intel LGM SoCs.

This driver does not support generic SPI and also the implementation only supports spi-mem interface to replace the existing driver in mtd/spi-nor/cadence-quadspi.c, the existing driver only support SPI-NOR flash memory.

---
 drivers/mtd/spi-nor/Kconfig                        |  11 -
 drivers/mtd/spi-nor/Makefile                       |   1 -
 drivers/spi/Kconfig                                |  10 +
 drivers/spi/Makefile                               |   1 +
 .../spi-cadence-quadspi.c}                         | 641 ++++++++++-----------
 5 files changed, 314 insertions(+), 350 deletions(-)
 rename drivers/{mtd/spi-nor/cadence-quadspi.c => spi/spi-cadence-quadspi.c} (73%)
drivers/mtd/spi-nor/Kconfig +0 -11
index c1eda67d1ad2..de1c82c8137c 100644
@@ -34,17 +34,6 @@ config SPI_ASPEED_SMC
 	  and support for the SPI flash memory controller (SPI) for
 	  the host firmware. The implementation only supports SPI NOR.
 
-config SPI_CADENCE_QUADSPI
-	tristate "Cadence Quad SPI controller"
-	depends on OF && (ARM || ARM64 || COMPILE_TEST)
-	help
-	  Enable support for the Cadence Quad SPI Flash controller.
-
-	  Cadence QSPI is a specialized controller for connecting an SPI
-	  Flash over 1/2/4-bit wide bus. Enable this option if you have a
-	  device with a Cadence QSPI controller and want to access the
-	  Flash as an MTD device.
-
 config SPI_HISI_SFC
 	tristate "Hisilicon FMC SPI-NOR Flash Controller(SFC)"
 	depends on ARCH_HISI || COMPILE_TEST
drivers/mtd/spi-nor/Makefile +0 -1
index 9c5ed03cdc19..747e4386273d 100644
@@ -1,7 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_MTD_SPI_NOR)	+= spi-nor.o
 obj-$(CONFIG_SPI_ASPEED_SMC)	+= aspeed-smc.o
-obj-$(CONFIG_SPI_CADENCE_QUADSPI)	+= cadence-quadspi.o
 obj-$(CONFIG_SPI_HISI_SFC)	+= hisi-sfc.o
 obj-$(CONFIG_SPI_MTK_QUADSPI)    += mtk-quadspi.o
 obj-$(CONFIG_SPI_NXP_SPIFI)	+= nxp-spifi.o
drivers/spi/Kconfig +10 -0
index d6ed0c355954..2735569ed2ea 100644
@@ -193,6 +193,16 @@ config SPI_CADENCE
 	  This selects the Cadence SPI controller master driver
 	  used by Xilinx Zynq and ZynqMP.
 
+config SPI_CADENCE_QUADSPI
+	tristate "Cadence Quad SPI controller"
+	depends on OF && (ARM || ARM64 || COMPILE_TEST || X86)
+	help
+	  Enable support for the Cadence Quad SPI Flash controller.
+
+	  Cadence QSPI is a specialized controller for connecting an SPI
+	  Flash over 1/2/4/8-bit wide bus. This enables support for the Octal
+	  and Quad SPI variants of Cadence QSPI IP.
+
 config SPI_CLPS711X
 	tristate "CLPS711X host SPI controller"
 	depends on ARCH_CLPS711X || COMPILE_TEST
drivers/spi/Makefile +1 -0
index 9b65ec5afc5e..a73cf7a7e635 100644
@@ -29,6 +29,7 @@ obj-$(CONFIG_SPI_BCM_QSPI)		+= spi-iproc-qspi.o spi-brcmstb-qspi.o spi-bcm-qspi.
 obj-$(CONFIG_SPI_BITBANG)		+= spi-bitbang.o
 obj-$(CONFIG_SPI_BUTTERFLY)		+= spi-butterfly.o
 obj-$(CONFIG_SPI_CADENCE)		+= spi-cadence.o
+obj-$(CONFIG_SPI_CADENCE_QUADSPI)	+= spi-cadence-quadspi.o
 obj-$(CONFIG_SPI_CLPS711X)		+= spi-clps711x.o
 obj-$(CONFIG_SPI_COLDFIRE_QSPI)		+= spi-coldfire-qspi.o
 obj-$(CONFIG_SPI_DAVINCI)		+= spi-davinci.o
drivers/spi/spi-cadence-quadspi.c renamed from drivers/mtd/spi-nor/cadence-quadspi.c +303 -338

1,151 lines not on this page · raw message

Signature · 1 line
2.11.0
#11 lore raw
In reply to Ramuthevar,Vadivel MuruganX
Quoted 11 lines · Ramuthevar,Vadivel MuruganX

Add support for the Cadence QSPI controller. This controller is present in the Intel Lightning Mountain(LGM) SoCs, Altera and TI SoCs. This driver has been tested on the Intel LGM SoCs.

This driver does not support generic SPI and also the implementation only supports spi-mem interface to replace the existing driver in mtd/spi-nor/cadence-quadspi.c, the existing driver only support SPI-NOR flash memory.

Thanks Mark and Vignesh for the review, suggestion to optimize the patch. Tested with mx25u12835f on LGM platform.

There is a typo in the subject -- it's quadspi , not quadpsi.

#12 lore raw
In reply to Ramuthevar,Vadivel MuruganX

Hi,

On 19/02/20 7:58 am, Ramuthevar,Vadivel MuruganX wrote:
[...]

Quoted 6 lines

CHECK Documentation/devicetree/bindings/spi/cdns,qspi-nor.example.dt.yaml

Ramuthevar Vadivel Murugan (2):
dt-bindings: spi: Add schema for Cadence QSPI Controller driver
spi: cadence-quadpsi: Add support for the Cadence QSPI controller

Quoted 8 lines
 .../devicetree/bindings/spi/cdns,qspi-nor.yaml     | 147 +++++
 drivers/mtd/spi-nor/Kconfig                        |  11 -
 drivers/mtd/spi-nor/Makefile                       |   1 -
 drivers/spi/Kconfig                                |   8 +
 drivers/spi/Makefile                               |   1 +
 .../spi-cadence-quadspi.c}                         | 641 ++++++++++-----------
 6 files changed, 459 insertions(+), 350 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml

You will have to remove old bindings as well. Also please CC linux-mtd list as these patches touch drivers/mtd/*

Just run scripts/get_maintainer.pl on your patches to get list of mailing list and people to CC

Quoted 2 lines
 rename drivers/{mtd/spi-nor/cadence-quadspi.c => spi/spi-cadence-quadspi.c} (73%)
Signature · 2 lines
Regards
Vignesh
#13 lore raw

Hi,

Quoted 18 lines · Vignesh Raghavendra

Hi,

On 19/02/20 7:58 am, Ramuthevar,Vadivel MuruganX wrote:
[...]

Quoted 6 lines

CHECK Documentation/devicetree/bindings/spi/cdns,qspi-nor.example.dt.yaml

Ramuthevar Vadivel Murugan (2):
dt-bindings: spi: Add schema for Cadence QSPI Controller driver
spi: cadence-quadpsi: Add support for the Cadence QSPI controller

Quoted 8 lines
  .../devicetree/bindings/spi/cdns,qspi-nor.yaml     | 147 +++++
  drivers/mtd/spi-nor/Kconfig                        |  11 -
  drivers/mtd/spi-nor/Makefile                       |   1 -
  drivers/spi/Kconfig                                |   8 +
  drivers/spi/Makefile                               |   1 +
  .../spi-cadence-quadspi.c}                         | 641 ++++++++++-----------
  6 files changed, 459 insertions(+), 350 deletions(-)

create mode 100644 Documentation/devicetree/bindings/spi/cdns,qspi-nor.yaml

Quoted 2 lines

You will have to remove old bindings as well. Also please CC linux-mtd list as these patches touch drivers/mtd/*

Sure, will remove old bindings.

Agree!, cc of linux-mtd list.

Quoted 3 lines

Just run scripts/get_maintainer.pl on your patches to get list of mailing list and people to CC

Thanks for the commands.

Regards
Vadivel

Quoted 2 lines
Quoted 2 lines

rename drivers/{mtd/spi-nor/cadence-quadspi.c => spi/spi-cadence-quadspi.c} (73%)