12 // complete init sequence taken from bootmii's ppc skeleton. thanks to segher
13 // after a talk with dhewg we came to that point that it's good to wipe+setup BATS correctly
17 // bus checkstops off, sleep modes off,
18 // caches off, caches invalidate,
19 // store gathering off, enable data cache
20 // flush assist, enable branch target cache,
21 // enable branch history table
28 lis r3,0x8200 //bits set: H4A(HID4 access), SBE(2nd BAT enabled)
35 mtspr IBAT0U,r0; mtspr IBAT1U,r0; mtspr IBAT2U,r0; mtspr IBAT3U,r0 // IBAT0...3
36 mtspr DBAT0U,r0; mtspr DBAT1U,r0; mtspr DBAT2U,r0; mtspr DBAT3U,r0 // DBAT0...3
38 mtspr IBAT4U,r0; mtspr IBAT5U,r0; mtspr IBAT6U,r0; mtspr IBAT7U,r0 // IBAT4...7
39 mtspr DBAT4U,r0; mtspr DBAT5U,r0; mtspr DBAT6U,r0; mtspr DBAT7U,r0 // DBAT4...7
45 mtsr 0,r0; mtsr 1,r0; mtsr 2,r0; mtsr 3,r0; mtsr 4,r0; mtsr 5,r0; mtsr 6,r0
46 mtsr 7,r0; mtsr 8,r0; mtsr 9,r0; mtsr 10,r0; mtsr 11,r0; mtsr 12,r0; mtsr 13,r0
47 mtsr 14,r0; mtsr 15,r0
50 // set [DI]BAT0 for 256MB@80000000,
51 // real 00000000, WIMG=0000, R/W
62 // set [DI]BAT4 for 256MB@90000000,
63 // real 10000000, WIMG=0000, R/W
73 // set DBAT1 for 256MB@c0000000,
74 // real 00000000, WIMG=0101, R/W
83 // set DBAT5 for 256MB@d0000000,
84 // real 10000000, WIMG=0101, R/W
93 ori r3,r3,MSR_DR|MSR_IR
102 # Enable the Floating Point Registers
110 # Clear all of the PS FPR's to 0
146 # Clear all of the FPR's to 0
185 .extern ICFlashInvalidate
224 rlwinm. r0,r3, 0, 16, 16 // Check if the Instruction Cache has been enabled or not.
230 rlwinm. r0, r3, 0, 17, 17 // Check if the Data Cache has been enabled or not.
237 clrrwi. r0, r3, 31 // Check if the Locked Cache has been enabled or not.
244 # Restore the non-volatile registers to their previous values and return.
260 # Disable interrupts!
266 # Clear various SPR's
278 oris r3,r3,0x0190 //set additional bits in HID4: SR0(store 0), LPE(PS LE exception), L2CFI(L2 castout prior to L2 inv. flash)
283 # Disable Speculative Bus Accesses to non-guarded space from both caches.
289 # Set the Non-IEEE mode in the FPSCR
292 # Disable Write Gather Pipe
293 mfspr r3,HID2 # (HID2)
294 rlwinm r3, r3, 0, 2, 0
295 mtspr HID2,r3 # (HID2)
298 # Restore the non-volatile registers to their previous values and return.
358 lis r3,__configBATS@h
359 ori r3,r3,__configBATS@l
364 .globl SYS_SwitchFiber