[U-Boot] [PATCH v2 0/4] sunxi: SPI: Add SUN6I generation SPI support

Andre Przywara andre.przywara at arm.com
Tue Feb 12 10:41:10 UTC 2019


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.

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.

Cheers,
Andre.

Jagan Teki (2):
  clk: sunxi: Implement SPI gates clocks and reset
  spi: sunxi: Add CLK support to Allwinner SPI driver

Oskari Lemmela (2):
  spi: sunxi: Enable and disable SPI clock on bus claim/release
  spi: sunxi: Support newer SoCs

 drivers/clk/sunxi/clk_a10.c  |   9 +++
 drivers/clk/sunxi/clk_a10s.c |   7 ++
 drivers/clk/sunxi/clk_a23.c  |   7 ++
 drivers/clk/sunxi/clk_a31.c  |  13 ++++
 drivers/clk/sunxi/clk_a64.c  |   7 ++
 drivers/clk/sunxi/clk_a80.c  |  15 ++++
 drivers/clk/sunxi/clk_a83t.c |   7 ++
 drivers/clk/sunxi/clk_h3.c   |   7 ++
 drivers/clk/sunxi/clk_h6.c   |   6 ++
 drivers/clk/sunxi/clk_r40.c  |  13 ++++
 drivers/clk/sunxi/clk_v3s.c  |   4 +
 drivers/spi/Kconfig          |   4 +-
 drivers/spi/sun4i_spi.c      | 177 +++++++++++++++++++++++++++++++++++++------
 13 files changed, 252 insertions(+), 24 deletions(-)

-- 
2.14.5



More information about the U-Boot mailing list