devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yao Zi <ziyao@disroot.org>
To: Yixun Lan <dlan@gentoo.org>, Alex Elder <elder@riscstar.com>
Cc: broonie@kernel.org, robh@kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, linux-spi@vger.kernel.org,
	devicetree@vger.kernel.org, paul.walmsley@sifive.com,
	palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr,
	p.zabel@pengutronix.de, spacemit@lists.linux.dev,
	linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] riscv: dts: spacemit: define a SPI controller node
Date: Thu, 18 Sep 2025 14:33:40 +0000	[thread overview]
Message-ID: <aMwYRGjTdbQCJf3S@pie> (raw)
In-Reply-To: <20250918133209-GYB1273705@gentoo.org>

On Thu, Sep 18, 2025 at 09:32:09PM +0800, Yixun Lan wrote:
> Hi Alex,
> 
> On 17:07 Wed 17 Sep     , Alex Elder wrote:
> > Define a node for the fourth SoC SPI controller (number 3) on
> > the SpacemiT K1 SoC.
> > 
> > Enable it on the Banana Pi BPI-F3 board, which exposes this feature
> > via its GPIO block:
> >   GPIO PIN 19:  MOSI
> >   GPIO PIN 21:  MISO
> >   GPIO PIN 23:  SCLK
> >   GPIO PIN 24:  SS (inverted)
> > 
> > Define pincontrol configurations for the pins as used on that board.
> > 
> > (This was tested using a GigaDevice GD25Q64E SPI NOR chip.)
> > 
> > Signed-off-by: Alex Elder <elder@riscstar.com>
> > ---
> >  .../boot/dts/spacemit/k1-bananapi-f3.dts      |  6 ++++++
> >  arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi  | 20 +++++++++++++++++++
> >  arch/riscv/boot/dts/spacemit/k1.dtsi          | 19 ++++++++++++++++++
> >  3 files changed, 45 insertions(+)

...

> > diff --git a/arch/riscv/boot/dts/spacemit/k1.dtsi b/arch/riscv/boot/dts/spacemit/k1.dtsi
> > index 66b33a9110ccd..a826cc1ac83d5 100644
> > --- a/arch/riscv/boot/dts/spacemit/k1.dtsi
> > +++ b/arch/riscv/boot/dts/spacemit/k1.dtsi
> > @@ -834,6 +834,25 @@ storage-bus {
> >  			#size-cells = <2>;
> >  			dma-ranges = <0x0 0x00000000 0x0 0x00000000 0x0 0x80000000>;
> >  
> > +			spi3: spi@d401c000 {
> > +				compatible = "spacemit,k1-spi";
> > +				reg = <0x0 0xd401c000 0x0 0x30>;
> > +				#address-cells = <1>;
> > +				#size-cells = <0>;
> > +				clocks = <&syscon_apbc CLK_SSP3>,
> > +					 <&syscon_apbc CLK_SSP3_BUS>;
> ..
> > +				clock-names = "core",
> > +					      "bus";
> can you simply put them together in one line? it's kind of tedious to split..
> > +				resets = <&syscon_apbc RESET_SSP3>;
> > +				interrupts-extended = <&plic 55>;
> why use interrupts-extended?
> > +				spacemit,k1-ssp-id = <3>;
> > +				dmas = <&pdma 20>,
> > +				       <&pdma 19>;
> .. em, so the SPI will use pdma, then probably you should also adjust Kconfig to
> select PDMA driver?

The driver seems to depend on the generic DMA engine API only, IOW,
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.

Best regards,
Yao Zi

> > +				dma-names = "rx",
> > +					    "tx";
> > +				status = "disabled";
> > +			};
> > +
> >  			emmc: mmc@d4281000 {
> >  				compatible = "spacemit,k1-sdhci";
> >  				reg = <0x0 0xd4281000 0x0 0x200>;
> > -- 
> > 2.48.1
> > 
> > 
> 
> -- 
> Yixun Lan (dlan)
> 

  parent reply	other threads:[~2025-09-18 14:34 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-17 22:07 [PATCH 0/3] spi: support the SpacemiT K1 SPI controller Alex Elder
2025-09-17 22:07 ` [PATCH 1/3] dt-bindings: spi: add SpacemiT K1 SPI support Alex Elder
2025-09-17 23:15   ` Yixun Lan
2025-09-17 23:40     ` Alex Elder
2025-09-18  0:16       ` Yixun Lan
2025-09-18  2:59         ` Alex Elder
2025-09-18  7:43           ` Troy Mitchell
2025-09-18 12:00             ` Alex Elder
2025-09-18 19:57       ` Rob Herring
2025-09-18 20:02         ` Alex Elder
2025-10-06  8:10   ` Krzysztof Kozlowski
2025-09-17 22:07 ` [PATCH 2/3] spi: spacemit: introduce SpacemiT K1 SPI controller driver Alex Elder
2025-09-18  7:47   ` Troy Mitchell
2025-09-18 12:00     ` Alex Elder
2025-09-18 12:41   ` Yixun Lan
2025-09-18 13:45     ` Alex Elder
2025-09-18 14:39       ` Yixun Lan
2025-09-18 14:47         ` Alex Elder
2025-09-18 14:56           ` Yixun Lan
2025-09-18 15:44         ` Alex Elder
2025-09-18 15:58         ` Alex Elder
2025-09-18 16:22         ` Alex Elder
2025-09-17 22:07 ` [PATCH 3/3] riscv: dts: spacemit: define a SPI controller node Alex Elder
2025-09-18 13:32   ` Yixun Lan
2025-09-18 13:51     ` Alex Elder
2025-09-18 14:06       ` Yixun Lan
2025-09-18 14:20         ` Alex Elder
2025-09-18 15:04           ` Yixun Lan
2025-09-18 14:33     ` Yao Zi [this message]
2025-09-18 16:22       ` Alex Elder
2025-09-19 15:25         ` Alex Elder

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=aMwYRGjTdbQCJf3S@pie \
    --to=ziyao@disroot.org \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlan@gentoo.org \
    --cc=elder@riscstar.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=robh@kernel.org \
    --cc=spacemit@lists.linux.dev \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).