Re: [PATCH 3/3] riscv: dts: spacemit: define a SPI controller node
From: Alex Elder
Date: Fri Sep 19 2025 - 11:25:28 EST
On 9/18/25 11:22 AM, Alex Elder wrote:
On 9/18/25 9:33 AM, Yao Zi wrote:
.. em, so the SPI will use pdma, then probably you should also adjust Kconfig toThe driver seems to depend on the generic DMA engine API only, IOW,
select PDMA driver?
theoretically it should work with other DMA controller as well. And it's
even capable to operate without DMA (see k1_spi_dma_setup()).
Dependency to PDMA really doesn't seem something should be enforced in
Kconfig: it doesn't exist in code level, and the driver is actually more
flexible.
You're right on both points. The code doesn't *require* PDMA to
operate correctly (to my knowledge).
Yixun, what do you think?
-Alex
I did some experiments. Currently, if I build a kernel with
SPI_SPACEMIT_K1 enabled (module or built-in) but MMP_PDMA
not set, the K1 SPI driver probe doesn't complete. The reason
is that dma_request_chan() returns -EPROBE_DEFER, not "knowing"
that the needed driver will never show up.
For now I have added a call to IS_ENABLED(CONFIG_MMP_PDMA) in
devm_k1_spi_dma_setup(), and if it's not enabled it will
return 0 (to indicate "all is well, but we won't use DMA").
That doesn't allow for a different DMA option, but it does
allow the driver to work without an explicit dependency
on the MMP_PDMA (via Kconfig).
-Alex