Add support for applications of overlays in SPL
Subsystems (6)
v2 cover Add support for applications of overlays in SPL
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
Signature · 1 line
2.17.1
RFC PATCH v2 1/12 spl: fit: Add support for applying DT overlay
From: Michal Simek <[email protected]>
doc/uImage.FIT/overlay-fdt-boot.txt is describing how to create FIT image with DT overlays in it.
Add support for this feature to SPL.
Here is the ZynqMP fragment where dtb points to full DT and dtbo is overlay which should be applied on the top of dtb.
config {
description = "ATF with full u-boot overlay";
firmware = "atf";
loadables = "uboot";
fdt = "dtb", "dtbo";
};The whole feature depends on OF_LIBFDT_OVERLAY which is adding +4kB code and 0 for platforms which are not enabling this feature.
---
Changes in v2: None
common/spl/spl_fit.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-)
common/spl/spl_fit.c +25 -2
@@ -278,10 +278,10 @@ static int spl_fit_append_fdt(struct spl_image_info *spl_image, void *fit, int images, ulong base_offset) { struct spl_image_info image_info; -int node, ret; +int node, ret, index =0 ;/* Figure out which device tree the board wants to use */ - node =spl_fit_get_image_node (fit, images,FIT_FDT_PROP ,0 ); + node =spl_fit_get_image_node (fit, images,FIT_FDT_PROP , index++);if (node <0 ) {debug ("%s: cannot find FDT node\n" , __func__);return node;
@@ -303,8 +303,31 @@ static int spl_fit_append_fdt(struct spl_image_info *spl_image,#if !CONFIG_IS_ENABLED (FIT_IMAGE_TINY )/* Try to make space, so we can inject details on the loadables */ ret =fdt_shrink_to_minimum (spl_image->fdt_addr,8192 ); +if (ret <0 ) +return ret;#endif +#if defined(CONFIG_OF_LIBFDT_OVERLAY ) +for (; ; index++) { + node =spl_fit_get_image_node (fit, images,FIT_FDT_PROP , index); +if (node <0 ) { +debug ("%s: No additional FDT node\n" , __func__); +return 0 ; + } + ret =spl_load_fit_image (info, sector, fit, base_offset, node, + &image_info); +if (ret <0 ) +return ret; + + ret =fdt_overlay_apply_verbose (spl_image->fdt_addr, + (void *)image_info.load_addr); +if (ret) +return ret; + +debug ("%s: DT overlay %s applied\n" , __func__, +fit_get_name (fit, node,NULL )); + } +#endif return ret; }
Signature · 1 line
2.17.1
RFC PATCH v2 2/12 spl: fit: Make room in the FDT before applying overlays
In reply to Jean-Jacques HiblotMake room in the FDT before applying the overlay, otherwise it may fail if the overlay is big. As the exact added size is not known in advance, just add the size of the overlay.
Move after the end of the application of the overlays, the resize of the FDT for the injection of the details on the loadables.
---
Changes in v2: None
common/spl/spl_fit.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
common/spl/spl_fit.c +11 -5
@@ -301,11 +301,6 @@ static int spl_fit_append_fdt(struct spl_image_info *spl_image,/* Make the load-address of the FDT available for the SPL framework */ spl_image->fdt_addr = (void *)image_info.load_addr; #if !CONFIG_IS_ENABLED(FIT_IMAGE_TINY) -/* Try to make space, so we can inject details on the loadables */ - ret =fdt_shrink_to_minimum (spl_image->fdt_addr,8192 ); -if (ret <0 ) -return ret; -#endif #if defined(CONFIG_OF_LIBFDT_OVERLAY) for (; ; index++) { node = spl_fit_get_image_node(fit, images, FIT_FDT_PROP, index);
@@ -319,6 +314,11 @@ static int spl_fit_append_fdt(struct spl_image_info *spl_image,if (ret <0 )return ret; +/* Make room in FDT for changes coming from the overlay */ + ret =fdt_increase_size (spl_image->fdt_addr, image_info.size); +if (ret <0 ) +return ret; + ret =fdt_overlay_apply_verbose (spl_image->fdt_addr, (void *)image_info.load_addr);if (ret)
@@ -328,6 +328,12 @@ static int spl_fit_append_fdt(struct spl_image_info *spl_image, fit_get_name(fit, node, NULL)); }#endif +/* Try to make space, so we can inject details on the loadables */ + ret =fdt_shrink_to_minimum (spl_image->fdt_addr,8192 ); +if (ret <0 ) +return ret; +#endif +return ret; }
Signature · 1 line
2.17.1
RFC PATCH v2 3/12 spl: fit: allocate a temporary buffer to load the overlays
In reply to Jean-Jacques HiblotIf the node describing an overlay does not specify a load address, it will be loaded at the address previously used.
Fixing it by allocating a temporary 64kB region that will be used as a default load address.
---
Changes in v2: None
common/spl/spl_fit.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
common/spl/spl_fit.c +14 -0
@@ -9,6 +9,7 @@#include <fpga.h> #include <image.h> #include <linux/libfdt.h> +#include <malloc.h> #include <spl.h> #ifndef CONFIG_SYS_BOOTM_LEN
@@ -302,6 +303,16 @@ static int spl_fit_append_fdt(struct spl_image_info *spl_image, spl_image->fdt_addr = (void *)image_info.load_addr; #if !CONFIG_IS_ENABLED(FIT_IMAGE_TINY) #if defined(CONFIG_OF_LIBFDT_OVERLAY) + void *tmpbuffer; + /* + * allocate 64kB of memory. This will be used to store the DT overlay + * before it is applied. It may not be used depending on how the + * overlay is stored. + */ + tmpbuffer = malloc(64 * 1024); + if (!tmpbuffer) + debug("%s: unable to allocate space for overlays\n", __func__); + for (; ; index++) { node = spl_fit_get_image_node(fit, images, FIT_FDT_PROP, index); if (node < 0) {
@@ -309,6 +320,7 @@ static int spl_fit_append_fdt(struct spl_image_info *spl_image,return 0 ; } + image_info.load_addr = (ulong ) tmpbuffer; ret =spl_load_fit_image (info, sector, fit, base_offset, node, &image_info);if (ret <0 )
@@ -327,6 +339,8 @@ static int spl_fit_append_fdt(struct spl_image_info *spl_image,debug ("%s: DT overlay %s applied\n" , __func__, fit_get_name(fit, node, NULL)); } +if (tmpbuffer) +free (tmpbuffer);#endif /* Try to make space, so we can inject details on the loadables */ ret =fdt_shrink_to_minimum (spl_image->fdt_addr,8192 );
Signature · 1 line
2.17.1
RFC PATCH v2 4/12 Makefile.lib: include /__symbols__ in dtb if OF_LIBFDT_OVERLAY is enabled
In reply to Jean-Jacques HiblotIn order to apply an overlay to a DTB. The DTB must have been generated with the option '-@'.
---
Changes in v2: None
scripts/Makefile.lib | 4 ++++ 1 file changed, 4 insertions(+)
scripts/Makefile.lib +4 -0
@@ -292,6 +292,10 @@ cmd_dt_S_dtb= \ $(obj)/%.dtb.S: $(obj)/%.dtb $(call cmd,dt_S_dtb) +ifeq ($(CONFIG_OF_LIBFDT_OVERLAY),y) +DTC_FLAGS += -@ +endif + quiet_cmd_dtc = DTC $@ # Modified for U-Boot # Bring in any U-Boot-specific include at the end of the file
Signature · 1 line
2.17.1
RFC PATCH v2 5/12 Makefile: Fix tests for CONFIG_SPL_LOAD_FIT and CONFIG_SPL_FIT_GENERATOR
In reply to Jean-Jacques HiblotThe current tests do to handle well the cases where those variables are not defined. When CONFIG_SPL_LOAD_FIT is not defined, U_BOOT_ITS gets defined as an empty string.
Fixing it by using intermediate variables with the quotes removed
---
Changes in v2: None
Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
Makefile +7 -4
@@ -1148,12 +1148,15 @@ ifndef CONFIG_SYS_UBOOT_START CONFIG_SYS_UBOOT_START := 0 endif + # Boards with more complex image requirments can provide an .its source file # or a generator script -ifneq ($(CONFIG_SPL_FIT_SOURCE),"") -U_BOOT_ITS = $(subst ",,$(CONFIG_SPL_FIT_SOURCE)) +SPL_FIT_SOURCE := $(subst ",,$(CONFIG_SPL_FIT_SOURCE)) +SPL_FIT_GENERATOR := $(subst ",,$(CONFIG_SPL_FIT_GENERATOR)) +ifneq ($(SPL_FIT_SOURCE),) +U_BOOT_ITS = $(SPL_FIT_SOURCE) else -ifneq ($(CONFIG_SPL_FIT_GENERATOR),"") +ifneq ($(SPL_FIT_GENERATOR),) U_BOOT_ITS := u-boot.its ifeq ($(CONFIG_SPL_FIT_GENERATOR),"arch/arm/mach-imx/mkimage_fit_atf.sh") U_BOOT_ITS_DEPS += u-boot-nodtb.bin
@@ -1162,7 +1165,7 @@ ifeq ($(CONFIG_SPL_FIT_GENERATOR),"arch/arm/mach-rockchip/make_fit_atf.py") U_BOOT_ITS_DEPS += u-boot endif $(U_BOOT_ITS): $(U_BOOT_ITS_DEPS) FORCE - $(srctree)/$(CONFIG_SPL_FIT_GENERATOR) \ + $(srctree)/$(SPL_FIT_GENERATOR) \ $(patsubst %,arch/$(ARCH)/dts/%.dtb,$(subst ",,$(CONFIG_OF_LIST))) > $@ endif endif
Signature · 1 line
2.17.1
RFC PATCH v2 6/12 Makefile: Fix u-boot.itb generation when building outside the source tree
In reply to Jean-Jacques HiblotInclude the object tree and the source tree in the search path of the FIT compîler (dtc). This allows to use paths relative to the root of the source or object trees in the ITS instead of working backward from the actual location of the ITS.
It also allows to use a build directory different of the source directory.
---
Changes in v2: None
Makefile | 5 +++-- board/theobroma-systems/lion_rk3368/fit_spl_atf.its | 6 +++--- board/theobroma-systems/puma_rk3399/fit_spl_atf.its | 8 ++++---- 3 files changed, 10 insertions(+), 9 deletions(-)
Makefile +3 -2
@@ -893,7 +893,8 @@ cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \ >$(MKIMAGEOUTPUT) $(if $(KBUILD_VERBOSE:0=), && cat $(MKIMAGEOUTPUT)) quiet_cmd_mkfitimage = MKIMAGE $@ -cmd_mkfitimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -f $(U_BOOT_ITS) -p $(CONFIG_FIT_EXTERNAL_OFFSET) $@\ +cmd_mkfitimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -D "-i $(obj) -i $(src)"\ + -f $(U_BOOT_ITS) $@ -p $(CONFIG_FIT_EXTERNAL_OFFSET)\ >$(MKIMAGEOUTPUT) $(if $(KBUILD_VERBOSE:0=), && cat $(MKIMAGEOUTPUT)) quiet_cmd_cat = CAT $@
@@ -1154,7 +1155,7 @@ endif SPL_FIT_SOURCE := $(subst ",,$(CONFIG_SPL_FIT_SOURCE)) SPL_FIT_GENERATOR := $(subst ",,$(CONFIG_SPL_FIT_GENERATOR)) ifneq ($(SPL_FIT_SOURCE),) -U_BOOT_ITS = $(SPL_FIT_SOURCE) +U_BOOT_ITS = $(src)/$(SPL_FIT_SOURCE) else ifneq ($(SPL_FIT_GENERATOR),) U_BOOT_ITS := u-boot.its
board/theobroma-systems/lion_rk3368/fit_spl_atf.its +3 -3
@@ -14,7 +14,7 @@ images { uboot { description = "U-Boot (64-bit)"; - data = /incbin/("../../../u-boot-nodtb.bin"); + data = /incbin/("u-boot-nodtb.bin"); type = "standalone"; os = "U-Boot"; arch = "arm64";
@@ -23,7 +23,7 @@ }; atf { description = "ARM Trusted Firmware"; - data = /incbin/("../../../bl31-rk3368.bin"); + data = /incbin/("bl31-rk3368.bin"); type = "firmware"; os = "arm-trusted-firmware"; arch = "arm64";
@@ -34,7 +34,7 @@ fdt { description = "RK3368-uQ7 (Lion) flat device-tree"; - data = /incbin/("../../../u-boot.dtb"); + data = /incbin/("u-boot.dtb"); type = "flat_dt"; compression = "none"; };
board/theobroma-systems/puma_rk3399/fit_spl_atf.its +4 -4
@@ -14,7 +14,7 @@ images { uboot { description = "U-Boot (64-bit)"; - data = /incbin/("../../../u-boot-nodtb.bin"); + data = /incbin/("u-boot-nodtb.bin"); type = "standalone"; os = "U-Boot"; arch = "arm64";
@@ -23,7 +23,7 @@ }; atf { description = "ARM Trusted Firmware"; - data = /incbin/("../../../bl31-rk3399.bin"); + data = /incbin/("bl31-rk3399.bin"); type = "firmware"; arch = "arm64"; os = "arm-trusted-firmware";
@@ -33,14 +33,14 @@ }; pmu { description = "Cortex-M0 firmware"; - data = /incbin/("../../../rk3399m0.bin"); + data = /incbin/("rk3399m0.bin"); type = "pmu-firmware"; compression = "none"; load = <0x180000>; }; fdt { description = "RK3399-Q7 (Puma) flat device-tree"; - data = /incbin/("../../../u-boot.dtb"); + data = /incbin/("u-boot.dtb"); type = "flat_dt"; compression = "none"; };
Signature · 1 line
2.17.1
RFC PATCH v2 7/12 Makefile: Pass the board name to the FIT generator scripts
In reply to Jean-Jacques HiblotCurrently the FIT generator scripts are passed only a list of dtbs. However some platforms may also require information about the board itself.
---
Changes in v2: None
Makefile | 2 +- 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 ++ 4 files changed, 8 insertions(+), 4 deletions(-)
Makefile +1 -1
@@ -1166,7 +1166,7 @@ ifeq ($(CONFIG_SPL_FIT_GENERATOR),"arch/arm/mach-rockchip/make_fit_atf.py") U_BOOT_ITS_DEPS += u-boot endif $(U_BOOT_ITS): $(U_BOOT_ITS_DEPS) FORCE - $(srctree)/$(SPL_FIT_GENERATOR) \ + $(srctree)/$(SPL_FIT_GENERATOR) $(BOARD) \ $(patsubst %,arch/$(ARCH)/dts/%.dtb,$(subst ",,$(CONFIG_OF_LIST))) > $@ endif endif
arch/arm/mach-imx/mkimage_fit_atf.sh +2 -1
@@ -4,7 +4,7 @@ # script to generate FIT image source for i.MX8MQ boards with # ARM Trusted Firmware and multiple device trees (given on the command line) # -# usage: $0 <dt_name> [<dt_name> [<dt_name] ...] +# usage: $0 <board> <dt_name> [<dt_name> [<dt_name] ...] [ -z "$BL31" ] && BL31="bl31.bin" [ -z "$TEE_LOAD_ADDR" ] && TEE_LOAD_ADDR="0xfe000000"
@@ -39,6 +39,7 @@ else ls -lct u-boot-nodtb.bin | awk '{print $5}' >&2 fi +shift for dtname in $* do echo "$dtname size: " >&2
arch/arm/mach-rockchip/make_fit_atf.py +3 -2
@@ -4,7 +4,7 @@ A script to generate FIT image source for rockchip boards with ARM Trusted Firmware and multiple device trees (given on the command line) -usage: $0 <dt_name> [<dt_name> [<dt_name] ...] +usage: $0 <board> <dt_name> [<dt_name> [<dt_name] ...] """ import os
@@ -209,7 +209,8 @@ def main(): print(__doc__) sys.exit(2) - dtbs = args + board = args[0] + dtbs = args[1:] #get_bl31_segments_info("u-boot") #get_bl31_segments_info("bl31.elf")
board/sunxi/mksunxi_fit_atf.sh +2 -0
@@ -46,6 +46,8 @@ cat << __HEADER_EOF }; __HEADER_EOF +shift + cnt=1 for dtname in $* do
Signature · 1 line
2.17.1
RFC PATCH v2 8/12 Makefile: use custom ITS to build u-boot.img if SPL_FIT_SOURCE or SPL_FIT_GENERATOR are set
In reply to Jean-Jacques HiblotIf SPL_FIT_SOURCE or SPL_FIT_GENERATOR are set, then the default output image should be built using the provided/generated ITS, not using the default template implemented by mkimage.
In that case, make u-boot.img a symbolic link to u-boot.itb
---
Changes in v2: None
Makefile | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
Makefile +12 -1
@@ -888,6 +888,9 @@ cmd_efipayload = $(OBJCOPY) -I binary -O $(EFIPAYLOAD_BFDTARGET) -B $(EFIPAYLOAD MKIMAGEOUTPUT ?= /dev/null +quiet_cmd_ln = LN $@ -> $< +cmd_ln = ln -f -s $< $@ + quiet_cmd_mkimage = MKIMAGE $@ cmd_mkimage = $(objtree)/tools/mkimage $(MKIMAGEFLAGS_$(@F)) -d $< $@ \ >$(MKIMAGEOUTPUT) $(if $(KBUILD_VERBOSE:0=), && cat $(MKIMAGEOUTPUT))
@@ -1199,7 +1202,7 @@ MKIMAGEFLAGS_u-boot-spl.kwb = -n $(srctree)/$(CONFIG_SYS_KWD_CONFIG:"%"=%) \ MKIMAGEFLAGS_u-boot.pbl = -n $(srctree)/$(CONFIG_SYS_FSL_PBL_RCW:"%"=%) \ -R $(srctree)/$(CONFIG_SYS_FSL_PBL_PBI:"%"=%) -T pblimage -u-boot-dtb.img u-boot.img u-boot.kwb u-boot.pbl u-boot-ivt.img: \ +u-boot-dtb.img u-boot.kwb u-boot.pbl u-boot-ivt.img: \ $(if $(CONFIG_SPL_LOAD_FIT),u-boot-nodtb.bin dts/dt.dtb,u-boot.bin) FORCE $(call if_changed,mkimage) $(BOARD_SIZE_CHECK)
@@ -1210,10 +1213,18 @@ else MKIMAGEFLAGS_u-boot.itb = -E endif +ifndef U_BOOT_ITS +u-boot.img: $(if $(CONFIG_SPL_LOAD_FIT),u-boot-nodtb.bin dts/dt.dtb,u-boot.bin) FORCE + $(call if_changed,mkimage) +else u-boot.itb: u-boot-nodtb.bin dts/dt.dtb $(U_BOOT_ITS) FORCE $(call if_changed,mkfitimage) $(BOARD_SIZE_CHECK) +u-boot.img: u-boot.itb + $(call if_changed,ln) +endif + u-boot-spl.kwb: u-boot.img spl/u-boot-spl.bin FORCE $(call if_changed,mkimage)
Signature · 1 line
2.17.1
RFC PATCH v2 9/12 spl: fit: constify the output parameter of spl_fit_get_image_name()
In reply to Jean-Jacques HiblotThere is no need for it to be non-constant. Making it constant, allows to return constant string without warning.
---
Changes in v2: None
common/spl/spl_fit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
common/spl/spl_fit.c +3 -3
@@ -39,7 +39,7 @@ __weak ulong board_spl_fit_size_align(ulong size)*/ static int spl_fit_get_image_name (const void *fit,int images,const char *type,int index, -char **outname) +const char **outname) {const char *name, *str;__maybe_unused int node;
@@ -94,7 +94,7 @@ static int spl_fit_get_image_name(const void *fit, int images,static int spl_fit_get_image_node (const void *fit,int images,const char *type,int index) { -char *str; +const char *str;int err;int node;
@@ -356,7 +356,7 @@ static int spl_fit_record_loadable(const void *fit, int images, int index, {int ret =0 ;#if !CONFIG_IS_ENABLED (FIT_IMAGE_TINY ) -char *name; +const char *name;int node; ret = spl_fit_get_image_name(fit, images, "loadables",
Signature · 1 line
2.17.1
RFC PATCH v2 10/12 spl: fit: Allow the board to tell if more images must be loaded from FIT
In reply to Jean-Jacques Hiblotspl_fit_get_image_name() is used to get the names of the images that the SPL must load from the FIT. It relies on the content of a property present in the FIT. The list of images is thus statically defined in the FIT. With this scheme, it becomes quickly hard to manage combinations of more than a hand few of images.
To address this problem, give the board-level code the opportunity to add to the list of images. The images from the FIT property are loaded first, and then the board_fit_get_additionnal_images() is called to get more image names.
---
Changes in v2: None
common/spl/spl_fit.c | 28 +++++++++++++++++++++++++--- include/spl.h | 16 ++++++++++++++++ 2 files changed, 41 insertions(+), 3 deletions(-)
common/spl/spl_fit.c +25 -3
@@ -25,6 +25,12 @@ __weak ulong board_spl_fit_size_align(ulong size)return size; } +__weak const char *board_fit_get_additionnal_images (int index, +const char *type) +{ +return NULL ; +} +/** * spl_fit_get_image_name(): By using the matching configuration subnode, * retrieve the name of an image, specified by a property name and an index
@@ -45,6 +51,7 @@ static int spl_fit_get_image_name(const void *fit, int images,__maybe_unused int node;int conf_node;int len, i; +bool found = true; conf_node =fit_find_config_node (fit);if (conf_node <0 ) {
@@ -70,12 +77,27 @@ static int spl_fit_get_image_name(const void *fit, int images,for (i =0 ; i < index; i++) { str =strchr (str,'\0' ) +1 ;if (!str || (str - name >= len)) { -debug ("no string for index %d\n" , index); -return -E2BIG ; + found = false; +break ; } } - *outname = (char *)str; +if (!found) { +/* +* no string in the property for this index. Check if the board +* level code can supply one. +*/ + str =board_fit_get_additionnal_images (index - i -1 , type); +if (str) + found = true; + } + +if (!found) { +debug ("no string for index %d\n" , index); +return -E2BIG ; + } + + *outname = str;return 0 ; }
include/spl.h +16 -0
@@ -370,6 +370,22 @@ void board_spl_fit_post_load(ulong load_addr, size_t length);*/ ulong board_spl_fit_size_align (ulong size); +/** +* board_fit_get_additionnal_images - Get additional image names from board- +* level code. +* This function can be used to provide the image names based on runtime +* detection. A classic use-case would when DTBOs are used to describe +* additionnal daughter cards. +* +* @param index Index of the image. Starts at 0 and gets incremented after each +* call to this function. +* @param type The type of image. For example, "fdt" for DTBs +* +* @return The name of the node describing the image. NULL indicates that +* there no more images to get from this function. +*/ +const char *board_fit_get_additionnal_images (int index,const char *type); +/** * spl_perform_fixups() - arch/board-specific callback before processing * the boot-payload
Signature · 1 line
2.17.1
RFC PATCH v2 11/12 configs: am335x_evm: enable SPL_FIT_IMAGE_TINY
In reply to Jean-Jacques HiblotThe size of the SPL for the am335x_evm is constrained. There is no need to have advanced SPL FIT features, so keep the SPL FIT support tiny.
---
Changes in v2: None
configs/am335x_evm_defconfig | 1 + 1 file changed, 1 insertion(+)
configs/am335x_evm_defconfig +1 -0
@@ -10,6 +10,7 @@ CONFIG_BOOTCOMMAND="if test ${boot_fit} -eq 1; then run update_to_fit; fi; run f CONFIG_SYS_CONSOLE_INFO_QUIET=y CONFIG_VERSION_VARIABLE=y CONFIG_ARCH_MISC_INIT=y +CONFIG_SPL_FIT_IMAGE_TINY=y # CONFIG_SPL_FS_EXT4 is not set CONFIG_SPL_MTD_SUPPORT=y CONFIG_SPL_MUSB_NEW_SUPPORT=y
Signature · 1 line
2.17.1
RFC PATCH v2 12/12 !!! TEMP !!! For demonstration only !!! DRA76: Usage of overlays in SPL
In reply to Jean-Jacques HiblotThis is an example of how to apply overlays in SPL for the DRA76
---
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
arch/arm/dts/Makefile | 2 +- arch/arm/dts/dra76-evm-dummy.dts | 14 +++++++++ arch/arm/dts/dra76-evm-dummy2.dts | 15 ++++++++++ board/ti/dra7xx/evm.c | 30 +++++++++++++++++++ board/ti/dra7xx/evm.its | 48 +++++++++++++++++++++++++++++++ configs/dra7xx_evm_defconfig | 2 ++ 6 files changed, 110 insertions(+), 1 deletion(-) 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
arch/arm/dts/Makefile +1 -1
@@ -276,7 +276,7 @@ dtb-$(CONFIG_ARCH_SOCFPGA) += \ socfpga_stratix10_socdk.dtb dtb-$(CONFIG_TARGET_DRA7XX_EVM) += dra72-evm.dtb dra7-evm.dtb \ - dra72-evm-revc.dtb dra71-evm.dtb dra76-evm.dtb + dra72-evm-revc.dtb dra71-evm.dtb dra76-evm.dtb dra76-evm-dummy.dtbo dra76-evm-dummy2.dtbo dtb-$(CONFIG_TARGET_AM57XX_EVM) += am57xx-beagle-x15.dtb \ am57xx-beagle-x15-revb1.dtb \ am57xx-beagle-x15-revc.dtb \
arch/arm/dts/dra76-evm-dummy.dts new file +14 -0
@@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com/ + */ + +/dts-v1/; +/plugin/; + + +&mmc1 { + dummy_node { + dummy_val = "this is only in overlay 1"; + }; +};
arch/arm/dts/dra76-evm-dummy2.dts new file +15 -0
@@ -0,0 +1,15 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2019 Texas Instruments Incorporated - http://www.ti.com/ + */ + +/dts-v1/; +/plugin/; + + +&mmc2 { + dummy_node { + dummy_val = "this is only in overlay 2"; + }; + +};
board/ti/dra7xx/evm.c +30 -0
@@ -704,6 +704,14 @@ int board_late_init(void)if (device_okay ("/ocp/omap_dwc3_2 at 488c0000" ))enable_usb_clocks (1 );#endif +char preboot_cmd[255 ]; + +sprintf (preboot_cmd,"fdt addr %p;\ +fdt print /ocp/mmc at 480b4000/dummy_node;\ +fdt print /ocp/mmc at 4809c000/dummy_node;" , + gd->fdt_blob); + +env_set ("preboot" , preboot_cmd);return 0 ; }
@@ -1069,6 +1077,28 @@ int ft_board_setup(void *blob, bd_t *bd)#endif #ifdef CONFIG_SPL_LOAD_FIT +#define MAX_DAUGHTER_BOARDS 2 +const bool detected[MAX_DAUGHTER_BOARDS ] = {false, true}; +const char *dtbo_nodes[] = {"dra76-evm-dummy" ,"dra76-evm-dummy2" }; + +const char *board_fit_get_additionnal_images (int index,const char *type) +{ +int i, j; + +if (strcmp (type,FIT_FDT_PROP )) +return NULL ; + + j =0 ; +for (i =0 ; i <MAX_DAUGHTER_BOARDS ; i++) { +if (detected[i]) { +if (j == index) +return dtbo_nodes[i]; + j++; + } + } +return NULL ; +} +int board_fit_config_name_match (const char *name) {if (is_dra72x ()) {
board/ti/dra7xx/evm.its new file +48 -0
48 lines not on this page · raw message
configs/dra7xx_evm_defconfig +2 -0
@@ -12,10 +12,12 @@ CONFIG_AHCI=y CONFIG_DISTRO_DEFAULTS=y CONFIG_NR_DRAM_BANKS=2 CONFIG_SPL_LOAD_FIT=y +CONFIG_SPL_FIT_SOURCE="board/ti/dra7xx/evm.its" CONFIG_OF_BOARD_SETUP=y CONFIG_USE_BOOTARGS=y CONFIG_BOOTARGS="androidboot.serialno=${serial#} console=ttyS0,115200 androidboot.console=ttyS0 androidboot.hardware=jacinto6evmboard" # CONFIG_USE_BOOTCOMMAND is not set +CONFIG_USE_PREBOOT=y CONFIG_SYS_CONSOLE_INFO_QUIET=y # CONFIG_MISC_INIT_R is not set CONFIG_VERSION_VARIABLE=y
Signature · 1 line
2.17.1
v2 cover Add support for applications of overlays in SPL
In reply to Jean-Jacques HiblotQuoted 34 lines · Jean-Jacques Hiblot
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 theMakefile
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: ifSPL_FIT_SOURCEorSPL_FIT_GENERATORare 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 theam335x_evmin 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.
Quoted 6 lines
Changes in v2:
- reworkedboard_fit_get_additionnal_images()and how it used inspl_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 theam335x_evm
This series looks better.
Is this able to also handle different images then just dtbs?
Thanks,
Michal
v2 cover Add support for applications of overlays in SPL
Hi Michal,
Quoted 34 lines · Michal Simek
Quoted 33 lines · Jean-Jacques Hiblot
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 theMakefile
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: ifSPL_FIT_SOURCEorSPL_FIT_GENERATORare 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 theam335x_evmin 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.
Quoted 8 lines
Quoted 6 lines
Changes in v2:
- reworkedboard_fit_get_additionnal_images()and how it used inspl_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 theam335x_evmThis series looks better.
Is this able to also handle different images then just dtbs?
Sorry I thought had answered this.
Yes this is able to handle different image types, not just dtbos.
Have you been able to play with it ? any additional comment ?
JJ
Quoted 4 lines
Thanks,
Michal
v2 cover Add support for applications of overlays in SPL
Quoted 50 lines · Jean-Jacques Hiblot
Hi Michal,
Quoted 47 lines · Michal Simek
Quoted 46 lines · Jean-Jacques Hiblot
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 theMakefile
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: ifSPL_FIT_SOURCEorSPL_FIT_GENERATORare 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
theam335x_evmin 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:
- reworkedboard_fit_get_additionnal_images()and how it used inspl_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 theam335x_evm
Quoted 8 lines
Quoted 2 lines
This series looks better.
Is this able to also handle different images then just dtbs?Sorry I thought had answered this.
Yes this is able to handle different image types, not just dtbos.
Have you been able to play with it ? any additional comment ?
I haven't had a time but series is going in a right direction. I found 2 days ago that applying my patch is increasing size for some platforms that travis is failing.
It means I would definitely suggest you to run travis on branch with all patches applied to see if this passing or some changes need to happen.
Thanks,
Michal
v2 cover Add support for applications of overlays in SPL
Quoted 55 lines · Michal Simek
Quoted 54 lines · Jean-Jacques Hiblot
Hi Michal,
Quoted 47 lines · Michal Simek
Quoted 39 lines · Jean-Jacques Hiblot
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 theMakefile
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: ifSPL_FIT_SOURCEorSPL_FIT_GENERATORare 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
theam335x_evmin 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.Quoted 7 lines
Changes in v2:
- reworkedboard_fit_get_additionnal_images()and how it used inspl_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 theam335x_evmQuoted 2 lines
This series looks better.
Is this able to also handle different images then just dtbs?Sorry I thought had answered this.
Quoted 8 lines
Quoted 3 lines
Yes this is able to handle different image types, not just dtbos.
Have you been able to play with it ? any additional comment ?
I haven't had a time but series is going in a right direction. I found 2 days ago that applying my patch is increasing size for some platforms that travis is failing.
It means I would definitely suggest you to run travis on branch with all patches applied to see if this passing or some changes need to happen.
Already done. https://travis-ci.org/jjhiblot/u-boot/builds/511617974
The failures (except dra7 which is unresolved) are all related to the generation of u-boot.itb (one patch replaces u-boot.img with a link to u-boot.itb, making travis build u-boot.itb)
Was the broken platform the am335x_evm? In that case, the fix is in the series. I disabled advanced FIT features for this platform as this is definitely not needed.
Thanks,
JJ
Quoted 6 lines
Thanks,
Michal
v2 cover Add support for applications of overlays in SPL
Quoted 75 lines · Jean-Jacques Hiblot
Quoted 62 lines · Michal Simek
Quoted 61 lines · Jean-Jacques Hiblot
Hi Michal,
Quoted 54 lines · Michal Simek
Quoted 45 lines · Jean-Jacques Hiblot
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 theMakefile
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: ifSPL_FIT_SOURCEorSPL_FIT_GENERATORare 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
theam335x_evmin 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.Quoted 8 lines
Changes in v2:
- reworkedboard_fit_get_additionnal_images()and how it used inspl_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 theam335x_evmQuoted 2 lines
This series looks better.
Is this able to also handle different images then just dtbs?Sorry I thought had answered this.
Quoted 8 lines
Quoted 3 lines
Yes this is able to handle different image types, not just dtbos.
Have you been able to play with it ? any additional comment ?
I haven't had a time but series is going in a right direction. I found 2 days ago that applying my patch is increasing size for some platforms that travis is failing.
It means I would definitely suggest you to run travis on branch with all patches applied to see if this passing or some changes need to happen.Already done. https://travis-ci.org/jjhiblot/u-boot/builds/511617974
Quoted 7 lines
The failures (except dra7 which is unresolved) are all related to the generation of u-boot.itb (one patch replaces u-boot.img with a link to u-boot.itb, making travis build u-boot.itb)
Was the broken platform the
am335x_evm? In that case, the fix is in the series. I disabled advanced FIT features for this platform as this is definitely not needed.
https://travis-ci.org/michalsimek/u-boot/builds/518675021
This was the issue.
aarch64: + orangepi_pc2
+aarch64-linux-ld.bfd: u-boot-spl section .rodata' will not fit in region .sram'
+aarch64-linux-ld.bfd: region `.sram' overflowed by 3152 bytes
M
v2 cover Add support for applications of overlays in SPL
In reply to Michal SimekTom, Simon,
Quoted 34 lines · Michal Simek
Quoted 33 lines · Jean-Jacques Hiblot
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 theMakefile
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: ifSPL_FIT_SOURCEorSPL_FIT_GENERATORare 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 theam335x_evmin 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.
Quoted 6 lines
Quoted 6 lines
Changes in v2:
- reworkedboard_fit_get_additionnal_images()and how it used inspl_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 theam335x_evm
I don't know if you had time to look at this series. Its purpose is to allow the SPL to apply DT overlays to the FDT loaded for u-boot based on a runtime detection of the HW.
We are going to need this kind of feature in our tree, I would really appreciate your feedback. I don't want to go in the wrong direction.
JJ
Quoted 5 lines
This series looks better.
Is this able to also handle different images then just dtbs? Thanks,
Michal
v2 cover Add support for applications of overlays in SPL
Hi Jean-Jacques,
Quoted 45 lines · Jean-Jacques Hiblot
Tom, Simon,
Quoted 34 lines · Michal Simek
Quoted 33 lines · Jean-Jacques Hiblot
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 theMakefile
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: ifSPL_FIT_SOURCEorSPL_FIT_GENERATORare 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 theam335x_evmin 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.
Quoted 6 lines
Quoted 6 lines
Changes in v2:
- reworkedboard_fit_get_additionnal_images()and how it used inspl_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 theam335x_evm
Quoted 6 lines
I don't know if you had time to look at this series. Its purpose is to allow the SPL to apply DT overlays to the FDT loaded for u-boot based on a runtime detection of the HW.
We are going to need this kind of feature in our tree, I would really appreciate your feedback. I don't want to go in the wrong direction.
No I have not looked at this yet. My only comment so far is to make sure that this feature is fully optional so it does not expand the size of SPL for other boards.
Regards,
Simon