[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGLn_=vG09C49goRkbygZdYch8H1c_kw3p7ar9NGOrgpd0_MiA@mail.gmail.com>
Date: Mon, 1 Jul 2024 14:43:46 +0530
From: Kanak Shilledar <kanakshilledar@...il.com>
To: Conor Dooley <conor@...nel.org>
Cc: kanakshilledar111@...tonmail.com, Serge Semin <fancer.lancer@...il.com>,
Mark Brown <broonie@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
Jisheng Zhang <jszhang@...nel.org>, Guo Ren <guoren@...nel.org>, Fu Wei <wefu@...hat.com>,
Paul Walmsley <paul.walmsley@...ive.com>, Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>, linux-spi@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-riscv@...ts.infradead.org
Subject: Re: [PATCH] arch: riscv: thead: implement basic spi
On Sun, Jun 30, 2024 at 7:22 PM Conor Dooley <conor@...nel.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@...il.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?
> Thanks,
> Conor.
Thanks and Regards,
Kanak Shilledar
Powered by blists - more mailing lists