meta-digi/meta-digi-arm/recipes-bsp/u-boot/u-boot-dey/ccmp15-dvk/boot.txt

93 lines
2.6 KiB
Plaintext

#
# U-Boot bootscript for NAND/SD images created by Yocto.
#
# As the first step in the boot script, check if we are using DualBoot. This
# requires the script to change some variables and save them, while the rest
# of the script changes variables only temporarily without saving them.
# Build boot attempt message string
if test "${bootlimit}" -gt 0 && test "${bootcount}" -gt 0; then
bootattempt="(boot attempt ${bootcount}/${bootlimit})"
fi
# Dual boot verification
if test "${dualboot}" = "yes"; then
if test "${active_system}" = "linux_a"; then
echo "Booting from system A ${bootattempt}"
setenv tmp_rootfsvol ${rootfsvol_a}
else
echo "Booting from system B ${bootattempt}"
setenv tmp_rootfsvol ${rootfsvol_b}
fi
if test "${mtdbootpart}" != "${active_system}"; then
setenv mtdbootpart ${active_system}
env_save_needed="1"
fi
if test "${rootfsvol}" != "${tmp_rootfsvol}"; then
setenv rootfsvol ${tmp_rootfsvol}
env_save_needed="1"
fi
if test "${env_save_needed}" = "1"; then
env delete tmp_rootfsvol
env save
fi
else
echo "Booting system ${bootattempt}"
# Check the boot source.
if test "${mtdbootpart}" = "linux"; then
# We are booting from the NAND using 'linux'.
true
elif test "${mtdbootpart}" = "recovery"; then
# We are booting from the NAND using 'recovery'.
setenv boot_initrd true
setenv initrd_file uramdisk-recovery.img
fi
setenv rootfsvol rootfs
fi
# Back up environment variables
setenv ORIG_overlays ${overlays}
#
# Determine overlays to apply depending on the hardware capabilities
# described by the HWID, SOM version, and carrier board version.
#
setexpr module_has_mca ${hwid_2} \& 10000
setexpr module_has_mca ${module_has_mca} / 10000
setexpr module_has_wifi ${hwid_2} \& 20000
setexpr module_has_wifi ${module_has_wifi} / 20000
setexpr module_has_bt ${hwid_2} \& 40000
setexpr module_has_bt ${module_has_bt} / 40000
if test "${module_has_bt}" = "1" && test -z "${disable_bt}"; then
setenv overlays _ov_som_bt_ccmp15.dtbo,${overlays}
fi
if test "${module_has_wifi}" = "1" && test -z "${disable_wifi}"; then
setenv overlays _ov_som_wifi_ccmp15.dtbo,${overlays}
fi
if test "${module_has_mca}" = "1" && test -z "${disable_mca}"; then
setenv overlays _ov_som_mca_ccmp15.dtbo,${overlays}
fi
# Apply DVKv1 overlay if the board_version is 1
if test -z "${board_version}" || test "${board_version}" -eq "1"; then
setenv overlays _ov_board_v1_ccmp15-dvk.dtbo,${overlays}
fi
if test "${boot_device}" = "mmc"; then
dboot linux mmc
else
dboot linux nand ${mtdbootpart}
fi
# We only get here in case of an error on the dboot command.
# Undo changes to environment variables
setenv overlays ${ORIG_overlays}
setenv ORIG_overlays