在uboot 启动机核的时候,默认的是:bootcmd命令。
在终端里:print打印出参数来若没有设置
m6tv_ref_v1#print
baudrate=115200
bootargs=init=/init console=ttyS0,115200n8 nohlt lpj=8000000
bootcmd=mmcinfo;fatload mmc 0:1 82000000 uimage;bootm
bootdelay=1
bootfile=uImage
bootpath=u-boot-512M-UartB.bin
bootsize=60000
bootstart=0
chipname=8726m
console=ttyS2,115200n8
ethact=Meson_Ethernet
ethaddr=00:15:18:01:81:31
gatewayip=10.18.9.1
hostname=arm_m6tv
ipaddr=10.18.9.97
loadaddr=0x82000000
machid=1124
mmcargs=setenv bootargs console=${console} boardname=m1_mbox
netmask=255.255.255.0
normalsize=400000
normalstart=1000000
p0path=uImage
p0size=400000
p0start=1000000
p1path=android.rootfs
p1size=8000000
p1start=1400000
partnum=2
preboot=mw da004004 80000510;mw c81000014 4000;mw c1109900 0
serverip=10.18.9.113
stderr=serial
stdin=serial
stdout=serial
testaddr=0x82400000
Environment size: 831/65532 bytes
m6tv_ref_v1#
在等待时间到了之后,会使用uboot默认的启动参数:
在uboot里:m6tv_ref_v1.h
#define CONFIG_EXTRA_ENV_SETTINGS \
"loadaddr=0x82000000\0" \
"testaddr=0x82400000\0" \
"usbtty=cdc_acm\0" \
"console=ttyS2,115200n8\0" \
"mmcargs=setenv bootargs console=${console} " \
"boardname=m1_mbox\0" \
"chipname=8726m\0" \
"machid=1124\0" \
"bootargs=init=/init console=ttyS0,115200n8 nohlt lpj=8000\0" \
"partnum=2\0" \
"p0start=1000000\0" \
"p0size=400000\0" \
"p0path=uImage\0" \
"p1start=1400000\0" \
"p1size=8000000\0" \
"p1path=android.rootfs\0" \
"bootstart=0\0" \
"bootsize=60000\0" \
"bootpath=u-boot-512M-UartB.bin\0" \
"normalstart=1000000\0" \
"normalsize=400000\0" \
#define CONFIG_BOOTCOMMAND "mmcinfo;fatload mmc 0:1 82000000 uimage;bootm"
uchar default_environment[] = {
#ifdef CONFIG_BOOTARGS
"bootargs=" CONFIG_BOOTARGS "\0"
#endif
#ifdef CONFIG_BOOTCOMMAND
"bootcmd=" CONFIG_BOOTCOMMAND "\0"
#endif
#ifdef CONFIG_NFSBOOTCOMMAND
"nfsboot=" CONFIG_NFSBOOTCOMMAND "\0"
#endif
#if defined(CONFIG_BOOTDELAY) && (CONFIG_BOOTDELAY >= 0)
"bootdelay=" MK_STR(CONFIG_BOOTDELAY) "\0"
#endif
#if defined(CONFIG_PCI_BOOTDELAY) && (CONFIG_PCI_BOOTDELAY > 0)
"pcidelay=" MK_STR(CONFIG_PCI_BOOTDELAY) "\0"
#endif
#ifdef CONFIG_EXTRA_ENV_SETTINGS
CONFIG_EXTRA_ENV_SETTINGS
#endif
"\0"
};
在编译的时候。。。
在uboot启动的时候,会去初始化:
init_fnc_t *init_sequence[] = {
env_init, /* initialize environment */
}
board.c
for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
if ((*init_fnc_ptr)() != 0) {
hang (); // 会调用到env_init 初始化默认参数
}
}
int env_init(void)
{
/* eMMC isn't usable before relocation */
gd->env_addr = (ulong)&default_environment[0];
gd->env_valid = 1;
return 0;
}
阅读(2307) | 评论(0) | 转发(0) |