2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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.
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
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
28 #include <mach_kgdb.h>
30 #include <ppc/proc_reg.h>
31 #include <ppc/spec_reg.h>
32 #include <mach/ppc/vm_param.h>
52 /* Defines for PVRs */
53 #define PROCESSOR_VERSION_601 1
54 #define PROCESSOR_VERSION_603 3
55 #define PROCESSOR_VERSION_604 4
56 #define PROCESSOR_VERSION_603e 6
57 #define PROCESSOR_VERSION_750 8
58 #define PROCESSOR_VERSION_750FX 0x7000 /* ? */
59 #define PROCESSOR_VERSION_604e 9
60 #define PROCESSOR_VERSION_604ev 10 /* ? */
61 #define PROCESSOR_VERSION_7400 12 /* ? */
62 #define PROCESSOR_VERSION_7410 0x800C /* ? */
63 #define PROCESSOR_VERSION_7450 0x8000 /* ? */
64 #define PROCESSOR_VERSION_7455 0x8001 /* ? */
67 * Interrupt and bootup stack for initial processor
74 /* Align on page boundry */
76 /* Red zone for interrupt stack, one page (will be unmapped)*/
80 .globl EXT(FixedStackStart)
85 .set ., .+INTSTACK_SIZE*NCPUS
87 /* Debugger stack - used by the debugger if present */
88 /* NOTE!!! Keep the debugger stack right after the interrupt stack */
89 #if MACH_KDP || MACH_KDB
92 .set ., .+KERNEL_STACK_SIZE*NCPUS
94 .globl EXT(FixedStackEnd)
98 .globl EXT(intstack_top_ss)
100 .long EXT(intstack)+INTSTACK_SIZE-FM_SIZE /* intstack_top_ss points to the top of interrupt stack */
103 .globl EXT(debstack_top_ss)
104 EXT(debstack_top_ss):
106 .long EXT(debstack)+KERNEL_STACK_SIZE-FM_SIZE /* debstack_top_ss points to the top of debug stack */
108 .globl EXT(debstackptr)
110 .long EXT(debstack)+KERNEL_STACK_SIZE-FM_SIZE
112 #endif /* MACH_KDP || MACH_KDB */
115 * All CPUs start here.
117 * This code is called from SecondaryLoader
119 * Various arguments are passed via a table:
120 * ARG0 = pointer to other startup parameters
124 ENTRY(_start_cpu,TAG_NO_FRAME_USED)
125 crclr bootCPU ; Set non-boot processor
126 crclr firstInit ; Set not first time init
127 mr r30,r3 ; Set current per_proc
130 ; Note that we are just trying to get close. The real TB sync will take
131 ; place later. The value we are loading is set in two places. For the
132 ; main processor, it will be the TB at the last interrupt before we went
133 ; to sleep. For the others, it will be the time just before the main
134 ; processor woke us up.
137 lwz r15,ruptStamp(r3) ; Get the timebase from the other processor
138 li r17,0 ; Clear this out
139 lwz r16,ruptStamp+4(r3) ; Get the timebase from the other processor
140 mtspr tbl,r17 ; Clear bottom so we do not tick
141 mtspr tbu,r15 ; Set top
142 mtspr tbl,r16 ; Then bottom again
146 ENTRY(_start,TAG_NO_FRAME_USED)
148 lis r30,hi16(EXT(per_proc_info)) ; Set current per_proc
149 ori r30,r30,lo16(EXT(per_proc_info)) ; Set current per_proc
150 crset bootCPU ; Set boot processor
152 lwz r17,pfAvailable(r30) ; Get the available bits
153 rlwinm. r0,r17,0,pfValidb,pfValidb ; Have we initialized the feature flags yet?
154 crmove firstInit,cr0_eq ; Set if we are doing first time init
155 bne allstart ; Yeah, we must be waking up from sleep...
158 ; Here is where we do any one time general low-level initialization
160 lis r20,HIGH_ADDR(fwdisplock) ; Get address of the firmware display lock
161 li r19,0 ; Zorch a register
162 ori r20,r20,LOW_ADDR(fwdisplock) ; Get address of the firmware display lock
163 stw r19,0(r20) ; Make sure the lock is free
165 allstart: mr r31,r3 ; Save away arguments
166 lis r23,hi16(EXT(per_proc_info)) ; Set base per_proc
167 ori r23,r23,lo16(EXT(per_proc_info)) ; Set base per_proc
169 mtsprg 0,r30 ; Set the per_proc
171 mfspr r6,hid0 ; Get the HID0
172 li r7,MSR_VM_OFF ; Get real mode MSR
173 rlwinm r6,r6,0,sleep+1,doze-1 ; Remove any vestiges of sleep
174 mtspr hid0,r6 ; Set the insominac HID0
175 mtmsr r7 ; Set the real mode SRR
178 ; Map in the first 256Mb in both instruction and data BATs
180 li r7,((0x7FF<<2)|2) ; Set up for V=R 256MB in supervisor space
181 li r8,((2<<3)|2) ; Physical address = 0, coherent, R/W
182 li r9,0 ; Clear out a register
184 mtsprg 1,r9 ; Clear the extra SPRGs
190 mtdbatu 0,r7 ; Map bottom 256MB
191 mtdbatl 0,r8 ; Map bottom 256MB
192 mtdbatu 1,r9 ; Invalidate maps
193 mtdbatl 1,r9 ; Invalidate maps
194 mtdbatu 2,r9 ; Invalidate maps
195 mtdbatl 2,r9 ; Invalidate maps
196 mtdbatu 3,r9 ; Invalidate maps
197 mtdbatl 3,r9 ; Invalidate maps
200 mtibatu 0,r7 ; Map bottom 256MB
201 mtibatl 0,r8 ; Map bottom 256MB
202 mtibatu 1,r9 ; Invalidate maps
203 mtibatl 1,r9 ; Invalidate maps
204 mtibatu 2,r9 ; Invalidate maps
205 mtibatl 2,r9 ; Invalidate maps
206 mtibatu 3,r9 ; Invalidate maps
207 mtibatl 3,r9 ; Invalidate maps
211 lis r26,hi16(processor_types) ; Point to processor table
212 ori r26,r26,lo16(processor_types) ; Other half
213 mfpvr r10 ; Get the PVR
215 nextPVR: lwz r28,ptFilter(r26) ; Get the filter
216 lwz r27,ptVersion(r26) ; Get the version and revision codes
217 and r28,r10,r28 ; Throw away dont care bits
218 cmplw r27,r28 ; Is this the right set?
219 beq donePVR ; We have the right one...
220 addi r26,r26,ptSize ; Point to the next type
221 b nextPVR ; Check it out...
223 donePVR: lwz r20,ptInitRout(r26) ; Grab the special init routine
224 mtlr r20 ; Setup to call the init
226 bf firstInit,notFirst ; Not first boot, go...
229 ; The following code just does a general initialization of the features just
230 ; after the initial first-time boot. This is not done after waking up or on
231 ; any "secondary" processor.
233 ; We are just setting defaults. The specific initialization code will modify these
237 lwz r17,ptFeatures(r26) ; Pick up the features
239 lwz r13,ptRptdProc(r26) ; Get the reported processor
240 sth r13,pfrptdProc(r30) ; Set the reported processor
242 lwz r13,ptTempMax(r26) ; Get maximum operating temperature
243 stw r13,thrmmaxTemp(r30) ; Set the maximum
244 lwz r13,ptTempThr(r26) ; Get temprature to throttle down when exceeded
245 stw r13,thrmthrottleTemp(r30) ; Set the temperature that we throttle
247 lwz r13,ptLineSize(r26) ; Get the cache line size
248 sth r13,pflineSize(r30) ; Save it
249 lwz r13,ptl1iSize(r26) ; Get icache size
250 stw r13,pfl1iSize(r30) ; Save it
251 lwz r13,ptl1dSize(r26) ; Get dcache size
252 stw r13,pfl1dSize(r30) ; Save it
253 b doOurInit ; Go do processor specific initialization...
255 notFirst: lwz r17,pfAvailable(r30) ; Get our features
256 rlwinm. r0,r17,0,pfValidb,pfValidb ; Have we set up this CPU yet?
257 bne doOurInit ; Yeah, must be wakeup...
259 lis r23,hi16(EXT(per_proc_info)) ; Set base per_proc
260 ori r23,r23,lo16(EXT(per_proc_info)) ; Set base per_proc
262 la r7,pfAvailable(r30) ; Point to features of our processor
263 la r8,pfAvailable(r23) ; Point to features of boot processor
264 li r9,(pfSize+thrmSize)/4 ; Get size of a features area
266 cpyFeat: subi r9,r9,1 ; Count word
267 lwz r0,0(r8) ; Get boot cpu features
268 stw r0,0(r7) ; Copy to ours
269 mr. r9,r9 ; Finished?
270 addi r7,r7,4 ; Next out
271 addi r8,r8,4 ; Next in
272 bgt cpyFeat ; Copy all boot cpu features to us...
274 lwz r17,pfAvailable(r30) ; Get our newly initialized features
277 mr. r20,r20 ; See if initialization routine
278 crand firstBoot,bootCPU,firstInit ; Indicate if we are on the initial first processor startup
279 bnelrl ; Do the initialization
281 ori r17,r17,lo16(pfValid) ; Set the valid bit
282 stw r17,pfAvailable(r30) ; Set the available features
283 mtsprg 2,r17 ; Remember the feature flags
285 rlwinm. r0,r17,0,pfFloatb,pfFloatb ; See if there is floating point
286 beq- noFloat ; Nope, this is a really stupid machine...
288 li r0,MSR_VM_OFF|MASK(MSR_FP) ; Enable for floating point
289 mtmsr r0 /* Set the standard MSR values */
292 lis r5,HIGH_ADDR(EXT(FloatInit)) /* Get top of floating point init value */
293 ori r5,r5,LOW_ADDR(EXT(FloatInit)) /* Slam bottom */
294 lfd f0,0(r5) /* Initialize FP0 */
295 fmr f1,f0 /* Ours in not */
296 fmr f2,f0 /* to wonder why, */
297 fmr f3,f0 /* ours is but to */
298 fmr f4,f0 /* do or die! */
327 li r0, MSR_VM_OFF ; Turn off floating point
331 noFloat: rlwinm. r0,r17,0,pfAltivecb,pfAltivecb ; See if there is Altivec
332 beq- noVector ; Nope...
334 li r0,0 ; Clear out a register
336 lis r7,hi16(MSR_VEC_ON) ; Get real mode MSR + Altivec
337 ori r7,r7,lo16(MSR_VM_OFF) ; Get real mode MSR + Altivec
338 mtmsr r7 ; Set the real mode SRR */
339 isync ; Make sure it has happened
341 lis r5,hi16(EXT(QNaNbarbarian)) ; Altivec initializer
342 ori r5,r5,lo16(EXT(QNaNbarbarian)) ; Altivec initializer
344 mtspr vrsave,r0 ; Set that no VRs are used yet */
346 vspltisw v1,0 ; Clear a register
347 lvx v0,br0,r5 ; Initialize VR0
348 mtvscr v1 ; Clear the vector status register
349 vor v2,v0,v0 ; Copy into the next register
350 vor v1,v0,v0 ; Copy into the next register
351 vor v3,v0,v0 ; Copy into the next register
352 vor v4,v0,v0 ; Copy into the next register
353 vor v5,v0,v0 ; Copy into the next register
354 vor v6,v0,v0 ; Copy into the next register
355 vor v7,v0,v0 ; Copy into the next register
356 vor v8,v0,v0 ; Copy into the next register
357 vor v9,v0,v0 ; Copy into the next register
358 vor v10,v0,v0 ; Copy into the next register
359 vor v11,v0,v0 ; Copy into the next register
360 vor v12,v0,v0 ; Copy into the next register
361 vor v13,v0,v0 ; Copy into the next register
362 vor v14,v0,v0 ; Copy into the next register
363 vor v15,v0,v0 ; Copy into the next register
364 vor v16,v0,v0 ; Copy into the next register
365 vor v17,v0,v0 ; Copy into the next register
366 vor v18,v0,v0 ; Copy into the next register
367 vor v19,v0,v0 ; Copy into the next register
368 vor v20,v0,v0 ; Copy into the next register
369 vor v21,v0,v0 ; Copy into the next register
370 vor v22,v0,v0 ; Copy into the next register
371 vor v23,v0,v0 ; Copy into the next register
372 vor v24,v0,v0 ; Copy into the next register
373 vor v25,v0,v0 ; Copy into the next register
374 vor v26,v0,v0 ; Copy into the next register
375 vor v27,v0,v0 ; Copy into the next register
376 vor v28,v0,v0 ; Copy into the next register
377 vor v29,v0,v0 ; Copy into the next register
378 vor v30,v0,v0 ; Copy into the next register
379 vor v31,v0,v0 ; Copy into the next register
381 li r0, MSR_VM_OFF ; Turn off vectors
385 noVector: rlwinm. r0,r17,0,pfSMPcapb,pfSMPcapb ; See if we can do SMP
388 lhz r13,PP_CPU_NUMBER(r30) ; Get the CPU number
389 mtspr pir,r13 ; Set the PIR
391 noSMP: rlwinm. r0,r17,0,pfThermalb,pfThermalb ; See if there is an TAU
392 beq- noThermometer ; Nope...
394 li r13,0 ; Disable thermals for now
395 mtspr thrm3,r13 ; Do it
396 li r13,lo16(thrmtidm|thrmvm) ; Set for lower-than thermal event at 0 degrees
397 mtspr thrm1,r13 ; Do it
398 lis r13,hi16(thrmthrm) ; Set 127 degrees
399 ori r13,r13,lo16(thrmvm) ; Set for higher-than event
400 mtspr thrm2,r13 ; Set it
404 bl EXT(cacheInit) ; Initializes all caches (including the TLB)
406 li r0,MSR_SUPERVISOR_INT_OFF ; Make sure we do not have FP enabled
407 mtmsr r0 ; Set the standard MSR values
410 bf bootCPU,callcpu ; Not the boot processor...
412 lis r29,HIGH_ADDR(EXT(intstack_top_ss)) ; move onto interrupt stack
413 ori r29,r29,LOW_ADDR(EXT(intstack_top_ss))
417 stw r28,FM_BACKPTR(r29) ; store a null frame backpointer
420 mr r3,r31 ; Restore any arguments we may have trashed
422 bl EXT(ppc_init) ; Jump into boot init code
426 lwz r29,PP_INTSTACK_TOP_SS(r31) ; move onto interrupt stack
429 stw r28,FM_BACKPTR(r29) ; store a null frame backpointer
432 mr r1,r29 ; move onto new stack
433 mr r3,r31 ; Restore any arguments we may have trashed
435 bl EXT(ppc_init_cpu) ; Jump into cpu init code
436 BREAKPOINT_TRAP ; Should never return
439 ; Specific processor initialization routines
445 bf firstBoot, init750nb ; No init for wakeup....
447 mfspr r13,l2cr ; Get the L2CR
448 rlwinm. r0,r13,0,l2e,l2e ; Any L2?
449 bne+ i750hl2 ; Yes...
450 rlwinm r17,r17,0,pfL2b+1,pfL2b-1 ; No L2, turn off feature
453 lis r14,hi16(256*1024) ; Base L2 size
454 addis r15,r13,0x3000 ; Hah... Figure this one out...
455 rlwinm r15,r15,4,30,31 ; Isolate
456 rlwinm. r8,r13,0,l2siz,l2sizf ; Was size valid?
457 slw r14,r14,r15 ; Set 256KB, 512KB, or 1MB
458 beq- init750l2none ; Not a valid setting...
460 stw r13,pfl2crOriginal(r30) ; Shadow the L2CR
461 stw r13,pfl2cr(r30) ; Shadow the L2CR
462 stw r14,pfl2Size(r30) ; Set the L2 size
463 b init750l2done ; Done with L2
466 rlwinm r17,r17,0,pfL2b+1,pfL2b-1 ; No level 2 cache
469 mfspr r11,hid0 ; Get the current HID0
470 stw r11,pfHID0(r30) ; Save the HID0 value
474 lwz r11,pfHID0(r30) ; Get HID0
476 mtspr hid0,r11 ; Set the HID
484 bf firstBoot, init750 ; No init for wakeup....
485 mfspr r13,hid1 ; Get HID1
486 li r14,lo16(0xFD5F) ; Get valid
487 rlwinm r13,r13,4,28,31 ; Isolate
488 slw r14,r14,r13 ; Position
489 rlwimi r17,r14,15-pfCanNapb,pfCanNapb,pfCanNapb ; Set it
490 b init750 ; Join common...
496 bf firstBoot, init750FXnb
498 stw r11, pfHID1(r30) ; Save the HID1 value
502 lwz r13, pfHID0(r30) ; Get HID0
503 lwz r11, pfHID1(r30) ; Get HID1
505 rlwinm. r0, r11, 0, hid1ps, hid1ps ; Isolate the hid1ps bit
506 beq init750FXnb2 ; Clear BTIC if hid1ps set
507 rlwinm r13, r13, 0, btic+1, btic-1 ; Clear the BTIC bit
511 mtspr hid0, r13 ; Set the HID
515 rlwinm r12, r11, 0, hid1ps+1, hid1ps-1 ; Select PLL0
516 mtspr hid1, r12 ; Restore PLL config
517 mftb r13 ; Wait 5000 ticks (> 200 us)
524 mtspr hid1, r11 ; Select the desired PLL
527 ; 750FX vers 2.0 or later
529 bf firstBoot, init750FXV2nb ; Wake from sleep
532 stw r11, pfHID2(r30) ; Save the HID2 value
533 b init750FX ; Continue with 750FX init
536 lwz r13, pfHID2(r30) ; Get HID2
537 rlwinm r13, r13, 0, hid2vmin+1, hid2vmin-1 ; Clear the vmin bit
538 mtspr hid2, r13 ; Restore HID2 value
539 sync ; Wait for it to be done
544 init7400: bf firstBoot,i7400nb ; Do different if not initial boot...
545 mfspr r13,l2cr ; Get the L2CR
546 rlwinm. r0,r13,0,l2e,l2e ; Any L2?
547 bne+ i7400hl2 ; Yes...
548 rlwinm r17,r17,0,pfL2b+1,pfL2b-1 ; No L2, turn off feature
550 i7400hl2: lis r14,hi16(256*1024) ; Base L2 size
551 addis r15,r13,0x3000 ; Hah... Figure this one out...
552 rlwinm r15,r15,4,30,31
553 slw r14,r14,r15 ; Set 256KB, 512KB, 1MB, or 2MB
555 stw r13,pfl2crOriginal(r30) ; Shadow the L2CR
556 stw r13,pfl2cr(r30) ; Shadow the L2CR
557 stw r14,pfl2Size(r30) ; Set the L2 size
559 mfspr r11,hid0 ; Get the current HID0
560 oris r11,r11,hi16(emcpm|eiecm) ; ?
563 stw r11,pfHID0(r30) ; Save the HID0 value
565 mfspr r11,msscr0 ; Get the msscr0 register
566 stw r11,pfMSSCR0(r30) ; Save the MSSCR0 value
567 mfspr r11,msscr1 ; Get the msscr1 register
568 stw r11,pfMSSCR1(r30) ; Save the MSSCR1 value
573 mtspr l2cr,r11 ; Make sure L2CR is zero
574 lwz r11,pfHID0(r30) ; Get HID0
576 mtspr hid0,r11 ; Set the HID
579 lwz r11,pfMSSCR0(r30) ; Get MSSCR0
582 mtspr msscr0,r11 ; Set the MSSCR0
583 lwz r11,pfMSSCR1(r30) ; Get msscr1
586 mtspr msscr1,r11 ; Set the msscr1
591 ; 7400 (ver 2.0 - ver 2.7)
594 bf firstBoot, init7400
595 mfspr r13, hid0 ; Get the HID0
596 ori r13, r13, nopdstm ; ?
597 mtspr hid0, r13 ; Set the HID0
603 ; Note that this is the same as 7400 except we initialize the l2cr2 register
605 init7410: li r13,0 ; Clear
606 mtspr 1016,r13 ; Turn off direct cache
607 b init7400 ; Join up with common....
610 ; 745X - Any 7450 family processor
613 bf firstBoot,init745Xnb ; Do different if not initial boot...
615 mfspr r13,l2cr ; Get the L2CR
616 rlwinm. r0,r13,0,l2e,l2e ; Any L2?
617 bne+ init745Xhl2 ; Yes...
618 rlwinm r17,r17,0,pfL2b+1,pfL2b-1 ; No L2, turn off feature
620 init745Xhl2: lis r14,hi16(256*1024) ; Base L2 size
621 rlwinm r15,r13,22,12,13 ; Convert to 256k, 512k, or 768k
622 add r14,r14,r15 ; Add in minimum
624 stw r13,pfl2crOriginal(r30) ; Shadow the L2CR
625 stw r13,pfl2cr(r30) ; Shadow the L2CR
626 stw r14,pfl2Size(r30) ; Set the L2 size
628 ; Take care of level 3 cache
630 mfspr r13,l3cr ; Get the L3CR
631 rlwinm. r0,r13,0,l3e,l3e ; Any L3?
632 bne+ init745Xhl3 ; Yes...
633 rlwinm r17,r17,0,pfL3b+1,pfL3b-1 ; No L3, turn off feature
635 init745Xhl3: cmplwi cr0,r13,0 ; No L3 if L3CR is zero
636 beq- init745Xnone ; Go turn off the features...
637 lis r14,hi16(1024*1024) ; Base L3 size
638 rlwinm r15,r13,4,31,31 ; Get size multiplier
639 slw r14,r14,r15 ; Set 1 or 2MB
641 stw r13,pfl3crOriginal(r30) ; Shadow the L3CR
642 stw r13,pfl3cr(r30) ; Shadow the L3CR
643 stw r14,pfl3Size(r30) ; Set the L3 size
644 b init745Xfin ; Return....
647 rlwinm r17,r17,0,pfL3fab+1,pfL3b-1 ; No 3rd level cache or assist
648 rlwinm r11,r17,pfWillNapb-pfCanNapb,pfCanNapb,pfCanNapb ; Set pfCanNap if pfWillNap is set
652 rlwinm r17,r17,0,pfWillNapb+1,pfWillNapb-1 ; Make sure pfWillNap is not set
654 mfspr r11,hid0 ; Get the current HID0
655 stw r11,pfHID0(r30) ; Save the HID0 value
656 mfspr r11,hid1 ; Get the current HID1
657 stw r11,pfHID1(r30) ; Save the HID1 value
658 mfspr r11,msscr0 ; Get the msscr0 register
659 stw r11,pfMSSCR0(r30) ; Save the MSSCR0 value
660 mfspr r11,msscr1 ; Get the msscr1 register
661 stw r11,pfMSSCR1(r30) ; Save the MSSCR1 value
662 mfspr r11,ictrl ; Get the ictrl register
663 stw r11,pfICTRL(r30) ; Save the ICTRL value
664 mfspr r11,ldstcr ; Get the ldstcr register
665 stw r11,pfLDSTCR(r30) ; Save the LDSTCR value
666 mfspr r11,ldstdb ; Get the ldstdb register
667 stw r11,pfLDSTDB(r30) ; Save the LDSTDB value
668 mfspr r11,pir ; Get the pir register
669 stw r11,pfBootConfig(r30) ; Save the BootConfig value
673 init745Xnb: lwz r11,pfHID0(r30) ; Get HID0
675 mtspr hid0,r11 ; Set the HID
677 lwz r11,pfHID1(r30) ; Get HID1
679 mtspr hid1,r11 ; Set the HID
681 lwz r11,pfMSSCR0(r30) ; Get MSSCR0
683 mtspr msscr0,r11 ; Set the MSSCR0
686 lwz r11,pfICTRL(r30) ; Get ICTRL
688 mtspr ictrl,r11 ; Set the ICTRL
691 lwz r11,pfLDSTCR(r30) ; Get LDSTCR
693 mtspr ldstcr,r11 ; Set the LDSTCR
696 lwz r11,pfLDSTDB(r30) ; Get LDSTDB
698 mtspr ldstdb,r11 ; Set the LDSTDB
706 bf firstBoot, init745X ; Not boot, use standard init
708 mfspr r13, pir ; Get BootConfig from PIR
709 rlwinm. r14, r13, 0, 20, 23 ; Is the pdet value zero
710 bne init7450done ; No, done for now
712 ori r13, r13, 0x0400 ; Force pdet value to 4
713 mtspr pir, r13 ; Write back the BootConfig
716 b init745X ; Continue with standard init
720 ; Processor to feature table
722 ; .align 2 - Always on word boundary
723 ; .long ptFilter - Mask of significant bits in the Version/Revision code
724 ; - NOTE: Always order from most restrictive to least restrictive matching
725 ; .short ptVersion - Version code from PVR. Always start with 0 which is default
726 ; .short ptRevision - Revision code from PVR. A zero value denotes the generic attributes if not specific
727 ; .long ptFeatures - Available features
728 ; .long ptInitRout - Initilization routine. Can modify any of the other attributes.
729 ; .long ptRptdProc - Processor type reported
730 ; .long ptTempMax - Maximum operating temprature
731 ; .long ptTempThr - Temprature threshold. We throttle if above
732 ; .long ptLineSize - Level 1 cache line size
733 ; .long ptl1iSize - Level 1 instruction cache size
734 ; .long ptl1dSize - Level 1 data cache size
743 .long 0xFFFF0000 ; All revisions
744 .short PROCESSOR_VERSION_601
746 .long pfFloat | pfSMPcap | pfL1i | pfL1d
748 .long CPU_SUBTYPE_POWERPC_ALL
758 .long 0xFFFF0000 ; All revisions
759 .short PROCESSOR_VERSION_603
761 .long pfFloat | pfL1i | pfL1d
763 .long CPU_SUBTYPE_POWERPC_603
773 .long 0xFFFF0000 ; All revisions
774 .short PROCESSOR_VERSION_603e
776 .long pfFloat | pfL1i | pfL1d
778 .long CPU_SUBTYPE_POWERPC_603e
788 .long 0xFFFF0000 ; All revisions
789 .short PROCESSOR_VERSION_604
791 .long pfFloat | pfSMPcap | pfL1i | pfL1d
793 .long CPU_SUBTYPE_POWERPC_604
803 .long 0xFFFF0000 ; All revisions
804 .short PROCESSOR_VERSION_604e
806 .long pfFloat | pfSMPcap | pfL1i | pfL1d
808 .long CPU_SUBTYPE_POWERPC_604e
818 .long 0xFFFF0000 ; All revisions
819 .short PROCESSOR_VERSION_604ev
821 .long pfFloat | pfSMPcap | pfL1i | pfL1d
823 .long CPU_SUBTYPE_POWERPC_604e
833 .long 0xFFFFFFFF ; Exact match
834 .short PROCESSOR_VERSION_750
836 .long pfFloat | pfCanSleep | pfCanNap | pfCanDoze | pfL1i | pfL1d | pfL2
838 .long CPU_SUBTYPE_POWERPC_750
848 .long 0xFFFF0F00 ; 2.x vers
849 .short PROCESSOR_VERSION_750
851 .long pfFloat | pfCanSleep | pfCanNap | pfCanDoze | pfL1i | pfL1d | pfL2
853 .long CPU_SUBTYPE_POWERPC_750
863 .long 0xFFFF0000 ; All revisions
864 .short PROCESSOR_VERSION_750
866 .long pfFloat | pfCanSleep | pfCanNap | pfCanDoze | pfThermal | pfL1i | pfL1d | pfL2
868 .long CPU_SUBTYPE_POWERPC_750
878 .long 0xFFFF0F00 ; 1.x vers
879 .short PROCESSOR_VERSION_750FX
881 .long pfFloat | pfCanSleep | pfCanNap | pfCanDoze | pfSlowNap | pfNoMuMMCK | pfL1i | pfL1d | pfL2
883 .long CPU_SUBTYPE_POWERPC_750
893 .long 0xFFFF0000 ; All revisions
894 .short PROCESSOR_VERSION_750FX
896 .long pfFloat | pfCanSleep | pfCanNap | pfCanDoze | pfSlowNap | pfNoMuMMCK | pfL1i | pfL1d | pfL2
898 .long CPU_SUBTYPE_POWERPC_750
905 ; 7400 (ver 2.0 - ver 2.7)
908 .long 0xFFFFFFF8 ; All revisions
909 .short PROCESSOR_VERSION_7400
911 .long pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfCanNap | pfCanDoze | pfThermal | pfL1i | pfL1d | pfL1fa | pfL2 | pfL2fa
913 .long CPU_SUBTYPE_POWERPC_7400
923 .long 0xFFFF0000 ; All revisions
924 .short PROCESSOR_VERSION_7400
926 .long pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfCanNap | pfCanDoze | pfThermal | pfL1i | pfL1d | pfL1fa | pfL2 | pfL2fa
928 .long CPU_SUBTYPE_POWERPC_7400
938 .long 0xFFFFFFFF ; Exact match
939 .short PROCESSOR_VERSION_7400
941 .long pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfCanNap | pfCanDoze | pfL1i | pfL1d | pfL1fa | pfL2 | pfL2fa
943 .long CPU_SUBTYPE_POWERPC_7400
953 .long 0xFFFF0000 ; All other revisions
954 .short PROCESSOR_VERSION_7410
956 .long pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfCanNap | pfCanDoze | pfL1i | pfL1d | pfL1fa | pfL2 | pfL2fa
958 .long CPU_SUBTYPE_POWERPC_7400
968 .long 0xFFFFFF00 ; Just revisions 1.xx
969 .short PROCESSOR_VERSION_7450
971 .long pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfNoMSRir | pfNoL2PFNap | pfLClck | pfL1i | pfL1d | pfL2 | pfL2fa | pfL2i | pfL3 | pfL3fa
973 .long CPU_SUBTYPE_POWERPC_7450
983 .long 0xFFFFFFFF ; Just revision 2.0
984 .short PROCESSOR_VERSION_7450
986 .long pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfNoMSRir | pfNoL2PFNap | pfLClck | pfL1i | pfL1d | pfL2 | pfL2fa | pfL2i | pfL3 | pfL3fa
988 .long CPU_SUBTYPE_POWERPC_7450
998 .long 0xFFFF0000 ; All other revisions
999 .short PROCESSOR_VERSION_7450
1001 .long pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfWillNap | pfNoMSRir | pfNoL2PFNap | pfLClck | pfL1i | pfL1d | pfL2 | pfL2fa | pfL2i | pfL3 | pfL3fa
1003 .long CPU_SUBTYPE_POWERPC_7450
1010 ; 7455 (1.xx) Just like 7450 2.0
1013 .long 0xFFFFFF00 ; Just revisions 1.xx
1014 .short PROCESSOR_VERSION_7455
1016 .long pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfNoMSRir | pfNoL2PFNap | pfLClck | pfL1i | pfL1d | pfL2 | pfL2fa | pfL2i | pfL3 | pfL3fa
1018 .long CPU_SUBTYPE_POWERPC_7450
1028 .long 0xFFFFFFFF ; Just revision 2.0
1029 .short PROCESSOR_VERSION_7455
1031 .long pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfWillNap | pfNoMSRir | pfNoL2PFNap | pfLClck | pfL1i | pfL1d | pfL2 | pfL2fa | pfL2i | pfL3 | pfL3fa
1033 .long CPU_SUBTYPE_POWERPC_7450
1043 .long 0xFFFF0000 ; All other revisions
1044 .short PROCESSOR_VERSION_7455
1046 .long pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfCanNap | pfNoMSRir | pfNoL2PFNap | pfLClck | pfL1i | pfL1d | pfL2 | pfL2fa | pfL2i | pfL3 | pfL3fa
1048 .long CPU_SUBTYPE_POWERPC_7450
1055 ; Default dumb loser machine
1058 .long 0x00000000 ; Matches everything
1061 .long pfFloat | pfL1i | pfL1d
1063 .long CPU_SUBTYPE_POWERPC_ALL