Specifications

A Minimal PowerPCÂȘ Boot Sequence for 27
Executing Compiled C Programs
Source Files
addis r4,r0,IBAT3L_VAL@h
ori r4,r4,IBAT3L_VAL@l
addis r3,r0,IBAT3U_VAL@h
ori r3,r3,IBAT3U_VAL@l
mtspr ibat3l,r4
mtspr ibat3u,r3
isync
addis r4,r0,DBAT3L_VAL@h
ori r4,r4,DBAT3L_VAL@l
addis r3,r0,DBAT3U_VAL@h
ori r3,r3,DBAT3U_VAL@l
mtspr dbat3l,r4
mtspr dbat3u,r3
isync
// BATs are now set up, now invalidate tlb entries
addis r3,0,0x0000
#ifdef MPC603e
addis r5,0,0x2 // set up high bound of 0x00020000 for 603e
#endif
#if defined(MPC750) || defined(MPC7400)
addis r5,0,0x4 // 750/MAX have 2x as many tlbs as 603e
#endif
isync
// Recall that in order to invalidate TLB entries, the value issued to
// tlbie must increase the value in bits 14:19 (750, MAX) or 15:19(603e)
// by one each iteration.
tlblp:
tlbie r3
sync
addi r3,r3,0x1000
cmp 0,0,r3,r5 // check if all TLBs invalidated yet
blt tlblp
blr
//-----------------------------------------------------------------------
// Function: invalidate_and_enable_L1_dcache
//
// Flash invalidate and enable the L1 dcache
//-----------------------------------------------------------------------
invalidate_and_enable_L1_dcache:
mfspr r5,hid0
ori r5,r5,0x4400
sync
mtspr hid0,r5