本文轉自http://blog.csdn.net/mutemob/article/details/8708401供學習參考
CPU上電後,此時SP指針指向0x0000_0000,從這個地址取第一條指令。但此時:PLL沒有啓動,CPU工作頻率爲外部輸入晶振頻率,非常低(S5PV210中晶振在CPU旁邊,兩顆24MHz,一顆27MHz);CPU的工作模式、中斷設置等不確定;存儲空間的各個BANK(包括內存)都沒有驅動,內存不能使用。在這種情況下必須在第一條指令處做一些初始化工作,這段初始化程序與操作系統獨立分開,稱之爲Bootloader。下面以S5PV210用的U-BOOT爲例:
友善之臂Tiny210 SDK2用的是三星公司的S5PV210,在開始U-BOOT的移植之前,有必要弄清楚S5PV210的啓動過程:
再來看旁邊XOM的一個信號反相器74LVC1G04的圖
繼續看芯片手冊,手冊上關於iROM/iRAM及Bootloader描述如下:
- The iROM code is placed in internal 64KB ROM. It initializes basic system functions such as clock, stack, and heap.
- The iROM loads the first boot loader image from a specific booting device to internal 96KB SRAM. The booting device is selected by Operating Mode (OM) pins. According to the secure boot key values, the iROM code may do an integrity check on the first bootloader image.
- The first boot loader loads the second boot loader then may check the integrity of the second boot loader according the secure boot key values.
- The second boot loader initializes system clock, UART, and DRAM controller. After initializing DRAM controller, it loads OS image from the booting device to DRAM. According to the secure boot key values, the second boot loader can do an integrity checkon the OS image.
- After the booting completes, the second boot loader jumps to the operating system.