
VxWorks
BSP Developer’s Guide, 6.0
16
The purpose of this routine is to initialize the CPU and some portion of memory. It
does the absolute minimum amount of initialization—that is, the initialization of
essential hardware only—before jumping to romStart( ). If romInit( ) is working
correctly, the memory from
LOCAL_MEM_LOCAL_ADRS through
(
LOCAL_MEM_LOCAL_ADRS + LOCAL_MEM_SIZE) should be readable and
writable. If this is not the case, romInit( ) is not working properly.
In addition to initializing memory as described above, the romInit( ) routine must
also disable interrupts and clear caches. romInit( ) then configures the boot type
(cold or warm) to be a subroutine argument and branches to romStart( ) in
bootInit.c. For more information on configuring the boot type, see 2.3.7 Hardware
Considerations, p.42.
romInit( ) must do only as much device setup as is required to start executing C
code. Hardware initialization is the responsibility of the sysHwInit( ) routine in
target/config/sysLib.c, which is called later during the boot sequence.
Step 2: Execute romStart( )
The purpose of the romStart( ) routine is to move all further bootstrap code from
ROM into RAM and then, if necessary, jump to the VxWorks image. Because this
implementation depends only on the CPU architecture, the romStart( ) routine is
provided by Wind River and is located in the file bootInit.c. Typically, romStart( )
jumps to the usrInit( ) routine in RAM.
The required execution steps are as follows:
1. Copy the data segment from flash to ROM. Depending on the image type, you
may also need to copy the text segment. If necessary, decompress the data
during the copy.
2. Clear unused RAM.
3. The romStart( ) routine then jumps to the RAM entry point, sysInit( ), which
is located in sysALib.s. The boot type (cold or warm) is passed as an argument
to sysInit( ).
Step 3: Execute sysInit( )
The sysInit( ) routine is the RAM entry point. sysInit( )—which should be the first
routine defined in sysALib.s—invalidates caches if applicable, initializes the
system interrupt tables with default stubs, initializes the system fault tables with
default stubs, and initializes all processor registers to known default values. The
routine also enables tracing, clears all pending interrupts, and finally invokes
usrInit( ) with the argument bootType.
Comentarios a estos manuales