From 23e8ddc745b5bae3d3635f90b7b3a1ab6f8fcafd Mon Sep 17 00:00:00 2001 From: Christophe Priouzeau Date: Mon, 6 Jun 2022 15:16:11 +0200 Subject: [PATCH] Rename U-Boot stm32mp extlinux Signed-off-by: Christophe Priouzeau Change-Id: Ia06ae796dfd1083a4adb608b3ff132622bad23d0 --- recipes-bsp/u-boot/stm32mp-extlinux.bb | 9 ++++++++- recipes-bsp/u-boot/stm32mp-extlinux/boot.scr.cmd | 7 ++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/recipes-bsp/u-boot/stm32mp-extlinux.bb b/recipes-bsp/u-boot/stm32mp-extlinux.bb index 2d973db..b338679 100644 --- a/recipes-bsp/u-boot/stm32mp-extlinux.bb +++ b/recipes-bsp/u-boot/stm32mp-extlinux.bb @@ -8,7 +8,7 @@ PACKAGE_ARCH = "${MACHINE_ARCH}" SRC_URI = "file://boot.scr.cmd" -PV = "3.1" +PV = "3.1.1" inherit kernel-arch extlinuxconf-stm32mp @@ -38,6 +38,13 @@ do_compile() { bbnote "Moving $(basename ${subdir}) to extlinux subdir" mv -f ${subdir} ${B}/extlinux fi + else + if [ "$(find ${B}/* -maxdepth 1 -type f | wc -l)" -eq 1 ] ; then + if [ "$(basename ${subdir})" != "extlinux" ]; then + bbnote "Moving $(basename ${subdir}) to extlinux subdir" + mv -f ${subdir} ${B}/extlinux + fi + fi fi fi # Generate boot script only when multiple extlinux.conf file are set diff --git a/recipes-bsp/u-boot/stm32mp-extlinux/boot.scr.cmd b/recipes-bsp/u-boot/stm32mp-extlinux/boot.scr.cmd index eeedb2e..8288797 100644 --- a/recipes-bsp/u-boot/stm32mp-extlinux/boot.scr.cmd +++ b/recipes-bsp/u-boot/stm32mp-extlinux/boot.scr.cmd @@ -23,7 +23,9 @@ env set boot_m4fw 'rproc init; rproc load 0 ${m4fw_addr} ${filesize}; rproc star 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;' +env set ov_init 'load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${fdtfile} && env set fdt_addr ${fdt_addr_r} && fdt addr ${fdt_addr} && setexpr fdtovaddr ${fdt_addr} + C0000' +env set ov_apply 'test -n ${fdtovaddr} && test -n ${overlay} && for ov in ${overlay}; do echo overlaying ${ov}...; load ${devtype} ${devnum}:${distro_bootpart} ${fdtovaddr} /overlays/${ov}.dtbo && fdt resize ${filesize} && fdt apply ${fdtovaddr}; done' +env set scan_overlays 'if test -e ${devtype} ${devnum}:${distro_bootpart} /overlays/overlays.txt && load ${devtype} ${devnum}:${distro_bootpart} ${loadaddr} /overlays/overlays.txt && env import -t ${loadaddr} ${filesize}; then echo loaded overlay.txt: ${overlay}; run ov_init; run ov_apply; fi' # Update the DISTRO command to search in sub-directory and load M4 firmware env set boot_prefixes "/${boot_device}${boot_instance}_" @@ -53,6 +55,9 @@ fi if test -e ${devtype} ${devnum}:${distro_bootpart} ${boot_prefixes}extlinux/${board_name}_extlinux.conf; then echo FOUND ${boot_prefixes}extlinux/${board_name}_extlinux.conf env set boot_syslinux_conf "extlinux/${board_name}_extlinux.conf" +else + echo FOUND ${boot_prefixes}extlinux/extlinux.conf + env set boot_syslinux_conf "extlinux/extlinux.conf" fi # don't save the updated content of bootfile variable to avoid conflict