Linux SPI subsystem development
 help / color / mirror / Atom feed
* [PATCH v2 0/5] spi: loongson: SPI-IO driver for Loongson-2K0300
@ 2026-11-30  2:32 Binbin Zhou
  2026-11-30  2:33 ` [PATCH v2 1/5] spi: dt-bindings: loongson,ls2k-spi: Document loongson,ls2k0300-spi compatible Binbin Zhou
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Binbin Zhou @ 2026-11-30  2:32 UTC (permalink / raw)
  To: Binbin Zhou, Huacai Chen, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Yinbo Zhu, Mark Brown
  Cc: Huacai Chen, Xuerui Wang, loongarch, devicetree, linux-spi,
	Bingxiong Li, Binbin Zhou

Hi all:

This series adds a new SPI controller driver for the Loongson-2K0300
SPI-IO blocks (SPI2 / SPI3). On the Loongson-2K0300 these blocks reside
in the chip IO address space (0x1610,c000 – 0x1610,ffff) and only
support IO-space access; a separate QSPI controller handles the main
SPI pins on the same SoC, so this driver uses the dedicated
compatible "loongson,ls2k0300-spi-io".

Test results
  SPI NOR flash on SPI2, spi-max-frequency = 28000000:
  DMA:
    read:  ~3.1 MB/s
    write: ~401 kB/s
  Intterupt:
    read:  ~750 KB/s
    write: ~300 kB/s

Thanks.
Binbin

========
V2:
Issues from sashiko.

Patch (2/5):
  - Add Acked-by tag from Conor, thanks.
Patch (3/5):
  - Drop SPI_3WIRE support;
  - Add optimize_message()/prepare_message()/unprepare_message() callbacks;
  - Split transfer_one() into setup_transfer()/transfer_one_irq()/
    transfer_one_dma(), and share the idle restore via reset_state()
    between handle_err() and unprepare_message().
  - Enable the OVR/UDR/CRC/MODF interrupts (new IER_ERR_MASK); in the IRQ
    handler clear the W1C status first and ignore errors while idle.
  - Use DIV64_U64_ROUND_UP() for the timeout math (fixes 32-bit builds) and
    derive max/min_speed_hz from the CFG2_BRINT limits.
  - Request the IRQ without IRQF_SHARED, use a fixed "loongson-spi-io" name,
    and initialize the controller before requesting the IRQ.
Patch (4/5):
  - Tighten can_dma(): require both tx_buf and rx_buf, non-zero length,
    4-byte aligned length and buffers.
  - Return PTR_ERR()/-ENOMEM on dmaengine_prep_slave_sg() failure instead of a
    fixed -EINVAL, so the fallback to interrupt mode is taken correctly.

Link to V1:
https://lore.kernel.org/all/cover.1795425389.git.zhoubinbin@loongson.cn/

Binbin Zhou (5):
  spi: dt-bindings: loongson,ls2k-spi: Document loongson,ls2k0300-spi
    compatible
  spi: dt-bindings: loongson,ls2k-spi: Document loongson,ls2k0300-spi-io
    compatible
  spi: loongson: Add spi-io interrupt-driven driver
  spi: loongson: Add DMA support to SPI-IO driver
  MAINTAINERS: Add myself as Loongson SPI maintainer

 .../bindings/spi/loongson,ls2k-spi.yaml       |   45 +
 MAINTAINERS                                   |    2 +
 drivers/spi/Kconfig                           |   16 +
 drivers/spi/Makefile                          |    1 +
 drivers/spi/spi-loongson-io.c                 | 1206 +++++++++++++++++
 5 files changed, 1270 insertions(+)
 create mode 100644 drivers/spi/spi-loongson-io.c


base-commit: 543bc7b4337302ae75119059bdeff6df8eb34b56
-- 
2.52.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-11-30 17:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30  2:32 [PATCH v2 0/5] spi: loongson: SPI-IO driver for Loongson-2K0300 Binbin Zhou
2026-11-30  2:33 ` [PATCH v2 1/5] spi: dt-bindings: loongson,ls2k-spi: Document loongson,ls2k0300-spi compatible Binbin Zhou
2026-11-30 17:53   ` Conor Dooley
2026-11-30  2:33 ` [PATCH v2 2/5] spi: dt-bindings: loongson,ls2k-spi: Document loongson,ls2k0300-spi-io compatible Binbin Zhou
2026-11-30  2:33 ` [PATCH v2 3/5] spi: loongson: Add spi-io interrupt-driven driver Binbin Zhou
2026-11-30  2:33 ` [PATCH v2 4/5] spi: loongson: Add DMA support to SPI-IO driver Binbin Zhou
2026-11-30  2:33 ` [PATCH v2 5/5] MAINTAINERS: Add myself as Loongson SPI maintainer Binbin Zhou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox