Skip to content

spi: support the SpacemiT K1 SPI controller

Alex Elder linux-devicetree linux-riscv linux-spi lkml spacemit 8 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v7 Latest3 patches 2 repliesIn review
  2. v63 patches 5 repliesSuperseded
  3. v53 patches 0 repliesSuperseded
Earlier versions · 5
VersionPostedPatchesRepliesStatus
v4 posting 2/23 patches1 replySuperseded
v4 posting 1/22 of 3 patches1 replySuperseded
v33 patches12 repliesSuperseded
v23 patches11 repliesSuperseded
v13 patches27 repliesSuperseded

Patches in v7 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3dt-bindings: spi: add SpacemiT K1 SPI supportDocumentation/devicetree/bindings/spi/spacemit,k1-spi.yaml+84 -00 replies
2/3spi: spacemit: introduce SpacemiT K1 SPI controller driverdrivers/spi/Kconfig drivers/spi/Makefile drivers/spi/spi-spacemit-k1.c+976 -02 replies
3/3riscv: dts: spacemit: define a SPI controller nodearch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi arch/riscv/boot/dts/spacemit/k1.dtsi+42 -00 replies

Reviews trailers per patch

2 of 3 patches have a Reviewed-by or Acked-by.

PatchConor DooleyTroy MitchellRob Herring (Arm)Yixun Lan
1/3A-b A-b R-b
2/3
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v7 thread

Cover letter [PATCH v7 0/3] spi: support the SpacemiT K1 SPI controller

This series adds support for the SPI controller found in the SpacemiT K1 SoC. The driver currently supports only master mode. The controller has two 32-entry FIFOs and supports PIO and DMA for transfers.

Version 7 fixes two bugs, and now builds the driver as a kernel module by default.

(Note, this is a distinct series from the QSPI driver, which was merged recently.)

-Alex

This series is available here:
https://github.com/riscstar/linux/tree/outgoing/spi-v7

Between version 6 and version 7:
- DIV_ROUND_UP_ULL() is now used when setting the speed, to address two errors reported by the Intel kernel test robot on 32-bit builds
- Fixed a bug interpreting the resource pointer in k1_spi_dma_cleanup()
- The driver is now built as a module by default, if ARCH_SPACEMIT is defined

Here is version 6 of this series:
https://lore.kernel.org/lkml/[email protected]/

Between version 5 and version 6:
- Rebase only

Here is version 5 of this series:
https://lore.kernel.org/lkml/[email protected]/

Between version 4 and version 5:
- Added Yixun's Reviewed-by tag on patch 3

Here is version 4 of this series:
https://lore.kernel.org/lkml/[email protected]/

Between version 3 and version 4 (all suggested by Yixun):
- Fixed an underrun/overrun comment error
- Renamed a pinctrl node
- Formatted dmas and dma-names properties on one line

Here is version 3 of this series:
https://lore.kernel.org/lkml/[email protected]/

Between version 2 and version 3:
- Add Conor's Acked-by to patch 1
- Add Rob's Reviewed-by to patch 1
- Added imply_PDMA to the SPI_SPACEMIT_K1 Kconfig option
- Fixed a bug pointed out by Vivian (and Troy) in word-sized reads
- Added a comment stating we use 1, 2, or 4 bytes per word
- Cleaned up DMA channels properly in case of failure setting up
- No longer use devm_*() for allocating DMA channels or buffer
- Moved the SPI controller into the dma-bus memory region

Here is version 2 of this series:
https://lore.kernel.org/lkml/[email protected]/

Between version 1 and version 2:
- Use enum rather than const for the binding compatible string
- Omit the label and status property in the binding example
- The spi-spacemit-k1.o make target is now added in sorted order
- The SPI_SPACEMIT_K1 config option is added in sorted order
- The SPI_SPACEMIT_K1 config does *not* depend on MMP_PDMA, however MMP_PDMA is checked at runtime, and if not enabled, DMA will not be used
- Read/modify/writes of registers no longer use an additional "virt" variable to hold the address accessed
- The k1_spi_driver_data->ioaddr field has been renamed base
- The DMA address for the base address is maintained, rather than saving the DMA address of the data register
- The spi-max-frequency property value is now bounds checked
- A local variable is now initialized to 0 in k1_spi_write_word()
- The driver name is now "k1-spi"
- DT aliases are used rather than spacemit,k1-ssp-id for bus number
- The order of two pin control properties was changed as requested
- Clock names and DMA names are now on one line in the "k1.dtsi"
- The interrupts property is used rather than interrupts-extended
- The order of two pin control properties was changed as requested
- Clock names and DMA names are now on one line in the "k1.dtsi"
- The interrupts property is used rather than interrupts-extended

Here is version 1 of this series:
https://lore.kernel.org/lkml/[email protected]/

Alex Elder (3):
dt-bindings: spi: add SpacemiT K1 SPI support
spi: spacemit: introduce SpacemiT K1 SPI controller driver
riscv: dts: spacemit: define a SPI controller node

 .../bindings/spi/spacemit,k1-spi.yaml         |  84 ++
 .../boot/dts/spacemit/k1-bananapi-f3.dts      |   7 +
 arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi  |  20 +
 arch/riscv/boot/dts/spacemit/k1.dtsi          |  15 +
 drivers/spi/Kconfig                           |   9 +
 drivers/spi/Makefile                          |   1 +
 drivers/spi/spi-spacemit-k1.c                 | 966 ++++++++++++++++++
 7 files changed, 1102 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/spi/spacemit,k1-spi.yaml
 create mode 100644 drivers/spi/spi-spacemit-k1.c

base-commit: 0f2995693867bfb26197b117cd55624ddc57582f

Signature · 1 line
2.48.1