blob: c972d3eb2511542c1a11812f879d7627cadef797 [file] [log] [blame]
Peng Fanaafee2c2024-12-03 23:42:54 +08001/* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
2
3boot_targets=mmc0 mmc1
4boot_fit=no
5bootm_size=0x10000000
6cntr_addr=0x98000000
7cntr_file=os_cntr_signed.bin
8console=ttyLP0,115200 earlycon
9fdt_addr_r=0x83000000
10fdt_addr=0x83000000
11fdtfile=CONFIG_DEFAULT_FDT_FILE
12image=Image
Peng Fan22d8e642025-01-09 11:29:04 +080013mmcdev=CONFIG_SYS_MMC_ENV_DEV
Peng Fanaafee2c2024-12-03 23:42:54 +080014mmcpart=1
15mmcroot=/dev/mmcblk1p2 rootwait rw
16mmcautodetect=yes
17mmcargs=setenv bootargs ${jh_clk} ${mcore_clk} console=${console} root=${mmcroot}
18prepare_mcore=setenv mcore_clk clk-imx93.mcore_booted
19loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image}
20loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr_r} ${fdtfile}
21loadcntr=fatload mmc ${mmcdev}:${mmcpart} ${cntr_addr} ${cntr_file}
22auth_os=auth_cntr ${cntr_addr}
Peng Fan22d8e642025-01-09 11:29:04 +080023sec_boot=no
Peng Fanaafee2c2024-12-03 23:42:54 +080024boot_os=booti ${loadaddr} - ${fdt_addr_r}
25mmcboot=
26 echo Booting from mmc ...;
27 run mmcargs;
28 if test ${sec_boot} = yes; then
Peng Fan22d8e642025-01-09 11:29:04 +080029 if run true; then
Peng Fanaafee2c2024-12-03 23:42:54 +080030 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;
41netargs=setenv bootargs ${jh_clk} ${mcore_clk} console=${console} root=/dev/nfs
42 ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp
43netboot=
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 Fan22d8e642025-01-09 11:29:04 +080053 if true; then
Peng Fanaafee2c2024-12-03 23:42:54 +080054 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 Fan22d8e642025-01-09 11:29:04 +080066bsp_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;
88scriptaddr=0x83500000