Skip to contentSkip to conversation

spi: atcspi200: Add support for Andes ATCSPI200 SPI controller

PATCH Superseded CL Wang 3 participants 8 messages Dec 10, 2025 – Dec 12, 2025

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

CL Wang

author maintainer
#0 lore raw

v2 cover spi: atcspi200: Add support for Andes ATCSPI200 SPI controller

Hi all,

This series adds support for the Andes ATCSPI200 SPI controller.

Changes in v2 include:
- Added missing clock disable/unprepare handling in probe error paths.
- Switched to devm_dma_request_chan() for proper DMA channel cleanup.
- Updated the DT binding and documented all compatible strings.
- Dropped the "spi_" prefix from dma-names as suggested.
- Added suspend/resume support for power management.
- Added the "andestech,ae350-spi" compatible string.

AE350 is part of the AndeShape™ platform family and is a commercially supported product with a fixed, documented SoC-level architecture (memory map, interrupt topology, and peripheral integration). Although AE350 is often deployed on FPGA boards, the platform behaves as a stable SoC integration rather than a prototype.

Upstream Linux already accepts FPGA-based platform-level compatible strings for stable SoC-like integrations. For example, the Tensilica FPGA platform uses:
compatible = "cdns,xtfpga-spi";

Following the same rationale, "andestech,ae350-spi" is proposed as the platform-level compatible string for AE350-based devices.

More information about AE350 can be found at:
https://www.andestech.com/en/products-solutions/andeshape-platforms/ae350-axi-based-platform-pre-integrated-with-n25f-nx25f-a25-ax25/

Patch overview:
- Patch 1: Adds the device tree binding documentation.
- Patch 2: Add ATCSPI200 SPI controller driver.
- Patch 3: Add MAINTAINERS entry for the ATCSPI200 SPI controller driver.

Comments and reviews are welcome.
Thanks for your time.

Best regards,
CL

CL Wang (3):
dt-bindings: spi: Add support for ATCSPI200 SPI controller
spi: atcspi200: Add ATCSPI200 SPI controller driver
MAINTAINERS: Add MAINTAINERS entry for the ATCSPI200 SPI controller
driver

 .../bindings/spi/andestech,qilai-spi.yaml     |  86 +++
 MAINTAINERS                                   |   6 +
 drivers/spi/Kconfig                           |   9 +
 drivers/spi/Makefile                          |   1 +
 drivers/spi/spi-atcspi200.c                   | 680 ++++++++++++++++++
 5 files changed, 782 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/spi/andestech,qilai-spi.yaml
 create mode 100644 drivers/spi/spi-atcspi200.c
Signature · 1 line
2.34.1
author maintainer
#1 lore raw

PATCH v2 1/3 dt-bindings: spi: Add support for ATCSPI200 SPI controller

Document devicetree bindings for the Andes ATCSPI200 SPI controller.

- Dropped the "spi_" prefix from dma-names as suggested.
- Updated the DT binding and documented all compatible strings.
- Added the "andestech,ae350-spi" compatible string.

AE350 is part of the AndeShape™ platform family and is a commercially supported product with a fixed, documented SoC-level architecture (memory map, interrupt topology, and peripheral integration). Although AE350 is often deployed on FPGA boards, the platform behaves as a stable SoC integration rather than a prototype.

Upstream Linux already accepts FPGA-based platform-level compatible strings for stable SoC-like integrations. For example, the Tensilica FPGA platform uses:
compatible = "cdns,xtfpga-spi";

Following the same rationale, "andestech,ae350-spi" is proposed as the platform-level compatible string for AE350-based devices.

More information about AE350 can be found at:
https://www.andestech.com/en/products-solutions/andeshape-platforms/ae350-axi-based-platform-pre-integrated-with-n25f-nx25f-a25-ax25/

---
 .../bindings/spi/andestech,qilai-spi.yaml     | 86 +++++++++++++++++++
 1 file changed, 86 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/spi/andestech,qilai-spi.yaml
