Specifications
A Minimal PowerPCª Boot Sequence for 21
Executing Compiled C Programs
Source Files
// turn off the L2I global invalidate bit
mfspr r3, l2cr
rlwinm r3,r3,0,11,9
mtspr l2cr, r3
#endif // L2CACHE_ENABLE
// Note MSR state at power-up:
// all exceptions disabled, address translation off,
// Exception prefix at 0xfff00000, FP disabled
#if MMU_ON == 1
// If the code specifies that weÕre going to use the MMU, branch to
// to the setup function that handles setting up the BATs and
// invalidating TLB entries.
//
// NOTE: WeÕve done nothing with the segment registers, so we need to
// be sure that all memory accessed by this code and by the user
// program is represented in the BATs. Otherwise, we might get
// some spurious translations.
bl setup_bats
sync
bl address_translation_on
sync
#endif
// relocate the text, data, and bss segments
bl relocate_image
// Note: This code is run from reset, so we assume that there is no
// data that needs to be flushed from the cache. This code only
// invalidates and enables the caches, it does not flush!
//
// Note: The caches are enabled *after* the relocation in order
// to help avoid cache preloading.
#if DCACHE_ON == 1
bl invalidate_and_enable_L1_dcache
#endif
#if ICACHE_ON == 1
bl invalidate_and_enable_L1_icache
#endif
#if L2CACHE_ENABLE == 1
addis r3,r0,L2_ENABLE@h
ori r3,r3,L2_ENABLE@l
mtspr l2cr,r3
#endif