[U-Boot] [RFC PATCH v2 00/12] Add support for applications of overlays in SPL

Jean-Jacques Hiblot jjhiblot at ti.com
Wed Mar 27 15:38:49 UTC 2019


The purpose of this series is to provide the SPL with ability to apply
overlays for u-boot. this is only a RFC so far, to get a feedback on the
approach.

Our use-case is the support of the daughter boards of the AM65x EVM. In
Linux, each board is supported by a unique overlay. The presence of the
boards is detected at runtime, and some useful features (like USB) are
implemented on those daughter boards. Instead of providing multiple dtbs
and fall in a combinatorial pit, we propose to use DT overlays.

Patch #1 "spl: fit: Add support for applying DT overlay" has been posted
a few weeks ago by Michal Simek.
Patch #2 and #3 amend Michal's patch.
Patch #4 and #5 are simple fixes for the Makefile
Patch #6 is not required but relates to this series and will be required
later by the AM6x platform
Patch #7 may be a bit controversial. It basically replaces u-boot.img with
a symlink to u-boot.itb in case we use a "complex" FIT (ie: if
SPL_FIT_SOURCE or SPL_FIT_GENERATOR are set). This breaks buildman for
several platforms because not all the binaries embedded in the FIT are
available.
Patch #9 adds a way to dynamically select the DT overlays. That is were we
would use HW detection to select the required overlays. In that case, the
board-level code tells what overlay it needs (it gives the name of the
node).
Patch #10 disables advanced SPL FIT features to keep the size of the SPL of
the am335x_evm in check
Patch #11 is not required, but demonstrates on a DRA76-evm how this series
can be used.

On arm, if overlay are supported, this series increases the size of the SPL
by 3-4 kB.

Changes in v2:
- reworked board_fit_get_additionnal_images() and how it used in spl_fit.c
- removed dtbo generation from dtso files and use .dts extension for the
  overlays
- add dynamic allocation usage in a separate patch
- defconfig change for the am335x_evm

Jean-Jacques Hiblot (11):
  spl: fit: Make room in the FDT before applying overlays
  spl: fit: allocate a temporary buffer to load the overlays
  Makefile.lib: include /__symbols__ in dtb if OF_LIBFDT_OVERLAY is
    enabled
  Makefile: Fix tests for CONFIG_SPL_LOAD_FIT and
    CONFIG_SPL_FIT_GENERATOR
  Makefile: Fix u-boot.itb generation when building outside the source
    tree
  Makefile: Pass the board name to the FIT generator scripts
  Makefile: use custom ITS to build u-boot.img if SPL_FIT_SOURCE or
    SPL_FIT_GENERATOR are set
  spl: fit: constify the output parameter of spl_fit_get_image_name()
  spl: fit: Allow the board to tell if more images must be loaded from
    FIT
  configs: am335x_evm: enable SPL_FIT_IMAGE_TINY
  !!! TEMP !!! For demonstration only !!! DRA76: Usage of overlays in
    SPL

Michal Simek (1):
  spl: fit: Add support for applying DT overlay

 Makefile                                      | 27 +++++--
 arch/arm/dts/Makefile                         |  2 +-
 arch/arm/dts/dra76-evm-dummy.dts              | 14 ++++
 arch/arm/dts/dra76-evm-dummy2.dts             | 15 ++++
 arch/arm/mach-imx/mkimage_fit_atf.sh          |  3 +-
 arch/arm/mach-rockchip/make_fit_atf.py        |  5 +-
 board/sunxi/mksunxi_fit_atf.sh                |  2 +
 .../lion_rk3368/fit_spl_atf.its               |  6 +-
 .../puma_rk3399/fit_spl_atf.its               |  8 +-
 board/ti/dra7xx/evm.c                         | 30 +++++++
 board/ti/dra7xx/evm.its                       | 48 +++++++++++
 common/spl/spl_fit.c                          | 81 +++++++++++++++++--
 configs/am335x_evm_defconfig                  |  1 +
 configs/dra7xx_evm_defconfig                  |  2 +
 include/spl.h                                 | 16 ++++
 scripts/Makefile.lib                          |  4 +
 16 files changed, 239 insertions(+), 25 deletions(-)
 create mode 100644 arch/arm/dts/dra76-evm-dummy.dts
 create mode 100644 arch/arm/dts/dra76-evm-dummy2.dts
 create mode 100644 board/ti/dra7xx/evm.its

-- 
2.17.1



More information about the U-Boot mailing list