Unverified Commit 8a3eb50d authored by Mark Brown's avatar Mark Brown
Browse files

Add support for NXP XSPI

Merge series from Haibo Chen <haibo.chen@nxp.com>:

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 is 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 mtd_debug and
UBIFS on NXP i.MX943 EVK board which has one MT35XU512ABA spi nor
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
parents 7f7b350e 29c8c00d
Loading
Loading
Loading
Loading
+88 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/spi/nxp,imx94-xspi.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: NXP External Serial Peripheral Interface (xSPI)

maintainers:
  - Haibo Chen <haibo.chen@nxp.com>
  - Han Xu <han.xu@nxp.com>

properties:
  compatible:
    oneOf:
      - enum:
          - nxp,imx94-xspi

  reg:
    items:
      - description: registers address space
      - description: memory mapped address space

  reg-names:
    items:
      - const: base
      - const: mmap

  interrupts:
    items:
      - description: interrupt for EENV0
      - description: interrupt for EENV1
      - description: interrupt for EENV2
      - description: interrupt for EENV3
      - description: interrupt for EENV4

  clocks:
    items:
      - description: SPI serial clock

  clock-names:
    items:
      - const: per

required:
  - compatible
  - reg
  - reg-names
  - interrupts
  - clocks
  - clock-names

allOf:
  - $ref: spi-controller.yaml#

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>

    soc {
        #address-cells = <2>;
        #size-cells = <2>;

        spi@42b90000 {
            compatible = "nxp,imx94-xspi";
            reg = <0x0 0x42b90000 0x0 0x50000>, <0x0 0x28000000 0x0 0x08000000>;
            reg-names = "base", "mmap";
            interrupts = <GIC_SPI 390 IRQ_TYPE_LEVEL_HIGH>,
                         <GIC_SPI 391 IRQ_TYPE_LEVEL_HIGH>,
                         <GIC_SPI 392 IRQ_TYPE_LEVEL_HIGH>,
                         <GIC_SPI 393 IRQ_TYPE_LEVEL_HIGH>,
                         <GIC_SPI 394 IRQ_TYPE_LEVEL_HIGH>;
            #address-cells = <1>;
            #size-cells = <0>;
            clocks = <&scmi_1>;
            clock-names = "per";

            flash@0 {
                compatible = "jedec,spi-nor";
                reg = <0>;
                spi-max-frequency = <200000000>;
                spi-rx-bus-width = <8>;
                spi-tx-bus-width = <8>;
            };
        };
    };
+9 −0
Original line number Diff line number Diff line
@@ -18946,6 +18946,15 @@ S: Maintained
F:	Documentation/devicetree/bindings/sound/trivial-codec.yaml
F:	sound/soc/codecs/tfa9879*
NXP XSPI DRIVER
M:	Han Xu <han.xu@nxp.com>
M:	Haibo Chen <haibo.chen@nxp.com>
L:	linux-spi@vger.kernel.org
L:	imx@lists.linux.dev
S:	Maintained
F:	Documentation/devicetree/bindings/spi/nxp,imx94-xspi.yaml
F:	drivers/spi/spi-nxp-xspi.c
NXP-NCI NFC DRIVER
S:	Orphan
F:	Documentation/devicetree/bindings/net/nfc/nxp,nci.yaml
+10 −0
Original line number Diff line number Diff line
@@ -481,6 +481,16 @@ config SPI_NXP_FLEXSPI
	  This controller does not support generic SPI messages and only
	  supports the high-level SPI memory interface.

config SPI_NXP_XSPI
        tristate "NXP xSPI controller"
	depends on ARCH_MXC || COMPILE_TEST
	depends on HAS_IOMEM
	help
	  This enables support for the xSPI controller. Up to two devices
	  can be connected to one host.
	  This controller does not support generic SPI messages and only
	  supports the high-level SPI memory interface.

config SPI_GPIO
	tristate "GPIO-based bitbanging SPI Master"
	depends on GPIOLIB || COMPILE_TEST
+1 −0
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ obj-$(CONFIG_SPI_WPCM_FIU) += spi-wpcm-fiu.o
obj-$(CONFIG_SPI_NPCM_FIU)		+= spi-npcm-fiu.o
obj-$(CONFIG_SPI_NPCM_PSPI)		+= spi-npcm-pspi.o
obj-$(CONFIG_SPI_NXP_FLEXSPI)		+= spi-nxp-fspi.o
obj-$(CONFIG_SPI_NXP_XSPI)		+= spi-nxp-xspi.o
obj-$(CONFIG_SPI_OC_TINY)		+= spi-oc-tiny.o
spi-octeon-objs				:= spi-cavium.o spi-cavium-octeon.o
obj-$(CONFIG_SPI_OCTEON)		+= spi-octeon.o
+1385 −0

File added.

Preview size limit exceeded, changes collapsed.