Documentation/devicetree/bindings/spi/andestech,qilai-spi.yaml new file +86 -0
new file mode 100644
index 000000000000..e58e6d675d70
@@ -0,0 +1,86 @@
+# 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 <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - andestech,qilai-spi
+      - andestech,ae350-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: tx
+      - const: 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 = "tx", "rx";
+
+        flash@0 {
+          compatible = "jedec,spi-nor";
+          reg = <0x0>;
+          spi-tx-bus-width = <0x4>;
+          spi-rx-bus-width = <0x4>;
+          spi-cpol;
+          spi-cpha;
+        };
+      };
+    };
Signature · 1 line
2.34.1
#2 lore raw

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

Quoted 41 lines · CL Wang

Document devicetree bindings for the Andes ATCSPI200 SPI controller.

- Dropped the "spi_" prefix from dma-names as suggested.
- Updated the DT binding and documented all compatible strings.
- Added the "andestech,ae350-spi" compatible string.

AE350 is part of the AndeShape™ platform family and is a commercially supported product with a fixed, documented SoC-level architecture (memory map, interrupt topology, and peripheral integration). Although AE350 is often deployed on FPGA boards, the platform behaves as a stable SoC integration rather than a prototype.

Upstream Linux already accepts FPGA-based platform-level compatible strings for stable SoC-like integrations. For example, the Tensilica FPGA platform uses:
compatible = "cdns,xtfpga-spi";

Following the same rationale, "andestech,ae350-spi" is proposed as the platform-level compatible string for AE350-based devices.

More information about AE350 can be found at:
https://www.andestech.com/en/products-solutions/andeshape-platforms/ae350-axi-based-platform-pre-integrated-with-n25f-nx25f-a25-ax25/

---
 .../bindings/spi/andestech,qilai-spi.yaml     | 86 +++++++++++++++++++
 1 file changed, 86 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/spi/andestech,qilai-spi.yaml
Documentation/devicetree/bindings/spi/andestech,qilai-spi.yaml new file +6 -0
new file mode 100644
index 000000000000..e58e6d675d70
@@ -0,0 +1,86 @@
+# 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#
+

Documentation/devicetree/bindings/spi/andestech,qilai-spi.yaml line 16

Quoted 10 lines
Documentation/devicetree/bindings/spi/andestech,qilai-spi.yaml new file +10 -0
+title: Andes ATCSPI200 SPI controller
+
+maintainers:
+  - CL Wang <[email protected]>
+
+properties:
+  compatible:
+    enum:
+      - andestech,qilai-spi
+      - andestech,ae350-spi

