[PATCH 0/4] mach-sunxi: sunxi SPI-NAND-SPL
Benedikt-Alexander Mokroß
u-boot at bamkrs.de
Wed May 13 14:25:41 CEST 2020
This patch-series enables u-boot to be booted from SPI-NAND
memory on sunxi SoCs. Development was done and tested on a sun8i V3s.
To accomplish this, the changes where split in 4 different
patches. The following list describes the patches, their
title, their message ID and contain their commit-message.
1) mach-sunxi: Refactor sunxi SPI-SPL
2b893c4d-6657-364e-6d17-18903cda6cf0 at bamkrs.de
The core functions to use the SPI are shared between
nor and nand. However, the logic on how to load data is
entirely different. Therefore it should be clever to
split, core, NOR and NAND in their respective files.
Further, SPI-NAND boot isn’t that popular (for good reasons)
and only very few sunxi SoCs are capable of doing so.
Most of the time only one is used and the other would unnecessary
bloat the (very limited) SPL. Thus it would be much more
readable and maintainable if those are split in multiple files and
distinct functions instead of a lot of #ifdef or similar.
This patch splits the sunxi SPI-SPL in its two components:
- SUNXI-SPI-Handling (spl_spi_sunxi.c)
- SPI-NOR with SPI-NOR-SPL-Logic (spl_spi_sunxi_nor.c)
For this, the SPL got moved in its own subdirectory.
This prepares the SPL to support more then just SPI-NOR.
2) mach-sunxi: V3s SPI-SPL
e25a756f-384f-16e4-180a-0ed95ddcc192 at bamkrs.de
The Kconfig files were missing the V3s entirely for SPI booting.
This patch adds support for the Allwinner V3s
to SPL_SPI_SUNXI (nothing changed code-wise, only Kconfig).
3) mach-sunxi: Configurable SPI clockdivider in SPL
4a692eb1-6019-bd1f-592c-3e3c8fceb036 at bamkrs.de
U-Boot uses a fixed clock divider for the SPI to mimic the
BROM. However, most of the time its perfectly fine to use a
higher clock rate to speed up the boot process.
This patch adds a configurable spi clockdivider.
In the original version, the divider is set to /4 to mimic
the BROMs behaviour. However, in many cases this can be
changed to /2 or no divider at all to speed up the booting
process.
4) mach-sunxi: Add SPI-NAND SPL-Support
2274fef3-d5b0-59c9-60c2-ae4c0965c381 at bamkrs.de
In the last patch, the actual SPI-NAND-SPL is added.
This patch uses the refactored sunxi SPI-SPL driver from the previous
patches of this series to add support for SPL booting from SPI-NAND.
SPI-NAND-Boot is supported by, at least, the V3s.
---
arch/arm/mach-sunxi/Kconfig | 2 +
arch/arm/mach-sunxi/Makefile | 3 +-
arch/arm/mach-sunxi/Kconfig | 2 +-
arch/arm/mach-sunxi/spl/Makefile | 9 +
arch/arm/mach-sunxi/spl/spi/Kconfig | 63 +++
arch/arm/mach-sunxi/spl/spi/Makefile | 16 +
arch/arm/mach-sunxi/spl/spi/spl_spi_sunxi.c | 159 ++++++++
arch/arm/mach-sunxi/spl/spi/spl_spi_sunxi.h | 112 ++++++
.../mach-sunxi/spl/spi/spl_spi_sunxi_nor.c | 138 +++++++
.../mach-sunxi/spl/spi/spl_spi_sunxi_nand.c | 497 ++++++++++++++++++
arch/arm/mach-sunxi/spl_spi_sunxi.c | 356 ------------------
11 files changed, 982 insertions(+), 361 deletions(-)
create mode 100644 arch/arm/mach-sunxi/spl/Makefile
create mode 100644 arch/arm/mach-sunxi/spl/spi/Kconfig
create mode 100644 arch/arm/mach-sunxi/spl/spi/Makefile
create mode 100644 arch/arm/mach-sunxi/spl/spi/spl_spi_sunxi.c
create mode 100644 arch/arm/mach-sunxi/spl/spi/spl_spi_sunxi.h
create mode 100644 arch/arm/mach-sunxi/spl/spi/spl_spi_sunxi_nor.c
create mode 100644 arch/arm/mach-sunxi/spl/spi/spl_spi_sunxi_nand.c
delete mode 100644 arch/arm/mach-sunxi/spl_spi_sunxi.c
More information about the U-Boot
mailing list