From: Binbin Zhou <zhoubinbin@loongson.cn>
To: Binbin Zhou <zhoubb.aaron@gmail.com>,
Huacai Chen <chenhuacai@loongson.cn>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Yinbo Zhu <zhuyinbo@loongson.cn>, Mark Brown <broonie@kernel.org>
Cc: Huacai Chen <chenhuacai@kernel.org>,
Xuerui Wang <kernel@xen0n.name>,
loongarch@lists.linux.dev, devicetree@vger.kernel.org,
linux-spi@vger.kernel.org, Bingxiong Li <libingxiong@loongson.cn>,
Binbin Zhou <zhoubinbin@loongson.cn>
Subject: [PATCH v2 0/5] spi: loongson: SPI-IO driver for Loongson-2K0300
Date: Mon, 30 Nov 2026 10:32:59 +0800 [thread overview]
Message-ID: <cover.1796005812.git.zhoubinbin@loongson.cn> (raw)
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
next reply other threads:[~2026-11-30 2:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 2:32 Binbin Zhou [this message]
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-12-01 2:57 ` Binbin Zhou
2026-12-01 18:23 ` 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:48 ` sashiko-bot
2026-11-30 2:33 ` [PATCH v2 4/5] spi: loongson: Add DMA support to SPI-IO driver Binbin Zhou
2026-11-30 2:53 ` sashiko-bot
2026-11-30 2:33 ` [PATCH v2 5/5] MAINTAINERS: Add myself as Loongson SPI maintainer Binbin Zhou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1796005812.git.zhoubinbin@loongson.cn \
--to=zhoubinbin@loongson.cn \
--cc=broonie@kernel.org \
--cc=chenhuacai@kernel.org \
--cc=chenhuacai@loongson.cn \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=kernel@xen0n.name \
--cc=krzk+dt@kernel.org \
--cc=libingxiong@loongson.cn \
--cc=linux-spi@vger.kernel.org \
--cc=loongarch@lists.linux.dev \
--cc=robh@kernel.org \
--cc=zhoubb.aaron@gmail.com \
--cc=zhuyinbo@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.