Download User`s Manual

Transcript
Appendix E Safe Start and Alternate Boot Image
Board State Requirements
Alternate boot images may expect the board to be in a particular state. Hence, the MOTLoad
boot loader attempts to generalize the state of the system as follows upon transferring control:
❏
The MMU is disabled.
❏
L1 instruction cache has been initialized and is enabled.
❏
L1 data cache has been initialized (invalidated) and disabled.
❏
L2 cache is disabled.
❏
L3 cache is disabled (if present).
❏
UART is initialized
❏
RAM is initialized and is mapped starting at CPU address 0.
❏
RAM is scrubbed of ECC or parity errors if RAM ECC or parity is supported.
❏
The active Flash bank (boot) is mapped to the upper end of the address space.
❏
Image is copied to RAM at the address specified by ImageRamAddress if specified by
COPY_TO_RAM.
❏
CPU register R1 (the stack pointer) is initialized to a value near the end of RAM.
❏
CPU register R3 contains a pointer to the alternate boot data structure.
The boot loader does not perform further initialization of the board than that specified prior to
transferring control to an alternate boot image. Alternate boot images need to initialize the
board to whatever state the images may further require for its execution.
Only POST images are expected, but not required, to return to the boot loader. Upon return, the
boot loader proceeds with the scan for alternate boot images. A POST image that returns
control to the boot loader must ensure that upon return the state of the board is consistent with
the state of the board prior to POST entry.
Alternate Boot Data Structure
The MOTLoad boot loader uses an alternate boot data structure to provide a user a mechanism
to pass POST results to subsequent boot images. The global Data field of the data structure
points to an area of RAM that is available for data storage. This RAM location is initialized to
zeroes. The boot loader does not clear this area of RAM after execution of a POST image or
other alternate boot images.
The alternate boot data structure also provides function pointers to ROM-based UART function
calls. This enables booted images to have early access to the console serial port. Below is a
description of the alternate boot data structure.
/*
* Structure passed to booted image.
*/
typedef struct altBootData {
unsigned int ramSize;/* board’s RAM size in MB */
void *flashPtr;/* ptr to this image in flash */
char boardType[16];/* board name string */
void *globalData;/* 16KB of user defined data, zeroed */
pVoidFunction_t romCpuGet; /* function ptr to CPU-get call */
198
MOTLoad Firmware Package User’s Manual (MOTLODA/UM4)