From f199af810f64ccce58a0bf292a55019c0b342a1c Mon Sep 17 00:00:00 2001 From: Romuald JEANNE Date: Mon, 15 Mar 2021 16:21:51 +0100 Subject: [PATCH] U-BOOT-STM32MP-EXTLINUX: manage overlay To manage overlay device tree on U-Boot via boot.scr script: - add an overlay entry on extlinux.conf without FDT or FDTDIR - create a directory named 'overlays' on boot directory - populate 'overlays' with the device tree overlay - create a file named overlays.txt on overlays directory - syntax of overlays.txt: overlay=aa bb cc dd - aa, bb, cc, dd correspond to a device tree name file (without extension) present on /overlays/ directory /overlays/aa.dtbo /overlays/bb.dtbo /overlays/cc.dtbo /overlays/dd.dtbo Tree of bootfs addons for overlay /overlays/aa.dtbo /overlays/bb.dtbo /overlays/cc.dtbo /overlays/dd.dtbo /overlays/overlays.txt warning: think to add an entry on extlinux.conf without FTDIR or FDTFILE entry Signed-off-by: Christophe Priouzeau Change-Id: I3615d6f03cf874cf3f3c12ea1dd5882bb054542d --- recipes-bsp/u-boot/u-boot-stm32mp-extlinux/boot.scr.cmd | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/recipes-bsp/u-boot/u-boot-stm32mp-extlinux/boot.scr.cmd b/recipes-bsp/u-boot/u-boot-stm32mp-extlinux/boot.scr.cmd index 67a5e39..eeedb2e 100644 --- a/recipes-bsp/u-boot/u-boot-stm32mp-extlinux/boot.scr.cmd +++ b/recipes-bsp/u-boot/u-boot-stm32mp-extlinux/boot.scr.cmd @@ -22,9 +22,12 @@ env set boot_m4fw 'rproc init; rproc load 0 ${m4fw_addr} ${filesize}; rproc star # boot M4 Firmware when available env set scan_m4fw 'if test -e ${devtype} ${devnum}:${distro_bootpart} ${m4fw_name};then echo Found M4 FW $m4fw_name; if load ${devtype} ${devnum}:${distro_bootpart} ${m4fw_addr} ${m4fw_name}; then run boot_m4fw; fi; fi;' +# management of overlay +env set scan_overlays 'if test -e ${devtype} ${devnum}:${distro_bootpart} /overlays/overlays.txt; then env set fdt_addr ${fdt_addr_r}; if load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr} ${fdtfile}; then fdt addr ${fdt_addr}; fdt resize; setexpr fdtovaddr ${fdt_addr} + C0000; if load ${devtype} ${devnum}:${distro_bootpart} ${fdtovaddr} /overlays/overlays.txt && env import -t ${fdtovaddr} ${filesize} && test -n ${overlay}; then echo loaded overlay.txt: ${overlay}; for ov in ${overlay}; do echo overlaying ${ov}...; load ${devtype} ${devnum}:${distro_bootpart} ${fdtovaddr} /overlays/${ov}.dtbo && fdt apply ${fdtovaddr}; done; fi; fi; fi;' + # Update the DISTRO command to search in sub-directory and load M4 firmware env set boot_prefixes "/${boot_device}${boot_instance}_" -env set boot_extlinux "run scan_m4fw;${boot_extlinux}" +env set boot_extlinux "run scan_m4fw;run scan_overlays; ${boot_extlinux}" # save the boot config for the 2nd boot env set boot_targets ${target}