天天看點

imx6q u-boot 啟動腳本分析

bootcmd=

run findfdt;  (1)

mmc dev ${mmcdev};  (mmc dev 2)  (2)

if mmc rescan; then     (3)

if run loadbootscript; then 

run bootscript; 

else 

if run loadimage; then  (4)

run mmcboot;        (13)

else 

run netboot; 

fi; 

fi; 

else 

run netboot; 

fi

loadimage=fatload mmc ${mmcdev}:${mmcpart} ${loadaddr} ${image} (fatload mmc 2:1 0x12000000 zImage  從第2塊mmc裝置的1分區 裝載zImage到記憶體的0x12000000位置) (5)

mmcboot=

echo Booting from mmc ...;  (6)

run mmcargs;                (7)

if test ${boot_fdt} = yes || test ${boot_fdt} = try; then  (9)

if run loadfdt; then  (10)

bootz ${loadaddr} - ${fdt_addr};  (12)

else 

if test ${boot_fdt} = try; then 

bootz; 

else 

echo WARN: Cannot load the DT; 

fi; 

fi; 

else 

bootz; 

fi;

mmcargs=setenv bootargs console=${console},${baudrate} ${smp} root=${mmcroot} (setenv bootargs console=ttymxc0,115200 root=/dev/mmcblk3p2 rootwait rw)  (8)

loadfdt=fatload mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file} (fatload mmc 2:1 0x18000000 imx6q-sabresd.dtb)  (11)

findfdt=

if test $fdt_file = undefined; then 

if test $board_name = SABREAUTO && test $board_rev = MX6QP; then 

setenv fdt_file imx6qp-sabreauto.dtb; 

fi; 

if test $board_name = SABREAUTO && test $board_rev = MX6Q; then 

setenv fdt_file imx6q-sabreauto.dtb; 

fi; 

if test $board_name = SABREAUTO && test $board_rev = MX6DL; then 

setenv fdt_file imx6dl-sabreauto.dtb;

fi; 

if test $board_name = SABRESD && test $board_rev = MX6QP; then 

setenv fdt_file imx6qp-sabresd.dtb; 

fi; 

if test $board_name = SABRESD && test $board_rev = MX6Q; then 

setenv fdt_file imx6q-sabresd.dtb; 

fi; 

if test $board_name = SABRESD && test $board_rev = MX6DL; then 

setenv fdt_file imx6dl-sabresd.dtb; 

fi; 

if test $fdt_file = undefined; then 

echo WARNING: Could not determine dtb to use; 

fi; 

fi;

imx6q u-boot 啟動腳本分析
imx6q u-boot 啟動腳本分析

繼續閱讀