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 <christophe.priouzeau@st.com>
Change-Id: I3615d6f03cf874cf3f3c12ea1dd5882bb054542d
This commit is contained in:
Romuald JEANNE 2021-03-15 16:21:51 +01:00 committed by Bernard PUEL
parent c2ed3e416d
commit f199af810f
1 changed files with 4 additions and 1 deletions

View File

@ -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}