本文主要是介绍NanoPC-T4 RK3399:uboot cmd与boot加载,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
一:获取autoboot命令
命令行模式的主逻辑接口:
#uboot_dev/common/main.c/* We come here after U-Boot is initialised and ready to process commands */
void main_loop(void)
{const char *s;bootstage_mark_name(BOOTSTAGE_ID_MAIN_LOOP, "main_loop");...s = bootdelay_process();if (cli_process_fdt(&s))cli_secure_boot_cmd(s);printf("[DEBUG]: s:%s\n",s);autoboot_command(s);cli_loop();panic("No CLI available");
}
通过env_get获取autoboot命令字符串s:
#uboot_dev/common/autoboot.cconst char *bootdelay_process(void)
{char *s;int bootdelay;bootcount_inc();s = env_get("bootdelay");bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY;...#ifdef CONFIG_POSTif (gd->flags & GD_FLG_POSTFAIL) {s = env_get("failbootcmd");} else
#endif
这篇关于NanoPC-T4 RK3399:uboot cmd与boot加载的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!