blob: 6291e70199d1e0a4ad5b0d55ae968f5c8c30f2f6 [file] [log] [blame]
setenv fdt_addr 0x42000000
setenv fdt_file mt8167-coral.dtb
setexpr boot_partition ${rootfs_partition} - 1
echo Loading image...
ext2load mmc ${mmcdev}:${boot_partition} ${kerneladdr} boot.img
# Load base device tree.
echo Loading device tree...
ext2load mmc ${mmcdev}:${boot_partition} ${fdt_addr} ${fdt_file}
fdt addr ${fdt_addr}
fdt resize
# Load overlays to arbitrary address beyond fdt location (will apply them later).
setexpr fdtovaddr ${fdt_addr} + F0000
# Parse overlays.txt and apply individual overlays.
if ext2load mmc ${mmcdev}:${boot_partition} ${fdtovaddr} overlays.txt && env import -t ${fdtovaddr} ${filesize} && test -n ${overlay}; then
echo Loaded overlay.txt: ${overlay}
for ov in ${overlay}; do
if ext2load mmc ${mmcdev}:${boot_partition} ${fdtovaddr} ${ov}.dtbo && fdt apply ${fdtovaddr}; then
echo Overlay of ${ov} successful
echo Overlay failed, reverting to original device tree
ext2load mmc ${mmcdev}:${boot_partition} ${fdt_addr} ${fdt_file}
bootm ${kerneladdr} - ${fdt_addr}
bootm ${kerneladdr} - ${fdt_addr}