mbox series

[v3,0/1] Add basic SPI support on TH1520

Message ID 20240705093503.215787-1-kanakshilledar@gmail.com (mailing list archive)
Headers show
Series Add basic SPI support on TH1520 | expand

Message

Kanak Shilledar July 5, 2024, 9:34 a.m. UTC
Implemented basic SPI support for TH1520 SoC. There are two SPIs reserved
on the LicheePi4A, one on the SPI Flash pads that are blanked out on the
back, and one on the pins. I implemented the one connected to the pad.

It is using a fixed clock of 396MHz. The address and clock frequency was
referenced from the TH1520 System Reference Manual [1].

I have tested this on the LicheePi4A.

[2] Driver Patch discussion
[3] Devicetree binding discussion

Changes made in v3:
- Dropped the driver patch as the generic fallback compatible was
  working properly. [2]
- Removed the devicetree binding patch as it got accepted and is already
  in the linux-next branch. [3]
- Arranged the devicetree aliases alphabetically in the DTS files.

Changes made in v2:
- Changed from single patch file to a patchset by splitting the single
  commit into dt-bindings, driver and the devicetree.

[1] https://openbeagle.org/beaglev-ahead/beaglev-ahead/-/blob/main/docs/TH1520%20System%20User%20Manual.pdf
[2] https://lore.kernel.org/all/20240701121355.262259-4-kanakshilledar@gmail.com/
[3] https://lore.kernel.org/all/20240701121355.262259-3-kanakshilledar@gmail.com/


Kanak Shilledar (1):
  riscv: dts: thead: add basic spi node

 .../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 |  5 +++++
 arch/riscv/boot/dts/thead/th1520.dtsi            | 16 ++++++++++++++++
 4 files changed, 34 insertions(+)


base-commit: 22a40d14b572deb80c0648557f4bd502d7e83826

Comments

Drew Fustini July 26, 2024, 3:52 a.m. UTC | #1
On Fri, Jul 05, 2024 at 03:04:58PM +0530, Kanak Shilledar wrote:
> Implemented basic SPI support for TH1520 SoC. There are two SPIs reserved
> on the LicheePi4A, one on the SPI Flash pads that are blanked out on the
> back, and one on the pins. I implemented the one connected to the pad.
> 
> It is using a fixed clock of 396MHz. The address and clock frequency was
> referenced from the TH1520 System Reference Manual [1].
> 
> [...]

Applied to thead-dt-for-next, thanks!

[1/1] riscv: dts: thead: add basic spi node
      commit: 0f351f8c4f4ee87b729cc366917e67e3eee2d3db

Best regards,
Emil Renner Berthing July 26, 2024, 8:19 a.m. UTC | #2
Drew Fustini wrote:
> On Fri, Jul 05, 2024 at 03:04:58PM +0530, Kanak Shilledar wrote:
> > Implemented basic SPI support for TH1520 SoC. There are two SPIs reserved
> > on the LicheePi4A, one on the SPI Flash pads that are blanked out on the
> > back, and one on the pins. I implemented the one connected to the pad.
> >
> > It is using a fixed clock of 396MHz. The address and clock frequency was
> > referenced from the TH1520 System Reference Manual [1].
> >
> > [...]
>
> Applied to thead-dt-for-next, thanks!

Hi Drew,

Are you sure you want to merge this patch? It adds another dummy clock for the
SPI, but the next kernel should have your clock driver that actually models the
SPI clock.
Also the clock driver says the SPI clock has a frequency of 792MHz, eg. double
of what this dummy clock is set to.

/Emil
Drew Fustini July 26, 2024, 4:05 p.m. UTC | #3
On Fri, Jul 26, 2024 at 04:19:51AM -0400, Emil Renner Berthing wrote:
> Drew Fustini wrote:
> > On Fri, Jul 05, 2024 at 03:04:58PM +0530, Kanak Shilledar wrote:
> > > Implemented basic SPI support for TH1520 SoC. There are two SPIs reserved
> > > on the LicheePi4A, one on the SPI Flash pads that are blanked out on the
> > > back, and one on the pins. I implemented the one connected to the pad.
> > >
> > > It is using a fixed clock of 396MHz. The address and clock frequency was
> > > referenced from the TH1520 System Reference Manual [1].
> > >
> > > [...]
> >
> > Applied to thead-dt-for-next, thanks!
> 
> Hi Drew,
> 
> Are you sure you want to merge this patch? It adds another dummy clock for the
> SPI, but the next kernel should have your clock driver that actually models the
> SPI clock.
> Also the clock driver says the SPI clock has a frequency of 792MHz, eg. double
> of what this dummy clock is set to.
> 
> /Emil

I am planning send updated dts patches for thead,th1520-clk-ap support
that addresses your recent comment [1]. I'll include a patch to convert
the SPI clock similar to the other dts patches in that series. Assuming
there are no issues with that new series, I will apply them to
thead-dt-for-next with enough testing time for them to be included in
the 6.12 pull request to Arnd.

Thanks,
Drew

[1] https://lore.kernel.org/linux-riscv/CAJM55Z8uo-Z_9ruyqygK1pbBCTkCxMBVoF8GD2dajhTKOYrAfA@mail.gmail.com/