spi: cadence: Add xSPI controller driver support
v2 cover spi: cadence: Add xSPI controller driver support
This patch introduces initial support for the Cadence xSPI controller in U-Boot.
The driver is ported from the Linux kernel implementation and supports three operating modes: ACMD, STIG, and Direct. Currently, only the STIG mode is enabled. The driver has been functionally verified on the Intel Simics platform and is intended for evaluation and experimental use at this stage.
---
Changes in v2:
- Squashed the Kconfig and Makefile enablement patch into the main driver commit, as requested by the maintainer.
- No functional or behavioral changes to the driver.
Boon Khai Ng (1):
spi: cadence: Add driver for xSPI
drivers/spi/Kconfig | 15 ++ drivers/spi/Makefile | 1 + drivers/spi/cadence_xspi.c | 449 +++++++++++++++++++++++++++++++++++++ drivers/spi/cadence_xspi.h | 226 +++++++++++++++++++ 4 files changed, 691 insertions(+) create mode 100644 drivers/spi/cadence_xspi.c create mode 100644 drivers/spi/cadence_xspi.h
Signature · 1 line
2.43.7
PATCH v2 1/1 spi: cadence: Add driver for xSPI
This patch ports the Cadence xSPI controller driver from the Linux kernel. The controller supports three operating modes:
1. ACMD (Auto Command) mode
- Includes PIO and CDMA submodes.
- CDMA mode uses linked descriptors for high-performance, low-overhead operation.
- PIO mode is suitable for simple, single-command transactions.
2. STIG (Software Triggered Instruction Generator) mode
- Issues low-level 128-bit instructions to memory.
- Uses the Slave DMA interface for data transfers.
3. Direct mode
- Enables direct data access through the slave interface without commands.
Currently, only the STIG work mode is enabled. Additional modes will be supported in future updates.
At the same time, also enabling the kconfig option for xSPI driver.
This driver has been ported and functionally verified on the Intel Simics platform. It is intended for evaluation and experimental use at this stage.
--- drivers/spi/Kconfig | 15 ++ drivers/spi/Makefile | 1 + drivers/spi/cadence_xspi.c | 449 +++++++++++++++++++++++++++++++++++++ drivers/spi/cadence_xspi.h | 226 +++++++++++++++++++ 4 files changed, 691 insertions(+) create mode 100644 drivers/spi/cadence_xspi.c create mode 100644 drivers/spi/cadence_xspi.h
drivers/spi/Kconfig +15 -0
@@ -162,6 +162,21 @@ config CADENCE_OSPI_VERSAL This option is used to enable Versal OSPI DMA operations which are used for ospi flash read using cadence qspi controller. +config CADENCE_XSPI + bool "Cadence XSPI driver (Experimental feature)" + help + Important: this feature is experimental so far and tested only + on simulated environment. + + Enable the Cadence eXpanded Serial Periheral Interface (xSPI) flash + driver. This driver can be used to access the SPI NOR flash on + platforms embedding this Cadence IP core up to 8 bit wide bus. + xSPI flash controller IP offers three work mode, Auto Command (ACMD) + work mode, Software Triggered Instruction Generator (STIG) work mode + and Direct work mode. This flash controller able to coomunicate + with Flash Memory Devices supporting JESD216 and JESD251 stadards + by using the Auto Command work mode. + config CF_SPI bool "ColdFire SPI driver" help
drivers/spi/Makefile +1 -0
@@ -8,6 +8,7 @@ ifdef CONFIG_$(SPL_TPL_)DM_SPI obj-y += spi-uclass.o obj-$(CONFIG_CADENCE_QSPI) += cadence_qspi.o cadence_qspi_apb.o obj-$(CONFIG_CADENCE_OSPI_VERSAL) += cadence_ospi_versal.o +obj-$(CONFIG_CADENCE_XSPI) += cadence_xspi.o obj-$(CONFIG_SANDBOX) += spi-emul-uclass.o obj-$(CONFIG_SOFT_SPI) += soft_spi.o obj-$(CONFIG_SPI_ASPEED_SMC) += spi-aspeed-smc.o
drivers/spi/cadence_xspi.c new file +449 -0
449 lines not on this page · raw message
drivers/spi/cadence_xspi.h new file +226 -0
226 lines not on this page · raw message
Signature · 1 line
2.43.7
Re: [PATCH v2 1/1] spi: cadence: Add driver for xSPI
Quoted 36 lines · Boon Khai Ng
This patch ports the Cadence xSPI controller driver from the Linux kernel. The controller supports three operating modes:
1. ACMD (Auto Command) mode
- Includes PIO and CDMA submodes.
- CDMA mode uses linked descriptors for high-performance, low-overhead operation.
- PIO mode is suitable for simple, single-command transactions.2. STIG (Software Triggered Instruction Generator) mode
- Issues low-level 128-bit instructions to memory.
- Uses the Slave DMA interface for data transfers.3. Direct mode
- Enables direct data access through the slave interface without commands.Currently, only the STIG work mode is enabled. Additional modes will be supported in future updates.
At the same time, also enabling the kconfig option for xSPI driver.
This driver has been ported and functionally verified on the Intel Simics platform. It is intended for evaluation and experimental use at this stage.
Signed-off-by Boon Khai Ng <[email protected]>--- drivers/spi/Kconfig | 15 ++ drivers/spi/Makefile | 1 + drivers/spi/cadence_xspi.c | 449 +++++++++++++++++++++++++++++++++++++ drivers/spi/cadence_xspi.h | 226 +++++++++++++++++++ 4 files changed, 691 insertions(+)create mode 100644
drivers/spi/cadence_xspi.c
create mode 100644drivers/spi/cadence_xspi.h
[...]
Best regards,
Tien Fong