| setenv fdt_addr 0x42000000 |
| setenv fdt_file mt8167-coral.dtb |
| |
| 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 |
| |
| # Overlay memory config for EVT1 |
| if test "${evt2_board}" -eq 0; then |
| if ext2load mmc ${mmcdev}:${boot_partition} ${fdtovaddr} coral-evt1.dtbo && fdt apply ${fdtovaddr}; then |
| echo Loaded EVT1 config |
| else |
| echo Overlay EVT1 config failed |
| ext2load mmc ${mmcdev}:${boot_partition} ${fdt_addr} ${fdt_file} |
| fi |
| fi |
| |
| # 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 |
| else |
| echo Overlay failed, reverting to original device tree |
| ext2load mmc ${mmcdev}:${boot_partition} ${fdt_addr} ${fdt_file} |
| bootm ${kerneladdr} - ${fdt_addr} |
| fi |
| done |
| fi |
| |
| bootm ${kerneladdr} - ${fdt_addr} |