ARM versatile uboot 实现过程,是假设ARM Boot_Monitor先于uboot运行。如果想脱离Boot_Monitor 实现由uboot的NOR flash 启动,需要做以下修改。
Revision to code tree
To enable autoboot from uboot, i.e. get rid of Boot_Monitor from the booting phase, following should be done
1. Init SDRAM
This can be done in lowlevel_init.S in the board/versatile folder. The SDRAM init could be copied from Boot_Monitor: platform code sysboot.S
2. Enable REMAP
after cpu_init function, set PC to PC+ #NOR_FLASH (when NOR_FLASH boot enabled, NOR_FLASH could be seen from both address 0x0 and the real 0x34000000 address.); set REMAP register. After remap, the 0x0 is the SDRAM space. Relocation could be done after this, by copying the code (adr r0, _start) to link address (TEXT_BASE). PC could then go back to the linked address and run.
3. Copy the vector table
copy the expection vector table to 0x0