User`s guide

2 Overview of a BSP
2.3 Components of a BSP
25
2
romInit.s
This assembly file contains the romInit( ) routine, which is the entry point for
bootstrapping, plus any romInit( ) subroutines. The romInit( ) routine must be the
first routine in the text segment of romInit.s.
At power-up (cold start) the processor begins execution at romInit( ). For warm
starts, the processor begins execution at romInit( ) plus a small offset (see
sysToMonitor( ) in sysLib.c). Most hardware and device initialization is
performed later in the boot sequence by sysHwInit( ), which is located in sysLib.c.
The job of romInit( ) is to perform the minimal setup needed to transfer control to
romStart( ), located in target/config/all/bootInit.c. The minimal setup includes:
Initializing the processor (this code is specific to the processor but not the
board, and thus can be copied from a reference BSP):
Mask processor interrupts
Set the initial stack pointer to
STACK_ADRS (defined in configAll.h)
Disable processor caches
Initializing access to target DRAM as needed for the following (this code is
board-specific):
Wait states
–Refresh rate
Chip-selects
Disabling secondary (L2) caches (if needed)
At the end of the initialization sequence, romInit( ) jumps to romStart( ) in
bootInit.c, passing the start type. The start type is
BOOT_COLD for a cold boot, or
the parameter passed from sysToMonitor( ) on a warm boot.
For more information, see romInit.s in a reference BSP or the template romInit.s
file in the template BSP. Also see 2.3.7 Hardware Considerations, p.42.
sysLib.c
The sysLib.c file contains the routines that directly or indirectly initialize all
hardware device drivers. The principal routines for initializing the hardware
drivers are sysHwInit( ) and sysHwInit2( ), but additional driver initialization
routines are called by usrRoot( ), such as sysClkConnect( ), which calls