[U-Boot] [PATCH v4 00/20] SPL: extend FIT loading support

Andre Przywara andre.przywara at arm.com
Wed Apr 26 00:32:32 UTC 2017


Another round of smaller fixes for the SPL FIT loading series and the
respective patches to enable this feature on 64-bit Allwinner SoCs.
The README has been changed to address all 64-bit Allwinner boards and
has consequently been renamed to README.sunxi64. Also we can now point
U-Boot to the ARM Trusted Firmware build by specifying the filename in
the BL31 environment variable. If this is not set, we default to look
for bl31.bin in U-Boot's build directory.
The other minor fixes are detailed in the Changelog below.
---

The first five patches introduce the core of the extened SPL FIT loading
support, see below for a description. Patch 6 fixes a Kconfig dependency
to simplify the usage of this option.
Patches 7-10 make some room in the sunxi 64-bit SPL to allow
compiling in the FIT loading bits. Patch 11 and 12 let the SPL choose
the proper DT from the FIT image.
The next two patches add the infrastructure and an actual generator script,
so the FIT image is automatically created at build time.
Patches 14, 15 and 16 enable the SPL FIT support for Allwinner 64-bit SoCs in
general and for the Pine64 and OrangePi PC 2 in particular.
The following two patches store a DT file name in the SPL header, so
U-Boot can easily pick the proper DT when scanning the FIT image.
The idea is that this DT name should stay with the board, ideally on
eMMC or SPI flash. So both U-Boot and a firmware update tool could
identify a board, updating with compatible firmware while keeping the
DT name in place. Ideally a board vendor would once seed this name
onto on-board storage like SPI flash.
I kept those two patches in, as the work on replacing mksunxiboot with
an mkimage extension is not ready yet. Feel free to drop those from
the series if this is a problem.
The penultimate patch updates the Pine64 README file to document the current
way of building U-Boot, which now includes the ARM Trusted Firmware build
in its image.
The last patch moves the maintainership from Hans over to me.

I would be delighted if that series could get merged into the sunxi tree.
This finally enables the fully open source firmware for the 64-bit
Allwinner SoCs (including the ATF binary).

This series is based on current sunxi/master.

Cheers,
Andre.

-------
Currently the FIT format is not used to its full potential in the SPL:
It only loads the first image from the /images node and appends the
proper FDT.
Some boards and platforms would benefit from loading more images before
starting U-Boot proper, notably Allwinner A64 and ARMv8 Rockchip boards,
which use an ARM Trusted Firmware (ATF) image to be executed before U-Boot.

This series tries to solve this in a board agnostic and generic way:
We extend the SPL FIT loading scheme to allow loading multiple images.
So apart from loading the image which is referenced by the "firmware"
property in the respective configuration node and placing the DTB right
behind it, we iterate over all strings in the "loadable" property.
Each image referenced there will be loaded to its specified load address.
The entry point U-Boot eventually branches to will be taken from the
first image to explicitly provide the "entry" property, or, if none
of them does so, from the load address of the "firmware" image.
This keeps the scheme compatible with the FIT images our Makefile creates
automatically at the moment.
Apart from the already mentioned ATF scenario this opens up more usage
scenarios, of which the commit message of patch 04/11 lists some.
The remaining patches prepare ane finally enable this scheme for the 64-bit
Allwinner boards.

Changelog v3 ... v4:
- [01/20]: return proper error codes instead of just -1 (+Simon's RB)
- [02/20]: improve kernel-doc comment (+Simon's RB)
- [03/20]: return proper error codes instead of just -1 (+Simon's RB)
- [04/20]: improve kernel-doc comment and error codes (+Simon's RB)
- [05/20]: add example .its source file (+Simon's RB)
- [10,11,12/20]: add Maxime's Acked-by
- [14/20]: add BL31 environment variable (+Maxime's Acked-by)
- [15/20]: drop unneeded OrangePi PC2 change
- [16/20]: add Maxime's Acked-by
- [19/20]: rewrite to be more generic, rename to README.sunxi64
- [20/20]: new patch to change maintainership

Changelog v2 ... v3:
- new patch 06/19 to improve SPL_FIT Kconfig dependencies
- rename symbol in mksunxiboot (SUNXI_SRAM instead of SUN4I_SRAM)
- enable SPL_LOAD_FIT for all Allwinner A64 and H5 boards in Kconfig
- add only CONFIG_OF_LIST to defconfigs (patch 15/19)

Changelog v1 ... v2:
- Add some function comments to spl_fit.c (patch 1-5)
- Improve error handling in SPL FIT code (patch 1-5)
- Fix bisectability (observing entry-point property)
- add documentation to doc/uImage.FIT/howto.txt
- fix Freescale CCN504 build failure
- (no changes in the last 10 patches)
- update README.pine64 (new last patch)
- add Reviewed-by's from Simon and Lokesh

--
Andre Przywara (19):
  SPL: FIT: refactor FDT loading
  SPL: FIT: rework U-Boot image loading
  SPL: FIT: improve error handling
  SPL: FIT: factor out spl_load_fit_image()
  SPL: FIT: allow loading multiple images
  Kconfig: fix SPL_FIT dependency
  tools: mksunxiboot: allow larger SPL binaries
  armv8: SPL: only compile GIC code if needed
  armv8: fsl: move ccn504 code into FSL Makefile
  sunxi: A64: move SPL stack to end of SRAM A2
  sunxi: SPL: store RAM size in gd
  sunxi: SPL: add FIT config selector for Pine64 boards
  Makefile: add rules to generate SPL FIT images
  sunxi: 64-bit SoCs: introduce FIT generator script
  sunxi: defconfig: add supported DT list for Pine64
  sunxi: enable automatic FIT build for 64-bit SoCs
  sunxi: use SPL header DT name for FIT board matching
  sunxi: update Pine64 README
  sunxi: Move maintainership for Pine64

Siarhei Siamashka (1):
  sunxi: Store the device tree name in the SPL header

 Kconfig                               |  22 ++-
 Makefile                              |  20 +++
 arch/arm/include/asm/arch-sunxi/spl.h |  19 ++-
 arch/arm/lib/Makefile                 |   4 +-
 board/sunxi/Kconfig                   |   4 +
 board/sunxi/MAINTAINERS               |   6 +-
 board/sunxi/README.pine64             |  98 -----------
 board/sunxi/README.sunxi64            | 165 +++++++++++++++++++
 board/sunxi/board.c                   |  36 +++-
 board/sunxi/mksunxi_fit_atf.sh        |  75 +++++++++
 common/spl/spl_fit.c                  | 301 ++++++++++++++++++++++------------
 configs/am335x_evm_defconfig          |   1 -
 configs/evb-rk3399_defconfig          |   1 -
 configs/pine64_plus_defconfig         |   1 +
 doc/uImage.FIT/howto.txt              |  21 +++
 doc/uImage.FIT/multi_spl.its          |  89 ++++++++++
 include/configs/sunxi-common.h        |  17 +-
 scripts/Makefile.spl                  |   3 +-
 tools/mksunxiboot.c                   |  53 +++++-
 19 files changed, 710 insertions(+), 226 deletions(-)
 delete mode 100644 board/sunxi/README.pine64
 create mode 100644 board/sunxi/README.sunxi64
 create mode 100755 board/sunxi/mksunxi_fit_atf.sh
 create mode 100644 doc/uImage.FIT/multi_spl.its

-- 
2.8.2



More information about the U-Boot mailing list