if fatload mmc ${current_partition} ${loadaddr} boot-alt.cfg && env import -t ${loadaddr} ${filesize}; then if test -n ${custom_boot_script}; then echo "Running custom bootscript ..." fatload mmc ${current_partition} ${loadaddr} ${custom_boot_script} source ${loadaddr} fi if test -n ${cmdline}; then echo "Kernel cmdline: ${cmdline}" setenv bootargs ${cmdline} fi if test -n ${devicetree};then echo "Loading devicetree ${devicetree} ..." if fatload mmc ${current_partition} ${fdt_addr} ${devicetree}; then fdt addr ${fdt_addr} version_to_fdt if test -n ${overlays}; then for ov in ${overlays}; do echo "Overlaying ${ov} ..." if fatload mmc ${current_partition} ${loadaddr} ${ov}; then fdt resize ${filesize} && fdt apply ${loadaddr} else echo "Failed to load overlay ${ov}" fi done fi temp_overlay="none" if test -n ${cpu_temp_grade}; then if test "${cpu_temp_grade}" = "industrial"; then temp_overlay="${soc_type}-industrial-temp-overlay" fi if test "${cpu_temp_grade}" = "extcommercial"; then temp_overlay="${soc_type}-industrial-temp-overlay" fi if test "${cpu_temp_grade}" = "automotive"; then temp_overlay="${soc_type}-automotive-temp-overlay" fi fi if test ! ${temp_overlay} = "none"; then fatload mmc ${current_partition} ${loadaddr} "${temp_overlay}.dtbo" if test $? = 1; then fatload mmc ${current_partition} ${loadaddr} "${temp_overlay}.dtb" if test $? = 1; then echo "No temp overlay applied for ${cpu_temp_grade} grade" temp_overlay="none" fi fi fi if test ! ${temp_overlay} = "none"; then echo "Overlaying ${temp_overlay} ..." fdt resize ${filesize} && fdt apply ${loadaddr} fi else echo "Failed to load devicetree ${devicetree}" fi fi initrd=- if test -n ${initramfs}; then echo "Loading initramfs ${initramfs} ..." if fatload mmc ${current_partition} ${initrd_addr} ${initramfs}; then initrd=${initrd_addr}:${filesize} else echo "Failed to load initramfs ${initramfs}" fi fi # Fallback if not set in config file if test -z ${kernel}; then kernel=linuximage fi echo "Load kernel ${kernel}" if fatload mmc ${current_partition} ${loadaddr} ${kernel}; then booti ${loadaddr} ${initrd} ${fdt_addr} else echo "Unable to load kernel ${kernel}" fi else echo "No valid boot-alt.cfg found" fi;