lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAGLn_=tE91_EEW6tV1aTYJQ7dPSTazjd_tc-t0Q7PJQA2ePYQg@mail.gmail.com>
Date: Mon, 1 Jul 2024 15:06:15 +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 Mon, Jul 1, 2024 at 3:03 PM Conor Dooley <conor@...nel.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@...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?
>
> 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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