一、boot原理
1、解决系统启动 (参考s5pc100手册 ---> 2.1节 irom code)
The boot loader is divided into the BL0(1st boot loader) and the BL1(2nd boot loader).
• BL0 which is placed in iROM loads BL1 from the booting device to iRAM. The booting device is determined by
the OM and NFMOD pins. In addition, according to the secure boot key values, BL0 checks the integrity of
BL1.
• BL1 has to initialize the DRAM controller. After initializing the DRAM controller, it loads the OS image from the
booting device to DRAM. And, according to the secure boot key values, BL1 checks the integrity of the OS
image.
1)、由BL0配置判断以哪种方式启动,一般使用拨码头开关控制
The booting device can one of the followings,
• NAND Flash
• OneNAND
• MMC or SD Memory including MoviNAND and iNAND
• USB
2)、
Full booting sequence in BL0 is as follows, BL0中配置好的booting 引导顺序
a. Initialize the PLL & Clock setting with fixed value 初始化PLL与Clock为固定值
b. Initialize the stack and heap region. 初始化堆与栈寄存器
c. Initialize the Instruction Cache controller. 初始化指令高速缓存寄存器
d. Load BL1 from the booting device to iRAM.* 装载BL1到IRAM,上图上步骤2
e. If secure booting is enabled, execute integrity check. 若安全引导启用,执行完整性检查
f. If integrity check passes, then jump to 0x34010. (First 4words are reserved.) 若通过完整性检查,跳转到0x34010,前四个字被保留
g. If integrity check fails, then it stops. 若
完整性检查失败,那么将停止启动
* NOTE. In case of SD/MMC, iROM code loads 9KB at 0x34000 from the end of the booting device. <
在SD/MMC情况下,IROM代码只加载9K(从
SD/MMC中结尾处
),9K代码加载至IRAM的0x34000>
* NOTE. In case of OneNAND and NAND, iROM code loads 16KB at 0x34000 from the beginning (Block 0) of the
booting device. <
在OneNAND 和 NAND情况下,IROM代码只加载16K(从
NAND/ONENAND中开始处
),16K代码加载至IRAM的0x34000.>
一般定的boot代码远大于16K,那么可以将其放在DRAM中,此时只需要在该16K代码中注明这些信息。也就是常说到的自搬移操作。
* NOTE. Bad block information is in the 6th byte of the spare area in case of 512 byte page NAND devices. And
the other NAND devices have bad block information in the first byte of the spare area.<在1页为512字节的NAND设备上,坏块信息在备用区域中的第6个字节;其他NAND设备的坏块信息在备用区域中的第1个字节>
2
、map.lds 链接脚本
OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
/*OUTPUT_FORMAT("elf32-arm", "elf32-arm", "elf32-arm")*/
OUTPUT_ARCH(arm)
ENTRY(_start) //系统入口
SECTIONS
{