uboot移植(三)SPL

参考 doc/README.SPL
我们知道, S5PV210 启动过程需要 BL1 BL2 ,其中 BL1 进行一些基本初始化(时钟、内存),加载
BL2 到内存。 U-boot 为此专门实现了 SPL 框架。
SPL 的全称为 secondary program loader ,即第 2 阶段程序加载器,即我们要实现的 BL1
要支持
SPL , 我们需要在单板配置文件 u-boot-2014.04/include/configs/smdkc100.h 定义宏 CONFIG_SPL
#define CONFIG_SPL
这样顶层 Makefile 在包含 u-boot-2014.04/include/configs/smdkc100.h 时,会得到
ALL-y += spl/u-boot-spl.bin

这样在执行 make all 时, make 会编译 spl/u-boot-spl.bin 这个目标

从这得知, spl/u-boot-spl.bin 依赖于 spl/u-boot-spl,然后 make 找到目标 spl/u-boot-spl,然后执行指
定的
Makefile 文件: u-boot-2014.04/spl/Makefile
u-boot-2014.04/spl/Makefile 中首先导出环境变量 CONFIG_SPL_BUILD=y, 这个宏在各个源代码文件中
用来控制代码的走向。
这样编译后,最终会在
u-boot-2014.04/spl 下生成 u-boot-spl.bin, 同时在 u-boot-2014.04 下生成
u-boot.bin
u-boot.bin
使用的链接脚本为 u-boot-2014.04/arch/arm/cpu/u-boot.lds
u-boot-spl.bin
使用的链接脚本为 u-boot-2014.04/arch/arm/cpu/u-boot-spl.lds


猜你喜欢

转载自blog.csdn.net/jerrygou/article/details/80368769