[U-Boot] [RFC PATCH 0/4] arm: sunxi: Allwinner SPI driver

S.J.R. van Schaik stephan at whiteboxsystems.nl
Fri Feb 10 15:25:31 UTC 2017


Hi,

The following patches implement a working SPI driver based on driver model for Allwinner (sunxi) devices. We have tested the driver on the A20 OLinuXino LIME 2 (sun7i) with a Winbond w25q128bv chip loading and booting a FIT image from the chip. The sun6i/sun8i/sun9i/sun50i code also builds properly, but still has to be tested on actual devices.

The additional SPI controllers (SPI1, SPI2, SPI3) are not yet supported by this driver because the clock gating code only sets up the clock for SPI0. We are going to implement this in the near future. It might make sense to migrate the clock code to a separate driver or at least to mach-sunxi.

We would like to hear some feedback to further improve these patches for mainline integration.


Yours sincerely,
  Stephan.

S.J.R. van Schaik (4):
  arch-sunxi: added missing AHB_GATE_OFFSET_SPIx defines for sun6i/sun9i
  arch-sunxi: added SPI register definitions for sun4i/sun7i
  arch-sunxi: added SPI register definitions for
    sun6i/sun8i/sun9i/sun50i
  sunxi-spi: added SPI driver for Allwinner devices (sunxi)

 arch/arm/include/asm/arch-sunxi/clock_sun6i.h |   2 +
 arch/arm/include/asm/arch-sunxi/clock_sun9i.h |   4 +
 arch/arm/include/asm/arch-sunxi/spi.h         |  29 +++
 arch/arm/include/asm/arch-sunxi/spi_sun4i.h   |  53 +++++
 arch/arm/include/asm/arch-sunxi/spi_sun6i.h   |  56 +++++
 drivers/spi/Kconfig                           |   5 +
 drivers/spi/Makefile                          |   1 +
 drivers/spi/sunxi_spi.c                       | 329 ++++++++++++++++++++++++++
 8 files changed, 479 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-sunxi/spi.h
 create mode 100644 arch/arm/include/asm/arch-sunxi/spi_sun4i.h
 create mode 100644 arch/arm/include/asm/arch-sunxi/spi_sun6i.h
 create mode 100644 drivers/spi/sunxi_spi.c

-- 
2.11.0



More information about the U-Boot mailing list