Skip to content

sunxi: SPI: Add SUN6I generation SPI support

Andre Przywara u-boot 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 Latest0 of 4 patches 0 repliesNew

Patches in v2 No applies recorded yet

None of the 4 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [U-Boot] [linux-sunxi] [PATCH v2 0/4] sunxi: SPI: Add SUN6I generation SPI support
Quoted 32 lines · On Tue, 12 Feb 2019 16:15:22 +0530 Jagan Teki <[email protected]>…
Quoted 31 lines · Andre Przywara

We already have a driver for the SPI devices in older Allwinner CPUs. Newer SoCs (SUN6I generation) have a similar, but improved IP block. This series adds support for that, so we can access the SPI flash that some newer boards come with.
This series gathers some patches that have appeared on the list in one form or another before (hence the v2 tag), but brings them all together and updates them.

The SUN4I/SUN6I SPI devices share a very similar architecure, but differ annoyingly in quite some details, to a point where a shared driver would look unnecessarily complicated. So we use an #ifdef based approach, which keeps the driver simple, at the cost of not being able to access both types of device in one binary build. But since there are no SoCs which feature both types, this is a theoretical disadvantage.

Patch 1/4 moves the clock toggling from the probe/remove to the claim/release-bus stage.
Patch 2/4 adds the SPI gate clocks and reset gates to the clock drivers, also describes at least the enable bit for the SPI mod clock. This is used in patch 3/4, which uses the new DM clock framework in the driver, helping to abstract differences between the SUN4I/SUN6I types.
Patch 4/4 eventually adds support for the new SUN6I generation SPI device. The actual device support is determined at compile time, based on the CONFIG_SUNXI_GEN_SUN6I symbol.

What's left out of this series is the config bits needed to actually activate the support for a board. At the moment this is unnecessarily verbose, so that Oskari is looking at simplifying this at the Kconfig level, which would complement this series.

Quoted 7 lines
Quoted 2 lines

This has been briefly tested on the Pine64-LTS and the OrangePi PC2 board. Please test them if you have other devices with a SUN6I SPI generation.

I have new series for this which I sent two days back [1]. which uses same sun4i driver and implement enum reg set to avoid ifdef.

[1] https://patchwork.ozlabs.org/cover/1039178/

Ah, sorry, I missed that completely. Will have a look at this later on.

Cheers,
Andre.