[IMX6Q]u-boot启动kernel流程

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 && 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值