+; 7450 - Specific
+
+init7450:
+ bf firstBoot, init745X ; Not boot, use standard init
+
+ mfspr r13, pir ; Get BootConfig from PIR
+ rlwinm. r14, r13, 0, 20, 23 ; Is the pdet value zero
+ bne init7450done ; No, done for now
+
+ ori r13, r13, 0x0400 ; Force pdet value to 4
+ mtspr pir, r13 ; Write back the BootConfig
+
+init7450done:
+ b init745X ; Continue with standard init
+
+
+init970:
+ lis r20,8 ; Set up for 512K L2
+init970x:
+ li r0,0 ; Clear this
+ mtspr hior,r0 ; Make sure that 0 is interrupt prefix
+ bf firstBoot,init970nb ; No init for wakeup or second processor....
+
+
+;
+; We can not query or change the L2 size. We will just
+; phoney up a L2CR to make sysctl "happy" and set the
+; L2 size to 512K.
+;
+
+ lis r0,0x8000 ; Synthesize a "valid" but non-existant L2CR
+ stw r0,pfl2crOriginal(r30) ; Set a dummy L2CR
+ stw r0,pfl2cr(r30) ; Set a dummy L2CR
+ stw r20,pfl2Size(r30) ; Set the L2 size
+
+ mfspr r11,hid0 ; Get original hid0
+ std r11,pfHID0(r30) ; Save original
+ mfspr r11,hid1 ; Get original hid1
+ std r11,pfHID1(r30) ; Save original
+ mfspr r11,hid4 ; Get original hid4
+ std r11,pfHID4(r30) ; Save original
+ mfspr r11,hid5 ; Get original hid5
+ std r11,pfHID5(r30) ; Save original
+
+ lis r0, hi16(dnapm) ; Create a mask for the dnap bit
+ sldi r0, r0, 32 ; Shift to the top half
+ ld r11,pfHID0(r30) ; Load the hid0 value
+ andc r11, r11, r0 ; Clear the dnap bit
+ isync
+ mtspr hid0,r11 ; Stuff it
+ mfspr r11,hid0 ; Get it
+ mfspr r11,hid0 ; Get it
+ mfspr r11,hid0 ; Get it
+ mfspr r11,hid0 ; Get it
+ mfspr r11,hid0 ; Get it
+ mfspr r11,hid0 ; Get it
+ isync
+
+ lis r0,(pcfValid|pcfLarge|pcfDedSeg)<<8 ; Set the valid bit, dedicated segment, and large page flags
+ ori r0,r0,(24<<8)|24 ; Add in the 16M page size
+ stw r0,lgpPcfg+(pcfSize*pcfLargePcfg)(0) ; Set the 16M primary large page configuration entry
+
+ blr
+
+;
+; Start up code for second processor or wake up from sleep
+;
+
+init970nb:
+ lis r0, hi16(dnapm) ; Create a mask for the dnap bit
+ sldi r0, r0, 32 ; Shift to the top half
+ ld r11,pfHID0(r30) ; Load the hid0 value
+ andc r11, r11, r0 ; Clear the dnap bit
+ isync
+ mtspr hid0,r11 ; Stuff it
+ mfspr r11,hid0 ; Get it
+ mfspr r11,hid0 ; Get it
+ mfspr r11,hid0 ; Get it
+ mfspr r11,hid0 ; Get it
+ mfspr r11,hid0 ; Get it
+ mfspr r11,hid0 ; Get it
+ isync
+
+ ld r20,pfHID1(r30) ; Get it
+ isync
+ mtspr hid1,r20 ; Stick it
+ mtspr hid1,r20 ; Stick it again
+ isync
+
+ ld r11,pfHID4(r30) ; Get it
+ sync
+ mtspr hid4,r11 ; Stick it
+ isync
+
+ lis r11,0xE000 ; Get the unlikeliest ESID possible
+ srdi r11,r11,1 ; Make 0x7FFFFFFFF0000000
+ slbie r11 ; Make sure the ERAT is cleared
+
+ ld r11,pfHID5(r30) ; Get it
+ mtspr hid5,r11 ; Set it
+ isync
+;
+; May have changed dcbz mode so kill icache
+;
+
+ eqv r13,r13,r13 ; Get a constant -1
+ mr r14,r20 ; Save HID1
+ rldimi r14,r13,54,9 ; Set force icbi match mode
+
+ li r11,0 ; Set start if ICBI range
+ isync
+ mtspr hid1,r14 ; Stick it
+ mtspr hid1,r14 ; Stick it again
+ isync
+
+inin970ki: icbi 0,r11 ; Kill I$
+ addi r11,r11,128 ; Next line
+ andis. r0,r11,1 ; Have we done them all?
+ beq++ inin970ki ; Not yet...
+
+ isync
+ mtspr hid1,r20 ; Stick it
+ mtspr hid1,r20 ; Stick it again
+ isync
+
+ blr ; Leave...
+
+
+
+; Unsupported Processors
+initUnsupported:
+ mtlr r2 ; Restore the return address
+ blr ; Return to the booter
+