[PATCH 1/2] dt-bindings: spi: Add support for ATCSPI200 SPI controller

CL Wang posted 2 patches 2 months, 4 weeks ago
There is a newer version of this series
[PATCH 1/2] dt-bindings: spi: Add support for ATCSPI200 SPI controller
Posted by CL Wang 2 months, 4 weeks ago
Document devicetree bindings for Andes ATCSPI200 SPI controller.

Signed-off-by: CL Wang <cl634@andestech.com>
---
 .../bindings/spi/andestech,qilai-spi.yaml     | 84 +++++++++++++++++++
 MAINTAINERS                                   |  6 ++
 2 files changed, 90 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/spi/andestech,qilai-spi.yaml

diff --git a/Documentation/devicetree/bindings/spi/andestech,qilai-spi.yaml b/Documentation/devicetree/bindings/spi/andestech,qilai-spi.yaml
new file mode 100644
index 000000000000..db065062a2af
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/andestech,qilai-spi.yaml
@@ -0,0 +1,84 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/spi/andestech,qilai-spi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Andes ATCSPI200 SPI controller
+
+maintainers:
+  - CL Wang <cl634@andestech.com>
+
+properties:
+  compatible:
+    const: andestech,qilai-spi
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  num-cs:
+    description: Number of chip selects supported
+    maxItems: 1
+
+  dmas:
+    items:
+      - description: Transmit FIFO DMA channel
+      - description: Receive FIFO DMA channel
+
+  dma-names:
+    items:
+      - const: spi_tx
+      - const: spi_rx
+
+patternProperties:
+  "@[0-9a-f]+$":
+    type: object
+    additionalProperties: true
+
+    properties:
+      spi-rx-bus-width:
+        enum: [1, 4]
+
+      spi-tx-bus-width:
+        enum: [1, 4]
+
+allOf:
+  - $ref: spi-controller.yaml#
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - dmas
+  - dma-names
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    soc {
+      #address-cells = <2>;
+      #size-cells = <2>;
+
+      spi@f0b00000 {
+        compatible = "andestech,qilai-spi";
+        reg = <0x0 0xf0b00000 0x0 0x1000>;
+        #address-cells = <1>;
+        #size-cells = <0>;
+        clocks = <&clk_spi>;
+        dmas = <&dma0 0>, <&dma0 1>;
+        dma-names = "spi_tx", "spi_rx";
+
+        flash@0 {
+          compatible = "jedec,spi-nor";
+          reg = <0x0>;
+          spi-tx-bus-width = <0x4>;
+          spi-rx-bus-width = <0x4>;
+          spi-cpol;
+          spi-cpha;
+        };
+      };
+    };
diff --git a/MAINTAINERS b/MAINTAINERS
index dd99c073a369..55e31996df03 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1803,6 +1803,12 @@ S:	Supported
 F:	drivers/clk/analogbits/*
 F:	include/linux/clk/analogbits*
 
+ANDES ATCSPI200 SPI DRIVER
+M:	CL Wang <cl634@andestech.com>
+S:	Supported
+F:	Documentation/devicetree/bindings/spi/andestech,qilai-spi.yaml
+F:	drivers/spi/spi-atcspi200.c
+
 ANDROID DRIVERS
 M:	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 M:	Arve Hjønnevåg <arve@android.com>
-- 
2.34.1

Re: [PATCH 1/2] dt-bindings: spi: Add support for ATCSPI200 SPI controller
Posted by Conor Dooley 2 months, 4 weeks ago
On Wed, Nov 12, 2025 at 11:47:23AM +0800, CL Wang wrote:
> Document devicetree bindings for Andes ATCSPI200 SPI controller.
> 
> Signed-off-by: CL Wang <cl634@andestech.com>
> ---
>  .../bindings/spi/andestech,qilai-spi.yaml     | 84 +++++++++++++++++++
>  MAINTAINERS                                   |  6 ++
>  2 files changed, 90 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/spi/andestech,qilai-spi.yaml
> 
> diff --git a/Documentation/devicetree/bindings/spi/andestech,qilai-spi.yaml b/Documentation/devicetree/bindings/spi/andestech,qilai-spi.yaml
> new file mode 100644
> index 000000000000..db065062a2af
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/andestech,qilai-spi.yaml
> @@ -0,0 +1,84 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/spi/andestech,qilai-spi.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Andes ATCSPI200 SPI controller

Is this a spi controller or a qspi controller?

> +
> +maintainers:
> +  - CL Wang <cl634@andestech.com>
> +
> +properties:
> +  compatible:
> +    const: andestech,qilai-spi
> +
> +  reg:
> +    maxItems: 1
> +
> +  clocks:
> +    maxItems: 1
> +
> +  num-cs:
> +    description: Number of chip selects supported
> +    maxItems: 1
> +
> +  dmas:
> +    items:
> +      - description: Transmit FIFO DMA channel
> +      - description: Receive FIFO DMA channel
> +
> +  dma-names:
> +    items:
> +      - const: spi_tx
> +      - const: spi_rx

Drop the "spi_", since it's obvious that it belongs to this controller.

> +
> +patternProperties:
> +  "@[0-9a-f]+$":
> +    type: object
> +    additionalProperties: true
> +
> +    properties:
> +      spi-rx-bus-width:
> +        enum: [1, 4]
> +
> +      spi-tx-bus-width:
> +        enum: [1, 4]
> +
> +allOf:
> +  - $ref: spi-controller.yaml#
> +
> +required:
> +  - compatible
> +  - reg
> +  - clocks
> +  - dmas
> +  - dma-names
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    soc {
> +      #address-cells = <2>;
> +      #size-cells = <2>;
> +
> +      spi@f0b00000 {
> +        compatible = "andestech,qilai-spi";
> +        reg = <0x0 0xf0b00000 0x0 0x1000>;
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        clocks = <&clk_spi>;
> +        dmas = <&dma0 0>, <&dma0 1>;
> +        dma-names = "spi_tx", "spi_rx";
> +
> +        flash@0 {
> +          compatible = "jedec,spi-nor";
> +          reg = <0x0>;
> +          spi-tx-bus-width = <0x4>;
> +          spi-rx-bus-width = <0x4>;
> +          spi-cpol;
> +          spi-cpha;
> +        };
> +      };
> +    };
> diff --git a/MAINTAINERS b/MAINTAINERS
> index dd99c073a369..55e31996df03 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -1803,6 +1803,12 @@ S:	Supported
>  F:	drivers/clk/analogbits/*
>  F:	include/linux/clk/analogbits*
>  
> +ANDES ATCSPI200 SPI DRIVER
> +M:	CL Wang <cl634@andestech.com>
> +S:	Supported
> +F:	Documentation/devicetree/bindings/spi/andestech,qilai-spi.yaml

> +F:	drivers/spi/spi-atcspi200.c

This driver does not exist at this point, so you shouldn't be adding it
here.
Cheers,
Conor.

pw-bot: changes-requested
Re: [PATCH 1/2] dt-bindings: spi: Add support for ATCSPI200 SPI controller
Posted by CL Wang 2 months, 3 weeks ago
Hi Conor,

Thanks for your suggestions. Please see my responses below.

> > +title: Andes ATCSPI200 SPI controller
> 
> Is this a spi controller or a qspi controller?
This controller is a standard SPI controller that supports single/dual/quad
modes.

> > +  dma-names:
> > +    items:
> > +      - const: spi_tx
> > +      - const: spi_rx
> 
> Drop the "spi_", since it's obvious that it belongs to this controller.
As you suggested, the spi_ prefix will be removed, since it is clear that
these channels belong to this controller. In the next version, the DMA
channel names will follow common conventions used by other SPI controllers:
dma-names = "tx", "rx";

> > +ANDES ATCSPI200 SPI DRIVER
> > +M:	CL Wang <cl634@andestech.com>
> > +S:	Supported
> > +F:	Documentation/devicetree/bindings/spi/andestech,qilai-spi.yaml
> 
> > +F:	drivers/spi/spi-atcspi200.c
The MAINTAINERS entry will be updated in the next revision so that only the
Devicetree binding file is listed. The driver entry will be added once the
driver patch is introduced.

Thanks again for your review and suggestions.

Best regards,
CL