I accept the rationale for adding the ae350 compatible, but given the lack of match data in your driver, you should pick one of these and have it be the fallback for the other. If you pick ae350, rename the file to match (since that'd be the "main" compatible then).

pw-bot: changes-requested

Cheers,
Conor.

author maintainer
#3 lore raw

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

Hi Conor,

Thanks for the review.

Understood regarding the requirement for a proper fallback compatible. For v3, I will:

Use "andestech,qilai-spi" as the primary compatible. Add "andestech,ae350-spi" as the fallback compatible.

Rename the binding file accordingly.
I'll send out v3 soon.

Thanks again for your feedback.

Best regards,
CL

#4 lore raw

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

In reply to CL Wang
Quoted 18 lines · CL Wang

Document devicetree bindings for the Andes ATCSPI200 SPI controller.

- Dropped the "spi_" prefix from dma-names as suggested.
- Updated the DT binding and documented all compatible strings.
- Added the "andestech,ae350-spi" compatible string.

AE350 is part of the AndeShape™ platform family and is a commercially supported product with a fixed, documented SoC-level architecture (memory map, interrupt topology, and peripheral integration). Although AE350 is often deployed on FPGA boards, the platform behaves as a stable SoC integration rather than a prototype.

Upstream Linux already accepts FPGA-based platform-level compatible strings for stable SoC-like integrations. For example, the Tensilica FPGA platform uses:
compatible = "cdns,xtfpga-spi";

Quoted 6 lines

Following the same rationale, "andestech,ae350-spi" is proposed as the platform-level compatible string for AE350-based devices.

More information about AE350 can be found at:
https://www.andestech.com/en/products-solutions/andeshape-platforms/ae350-axi-based-platform-pre-integrated-with-n25f-nx25f-a25-ax25/

That's a completely corrupted changelog.

Please apply your patch and look. Or run checkpatch. Does it look good?

Best regards,
Krzysztof

author maintainer
#5 lore raw

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

Hi Krzysztof,

Thank you for pointing out the mistake. I’ll make sure to properly verify the change log formatting before the next submission. I appreciate your guidance and will follow this practice going forward.

Best regards,
CL Wang

Quoted 8 lines · Krzysztof Kozlowski
Quoted 1 line

That's a completely corrupted changelog.

Please apply your patch and look. Or run checkpatch. Does it look good?

Best regards,
Krzysztof

author maintainer
#6 lore raw

PATCH v2 2/3 spi: atcspi200: Add ATCSPI200 SPI controller driver

In reply to CL Wang

Add driver for the Andes ATCSPI200 SPI controller.

---
Changes for v2:
- Added missing clock disable/unprepare handling in probe error paths.
- Switched to devm_dma_request_chan() for proper DMA channel cleanup.
- Dropped the "spi_" prefix from dma-names as suggested.
- Added suspend/resume support for power management.
- Added the "andestech,ae350-spi" compatible string.

---
 drivers/spi/Kconfig         |   9 +
 drivers/spi/Makefile        |   1 +
 drivers/spi/spi-atcspi200.c | 680 ++++++++++++++++++++++++++++++++++++
 3 files changed, 690 insertions(+)
 create mode 100644 drivers/spi/spi-atcspi200.c
drivers/spi/Kconfig +9 -0
index 5520403896fc..617d3095f2c8 100644
@@ -136,6 +136,15 @@ config SPI_AR934X
 	  This enables support for the SPI controller present on the
 	  Qualcomm Atheros AR934X/QCA95XX SoCs.
 
+config SPI_ATCSPI200
+	tristate "Andes ATCSPI200 SPI controller"
+	depends on ARCH_ANDES
+	help
+	  SPI driver for Andes ATCSPI200 SPI controller.
+	  ATCSPI200 controller supports DMA and PIO modes. When DMA
+	  is not available, the driver automatically falls back to
+	  PIO mode.
+
 config SPI_ATH79
 	tristate "Atheros AR71XX/AR724X/AR913X SPI controller driver"
 	depends on ATH79 || COMPILE_TEST
drivers/spi/Makefile +1 -0
index 863b628ff1ec..96c346144645 100644
@@ -26,6 +26,7 @@ obj-$(CONFIG_SPI_APPLE)			+= spi-apple.o
 obj-$(CONFIG_SPI_AR934X)		+= spi-ar934x.o
 obj-$(CONFIG_SPI_ARMADA_3700)		+= spi-armada-3700.o
 obj-$(CONFIG_SPI_ASPEED_SMC)		+= spi-aspeed-smc.o
+obj-$(CONFIG_SPI_ATCSPI200)		+= spi-atcspi200.o
 obj-$(CONFIG_SPI_ATMEL)			+= spi-atmel.o
 obj-$(CONFIG_SPI_ATMEL_QUADSPI)		+= atmel-quadspi.o
 obj-$(CONFIG_SPI_AT91_USART)		+= spi-at91-usart.o
drivers/spi/spi-atcspi200.c new file +680 -0

680 lines not on this page · raw message

Signature · 1 line
2.34.1
author maintainer
#7 lore raw

PATCH v2 3/3 MAINTAINERS: Add MAINTAINERS entry for the ATCSPI200 SPI controller driver

In reply to CL Wang

MAINTAINERS: Add entry for the Andes ATCSPI200 SPI controller driver

---
Changes for v2:
- Split the MAINTAINERS update into a separate patch.

---
 MAINTAINERS | 6 ++++++
 1 file changed, 6 insertions(+)
MAINTAINERS +6 -0
index 8b39a55b939a..74ded6a79efd 100644
@@ -1804,6 +1804,12 @@ S:	Supported
 F:	drivers/clk/analogbits/*
 F:	include/linux/clk/analogbits*
 
+ANDES ATCSPI200 SPI DRIVER
+M:	CL Wang <[email protected]>
+S:	Supported
+F:	Documentation/devicetree/bindings/spi/andestech,qilai-spi.yaml
+F:	drivers/spi/spi-atcspi200.c
+
 ANDROID DRIVERS
 M:	Greg Kroah-Hartman <[email protected]>
 M:	Arve Hjønnevåg <[email protected]>
Signature · 1 line
2.34.1