AM335x uboot spl分析
芯片到uboot启动流程
ROM → SPL→ uboot.img
简介
在335x 中ROM code是第一级的bootlader。mpu上电后将会自动执行这里的代码,完成部分初始化和引导第二级的bootlader,第二级的bootlader引导第三级bootader,在ti官方上对于第二级和第三级的bootlader由uboot提供。
SPL
To unify all existing implementations for a secondary program loader (SPL) and to allow simply adding of new implementations this generic SPL framework has been created. With this framework almost all source files for a board can be reused. No code duplication or symlinking is necessary anymore.
1> Basic ARM initialization
2> UART console initialization
3> Clocks and DPLL locking (minimal)
4> SDRAM initialization
5> Mux (minimal)
6> BootDevice initialization(based on where we are booting from.MMC1/MMC2/Nand/Onenand)
7> Bootloading real u-boot from the BootDevice and passing control to it.
uboot spl源代码分析
一、makefile分析
打开spl文件夹只有一个makefile 可见spl都是复用uboot原先的代码。
主要涉及的代码文件为u-boot-2011.09-psp04.06.00.03/arch/arm/cpu/armv7
u-boot-2011.09-psp04.06.00.03/arch/arm/lib
u-boot-2011.09-psp04.06.00.03/drivers
LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-spl.lds
这个为链接脚本
二、u-boot-spl.lds
Sram 0x402F0400 |
Sdram 0x80000000 |
|
.bss |
.TEXT (arch/arm/cpu/armv7/start.o) |
|
.rodata |
|
.data |
|
__start 为程序开始
__image_copy_end
_end
三、代码解析
__start 为程序开始 (arch/arm/cpu/armv7/start.S)
.globl _start 这是在定义