Peng Fan | aafee2c | 2024-12-03 23:42:54 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */ |
| 2 | |
| 3 | boot_targets=mmc0 mmc1 |
| 4 | boot_fit=no |
| 5 | bootm_size=0x10000000 |
| 6 | cntr_addr=0x98000000 |
| 7 | cntr_file=os_cntr_signed.bin |
| 8 | console=ttyLP0,115200 earlycon |
| 9 | fdt_addr_r=0x83000000 |
| 10 | fdt_addr=0x83000000 |
| 11 | fdtfile=CONFIG_DEFAULT_FDT_FILE |
| 12 | image=Image |
Peng Fan | 22d8e64 | 2025-01-09 11:29:04 +0800 | [diff] [blame^] | 13 | mmcdev=CONFIG_SYS_MMC_ENV_DEV |
Peng Fan | aafee2c | 2024-12-03 23:42:54 +0800 | [diff] [blame] | 14 | mmcpart=1 |
| 15 | mmcroot=/dev/mmcblk1p2 rootwait rw |
| 16 | mmcautodetect=yes |
| 17 | mmcargs=setenv bootargs ${jh_clk} ${mcore_clk} console=${console} root=${mmcroot} |
| 18 | prepare_mcore=setenv mcore_clk clk-imx93.mcore_booted |
| 19 | loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image} |
| 20 | loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdtfile} |
| 21 | loadcntr=fatload mmc ${mmcdev}:${mmcpart} ${cntr_addr} ${cntr_file} |
| 22 | auth_os=auth_cntr ${cntr_addr} |
Peng Fan | 22d8e64 | 2025-01-09 11:29:04 +0800 | [diff] [blame^] | 23 | sec_boot=no |
Peng Fan | aafee2c | 2024-12-03 23:42:54 +0800 | [diff] [blame] | 24 | boot_os=booti ${loadaddr} - ${fdt_addr_r} |
| 25 | mmcboot= |
| 26 | echo Booting from mmc ...; |
| 27 | run mmcargs; |
| 28 | if test ${sec_boot} = yes; then |
Peng Fan | 22d8e64 | 2025-01-09 11:29:04 +0800 | [diff] [blame^] | 29 | if run true; then |
Peng Fan | aafee2c | 2024-12-03 23:42:54 +0800 | [diff] [blame] | 30 | run boot_os; |
| 31 | else |
| 32 | echo ERR: failed to authenticate; |
| 33 | fi; |
| 34 | else |
| 35 | if run loadfdt; then |
| 36 | run boot_os; |
| 37 | else |
| 38 | echo WARN: Cannot load the DT; |
| 39 | fi; |
| 40 | fi; |
| 41 | netargs=setenv bootargs ${jh_clk} ${mcore_clk} console=${console} root=/dev/nfs |
| 42 | ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp |
| 43 | netboot= |
| 44 | echo Booting from net ...; |
| 45 | run netargs; |
| 46 | if test ${ip_dyn} = yes; then |
| 47 | setenv get_cmd dhcp; |
| 48 | else |
| 49 | setenv get_cmd tftp; |
| 50 | fi; |
| 51 | if test ${sec_boot} = yes; then |
| 52 | ${get_cmd} ${cntr_addr} ${cntr_file}; |
Peng Fan | 22d8e64 | 2025-01-09 11:29:04 +0800 | [diff] [blame^] | 53 | if true; then |
Peng Fan | aafee2c | 2024-12-03 23:42:54 +0800 | [diff] [blame] | 54 | run boot_os; |
| 55 | else |
| 56 | echo ERR: failed to authenticate; |
| 57 | fi; |
| 58 | else |
| 59 | ${get_cmd} ${loadaddr} ${image}; |
| 60 | if ${get_cmd} ${fdt_addr_r} ${fdtfile}; then |
| 61 | run boot_os; |
| 62 | else |
| 63 | echo WARN: Cannot load the DT; |
| 64 | fi; |
| 65 | fi; |
Peng Fan | 22d8e64 | 2025-01-09 11:29:04 +0800 | [diff] [blame^] | 66 | bsp_bootcmd= |
| 67 | echo Running BSP bootcmd ...; |
| 68 | mmc dev ${mmcdev}; |
| 69 | if mmc rescan; then |
| 70 | if run loadbootscript; then |
| 71 | run bootscript; |
| 72 | else |
| 73 | if test ${sec_boot} = yes; then |
| 74 | if run loadcntr; then |
| 75 | run mmcboot; |
| 76 | else |
| 77 | run netboot; |
| 78 | fi; |
| 79 | else |
| 80 | if run loadimage; then |
| 81 | run mmcboot; |
| 82 | else |
| 83 | run netboot; |
| 84 | fi; |
| 85 | fi; |
| 86 | fi; |
| 87 | fi; |
| 88 | scriptaddr=0x83500000 |