From: Kanak Shilledar <kanakshilledar@gmail.com>
To: Conor Dooley <conor@kernel.org>
Cc: kanakshilledar111@protonmail.com,
Serge Semin <fancer.lancer@gmail.com>,
Mark Brown <broonie@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Jisheng Zhang <jszhang@kernel.org>, Guo Ren <guoren@kernel.org>,
Fu Wei <wefu@redhat.com>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
linux-spi@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org
Subject: Re: [PATCH] arch: riscv: thead: implement basic spi
Date: Mon, 1 Jul 2024 15:06:15 +0530 [thread overview]
Message-ID: <CAGLn_=tE91_EEW6tV1aTYJQ7dPSTazjd_tc-t0Q7PJQA2ePYQg@mail.gmail.com> (raw)
In-Reply-To: <20240701-unsnap-unhitched-a84476a719cd@spud>
On Mon, Jul 1, 2024 at 3:03 PM Conor Dooley <conor@kernel.org> wrote:
>
> On Mon, Jul 01, 2024 at 02:43:46PM +0530, Kanak Shilledar wrote:
> > On Sun, Jun 30, 2024 at 7:22 PM Conor Dooley <conor@kernel.org> wrote:
> > >
> > > On Sun, Jun 30, 2024 at 12:08:20PM +0530, Kanak Shilledar wrote:
> > > > implemented basic spi support for TH1520 SoC.
> > > > created a fixed clock and a simple spi0 node.
> > > > updated the matching binding to include thead,th1520-spi as compatible.
> > > > added a spidev device in devicetree which will utilise the spi0 node.
> > > > this is usually reserved for a SPI NOR flash which is left unpopulated
> > > > underneath the carrier board. I performed a SPI self loop test using
> > > > tools/spi/spidev_test.c and tried sending `\xDE\xAD\xBE\xEF` and verified
> > > > it is being received correctly. i updated the of_device_id struct in
> > > > drivers/spi/spi-dw-mmio.c to include "thead,th1520-spi" as the compatible.
> > > > this patch also adds basic spi support on beaglev ahead which shares the
> > > > same TH1520 SoC. i have only tested on LicheePi 4A.
> > > >
> > > > Signed-off-by: Kanak Shilledar <kanakshilledar@gmail.com>
> > > > ---
> > > > .../devicetree/bindings/spi/snps,dw-apb-ssi.yaml | 4 ++++
> > > > .../boot/dts/thead/th1520-beaglev-ahead.dts | 9 +++++++++
> > > > .../boot/dts/thead/th1520-lichee-module-4a.dtsi | 4 ++++
> > > > .../riscv/boot/dts/thead/th1520-lichee-pi-4a.dts | 10 ++++++++++
> > > > arch/riscv/boot/dts/thead/th1520.dtsi | 16 ++++++++++++++++
> > > > drivers/spi/spi-dw-mmio.c | 1 +
> > >
> > > This needs to be 3 different patches - one for the binding, one for the
> > > driver and a final one for the dts files.
> >
> > I will convert this into a patch set of 3 patch as you suggested.
> >
> > > > +
> > > > +&spi0 {
> > > > + status = "okay";
> > > > + spidev@0 {
> > >
> > > "spidev" is not a type of device, the nodename should match the type.
> > >
> > > > + compatible = "rohm,dh2228fv";
> > > > + reg = <0>;
> > > > + spi-max-frequency = <500000>;
> > > > + };
> > > > +};
> > >
> > > I'll put money on you not having a dh2228fv on this board. Document what
> > > you actually have on it please, not what allows you to probe the spidev
> > > driver in linux.
> >
> > Yes, you are right! Actually as per the vendor's kernel it should be a
> > "spi-nor" device from winbond.
> > I changed it to spidev for testing purposes. Shall I just leave it
> > with status = "okay" or add the node for
> > that spi-nor flash?
>
> If it isn't on the board, it shouldn't be in the devicetree. Please add
> the actual device that is here instead. If there's a board with nothing
> connected, then please don't add anything.
Alright got it. The SPI flash pad is left unpopulated on the LicheePi 4A board.
Thus, I will not mention it in the devicetree.
> Thanks,
> Conor.
Thanks and Regards,
Kanak Shilledar
prev parent reply other threads:[~2024-07-01 9:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-30 6:38 [PATCH] arch: riscv: thead: implement basic spi Kanak Shilledar
2024-06-30 13:51 ` Conor Dooley
2024-07-01 9:13 ` Kanak Shilledar
2024-07-01 9:33 ` Conor Dooley
2024-07-01 9:36 ` Kanak Shilledar [this message]
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='CAGLn_=tE91_EEW6tV1aTYJQ7dPSTazjd_tc-t0Q7PJQA2ePYQg@mail.gmail.com' \
--to=kanakshilledar@gmail.com \
--cc=aou@eecs.berkeley.edu \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=conor@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=fancer.lancer@gmail.com \
--cc=guoren@kernel.org \
--cc=jszhang@kernel.org \
--cc=kanakshilledar111@protonmail.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=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=robh@kernel.org \
--cc=wefu@redhat.com \
/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).