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 |
| 13 | mmcpart=1 |
| 14 | mmcroot=/dev/mmcblk1p2 rootwait rw |
| 15 | mmcautodetect=yes |
| 16 | mmcargs=setenv bootargs ${jh_clk} ${mcore_clk} console=${console} root=${mmcroot} |
| 17 | prepare_mcore=setenv mcore_clk clk-imx93.mcore_booted |
| 18 | loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image} |
| 19 | loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdtfile} |
| 20 | loadcntr=fatload mmc ${mmcdev}:${mmcpart} ${cntr_addr} ${cntr_file} |
| 21 | auth_os=auth_cntr ${cntr_addr} |
| 22 | boot_os=booti ${loadaddr} - ${fdt_addr_r} |
| 23 | mmcboot= |
| 24 | echo Booting from mmc ...; |
| 25 | run mmcargs; |
| 26 | if test ${sec_boot} = yes; then |
| 27 | if run auth_os; then |
| 28 | run boot_os; |
| 29 | else |
| 30 | echo ERR: failed to authenticate; |
| 31 | fi; |
| 32 | else |
| 33 | if run loadfdt; then |
| 34 | run boot_os; |
| 35 | else |
| 36 | echo WARN: Cannot load the DT; |
| 37 | fi; |
| 38 | fi; |
| 39 | netargs=setenv bootargs ${jh_clk} ${mcore_clk} console=${console} root=/dev/nfs |
| 40 | ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp |
| 41 | netboot= |
| 42 | echo Booting from net ...; |
| 43 | run netargs; |
| 44 | if test ${ip_dyn} = yes; then |
| 45 | setenv get_cmd dhcp; |
| 46 | else |
| 47 | setenv get_cmd tftp; |
| 48 | fi; |
| 49 | if test ${sec_boot} = yes; then |
| 50 | ${get_cmd} ${cntr_addr} ${cntr_file}; |
| 51 | if run auth_os; then |
| 52 | run boot_os; |
| 53 | else |
| 54 | echo ERR: failed to authenticate; |
| 55 | fi; |
| 56 | else |
| 57 | ${get_cmd} ${loadaddr} ${image}; |
| 58 | if ${get_cmd} ${fdt_addr_r} ${fdtfile}; then |
| 59 | run boot_os; |
| 60 | else |
| 61 | echo WARN: Cannot load the DT; |
| 62 | fi; |
| 63 | fi; |