[U-Boot] [PATCH 1/1] arm: sunxi: Allwinner A10 SPI driver

Maxime Ripard maxime.ripard at free-electrons.com
Fri Dec 1 15:59:54 UTC 2017


Hi Stefan,

On Fri, Dec 01, 2017 at 10:27:12AM +0200, Stefan Mavrodiev wrote:
> Add spi driver for sun4i, sun5i and sun7i SoCs. The driver is
> adapted from mailine kernel (currently 4.15.0-rc1).
> 
> Signed-off-by: Stefan Mavrodiev <stefan at olimex.com>
> ---
>  Tested with A20-OLinuXino-Lime2 with W25Q128 chip. The output is:
>  => sspi
> 
>  => sf probe
>  SF: Detected w25q128bv with page size 256 Bytes, erase size 4 KiB, total 16 Mib
> 
>  => sf test 0 1000000
>  SPI flash test:
>  0 erase: 188398 ticks, 86 KiB/s 0.688 Mbps
>  1 check: 141504 ticks, 115 KiB/s 0.920 Mbps
>  2 write: 174697 ticks, 93 KiB/s 0.744 Mbps
>  3 read: 141312 ticks, 115 KiB/s 0.920 Mbps
>  Test passed
>  0 erase: 188398 ticks, 86 KiB/s 0.688 Mbps
>  1 check: 141504 ticks, 115 KiB/s 0.920 Mbps
>  2 write: 174697 ticks, 93 KiB/s 0.744 Mbps
>  3 read: 141312 ticks, 115 KiB/s 0.920 Mbps
> 
>  drivers/spi/Kconfig     |   5 +
>  drivers/spi/Makefile    |   1 +
>  drivers/spi/sun4i_spi.c | 423 ++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 429 insertions(+)
>  create mode 100644 drivers/spi/sun4i_spi.c
> 
> diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
> index 88da9a4..d78253a 100644
> --- a/drivers/spi/Kconfig
> +++ b/drivers/spi/Kconfig
> @@ -132,6 +132,11 @@ config STM32_QSPI
>  	  used to access the SPI NOR flash chips on platforms embedding
>  	  this ST IP core.
>  
> +config SUN4I_SPI
> +	bool "Allwinner A10 SoCs SPI controller"
> +	help
> +	  SPI driver for Allwinner sun4i, sun5i and sun7i SoCs
> +
>  config TEGRA114_SPI
>  	bool "nVidia Tegra114 SPI driver"
>  	help
> diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile
> index ad56203..04ba305 100644
> --- a/drivers/spi/Makefile
> +++ b/drivers/spi/Makefile
> @@ -42,6 +42,7 @@ obj-$(CONFIG_SANDBOX_SPI) += sandbox_spi.o
>  obj-$(CONFIG_SH_SPI) += sh_spi.o
>  obj-$(CONFIG_SH_QSPI) += sh_qspi.o
>  obj-$(CONFIG_STM32_QSPI) += stm32_qspi.o
> +obj-$(CONFIG_SUN4I_SPI) += sun4i_spi.o
>  obj-$(CONFIG_TEGRA114_SPI) += tegra114_spi.o
>  obj-$(CONFIG_TEGRA20_SFLASH) += tegra20_sflash.o
>  obj-$(CONFIG_TEGRA20_SLINK) += tegra20_slink.o
> diff --git a/drivers/spi/sun4i_spi.c b/drivers/spi/sun4i_spi.c
> new file mode 100644
> index 0000000..3ef1c68
> --- /dev/null
> +++ b/drivers/spi/sun4i_spi.c
> @@ -0,0 +1,423 @@
> +/*
> + * (C) Copyright 2017 Whitebox Systems / Northend Systems B.V.
> + * S.J.R. van Schaik <stephan at whiteboxsystems.nl>
> + * M.B.W. Wajer <merlijn at whiteboxsystems.nl>
> + *
> + * (C) Copyright 2017 Olimex Ltd..
> + * Stefan Mavrodiev <stefan at olimex.com>
> + *
> + * SPDX-License-Identifier:	GPL-2.0+

If you indeed based this on the kernel driver, you should keep the
original copyrights holder.

It looks good otherwise, let's see what Jagan thinks about it.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20171201/8d03154e/attachment.sig>


More information about the U-Boot mailing list