]>
Commit | Line | Data |
---|---|---|
1c79356b A |
1 | /* |
2 | * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
e5568f75 A |
6 | * The contents of this file constitute Original Code as defined in and |
7 | * are subject to the Apple Public Source License Version 1.1 (the | |
8 | * "License"). You may not use this file except in compliance with the | |
9 | * License. Please obtain a copy of the License at | |
10 | * http://www.apple.com/publicsource and read it before using this file. | |
1c79356b | 11 | * |
e5568f75 A |
12 | * This Original Code and all software distributed under the License are |
13 | * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER | |
1c79356b A |
14 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
15 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
e5568f75 A |
16 | * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the |
17 | * License for the specific language governing rights and limitations | |
18 | * under the License. | |
1c79356b A |
19 | * |
20 | * @APPLE_LICENSE_HEADER_END@ | |
21 | */ | |
22 | /* | |
23 | * @OSF_COPYRIGHT@ | |
24 | */ | |
43866e37 A |
25 | |
26 | #define __APPLE_API_PRIVATE | |
27 | ||
1c79356b A |
28 | #include <cpus.h> |
29 | #include <mach_kdb.h> | |
30 | #include <mach_kdp.h> | |
31 | #include <mach_kgdb.h> | |
32 | #include <ppc/asm.h> | |
33 | #include <ppc/proc_reg.h> | |
9bccf70c | 34 | #include <ppc/spec_reg.h> |
43866e37 | 35 | #include <machine/cpu_capabilities.h> |
1c79356b A |
36 | #include <mach/ppc/vm_param.h> |
37 | #include <assym.s> | |
38 | ||
43866e37 A |
39 | #define ptFilter 0 |
40 | #define ptVersion 4 | |
41 | #define ptRevision 6 | |
42 | #define ptFeatures 8 | |
43 | #define ptCPUCap 12 | |
4a249263 A |
44 | #define ptPwrModes 16 |
45 | #define ptPatch 20 | |
46 | #define ptInitRout 24 | |
47 | #define ptRptdProc 28 | |
483a1d10 A |
48 | #define ptLineSize 32 |
49 | #define ptl1iSize 36 | |
50 | #define ptl1dSize 40 | |
51 | #define ptPTEG 44 | |
52 | #define ptMaxVAddr 48 | |
53 | #define ptMaxPAddr 52 | |
54 | #define ptSize 56 | |
1c79356b A |
55 | |
56 | #define bootCPU 10 | |
57 | #define firstInit 9 | |
58 | #define firstBoot 8 | |
0b4e3aa0 | 59 | |
1c79356b A |
60 | /* |
61 | * Interrupt and bootup stack for initial processor | |
62 | */ | |
63 | ||
64 | .file "start.s" | |
65 | ||
1c79356b A |
66 | /* |
67 | * All CPUs start here. | |
68 | * | |
69 | * This code is called from SecondaryLoader | |
70 | * | |
71 | * Various arguments are passed via a table: | |
55e303ae | 72 | * R3 = pointer to other startup parameters |
1c79356b A |
73 | */ |
74 | .text | |
55e303ae A |
75 | |
76 | ENTRY(resetPOR,TAG_NO_FRAME_USED) | |
77 | ||
78 | li r12,0 ; Get a 0 | |
79 | stw r12,0xF0(0) ; Make sure the special flag is clear | |
80 | mtmsrd r12 ; Make sure we are in 32-bit mode | |
81 | isync ; Really make sure | |
82 | lwz r3,0xF4(0) ; Get the boot_args pointer | |
83 | b startJoin ; Join up... | |
84 | ||
85 | ||
1c79356b A |
86 | ENTRY(_start_cpu,TAG_NO_FRAME_USED) |
87 | crclr bootCPU ; Set non-boot processor | |
88 | crclr firstInit ; Set not first time init | |
89 | mr r30,r3 ; Set current per_proc | |
90 | ||
91 | ; | |
92 | ; Note that we are just trying to get close. The real TB sync will take | |
93 | ; place later. The value we are loading is set in two places. For the | |
94 | ; main processor, it will be the TB at the last interrupt before we went | |
95 | ; to sleep. For the others, it will be the time just before the main | |
96 | ; processor woke us up. | |
97 | ; | |
98 | ||
99 | lwz r15,ruptStamp(r3) ; Get the timebase from the other processor | |
100 | li r17,0 ; Clear this out | |
101 | lwz r16,ruptStamp+4(r3) ; Get the timebase from the other processor | |
102 | mtspr tbl,r17 ; Clear bottom so we do not tick | |
103 | mtspr tbu,r15 ; Set top | |
104 | mtspr tbl,r16 ; Then bottom again | |
1c79356b A |
105 | b allstart |
106 | ||
107 | ENTRY(_start,TAG_NO_FRAME_USED) | |
108 | ||
55e303ae A |
109 | startJoin: |
110 | mflr r2 ; Save the return address | |
1c79356b A |
111 | lis r30,hi16(EXT(per_proc_info)) ; Set current per_proc |
112 | ori r30,r30,lo16(EXT(per_proc_info)) ; Set current per_proc | |
113 | crset bootCPU ; Set boot processor | |
114 | ||
115 | lwz r17,pfAvailable(r30) ; Get the available bits | |
116 | rlwinm. r0,r17,0,pfValidb,pfValidb ; Have we initialized the feature flags yet? | |
117 | crmove firstInit,cr0_eq ; Set if we are doing first time init | |
118 | bne allstart ; Yeah, we must be waking up from sleep... | |
119 | ||
120 | ; | |
121 | ; Here is where we do any one time general low-level initialization | |
122 | ||
123 | lis r20,HIGH_ADDR(fwdisplock) ; Get address of the firmware display lock | |
124 | li r19,0 ; Zorch a register | |
125 | ori r20,r20,LOW_ADDR(fwdisplock) ; Get address of the firmware display lock | |
126 | stw r19,0(r20) ; Make sure the lock is free | |
127 | ||
43866e37 A |
128 | allstart: |
129 | mr r31,r3 ; Save away arguments | |
130 | ||
131 | crand firstBoot,bootCPU,firstInit ; Indicate if we are on the initial first processor startup | |
132 | ||
d7e50217 | 133 | mtsprg 0,r30 ; Set the per_proc |
1c79356b | 134 | |
de355530 | 135 | li r9,0 ; Clear out a register |
55e303ae | 136 | mtsprg 1,r9 ; Clear the SPRGs |
de355530 A |
137 | mtsprg 2,r9 |
138 | mtsprg 3,r9 | |
139 | ||
55e303ae A |
140 | li r7,MSR_VM_OFF ; Get real mode MSR |
141 | mtmsr r7 ; Set the real mode SRR | |
142 | isync | |
143 | ||
1c79356b A |
144 | lis r26,hi16(processor_types) ; Point to processor table |
145 | ori r26,r26,lo16(processor_types) ; Other half | |
146 | mfpvr r10 ; Get the PVR | |
147 | ||
148 | nextPVR: lwz r28,ptFilter(r26) ; Get the filter | |
149 | lwz r27,ptVersion(r26) ; Get the version and revision codes | |
150 | and r28,r10,r28 ; Throw away dont care bits | |
151 | cmplw r27,r28 ; Is this the right set? | |
152 | beq donePVR ; We have the right one... | |
153 | addi r26,r26,ptSize ; Point to the next type | |
154 | b nextPVR ; Check it out... | |
155 | ||
156 | donePVR: lwz r20,ptInitRout(r26) ; Grab the special init routine | |
157 | mtlr r20 ; Setup to call the init | |
158 | ||
43866e37 | 159 | bf firstBoot,notFirst ; Not first boot, go... |
1c79356b A |
160 | |
161 | ; | |
162 | ; The following code just does a general initialization of the features just | |
163 | ; after the initial first-time boot. This is not done after waking up or on | |
55e303ae A |
164 | ; any "secondary" processor. Just after the boot-processor init, we copy the |
165 | ; features to any possible per_proc. | |
1c79356b A |
166 | ; |
167 | ; We are just setting defaults. The specific initialization code will modify these | |
168 | ; if necessary. | |
169 | ; | |
55e303ae A |
170 | lis r18,hi16(EXT(_cpu_capabilities)) ; Get the address of _cpu_capabilities |
171 | ori r18,r18,lo16(EXT(_cpu_capabilities)) | |
43866e37 | 172 | lwz r17,ptCPUCap(r26) ; Get the default cpu capabilities |
55e303ae | 173 | stw r17, 0(r18) ; Save the default value in _cpu_capabilities |
1c79356b A |
174 | |
175 | lwz r17,ptFeatures(r26) ; Pick up the features | |
176 | ||
55e303ae A |
177 | lwz r18,ptRptdProc(r26) ; Get the reported processor |
178 | sth r18,pfrptdProc(r30) ; Set the reported processor | |
1c79356b | 179 | |
4a249263 A |
180 | lwz r13,ptPwrModes(r26) ; Get the supported power modes |
181 | stw r13,pfPowerModes(r30) ; Set the supported power modes | |
182 | ||
1c79356b A |
183 | lwz r13,ptLineSize(r26) ; Get the cache line size |
184 | sth r13,pflineSize(r30) ; Save it | |
185 | lwz r13,ptl1iSize(r26) ; Get icache size | |
186 | stw r13,pfl1iSize(r30) ; Save it | |
187 | lwz r13,ptl1dSize(r26) ; Get dcache size | |
188 | stw r13,pfl1dSize(r30) ; Save it | |
55e303ae A |
189 | lwz r13,ptPTEG(r26) ; Get PTEG size address |
190 | stw r13,pfPTEG(r30) ; Save it | |
191 | lwz r13,ptMaxVAddr(r26) ; Get max virtual address | |
192 | stw r13,pfMaxVAddr(r30) ; Save it | |
193 | lwz r13,ptMaxPAddr(r26) ; Get max physical address | |
194 | stw r13,pfMaxPAddr(r30) ; Save it | |
195 | lis r11,hi16(EXT(patch_table)) | |
196 | ori r11,r11,lo16(EXT(patch_table)) | |
197 | lwz r19,ptPatch(r26) ; Get ptPatch field | |
198 | li r12,PATCH_TABLE_SIZE | |
199 | mtctr r12 | |
200 | patch_loop: | |
201 | lwz r16,patchType(r11) ; Load the patch type | |
202 | lwz r15,patchValue(r11) ; Load the patch value | |
203 | cmplwi cr1,r16,PATCH_FEATURE ; Is it a patch feature entry | |
204 | and. r14,r15,r19 ; Is it set in the patch feature | |
205 | crandc cr0_eq,cr1_eq,cr0_eq ; Do we have a match | |
206 | beq patch_apply ; Yes, patch memory | |
207 | cmplwi cr1,r16,PATCH_PROCESSOR ; Is it a patch processor entry | |
208 | cmplw cr0,r15,r18 ; Check matching processor | |
209 | crand cr0_eq,cr1_eq,cr0_eq ; Do we have a match | |
210 | bne patch_skip ; No, skip patch memory | |
211 | patch_apply: | |
212 | lwz r13,patchAddr(r11) ; Load the address to patch | |
213 | lwz r14,patchData(r11) ; Load the patch data | |
214 | stw r14,0(r13) ; Patch the location | |
215 | dcbf 0,r13 ; Flush the old one | |
216 | sync ; Make sure we see it all | |
217 | icbi 0,r13 ; Flush the i-cache | |
218 | isync ; Hang out | |
219 | sync ; Hang out some more... | |
220 | patch_skip: | |
221 | addi r11,r11,peSize ; Point to the next patch entry | |
222 | bdnz patch_loop ; Loop if in the range | |
1c79356b A |
223 | b doOurInit ; Go do processor specific initialization... |
224 | ||
225 | notFirst: lwz r17,pfAvailable(r30) ; Get our features | |
1c79356b | 226 | |
55e303ae A |
227 | doOurInit: mr. r20,r20 ; See if initialization routine |
228 | crand firstBoot,bootCPU,firstInit ; Indicate if we are on the initial first processor startup | |
229 | bnelrl ; Do the initialization | |
230 | ||
231 | ori r17,r17,lo16(pfValid) ; Set the valid bit | |
232 | stw r17,pfAvailable(r30) ; Set the available features | |
233 | ||
234 | bf firstBoot,nofeatcpy ; Skip feature propagate if not first time boot... | |
235 | ||
236 | li r2,NCPUS ; Get number of CPUs | |
1c79356b A |
237 | lis r23,hi16(EXT(per_proc_info)) ; Set base per_proc |
238 | ori r23,r23,lo16(EXT(per_proc_info)) ; Set base per_proc | |
55e303ae | 239 | addi r6,r23,ppSize ; Point to the next one |
1c79356b | 240 | |
55e303ae | 241 | cpyFCpu: addic. r2,r2,-1 ; Count down |
1c79356b | 242 | la r8,pfAvailable(r23) ; Point to features of boot processor |
55e303ae | 243 | la r7,pfAvailable(r6) ; Point to features of our processor |
483a1d10 | 244 | li r9,pfSize/4 ; Get size of a features area |
55e303ae | 245 | ble-- nofeatcpy ; Copied all we need |
1c79356b A |
246 | |
247 | cpyFeat: subi r9,r9,1 ; Count word | |
248 | lwz r0,0(r8) ; Get boot cpu features | |
249 | stw r0,0(r7) ; Copy to ours | |
250 | mr. r9,r9 ; Finished? | |
251 | addi r7,r7,4 ; Next out | |
252 | addi r8,r8,4 ; Next in | |
253 | bgt cpyFeat ; Copy all boot cpu features to us... | |
d7e50217 | 254 | |
55e303ae A |
255 | lwz r17,pfAvailable(r6) ; Get our newly initialized features |
256 | addi r6,r6,ppSize ; Point to the next one | |
257 | b cpyFCpu ; Do the next per_proc... | |
1c79356b | 258 | |
55e303ae A |
259 | |
260 | nofeatcpy: rlwinm. r0,r17,0,pf64Bitb,pf64Bitb ; Is this a 64-bit machine? | |
de355530 | 261 | mtsprg 2,r17 ; Remember the feature flags |
55e303ae A |
262 | |
263 | bne++ start64 ; Skip following if 64-bit... | |
264 | ||
265 | mfspr r6,hid0 ; Get the HID0 | |
266 | rlwinm r6,r6,0,sleep+1,doze-1 ; Remove any vestiges of sleep | |
267 | mtspr hid0,r6 ; Set the insominac HID0 | |
268 | isync | |
269 | ||
270 | ; Clear the BAT registers | |
271 | ||
272 | li r9,0 ; Clear out a register | |
273 | sync | |
274 | isync | |
275 | mtdbatu 0,r9 ; Invalidate maps | |
276 | mtdbatl 0,r9 ; Invalidate maps | |
277 | mtdbatu 1,r9 ; Invalidate maps | |
278 | mtdbatl 1,r9 ; Invalidate maps | |
279 | mtdbatu 2,r9 ; Invalidate maps | |
280 | mtdbatl 2,r9 ; Invalidate maps | |
281 | mtdbatu 3,r9 ; Invalidate maps | |
282 | mtdbatl 3,r9 ; Invalidate maps | |
283 | sync | |
284 | isync | |
285 | mtibatu 0,r9 ; Invalidate maps | |
286 | mtibatl 0,r9 ; Invalidate maps | |
287 | mtibatu 1,r9 ; Invalidate maps | |
288 | mtibatl 1,r9 ; Invalidate maps | |
289 | mtibatu 2,r9 ; Invalidate maps | |
290 | mtibatl 2,r9 ; Invalidate maps | |
291 | mtibatu 3,r9 ; Invalidate maps | |
292 | mtibatl 3,r9 ; Invalidate maps | |
293 | sync | |
294 | isync | |
295 | b startcommon ; Go join up the common start routine | |
d7e50217 | 296 | |
55e303ae A |
297 | start64: lis r5,hi16(startcommon) ; Get top of address of continue point |
298 | mfspr r6,hid0 ; Get the HID0 | |
299 | ori r5,r5,lo16(startcommon) ; Get low of address of continue point | |
300 | lis r9,hi16(MASK(MSR_HV)) ; ? | |
301 | lis r20,hi16(dozem|napm|sleepm) ; Get mask of power saving features | |
302 | li r7,MSR_VM_OFF ; Get real mode MSR, 64-bit off | |
303 | sldi r9,r9,32 ; Slide into position | |
304 | sldi r20,r20,32 ; Slide power stuff into position | |
305 | or r9,r9,r7 ; Form initial MSR | |
306 | andc r6,r6,r20 ; Remove any vestiges of sleep | |
307 | isync | |
308 | mtspr hid0,r6 ; Set the insominac HID0 | |
309 | mfspr r6,hid0 ; Get it | |
310 | mfspr r6,hid0 ; Get it | |
311 | mfspr r6,hid0 ; Get it | |
312 | mfspr r6,hid0 ; Get it | |
313 | mfspr r6,hid0 ; Get it | |
314 | mfspr r6,hid0 ; Get it | |
315 | isync | |
316 | mtsrr0 r5 ; Set the continue point | |
317 | mtsrr1 r9 ; Set our normal disabled MSR | |
318 | rfid ; Tally ho... | |
319 | ||
320 | .align 5 | |
321 | ||
322 | startcommon: | |
1c79356b A |
323 | rlwinm. r0,r17,0,pfFloatb,pfFloatb ; See if there is floating point |
324 | beq- noFloat ; Nope, this is a really stupid machine... | |
325 | ||
326 | li r0,MSR_VM_OFF|MASK(MSR_FP) ; Enable for floating point | |
327 | mtmsr r0 /* Set the standard MSR values */ | |
328 | isync | |
329 | ||
330 | lis r5,HIGH_ADDR(EXT(FloatInit)) /* Get top of floating point init value */ | |
331 | ori r5,r5,LOW_ADDR(EXT(FloatInit)) /* Slam bottom */ | |
332 | lfd f0,0(r5) /* Initialize FP0 */ | |
333 | fmr f1,f0 /* Ours in not */ | |
334 | fmr f2,f0 /* to wonder why, */ | |
335 | fmr f3,f0 /* ours is but to */ | |
336 | fmr f4,f0 /* do or die! */ | |
337 | fmr f5,f0 | |
338 | fmr f6,f0 | |
339 | fmr f7,f0 | |
340 | fmr f8,f0 | |
341 | fmr f9,f0 | |
342 | fmr f10,f0 | |
343 | fmr f11,f0 | |
344 | fmr f12,f0 | |
345 | fmr f13,f0 | |
346 | fmr f14,f0 | |
347 | fmr f15,f0 | |
348 | fmr f16,f0 | |
349 | fmr f17,f0 | |
350 | fmr f18,f0 | |
351 | fmr f19,f0 | |
352 | fmr f20,f0 | |
353 | fmr f21,f0 | |
354 | fmr f22,f0 | |
355 | fmr f23,f0 | |
356 | fmr f24,f0 | |
357 | fmr f25,f0 | |
358 | fmr f26,f0 | |
359 | fmr f27,f0 | |
360 | fmr f28,f0 | |
361 | fmr f29,f0 | |
362 | fmr f30,f0 | |
363 | fmr f31,f0 | |
364 | ||
365 | li r0, MSR_VM_OFF ; Turn off floating point | |
366 | mtmsr r0 | |
367 | isync | |
368 | ||
369 | noFloat: rlwinm. r0,r17,0,pfAltivecb,pfAltivecb ; See if there is Altivec | |
370 | beq- noVector ; Nope... | |
371 | ||
372 | li r0,0 ; Clear out a register | |
373 | ||
374 | lis r7,hi16(MSR_VEC_ON) ; Get real mode MSR + Altivec | |
375 | ori r7,r7,lo16(MSR_VM_OFF) ; Get real mode MSR + Altivec | |
376 | mtmsr r7 ; Set the real mode SRR */ | |
377 | isync ; Make sure it has happened | |
378 | ||
379 | lis r5,hi16(EXT(QNaNbarbarian)) ; Altivec initializer | |
380 | ori r5,r5,lo16(EXT(QNaNbarbarian)) ; Altivec initializer | |
381 | ||
382 | mtspr vrsave,r0 ; Set that no VRs are used yet */ | |
383 | ||
55e303ae A |
384 | vspltish v1,1 ; Turn on the non-Java bit and saturate |
385 | vspltisw v0,1 ; Turn on the saturate bit | |
386 | vxor v1,v1,v0 ; Turn off saturate and leave non-Java set | |
1c79356b A |
387 | lvx v0,br0,r5 ; Initialize VR0 |
388 | mtvscr v1 ; Clear the vector status register | |
389 | vor v2,v0,v0 ; Copy into the next register | |
390 | vor v1,v0,v0 ; Copy into the next register | |
391 | vor v3,v0,v0 ; Copy into the next register | |
392 | vor v4,v0,v0 ; Copy into the next register | |
393 | vor v5,v0,v0 ; Copy into the next register | |
394 | vor v6,v0,v0 ; Copy into the next register | |
395 | vor v7,v0,v0 ; Copy into the next register | |
396 | vor v8,v0,v0 ; Copy into the next register | |
397 | vor v9,v0,v0 ; Copy into the next register | |
398 | vor v10,v0,v0 ; Copy into the next register | |
399 | vor v11,v0,v0 ; Copy into the next register | |
400 | vor v12,v0,v0 ; Copy into the next register | |
401 | vor v13,v0,v0 ; Copy into the next register | |
402 | vor v14,v0,v0 ; Copy into the next register | |
403 | vor v15,v0,v0 ; Copy into the next register | |
404 | vor v16,v0,v0 ; Copy into the next register | |
405 | vor v17,v0,v0 ; Copy into the next register | |
406 | vor v18,v0,v0 ; Copy into the next register | |
407 | vor v19,v0,v0 ; Copy into the next register | |
408 | vor v20,v0,v0 ; Copy into the next register | |
409 | vor v21,v0,v0 ; Copy into the next register | |
410 | vor v22,v0,v0 ; Copy into the next register | |
411 | vor v23,v0,v0 ; Copy into the next register | |
412 | vor v24,v0,v0 ; Copy into the next register | |
413 | vor v25,v0,v0 ; Copy into the next register | |
414 | vor v26,v0,v0 ; Copy into the next register | |
415 | vor v27,v0,v0 ; Copy into the next register | |
416 | vor v28,v0,v0 ; Copy into the next register | |
417 | vor v29,v0,v0 ; Copy into the next register | |
418 | vor v30,v0,v0 ; Copy into the next register | |
419 | vor v31,v0,v0 ; Copy into the next register | |
420 | ||
421 | li r0, MSR_VM_OFF ; Turn off vectors | |
422 | mtmsr r0 | |
423 | isync | |
424 | ||
425 | noVector: rlwinm. r0,r17,0,pfSMPcapb,pfSMPcapb ; See if we can do SMP | |
426 | beq- noSMP ; Nope... | |
427 | ||
428 | lhz r13,PP_CPU_NUMBER(r30) ; Get the CPU number | |
429 | mtspr pir,r13 ; Set the PIR | |
430 | ||
483a1d10 | 431 | noSMP: |
1c79356b A |
432 | |
433 | bl EXT(cacheInit) ; Initializes all caches (including the TLB) | |
55e303ae A |
434 | |
435 | rlwinm. r0,r17,0,pf64Bitb,pf64Bitb ; Is this a 64-bit machine? | |
436 | beq++ isnot64 ; Skip following if not 64-bit... | |
1c79356b | 437 | |
55e303ae A |
438 | mfmsr r29 ; Get the MSR |
439 | rlwinm r29,r29,0,0,31 ; Make sure that 64-bit mode is off | |
440 | mtmsrd r29 ; Set it | |
441 | isync ; Make sure | |
1c79356b | 442 | |
55e303ae | 443 | isnot64: bf bootCPU,callcpu |
1c79356b A |
444 | |
445 | lis r29,HIGH_ADDR(EXT(intstack_top_ss)) ; move onto interrupt stack | |
446 | ori r29,r29,LOW_ADDR(EXT(intstack_top_ss)) | |
447 | lwz r29,0(r29) | |
448 | ||
449 | li r28,0 | |
450 | stw r28,FM_BACKPTR(r29) ; store a null frame backpointer | |
451 | ||
452 | mr r1,r29 | |
453 | mr r3,r31 ; Restore any arguments we may have trashed | |
454 | ||
55e303ae A |
455 | ; Note that we exit from here with translation still off |
456 | ||
1c79356b A |
457 | bl EXT(ppc_init) ; Jump into boot init code |
458 | BREAKPOINT_TRAP | |
459 | ||
460 | callcpu: | |
461 | lwz r29,PP_INTSTACK_TOP_SS(r31) ; move onto interrupt stack | |
462 | ||
463 | li r28,0 | |
464 | stw r28,FM_BACKPTR(r29) ; store a null frame backpointer | |
465 | ||
466 | ||
467 | mr r1,r29 ; move onto new stack | |
468 | mr r3,r31 ; Restore any arguments we may have trashed | |
469 | ||
55e303ae A |
470 | ; Note that we exit from here with translation still off |
471 | ||
1c79356b A |
472 | bl EXT(ppc_init_cpu) ; Jump into cpu init code |
473 | BREAKPOINT_TRAP ; Should never return | |
474 | ||
475 | ; | |
476 | ; Specific processor initialization routines | |
477 | ; | |
478 | ||
1c79356b A |
479 | ; 750 |
480 | ||
765c9de3 A |
481 | init750: |
482 | bf firstBoot, init750nb ; No init for wakeup.... | |
1c79356b | 483 | |
765c9de3 | 484 | mfspr r13,l2cr ; Get the L2CR |
1c79356b A |
485 | rlwinm. r0,r13,0,l2e,l2e ; Any L2? |
486 | bne+ i750hl2 ; Yes... | |
487 | rlwinm r17,r17,0,pfL2b+1,pfL2b-1 ; No L2, turn off feature | |
488 | ||
765c9de3 A |
489 | i750hl2: |
490 | lis r14,hi16(256*1024) ; Base L2 size | |
491 | addis r15,r13,0x3000 ; Hah... Figure this one out... | |
492 | rlwinm r15,r15,4,30,31 ; Isolate | |
493 | rlwinm. r8,r13,0,l2siz,l2sizf ; Was size valid? | |
494 | slw r14,r14,r15 ; Set 256KB, 512KB, or 1MB | |
495 | beq- init750l2none ; Not a valid setting... | |
1c79356b | 496 | |
d52fe63f | 497 | stw r13,pfl2crOriginal(r30) ; Shadow the L2CR |
765c9de3 A |
498 | stw r13,pfl2cr(r30) ; Shadow the L2CR |
499 | stw r14,pfl2Size(r30) ; Set the L2 size | |
500 | b init750l2done ; Done with L2 | |
1c79356b | 501 | |
765c9de3 A |
502 | init750l2none: |
503 | rlwinm r17,r17,0,pfL2b+1,pfL2b-1 ; No level 2 cache | |
504 | ||
505 | init750l2done: | |
506 | mfspr r11,hid0 ; Get the current HID0 | |
507 | stw r11,pfHID0(r30) ; Save the HID0 value | |
508 | blr ; Return... | |
509 | ||
510 | init750nb: | |
d52fe63f | 511 | lwz r11,pfHID0(r30) ; Get HID0 |
765c9de3 A |
512 | sync |
513 | mtspr hid0,r11 ; Set the HID | |
514 | isync | |
515 | sync | |
516 | blr | |
1c79356b | 517 | |
d52fe63f A |
518 | ; 750CX |
519 | ||
520 | init750CX: | |
521 | bf firstBoot, init750 ; No init for wakeup.... | |
522 | mfspr r13,hid1 ; Get HID1 | |
523 | li r14,lo16(0xFD5F) ; Get valid | |
55e303ae A |
524 | rlwinm r13,r13,4,28,31 ; Isolate |
525 | slw r14,r14,r13 ; Position | |
526 | rlwimi r17,r14,15-pfCanNapb,pfCanNapb,pfCanNapb ; Set it | |
527 | b init750 ; Join common... | |
d52fe63f A |
528 | |
529 | ||
9bccf70c A |
530 | ; 750FX |
531 | ||
532 | init750FX: | |
533 | bf firstBoot, init750FXnb | |
534 | mfspr r11, hid1 | |
535 | stw r11, pfHID1(r30) ; Save the HID1 value | |
536 | b init750 | |
537 | ||
538 | init750FXnb: | |
539 | lwz r13, pfHID0(r30) ; Get HID0 | |
540 | lwz r11, pfHID1(r30) ; Get HID1 | |
541 | ||
55e303ae | 542 | rlwinm. r0, r11, 0, hid1ps, hid1ps ; Isolate the hid1ps bit |
9bccf70c | 543 | beq init750FXnb2 ; Clear BTIC if hid1ps set |
55e303ae | 544 | rlwinm r13, r13, 0, btic+1, btic-1 ; Clear the BTIC bit |
9bccf70c A |
545 | |
546 | init750FXnb2: | |
547 | sync | |
548 | mtspr hid0, r13 ; Set the HID | |
549 | isync | |
550 | sync | |
551 | ||
55e303ae | 552 | rlwinm r12, r11, 0, hid1ps+1, hid1ps-1 ; Select PLL0 |
9bccf70c | 553 | mtspr hid1, r12 ; Restore PLL config |
55e303ae | 554 | mftb r13 ; Wait 5000 ticks (> 200 us) |
9bccf70c A |
555 | |
556 | init750FXnbloop: | |
557 | mftb r14 | |
558 | sub r14, r14, r13 | |
559 | cmpli cr0, r14, 5000 | |
560 | ble init750FXnbloop | |
561 | mtspr hid1, r11 ; Select the desired PLL | |
562 | blr | |
563 | ||
d12e1678 A |
564 | ; 750FX vers 2.0 or later |
565 | init750FXV2: | |
566 | bf firstBoot, init750FXV2nb ; Wake from sleep | |
567 | ||
568 | mfspr r11, hid2 | |
569 | stw r11, pfHID2(r30) ; Save the HID2 value | |
570 | b init750FX ; Continue with 750FX init | |
571 | ||
572 | init750FXV2nb: | |
573 | lwz r13, pfHID2(r30) ; Get HID2 | |
574 | rlwinm r13, r13, 0, hid2vmin+1, hid2vmin-1 ; Clear the vmin bit | |
575 | mtspr hid2, r13 ; Restore HID2 value | |
576 | sync ; Wait for it to be done | |
577 | b init750FX | |
578 | ||
d52fe63f A |
579 | ; 7400 |
580 | ||
1c79356b A |
581 | init7400: bf firstBoot,i7400nb ; Do different if not initial boot... |
582 | mfspr r13,l2cr ; Get the L2CR | |
583 | rlwinm. r0,r13,0,l2e,l2e ; Any L2? | |
584 | bne+ i7400hl2 ; Yes... | |
585 | rlwinm r17,r17,0,pfL2b+1,pfL2b-1 ; No L2, turn off feature | |
586 | ||
587 | i7400hl2: lis r14,hi16(256*1024) ; Base L2 size | |
588 | addis r15,r13,0x3000 ; Hah... Figure this one out... | |
589 | rlwinm r15,r15,4,30,31 | |
590 | slw r14,r14,r15 ; Set 256KB, 512KB, 1MB, or 2MB | |
591 | ||
55e303ae | 592 | stw r13,pfl2crOriginal(r30) ; Shadow the L2CR |
1c79356b A |
593 | stw r13,pfl2cr(r30) ; Shadow the L2CR |
594 | stw r14,pfl2Size(r30) ; Set the L2 size | |
595 | ||
596 | mfspr r11,hid0 ; Get the current HID0 | |
597 | oris r11,r11,hi16(emcpm|eiecm) ; ? | |
598 | mtspr hid0,r11 ; ? | |
599 | isync | |
600 | stw r11,pfHID0(r30) ; Save the HID0 value | |
601 | ||
602 | mfspr r11,msscr0 ; Get the msscr0 register | |
603 | stw r11,pfMSSCR0(r30) ; Save the MSSCR0 value | |
604 | mfspr r11,msscr1 ; Get the msscr1 register | |
605 | stw r11,pfMSSCR1(r30) ; Save the MSSCR1 value | |
606 | blr ; Return... | |
607 | ||
765c9de3 | 608 | i7400nb: |
d52fe63f | 609 | li r11,0 |
55e303ae | 610 | mtspr l2cr,r11 ; Make sure L2CR is zero |
765c9de3 | 611 | lwz r11,pfHID0(r30) ; Get HID0 |
1c79356b A |
612 | sync |
613 | mtspr hid0,r11 ; Set the HID | |
765c9de3 A |
614 | isync |
615 | sync | |
1c79356b A |
616 | lwz r11,pfMSSCR0(r30) ; Get MSSCR0 |
617 | isync | |
618 | sync | |
619 | mtspr msscr0,r11 ; Set the MSSCR0 | |
620 | lwz r11,pfMSSCR1(r30) ; Get msscr1 | |
621 | isync | |
622 | sync | |
623 | mtspr msscr1,r11 ; Set the msscr1 | |
624 | isync | |
625 | sync | |
626 | blr | |
9bccf70c A |
627 | |
628 | ; 7400 (ver 2.0 - ver 2.7) | |
629 | ||
630 | init7400v2_7: | |
631 | bf firstBoot, init7400 | |
632 | mfspr r13, hid0 ; Get the HID0 | |
633 | ori r13, r13, nopdstm ; ? | |
634 | mtspr hid0, r13 ; Set the HID0 | |
635 | isync | |
636 | sync | |
637 | b init7400 | |
638 | ||
1c79356b A |
639 | ; 7410 |
640 | ; Note that this is the same as 7400 except we initialize the l2cr2 register | |
641 | ||
642 | init7410: li r13,0 ; Clear | |
643 | mtspr 1016,r13 ; Turn off direct cache | |
644 | b init7400 ; Join up with common.... | |
1c79356b | 645 | |
d52fe63f A |
646 | |
647 | ; 745X - Any 7450 family processor | |
648 | ||
649 | init745X: | |
55e303ae | 650 | bf firstBoot,init745Xnb ; Do different if not initial boot... |
1c79356b A |
651 | |
652 | mfspr r13,l2cr ; Get the L2CR | |
653 | rlwinm. r0,r13,0,l2e,l2e ; Any L2? | |
d52fe63f | 654 | bne+ init745Xhl2 ; Yes... |
1c79356b A |
655 | rlwinm r17,r17,0,pfL2b+1,pfL2b-1 ; No L2, turn off feature |
656 | ||
43866e37 | 657 | init745Xhl2: |
e5568f75 A |
658 | mfpvr r14 ; Get processor version |
659 | rlwinm r14,r14,16,16,31 ; Isolate processor version | |
660 | cmpli cr0, r14, PROCESSOR_VERSION_7457 ; Test for 7457 or | |
661 | cmpli cr1, r14, PROCESSOR_VERSION_7447A ; 7447A | |
662 | cror cr0_eq, cr1_eq, cr0_eq | |
43866e37 | 663 | lis r14,hi16(512*1024) ; 512KB L2 |
e5568f75 | 664 | beq init745Xhl2_2 |
43866e37 A |
665 | |
666 | lis r14,hi16(256*1024) ; Base L2 size | |
1c79356b A |
667 | rlwinm r15,r13,22,12,13 ; Convert to 256k, 512k, or 768k |
668 | add r14,r14,r15 ; Add in minimum | |
43866e37 A |
669 | |
670 | init745Xhl2_2: | |
e5568f75 | 671 | stw r13,pfl2crOriginal(r30) ; Shadow the L2CR |
1c79356b A |
672 | stw r13,pfl2cr(r30) ; Shadow the L2CR |
673 | stw r14,pfl2Size(r30) ; Set the L2 size | |
674 | ||
675 | ; Take care of level 3 cache | |
676 | ||
677 | mfspr r13,l3cr ; Get the L3CR | |
7b1edb79 | 678 | rlwinm. r0,r13,0,l3e,l3e ; Any L3? |
d52fe63f | 679 | bne+ init745Xhl3 ; Yes... |
7b1edb79 | 680 | rlwinm r17,r17,0,pfL3b+1,pfL3b-1 ; No L3, turn off feature |
1c79356b | 681 | |
55e303ae A |
682 | init745Xhl3: cmplwi cr0,r13,0 ; No L3 if L3CR is zero |
683 | beq- init745Xnone ; Go turn off the features... | |
1c79356b A |
684 | lis r14,hi16(1024*1024) ; Base L3 size |
685 | rlwinm r15,r13,4,31,31 ; Get size multiplier | |
686 | slw r14,r14,r15 ; Set 1 or 2MB | |
687 | ||
55e303ae | 688 | stw r13,pfl3crOriginal(r30) ; Shadow the L3CR |
1c79356b A |
689 | stw r13,pfl3cr(r30) ; Shadow the L3CR |
690 | stw r14,pfl3Size(r30) ; Set the L3 size | |
d52fe63f | 691 | b init745Xfin ; Return.... |
1c79356b | 692 | |
d52fe63f | 693 | init745Xnone: |
55e303ae | 694 | rlwinm r17,r17,0,pfL3fab+1,pfL3b-1 ; No 3rd level cache or assist |
0b4e3aa0 A |
695 | rlwinm r11,r17,pfWillNapb-pfCanNapb,pfCanNapb,pfCanNapb ; Set pfCanNap if pfWillNap is set |
696 | or r17,r17,r11 | |
1c79356b | 697 | |
d52fe63f | 698 | init745Xfin: |
55e303ae | 699 | rlwinm r17,r17,0,pfWillNapb+1,pfWillNapb-1 ; Make sure pfWillNap is not set |
0b4e3aa0 A |
700 | |
701 | mfspr r11,hid0 ; Get the current HID0 | |
1c79356b A |
702 | stw r11,pfHID0(r30) ; Save the HID0 value |
703 | mfspr r11,hid1 ; Get the current HID1 | |
704 | stw r11,pfHID1(r30) ; Save the HID1 value | |
705 | mfspr r11,msscr0 ; Get the msscr0 register | |
706 | stw r11,pfMSSCR0(r30) ; Save the MSSCR0 value | |
707 | mfspr r11,msscr1 ; Get the msscr1 register | |
708 | stw r11,pfMSSCR1(r30) ; Save the MSSCR1 value | |
709 | mfspr r11,ictrl ; Get the ictrl register | |
710 | stw r11,pfICTRL(r30) ; Save the ICTRL value | |
711 | mfspr r11,ldstcr ; Get the ldstcr register | |
712 | stw r11,pfLDSTCR(r30) ; Save the LDSTCR value | |
0b4e3aa0 A |
713 | mfspr r11,ldstdb ; Get the ldstdb register |
714 | stw r11,pfLDSTDB(r30) ; Save the LDSTDB value | |
d52fe63f A |
715 | mfspr r11,pir ; Get the pir register |
716 | stw r11,pfBootConfig(r30) ; Save the BootConfig value | |
1c79356b A |
717 | blr ; Return.... |
718 | ||
719 | ||
d52fe63f | 720 | init745Xnb: lwz r11,pfHID0(r30) ; Get HID0 |
1c79356b A |
721 | sync |
722 | mtspr hid0,r11 ; Set the HID | |
723 | isync | |
724 | lwz r11,pfHID1(r30) ; Get HID1 | |
725 | sync | |
726 | mtspr hid1,r11 ; Set the HID | |
727 | isync | |
728 | lwz r11,pfMSSCR0(r30) ; Get MSSCR0 | |
729 | sync | |
730 | mtspr msscr0,r11 ; Set the MSSCR0 | |
731 | isync | |
732 | sync | |
733 | lwz r11,pfICTRL(r30) ; Get ICTRL | |
734 | sync | |
735 | mtspr ictrl,r11 ; Set the ICTRL | |
736 | isync | |
737 | sync | |
738 | lwz r11,pfLDSTCR(r30) ; Get LDSTCR | |
739 | sync | |
740 | mtspr ldstcr,r11 ; Set the LDSTCR | |
741 | isync | |
742 | sync | |
0b4e3aa0 A |
743 | lwz r11,pfLDSTDB(r30) ; Get LDSTDB |
744 | sync | |
745 | mtspr ldstdb,r11 ; Set the LDSTDB | |
746 | isync | |
747 | sync | |
1c79356b A |
748 | blr |
749 | ||
d52fe63f A |
750 | ; 7450 - Specific |
751 | ||
752 | init7450: | |
753 | bf firstBoot, init745X ; Not boot, use standard init | |
754 | ||
755 | mfspr r13, pir ; Get BootConfig from PIR | |
756 | rlwinm. r14, r13, 0, 20, 23 ; Is the pdet value zero | |
757 | bne init7450done ; No, done for now | |
758 | ||
759 | ori r13, r13, 0x0400 ; Force pdet value to 4 | |
760 | mtspr pir, r13 ; Write back the BootConfig | |
761 | ||
762 | init7450done: | |
763 | b init745X ; Continue with standard init | |
764 | ||
1c79356b | 765 | |
55e303ae A |
766 | init970: |
767 | li r20,0 ; Clear this | |
483a1d10 | 768 | mtspr hior,r20 ; Make sure that 0 is interrupt prefix |
55e303ae A |
769 | bf firstBoot,init970nb ; No init for wakeup or second processor.... |
770 | ||
771 | ||
772 | mfspr r11,hid0 ; Get original hid0 | |
773 | std r11,pfHID0(r30) ; Save original | |
774 | mfspr r11,hid1 ; Get original hid1 | |
775 | std r11,pfHID1(r30) ; Save original | |
776 | mfspr r11,hid4 ; Get original hid4 | |
777 | std r11,pfHID4(r30) ; Save original | |
778 | mfspr r11,hid5 ; Get original hid5 | |
779 | std r11,pfHID5(r30) ; Save original | |
483a1d10 A |
780 | |
781 | lis r0, hi16(dnapm) ; Create a mask for the dnap bit | |
782 | sldi r0, r0, 32 ; Shift to the top half | |
783 | ld r11,pfHID0(r30) ; Load the hid0 value | |
784 | andc r11, r11, r0 ; Clear the dnap bit | |
785 | isync | |
786 | mtspr hid0,r11 ; Stuff it | |
787 | mfspr r11,hid0 ; Get it | |
788 | mfspr r11,hid0 ; Get it | |
789 | mfspr r11,hid0 ; Get it | |
790 | mfspr r11,hid0 ; Get it | |
791 | mfspr r11,hid0 ; Get it | |
792 | mfspr r11,hid0 ; Get it | |
793 | isync | |
794 | ||
55e303ae A |
795 | ; |
796 | ; We can not query or change the L2 size. We will just | |
797 | ; phoney up a L2CR to make sysctl "happy" and set the | |
798 | ; L2 size to 512K. | |
799 | ; | |
800 | ||
801 | lis r0,0x8000 ; Synthesize a "valid" but non-existant L2CR | |
802 | stw r0,pfl2crOriginal(r30) ; Set a dummy L2CR | |
803 | stw r0,pfl2cr(r30) ; Set a dummy L2CR | |
804 | lis r0,8 ; Get 512K | |
805 | stw r0,pfl2Size(r30) ; Set the L2 size | |
806 | ||
807 | blr | |
808 | ||
809 | ; | |
810 | ; Start up code for second processor or wake up from sleep | |
811 | ; | |
812 | ||
483a1d10 A |
813 | init970nb: |
814 | lis r0, hi16(dnapm) ; Create a mask for the dnap bit | |
815 | sldi r0, r0, 32 ; Shift to the top half | |
816 | ld r11,pfHID0(r30) ; Load the hid0 value | |
817 | andc r11, r11, r0 ; Clear the dnap bit | |
55e303ae A |
818 | isync |
819 | mtspr hid0,r11 ; Stuff it | |
820 | mfspr r11,hid0 ; Get it | |
821 | mfspr r11,hid0 ; Get it | |
822 | mfspr r11,hid0 ; Get it | |
823 | mfspr r11,hid0 ; Get it | |
824 | mfspr r11,hid0 ; Get it | |
825 | mfspr r11,hid0 ; Get it | |
826 | isync | |
827 | ||
5353443c | 828 | ld r20,pfHID1(r30) ; Get it |
55e303ae | 829 | isync |
5353443c A |
830 | mtspr hid1,r20 ; Stick it |
831 | mtspr hid1,r20 ; Stick it again | |
55e303ae A |
832 | isync |
833 | ||
834 | ld r11,pfHID4(r30) ; Get it | |
835 | sync | |
836 | mtspr hid4,r11 ; Stick it | |
837 | isync | |
5353443c A |
838 | |
839 | lis r11,0xE000 ; Get the unlikeliest ESID possible | |
840 | srdi r11,r11,1 ; Make 0x7FFFFFFFF0000000 | |
841 | slbie r11 ; Make sure the ERAT is cleared | |
55e303ae A |
842 | |
843 | ld r11,pfHID5(r30) ; Get it | |
844 | mtspr hid5,r11 ; Set it | |
845 | isync | |
5353443c A |
846 | ; |
847 | ; May have changed dcbz mode so kill icache | |
848 | ; | |
849 | ||
850 | eqv r13,r13,r13 ; Get a constant -1 | |
851 | mr r14,r20 ; Save HID1 | |
852 | rldimi r14,r13,54,9 ; Set force icbi match mode | |
853 | ||
854 | li r11,0 ; Set start if ICBI range | |
855 | isync | |
856 | mtspr hid1,r14 ; Stick it | |
857 | mtspr hid1,r14 ; Stick it again | |
858 | isync | |
859 | ||
860 | inin970ki: icbi 0,r11 ; Kill I$ | |
861 | addi r11,r11,128 ; Next line | |
862 | andis. r0,r11,1 ; Have we done them all? | |
863 | beq++ inin970ki ; Not yet... | |
864 | ||
865 | isync | |
866 | mtspr hid1,r20 ; Stick it | |
867 | mtspr hid1,r20 ; Stick it again | |
868 | isync | |
869 | ||
55e303ae A |
870 | blr ; Leave... |
871 | ||
872 | ||
873 | ; Unsupported Processors | |
874 | initUnsupported: | |
875 | mtlr r2 ; Restore the return address | |
876 | blr ; Return to the booter | |
877 | ||
878 | ||
1c79356b A |
879 | ; |
880 | ; Processor to feature table | |
881 | ||
882 | ; .align 2 - Always on word boundary | |
883 | ; .long ptFilter - Mask of significant bits in the Version/Revision code | |
884 | ; - NOTE: Always order from most restrictive to least restrictive matching | |
885 | ; .short ptVersion - Version code from PVR. Always start with 0 which is default | |
886 | ; .short ptRevision - Revision code from PVR. A zero value denotes the generic attributes if not specific | |
887 | ; .long ptFeatures - Available features | |
43866e37 | 888 | ; .long ptCPUCap - Default value for _cpu_capabilities |
4a249263 | 889 | ; .long ptPwrModes - Available power management features |
55e303ae | 890 | ; .long ptPatch - Patch features |
1c79356b A |
891 | ; .long ptInitRout - Initilization routine. Can modify any of the other attributes. |
892 | ; .long ptRptdProc - Processor type reported | |
1c79356b A |
893 | ; .long ptLineSize - Level 1 cache line size |
894 | ; .long ptl1iSize - Level 1 instruction cache size | |
895 | ; .long ptl1dSize - Level 1 data cache size | |
55e303ae A |
896 | ; .long ptPTEG - Size of PTEG |
897 | ; .long ptMaxVAddr - Maximum effective address | |
898 | ; .long ptMaxPAddr - Maximum physical address | |
899 | ; | |
1c79356b A |
900 | |
901 | .align 2 | |
902 | processor_types: | |
903 | ||
1c79356b A |
904 | ; 750CX (ver 2.x) |
905 | ||
55e303ae A |
906 | .align 2 |
907 | .long 0xFFFF0F00 ; 2.x vers | |
908 | .short PROCESSOR_VERSION_750 | |
909 | .short 0x0200 | |
910 | .long pfFloat | pfCanSleep | pfCanNap | pfCanDoze | pf32Byte | pfL2 | |
911 | .long kCache32 | kHasGraphicsOps | kHasStfiwx | |
4a249263 | 912 | .long 0 |
55e303ae A |
913 | .long PatchExt32 |
914 | .long init750CX | |
915 | .long CPU_SUBTYPE_POWERPC_750 | |
55e303ae A |
916 | .long 32 |
917 | .long 32*1024 | |
918 | .long 32*1024 | |
919 | .long 64 | |
920 | .long 52 | |
921 | .long 32 | |
922 | ||
1c79356b A |
923 | ; 750 (generic) |
924 | ||
55e303ae A |
925 | .align 2 |
926 | .long 0xFFFF0000 ; All revisions | |
927 | .short PROCESSOR_VERSION_750 | |
928 | .short 0 | |
483a1d10 | 929 | .long pfFloat | pfCanSleep | pfCanNap | pfCanDoze | pf32Byte | pfL2 |
55e303ae | 930 | .long kCache32 | kHasGraphicsOps | kHasStfiwx |
4a249263 | 931 | .long 0 |
55e303ae A |
932 | .long PatchExt32 |
933 | .long init750 | |
934 | .long CPU_SUBTYPE_POWERPC_750 | |
55e303ae A |
935 | .long 32 |
936 | .long 32*1024 | |
937 | .long 32*1024 | |
938 | .long 64 | |
939 | .long 52 | |
940 | .long 32 | |
941 | ||
d12e1678 A |
942 | ; 750FX (ver 1.x) |
943 | ||
55e303ae A |
944 | .align 2 |
945 | .long 0xFFFF0F00 ; 1.x vers | |
946 | .short PROCESSOR_VERSION_750FX | |
947 | .short 0x0100 | |
948 | .long pfFloat | pfCanSleep | pfCanNap | pfCanDoze | pfSlowNap | pfNoMuMMCK | pf32Byte | pfL2 | |
949 | .long kCache32 | kHasGraphicsOps | kHasStfiwx | |
4a249263 | 950 | .long pmDualPLL |
55e303ae A |
951 | .long PatchExt32 |
952 | .long init750FX | |
953 | .long CPU_SUBTYPE_POWERPC_750 | |
55e303ae A |
954 | .long 32 |
955 | .long 32*1024 | |
956 | .long 32*1024 | |
957 | .long 64 | |
958 | .long 52 | |
959 | .long 32 | |
960 | ||
9bccf70c | 961 | ; 750FX (generic) |
0b4e3aa0 | 962 | |
55e303ae A |
963 | .align 2 |
964 | .long 0xFFFF0000 ; All revisions | |
965 | .short PROCESSOR_VERSION_750FX | |
966 | .short 0 | |
967 | .long pfFloat | pfCanSleep | pfCanNap | pfCanDoze | pfSlowNap | pfNoMuMMCK | pf32Byte | pfL2 | |
968 | .long kCache32 | kHasGraphicsOps | kHasStfiwx | |
4a249263 | 969 | .long pmDualPLL | pmDPLLVmin |
55e303ae A |
970 | .long PatchExt32 |
971 | .long init750FXV2 | |
972 | .long CPU_SUBTYPE_POWERPC_750 | |
55e303ae A |
973 | .long 32 |
974 | .long 32*1024 | |
975 | .long 32*1024 | |
976 | .long 64 | |
977 | .long 52 | |
978 | .long 32 | |
979 | ||
9bccf70c A |
980 | ; 7400 (ver 2.0 - ver 2.7) |
981 | ||
55e303ae A |
982 | .align 2 |
983 | .long 0xFFFFFFF8 ; ver 2.0 - 2.7 | |
984 | .short PROCESSOR_VERSION_7400 | |
985 | .short 0x0200 | |
483a1d10 | 986 | .long pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfCanNap | pfCanDoze | pf32Byte | pfL1fa | pfL2 | pfL2fa | pfHasDcba |
55e303ae | 987 | .long kHasAltivec | kCache32 | kDcbaAvailable | kDataStreamsAvailable | kHasGraphicsOps | kHasStfiwx |
4a249263 | 988 | .long 0 |
55e303ae A |
989 | .long PatchExt32 |
990 | .long init7400v2_7 | |
991 | .long CPU_SUBTYPE_POWERPC_7400 | |
55e303ae A |
992 | .long 32 |
993 | .long 32*1024 | |
994 | .long 32*1024 | |
995 | .long 64 | |
996 | .long 52 | |
997 | .long 32 | |
998 | ||
1c79356b A |
999 | ; 7400 (generic) |
1000 | ||
55e303ae A |
1001 | .align 2 |
1002 | .long 0xFFFF0000 ; All revisions | |
1003 | .short PROCESSOR_VERSION_7400 | |
1004 | .short 0 | |
483a1d10 | 1005 | .long pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfCanNap | pfCanDoze | pf32Byte | pfL1fa | pfL2 | pfL2fa | pfHasDcba |
55e303ae | 1006 | .long kHasAltivec | kCache32 | kDcbaAvailable | kDataStreamsRecommended | kDataStreamsAvailable | kHasGraphicsOps | kHasStfiwx |
4a249263 | 1007 | .long 0 |
55e303ae A |
1008 | .long PatchExt32 |
1009 | .long init7400 | |
1010 | .long CPU_SUBTYPE_POWERPC_7400 | |
55e303ae A |
1011 | .long 32 |
1012 | .long 32*1024 | |
1013 | .long 32*1024 | |
1014 | .long 64 | |
1015 | .long 52 | |
1016 | .long 36 | |
1017 | ||
1c79356b A |
1018 | ; 7410 (ver 1.1) |
1019 | ||
55e303ae A |
1020 | .align 2 |
1021 | .long 0xFFFFFFFF ; Exact match | |
1022 | .short PROCESSOR_VERSION_7400 | |
1023 | .short 0x1101 | |
1024 | .long pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfCanNap | pfCanDoze | pf32Byte | pfL1fa | pfL2 | pfL2fa | pfHasDcba | |
1025 | .long kHasAltivec | kCache32 | kDcbaAvailable | kDataStreamsRecommended | kDataStreamsAvailable | kHasGraphicsOps | kHasStfiwx | |
4a249263 | 1026 | .long 0 |
55e303ae A |
1027 | .long PatchExt32 |
1028 | .long init7410 | |
1029 | .long CPU_SUBTYPE_POWERPC_7400 | |
55e303ae A |
1030 | .long 32 |
1031 | .long 32*1024 | |
1032 | .long 32*1024 | |
1033 | .long 64 | |
1034 | .long 52 | |
1035 | .long 36 | |
1c79356b A |
1036 | |
1037 | ; 7410 (generic) | |
1038 | ||
55e303ae A |
1039 | .align 2 |
1040 | .long 0xFFFF0000 ; All other revisions | |
1041 | .short PROCESSOR_VERSION_7410 | |
1042 | .short 0 | |
1043 | .long pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfCanNap | pfCanDoze | pf32Byte | pfL1fa | pfL2 | pfL2fa | pfHasDcba | |
1044 | .long kHasAltivec | kCache32 | kDcbaAvailable | kDataStreamsRecommended | kDataStreamsAvailable | kHasGraphicsOps | kHasStfiwx | |
4a249263 | 1045 | .long 0 |
55e303ae A |
1046 | .long PatchExt32 |
1047 | .long init7410 | |
1048 | .long CPU_SUBTYPE_POWERPC_7400 | |
55e303ae A |
1049 | .long 32 |
1050 | .long 32*1024 | |
1051 | .long 32*1024 | |
1052 | .long 64 | |
1053 | .long 52 | |
1054 | .long 36 | |
1c79356b A |
1055 | |
1056 | ; 7450 (ver 1.xx) | |
1057 | ||
55e303ae A |
1058 | .align 2 |
1059 | .long 0xFFFFFF00 ; Just revisions 1.xx | |
1060 | .short PROCESSOR_VERSION_7450 | |
1061 | .short 0x0100 | |
1062 | .long pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfNoMSRir | pfNoL2PFNap | pfLClck | pf32Byte | pfL2 | pfL2fa | pfL2i | pfL3 | pfL3fa | pfHasDcba | |
1063 | .long kHasAltivec | kCache32 | kDcbaAvailable | kDataStreamsRecommended | kDataStreamsAvailable | kHasGraphicsOps | kHasStfiwx | |
4a249263 | 1064 | .long 0 |
55e303ae A |
1065 | .long PatchExt32 |
1066 | .long init7450 | |
1067 | .long CPU_SUBTYPE_POWERPC_7450 | |
55e303ae A |
1068 | .long 32 |
1069 | .long 32*1024 | |
1070 | .long 32*1024 | |
1071 | .long 64 | |
1072 | .long 52 | |
1073 | .long 36 | |
1c79356b | 1074 | |
0b4e3aa0 A |
1075 | ; 7450 (2.0) |
1076 | ||
55e303ae A |
1077 | .align 2 |
1078 | .long 0xFFFFFFFF ; Just revision 2.0 | |
1079 | .short PROCESSOR_VERSION_7450 | |
1080 | .short 0x0200 | |
1081 | .long pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfNoMSRir | pfNoL2PFNap | pfLClck | pf32Byte | pfL2 | pfL2fa | pfL2i | pfL3 | pfL3fa | pfHasDcba | |
1082 | .long kHasAltivec | kCache32 | kDcbaAvailable | kDataStreamsRecommended | kDataStreamsAvailable | kHasGraphicsOps | kHasStfiwx | |
4a249263 | 1083 | .long 0 |
55e303ae A |
1084 | .long PatchExt32 |
1085 | .long init7450 | |
1086 | .long CPU_SUBTYPE_POWERPC_7450 | |
55e303ae A |
1087 | .long 32 |
1088 | .long 32*1024 | |
1089 | .long 32*1024 | |
1090 | .long 64 | |
1091 | .long 52 | |
1092 | .long 36 | |
0b4e3aa0 A |
1093 | |
1094 | ; 7450 (2.1) | |
1c79356b | 1095 | |
55e303ae A |
1096 | .align 2 |
1097 | .long 0xFFFF0000 ; All other revisions | |
1098 | .short PROCESSOR_VERSION_7450 | |
1099 | .short 0 | |
1100 | .long pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfWillNap | pfNoMSRir | pfNoL2PFNap | pfLClck | pf32Byte | pfL2 | pfL2fa | pfL2i | pfL3 | pfL3fa | pfHasDcba | |
1101 | .long kHasAltivec | kCache32 | kDcbaAvailable | kDataStreamsRecommended | kDataStreamsAvailable | kHasGraphicsOps | kHasStfiwx | |
4a249263 | 1102 | .long 0 |
55e303ae A |
1103 | .long PatchExt32 |
1104 | .long init7450 | |
1105 | .long CPU_SUBTYPE_POWERPC_7450 | |
55e303ae A |
1106 | .long 32 |
1107 | .long 32*1024 | |
1108 | .long 32*1024 | |
1109 | .long 64 | |
1110 | .long 52 | |
1111 | .long 36 | |
1c79356b | 1112 | |
d52fe63f A |
1113 | ; 7455 (1.xx) Just like 7450 2.0 |
1114 | ||
55e303ae A |
1115 | .align 2 |
1116 | .long 0xFFFFFF00 ; Just revisions 1.xx | |
1117 | .short PROCESSOR_VERSION_7455 | |
1118 | .short 0x0100 | |
1119 | .long pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfNoMSRir | pfNoL2PFNap | pfLClck | pf32Byte | pfL2 | pfL2fa | pfL2i | pfL3 | pfL3fa | pfHasDcba | |
1120 | .long kHasAltivec | kCache32 | kDcbaAvailable | kDataStreamsRecommended | kDataStreamsAvailable | kHasGraphicsOps | kHasStfiwx | |
4a249263 | 1121 | .long 0 |
55e303ae A |
1122 | .long PatchExt32 |
1123 | .long init745X | |
1124 | .long CPU_SUBTYPE_POWERPC_7450 | |
55e303ae A |
1125 | .long 32 |
1126 | .long 32*1024 | |
1127 | .long 32*1024 | |
1128 | .long 64 | |
1129 | .long 52 | |
1130 | .long 36 | |
d52fe63f A |
1131 | |
1132 | ; 7455 (2.0) | |
1133 | ||
55e303ae A |
1134 | .align 2 |
1135 | .long 0xFFFFFFFF ; Just revision 2.0 | |
1136 | .short PROCESSOR_VERSION_7455 | |
1137 | .short 0x0200 | |
1138 | .long pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfWillNap | pfNoMSRir | pfNoL2PFNap | pfLClck | pf32Byte | pfL2 | pfL2fa | pfL2i | pfL3 | pfL3fa | pfHasDcba | |
1139 | .long kHasAltivec | kCache32 | kDcbaAvailable | kDataStreamsRecommended | kDataStreamsAvailable | kHasGraphicsOps | kHasStfiwx | |
4a249263 | 1140 | .long 0 |
55e303ae A |
1141 | .long PatchExt32 |
1142 | .long init745X | |
1143 | .long CPU_SUBTYPE_POWERPC_7450 | |
55e303ae A |
1144 | .long 32 |
1145 | .long 32*1024 | |
1146 | .long 32*1024 | |
1147 | .long 64 | |
1148 | .long 52 | |
1149 | .long 36 | |
d52fe63f A |
1150 | |
1151 | ; 7455 (2.1) | |
1152 | ||
55e303ae A |
1153 | .align 2 |
1154 | .long 0xFFFF0000 ; All other revisions | |
1155 | .short PROCESSOR_VERSION_7455 | |
1156 | .short 0 | |
1157 | .long pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfCanNap | pfNoMSRir | pfNoL2PFNap | pfLClck | pf32Byte | pfL2 | pfL2fa | pfL2i | pfL3 | pfL3fa | pfHasDcba | |
1158 | .long kHasAltivec | kCache32 | kDcbaAvailable | kDataStreamsRecommended | kDataStreamsAvailable | kHasGraphicsOps | kHasStfiwx | |
4a249263 | 1159 | .long 0 |
55e303ae A |
1160 | .long PatchExt32 |
1161 | .long init745X | |
1162 | .long CPU_SUBTYPE_POWERPC_7450 | |
55e303ae A |
1163 | .long 32 |
1164 | .long 32*1024 | |
1165 | .long 32*1024 | |
1166 | .long 64 | |
1167 | .long 52 | |
1168 | .long 36 | |
43866e37 A |
1169 | |
1170 | ; 7457 | |
1171 | ||
55e303ae A |
1172 | .align 2 |
1173 | .long 0xFFFF0000 ; All revisions | |
1174 | .short PROCESSOR_VERSION_7457 | |
1175 | .short 0 | |
1176 | .long pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfCanNap | pfNoMSRir | pfNoL2PFNap | pfLClck | pf32Byte | pfL2 | pfL2fa | pfL2i | pfL3 | pfL3fa | pfHasDcba | |
1177 | .long kHasAltivec | kCache32 | kDcbaAvailable | kDataStreamsRecommended | kDataStreamsAvailable | kHasGraphicsOps | kHasStfiwx | |
4a249263 | 1178 | .long 0 |
55e303ae A |
1179 | .long PatchExt32 |
1180 | .long init745X | |
1181 | .long CPU_SUBTYPE_POWERPC_7450 | |
55e303ae A |
1182 | .long 32 |
1183 | .long 32*1024 | |
1184 | .long 32*1024 | |
1185 | .long 64 | |
1186 | .long 52 | |
1187 | .long 36 | |
1188 | ||
e5568f75 A |
1189 | ; 7447A |
1190 | ||
1191 | .align 2 | |
1192 | .long 0xFFFF0000 ; All revisions | |
1193 | .short PROCESSOR_VERSION_7447A | |
1194 | .short 0 | |
1195 | .long pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfCanNap | pfNoMSRir | pfNoL2PFNap | pfLClck | pf32Byte | pfL2 | pfL2fa | pfL2i | pfL3 | pfL3fa | pfHasDcba | |
1196 | .long kHasAltivec | kCache32 | kDcbaAvailable | kDataStreamsRecommended | kDataStreamsAvailable | kHasGraphicsOps | kHasStfiwx | |
1197 | .long pmDFS | |
1198 | .long PatchExt32 | |
1199 | .long init745X | |
1200 | .long CPU_SUBTYPE_POWERPC_7450 | |
e5568f75 A |
1201 | .long 32 |
1202 | .long 32*1024 | |
1203 | .long 32*1024 | |
1204 | .long 64 | |
1205 | .long 52 | |
1206 | .long 36 | |
1207 | ||
55e303ae A |
1208 | ; 970 |
1209 | ||
1210 | .align 2 | |
1211 | .long 0xFFFF0000 ; All versions so far | |
1212 | .short PROCESSOR_VERSION_970 | |
1213 | .short 0 | |
1214 | .long pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfCanNap | pf128Byte | pf64Bit | pfL2 | pfSCOMFixUp | |
1215 | .long kHasAltivec | k64Bit | kCache128 | kDataStreamsAvailable | kDcbtStreamsRecommended | kDcbtStreamsAvailable | kHasGraphicsOps | kHasStfiwx | kHasFsqrt | |
4a249263 A |
1216 | .long 0 |
1217 | .long PatchLwsync | |
1218 | .long init970 | |
1219 | .long CPU_SUBTYPE_POWERPC_970 | |
4a249263 A |
1220 | .long 128 |
1221 | .long 64*1024 | |
1222 | .long 32*1024 | |
1223 | .long 128 | |
1224 | .long 65 | |
1225 | .long 42 | |
1226 | ||
1227 | ; 970FX | |
1228 | ||
1229 | .align 2 | |
1230 | .long 0xFFFF0000 ; All versions so far | |
1231 | .short PROCESSOR_VERSION_970FX | |
1232 | .short 0 | |
1233 | .long pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfCanNap | pf128Byte | pf64Bit | pfL2 | |
1234 | .long kHasAltivec | k64Bit | kCache128 | kDataStreamsAvailable | kDcbtStreamsRecommended | kDcbtStreamsAvailable | kHasGraphicsOps | kHasStfiwx | kHasFsqrt | |
1235 | .long pmPowerTune | |
55e303ae A |
1236 | .long PatchLwsync |
1237 | .long init970 | |
1238 | .long CPU_SUBTYPE_POWERPC_970 | |
55e303ae A |
1239 | .long 128 |
1240 | .long 64*1024 | |
1241 | .long 32*1024 | |
1242 | .long 128 | |
1243 | .long 65 | |
1244 | .long 42 | |
1245 | ||
1246 | ; All other processors are not supported | |
1247 | ||
1248 | .align 2 | |
1249 | .long 0x00000000 ; Matches everything | |
1250 | .short 0 | |
1251 | .short 0 | |
1252 | .long pfFloat | pf32Byte | |
1253 | .long kCache32 | kHasGraphicsOps | kHasStfiwx | |
4a249263 | 1254 | .long 0 |
55e303ae A |
1255 | .long PatchExt32 |
1256 | .long initUnsupported | |
1257 | .long CPU_SUBTYPE_POWERPC_ALL | |
55e303ae A |
1258 | .long 32 |
1259 | .long 32*1024 | |
1260 | .long 32*1024 | |
1261 | .long 64 | |
1262 | .long 52 | |
1263 | .long 32 | |
1c79356b | 1264 |