X-013-UBOOT-使能autoboot功能
作者:wowo 发布于:2016-10-5 21:51 分类:X Project
1. 前言
通过“X-012-KERNEL-serial early console的移植”,早期的串口控制台已经ready,kernel的printk可以正确输出,“X Project”由此进入“文明”时代。基于此,后续的开发工作将会focus在linux kernel上,而u-boot,可以蜕化为其原始目标:boot kernel。
在之前的测试和调试过程中,都是先进入u-boot的命令行,手动输入bootm命令,boot linux kernel。为了简化这个动作,有必要将u-boot的autoboot功能用起来。
所谓的autoboot,是指u-boot run起来之后,自动加载并执行linux kernel image的 过程。该功能非常简单,之所以写一篇文章,权当“X Project”开发过程的一个记录。
2. 使能autoboot
2.1 u-boot autoboot功能简介
u-boot autoboot功能的具体介绍可参考“README.autoboot[1]”,总结来说:
1)通过CONFIG_BOOTDELAY配置是否使用autoboot功能,是否在autoboot之前等待一段时间以便让用户输入从而进入命令行:
Delay before automatically booting the default image;
set to -1 to disable autoboot.
set to -2 to autoboot with no delay and not check for abort (even when CONFIG_ZERO_BOOTDELAY_CHECK is defined).
2)通过CONFIG_BOOTCOMMAND配置boot kernel所使用的命令。
3)通过CONFIG_BOOTARGS配置命令行参数。
4)其它等等。
2.2 基于bubblegum-96配置并使能autoboot
以“X Project”目前的情况来说,我们暂时只使用CONFIG_BOOTDELAY和CONFIG_BOOTCOMMAND两个即可,如下:
/* include/configs/bubblegum.h */
#define CONFIG_BOOTDELAY -2
#define CONFIG_BOOTCOMMAND "bootm 0x6400000"
其中CONFIG_BOOTDELAY为-2,表示不需要任何delay;CONFIG_BOOTCOMMAND即为我们在u-boot命令行敲入的用于boot kernel的指令。
注1:由于当前bubblegum-96的u-boot没有移植timer驱动,CONFIG_BOOTDELAY为正值的时候无法正确使用(没有计时,也就没有timeout了)。
2.3 简单的测试
为了方便测试,我在build makefile中添加了几个辅助命令,如下:
#
# some help commands
#
spl-run:
sudo $(DFU_DIR)/dfu $(BOARD_NAME) $(SPL_BASE) $(TOOLS_DIR)/$(BOARD_VENDOR)/splboot.bin 1uimage-load:
sudo $(DFU_DIR)/dfu $(BOARD_NAME) $(FIT_UIMAGE_BASE) $(UIMAGE_ITB_FILE) 0uboot-run:
sudo $(DFU_DIR)/dfu $(BOARD_NAME) $(UBOOT_BASE) $(OUT_DIR)/u-boot/u-boot-dtb.bin 1kernel-run: uimage-load uboot-run
按住ADFU键开机,执行make spl-run初始化DDR,然后执行make kernel-run,就可以直接启东到linux kernel了。具体可参考”README.bubblegum96[2]”。
以上改动可参考如下patch:
https://github.com/wowotechX/u-boot/commit/59553f4c7583c002e9eb5e2ac7402a25699d51c6
3. 参考文档
[1] README.autoboot
原创文章,转发请注明出处。蜗窝科技,www.wowotech.net。
标签: boot u-boot bootm autoboot

评论:
功能
最新评论
文章分类
随机文章
文章存档
- 2024年2月(1)
- 2023年5月(1)
- 2022年10月(1)
- 2022年8月(1)
- 2022年6月(1)
- 2022年5月(1)
- 2022年4月(2)
- 2022年2月(2)
- 2021年12月(1)
- 2021年11月(5)
- 2021年7月(1)
- 2021年6月(1)
- 2021年5月(3)
- 2020年3月(3)
- 2020年2月(2)
- 2020年1月(3)
- 2019年12月(3)
- 2019年5月(4)
- 2019年3月(1)
- 2019年1月(3)
- 2018年12月(2)
- 2018年11月(1)
- 2018年10月(2)
- 2018年8月(1)
- 2018年6月(1)
- 2018年5月(1)
- 2018年4月(7)
- 2018年2月(4)
- 2018年1月(5)
- 2017年12月(2)
- 2017年11月(2)
- 2017年10月(1)
- 2017年9月(5)
- 2017年8月(4)
- 2017年7月(4)
- 2017年6月(3)
- 2017年5月(3)
- 2017年4月(1)
- 2017年3月(8)
- 2017年2月(6)
- 2017年1月(5)
- 2016年12月(6)
- 2016年11月(11)
- 2016年10月(9)
- 2016年9月(6)
- 2016年8月(9)
- 2016年7月(5)
- 2016年6月(8)
- 2016年5月(8)
- 2016年4月(7)
- 2016年3月(5)
- 2016年2月(5)
- 2016年1月(6)
- 2015年12月(6)
- 2015年11月(9)
- 2015年10月(9)
- 2015年9月(4)
- 2015年8月(3)
- 2015年7月(7)
- 2015年6月(3)
- 2015年5月(6)
- 2015年4月(9)
- 2015年3月(9)
- 2015年2月(6)
- 2015年1月(6)
- 2014年12月(17)
- 2014年11月(8)
- 2014年10月(9)
- 2014年9月(7)
- 2014年8月(12)
- 2014年7月(6)
- 2014年6月(6)
- 2014年5月(9)
- 2014年4月(9)
- 2014年3月(7)
- 2014年2月(3)
- 2014年1月(4)
2016-11-22 21:53