U-BOOT-STM32MP-EXTLINUX: update for v2.0.0

Change-Id: Iae892ccf630ff290ee337bead4d36e753e24db15
This commit is contained in:
Romuald JEANNE committed 2020-06-23 17:23:51 +02:00
1 parent 6f08519d2c
commit c3ccf68bd4
2 files changed
+78 -32

No files matched your search

@@ -1,45 +1,71 @@
# Generate boot.scr.uimg:
# ./tools/mkimage -C none -A arm -T script -d boot.src.cmd boot.scr.uimg
#
#########################################################################
# SAMPLE BOOT SCRIPT: PLEASE DON'T USE this SCRIPT in REAL PRODUCT
#########################################################################
# this script is only a OpenSTLinux helper to manage multiple target with the
# same bootfs, for real product with only one supported configuration change the
# bootcmd in U-boot or use the normal path for extlinux.conf to use DISTRO
# boocmd (generic distibution); U-Boot searches with boot_prefixes="/ /boot/":
# - /extlinux/extlinux.conf
# - /boot/extlinux/extlinux.conf
#########################################################################
echo "Executing SCRIPT on target=${target}"
# M4 Firmware load
env set m4fw_name "rproc-m4-fw.elf"
env set m4fw_addr ${kernel_addr_r}
env set boot_m4fw 'rproc init; rproc load 0 ${m4fw_addr} ${filesize}; rproc load_rsc 0 ${m4fw_addr} ${filesize}; rproc start 0'
env set boot_m4fw 'rproc init; rproc load 0 ${m4fw_addr} ${filesize}; rproc start 0'
# 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;'
# Update DISTRO command= search in sub-directory and load M4 firmware
env set boot_prefixes "/${boot_device}${boot_instance}_${board_name}_"
# 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}"
if test ${boot_device} = mmc; then
if test ${distro_bootpart} > 4; then
env set boot_prefixes "/mmc${boot_instance}_${board_name}-optee_"
# save the boot config for the 2nd boot
env set boot_targets ${target}
# when {boot_device} = nor, use ${target} = the location of U-Boot
# script boot.scr.img found in DISTRO script
# value can be "mmc0" (SD Card), "mmc1" (eMMC) or "ubifs0" (NAND)
if test ${target} = mmc0; then
if test -d ${devtype} ${devnum}:${distro_bootpart} /mmc0_extlinux; then
env set boot_prefixes "/mmc0_"
fi
elif test ${target} = mmc1; then
if test -d ${devtype} ${devnum}:${distro_bootpart} /mmc1_extlinux; then
env set boot_prefixes "/mmc1_"
fi
elif test ${target} = ubifs0; then
if test -d ${devtype} ${devnum}:${distro_bootpart} /nand0_extlinux; then
env set boot_prefixes "/nand0_"
fi
#start the correct exlinux.conf
run scan_dev_for_boot_part
elif test ${boot_device} = nand; then
#start the correct exlinux.conf without remount UBI
run scan_dev_for_boot
elif test ${boot_device} = nor; then
#EMMC boot
env set boot_prefixes "/${boot_device}${boot_instance}-mmc1_${board_name}_"
run bootcmd_mmc1
#NAND boot
env set boot_prefixes "/nand0_${board_name}_"
run bootcmd_ubifs0
#SDCARD boot
env set boot_prefixes "/${boot_device}${boot_instance}_${board_name}_"
run bootcmd_mmc0
fi
echo SCRIPT FAILED... ${boot_prefixes}extlinux/extlinux.conf not found !
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"
fi
# don't save the updated content of bootfile variable to avoid conflict
env delete bootfile
# save the boot config the 2nd boot (boot_prefixes/boot_extlinux)
env save
# start the correct exlinux.conf
run bootcmd_${target}
echo SCRIPT FAILED... ${boot_prefixes}${boot_syslinux_conf} not found !
# restore environment to default value when failed
env default boot_targets
env default boot_prefixes
env default boot_extlinux
env default boot_syslinux_conf
env save