u-boot版本:v2009.08
u-boot利用了env里的cmd来实现调用boot linux的接口, 效果等同于在u-boot中敲"booti xxx..."
start_armboot -> board_late_init:
int board_late_init(void)
{
int ret = 0;
#ifdef MX6Q_SABRESD_ANDROID_H
switch (get_boot_device()) {
case SD_BOOT:
if (!getenv("fastboot_dev"))
setenv("fastboot_dev", "mmc2");
/*本例的boot device是SD,并且device number是2*/
if (!getenv("bootcmd"))
setenv("bootcmd", "booti mmc2");
break;
......
}
#endif
......
return 0;
}
start_armboot ->main_loop:
void main_loop (void)
{
......
/*获取前面set的bootcmd,值是"booti mmc2"*/
s = getenv ("bootcmd");
debug ("### main_loop: bootcmd=\"%s\"\n", s ? s : "<UNDEFINED>");
/*如果u-boot开机阶段没有收到按键事件,那么就去启动kernel*/
if (bootdelay >= 0 &&