Skip to content

Commit 29c8c00

Browse files
BoughChenbroonie
authored andcommitted
spi: add driver for NXP XSPI controller
Add driver support for NXP XSPI controller. XSPI is a flexible SPI host controller which supports up to 2 external devices (2 CS). It support Single/Dual/Quad/Octal mode data transfer. The difference between XSPI and Flexspi: 1.the register layout is total different. 2.XSPI support multiple independent execution environments (EENVs) for HW virtualization with some limitations. Each EENV has its own interrupt and its own set of programming registers that exists in a specific offset range in the XSPI memory map. The main environment (EENV0) address space contains all of the registers for controlling EENV0 plus all of the general XSPI control and programming registers. The register mnemonics for the user environments (EENV1 to EENV4) have "_SUB_n" appended to the mnemonic for the corresponding main-environment register. Current driver based on EENV0, which means system already give EENV0 right to linux. This driver use SPI memory interface of the SPI framework to issue flash memory operations. Tested this driver with UBIFS and mtd_debug on NXP i.MX943 EVK board which has one spi nor MT35XU512ABA flash. Now this driver has the following key features: - Support up to OCT DDR mode - Support AHB read - Support IP read and IP write - Support two CS Reviewed-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Haibo Chen <haibo.chen@nxp.com> Link: https://patch.msgid.link/20251216-xspi-v7-2-282525220979@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 64ba616 commit 29c8c00

4 files changed

Lines changed: 1397 additions & 0 deletions

File tree

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18953,6 +18953,7 @@ L: linux-spi@vger.kernel.org
1895318953
L: imx@lists.linux.dev
1895418954
S: Maintained
1895518955
F: Documentation/devicetree/bindings/spi/nxp,imx94-xspi.yaml
18956+
F: drivers/spi/spi-nxp-xspi.c
1895618957

1895718958
NXP-NCI NFC DRIVER
1895818959
S: Orphan

drivers/spi/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,16 @@ config SPI_NXP_FLEXSPI
481481
This controller does not support generic SPI messages and only
482482
supports the high-level SPI memory interface.
483483

484+
config SPI_NXP_XSPI
485+
tristate "NXP xSPI controller"
486+
depends on ARCH_MXC || COMPILE_TEST
487+
depends on HAS_IOMEM
488+
help
489+
This enables support for the xSPI controller. Up to two devices
490+
can be connected to one host.
491+
This controller does not support generic SPI messages and only
492+
supports the high-level SPI memory interface.
493+
484494
config SPI_GPIO
485495
tristate "GPIO-based bitbanging SPI Master"
486496
depends on GPIOLIB || COMPILE_TEST

drivers/spi/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ obj-$(CONFIG_SPI_WPCM_FIU) += spi-wpcm-fiu.o
102102
obj-$(CONFIG_SPI_NPCM_FIU) += spi-npcm-fiu.o
103103
obj-$(CONFIG_SPI_NPCM_PSPI) += spi-npcm-pspi.o
104104
obj-$(CONFIG_SPI_NXP_FLEXSPI) += spi-nxp-fspi.o
105+
obj-$(CONFIG_SPI_NXP_XSPI) += spi-nxp-xspi.o
105106
obj-$(CONFIG_SPI_OC_TINY) += spi-oc-tiny.o
106107
spi-octeon-objs := spi-cavium.o spi-cavium-octeon.o
107108
obj-$(CONFIG_SPI_OCTEON) += spi-octeon.o

0 commit comments

Comments
 (0)