Specifications
4
A Minimal PowerPCª Boot Sequence for
Executing Compiled C Program
s
PowerPC Processor Initialization
The procedure for initializing a pair of BAT registers is as follows:
1. Disable the MMU.
2. If modifying a data BAT, execute an
isync
instruction.
3. Initialize the lower portion of the BAT array entry.
4. Initialize the upper portion of the BAT array entry.
5. Execute an
isync
instruction.
6. Re-enable the MMU when all setup is complete.
Unused BAT registers must be invalidated by clearing the Vs and Vp bits in the upper BAT register before
enabling and translating.
For each region of memory to be mapped, an appropriate BL and BEPI must be chosen. The BL Þeld is an
encoding of the length of the block to be mapped. The BEPI Þeld corresponds to the upper bits of the logical
address of a region to be mapped onto physical memory. During address translation, addresses are compared
with the BEPI Þeld to determine if a BAT array hit has occurred.
Next, the BRPN must be chosen to indicate the physical memory onto which the logical region speciÞed by
the BEPI is to be mapped. For many minimal systems where the logical and physical addresses are
equivalent, including the sample located at the end of this document, the BEPI and BRPN will be equal.
Note that the values in the BEPI and BRPN Þelds must have at least as many low order zeroes as the BL has
ones. Otherwise, the results are boundedly undeÞned. The possible BL encodings are shown in Table 3.
The Vs and Vp bits in the upper BAT register, along with the PP bits in the lower BATs, specify the access
controls for the memory region. A region may be marked valid for supervisor mode, valid for user mode, or
valid for both modes; Table 4 shows these options.
Table 3. BL Encodings
Block Size BL Encoding
128 Kbytes 000 0000 0000
256 Kbytes 000 0000 0001
512 Kbytes 000 0000 0011
1 Mbyte 000 0000 0111
2 Mbytes 000 0000 1111
4 Mbytes 000 0001 1111
8 Mbytes 000 0011 1111
16 Mbytes 000 0111 1111
32 Mbytes 000 1111 1111
64 Mbytes 001 1111 1111
128 Mbytes 011 1111 1111
256 Mbytes 111 1111 1111