]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/ppc/start.s
xnu-201.42.3.tar.gz
[apple/xnu.git] / osfmk / ppc / start.s
index 233064634bad4544f875cac22e3d2e33fd755576..21a82ccdc0f44e9c6c5c06ffeed4f967b3e3ce90 100644 (file)
@@ -59,6 +59,7 @@
 #define PROCESSOR_VERSION_7400         12      /* ? */
 #define PROCESSOR_VERSION_7410         0x800C  /* ? */
 #define PROCESSOR_VERSION_7450         0x8000  /* ? */
+#define PROCESSOR_VERSION_7455         0x8001  /* ? */
 
 /*
  * Interrupt and bootup stack for initial processor
@@ -436,17 +437,6 @@ callcpu:
 ;                      Specific processor initialization routines
 ;
 
-;                      750CX
-
-init750CX:
-                       bf      firstBoot, init750                                              ; No init for wakeup....
-                       mfspr   r13,hid1                                                        ; Get HID1
-                       li              r14,lo16(0xFD5F)                                        ; Get valid
-                       rlwinm  r13,r13,4,28,31                                         ; Isolate
-                       slw             r14,r14,r13                                                     ; Position
-                       rlwimi  r17,r14,15-pfCanNapb,pfCanNapb,pfCanNapb        ; Set it                        
-                       b               init750                                                 ; Join common...
-
 ;                      750
 
 init750:
@@ -465,6 +455,7 @@ i750hl2:
                        slw     r14,r14,r15                                                     ; Set 256KB, 512KB, or 1MB
                        beq-    init750l2none                                                   ; Not a valid setting...
                        
+                       stw     r13,pfl2crOriginal(r30)                                         ; Shadow the L2CR
                        stw     r13,pfl2cr(r30)                                                 ; Shadow the L2CR
                        stw     r14,pfl2Size(r30)                                               ; Set the L2 size
                        b       init750l2done                                                   ; Done with L2
@@ -478,13 +469,27 @@ init750l2done:
                        blr                                                                     ; Return...
                        
 init750nb:
-                       lwz             r11,pfHID0(r30)                                         ; Get HID0
+                       lwz     r11,pfHID0(r30)                                                 ; Get HID0
                        sync
                        mtspr   hid0,r11                                                        ; Set the HID
                        isync
                        sync
                        blr
 
+;                      750CX
+
+init750CX:
+                       bf      firstBoot, init750                                              ; No init for wakeup....
+                       mfspr   r13,hid1                                                        ; Get HID1
+                       li      r14,lo16(0xFD5F)                                                ; Get valid
+                       rlwinm  r13,r13,4,28,31                                                 ; Isolate
+                       slw     r14,r14,r13                                                     ; Position
+                       rlwimi  r17,r14,15-pfCanNapb,pfCanNapb,pfCanNapb                        ; Set it                        
+                       b       init750                                                         ; Join common...
+
+
+;                      7400
+
 init7400:      bf              firstBoot,i7400nb                                       ; Do different if not initial boot...
                        mfspr   r13,l2cr                                                        ; Get the L2CR
                        rlwinm. r0,r13,0,l2e,l2e                                        ; Any L2?
@@ -496,6 +501,7 @@ i7400hl2:   lis             r14,hi16(256*1024)                                      ; Base L2 size
                        rlwinm  r15,r15,4,30,31                                          
                        slw             r14,r14,r15                                                     ; Set 256KB, 512KB, 1MB, or 2MB
                        
+                       stw             r13,pfl2crOriginal(r30)                                 ; Shadow the L2CR
                        stw             r13,pfl2cr(r30)                                         ; Shadow the L2CR
                        stw             r14,pfl2Size(r30)                                       ; Set the L2 size
                        
@@ -512,6 +518,8 @@ i7400hl2:   lis             r14,hi16(256*1024)                                      ; Base L2 size
                        blr                                                                                     ; Return...
                        
 i7400nb:
+                       li              r11,0
+                       mtspr           l2cr,r11                                                ; Make sure L2CR is zero
                        lwz             r11,pfHID0(r30)                                         ; Get HID0
                        sync
                        mtspr   hid0,r11                                                        ; Set the HID
@@ -535,20 +543,23 @@ i7400nb:
 init7410:      li              r13,0                                                           ; Clear
                        mtspr   1016,r13                                                        ; Turn off direct cache
                        b               init7400                                                        ; Join up with common....
-                       
-;                      7450
 
-init7450:      bf              firstBoot,i7450nb                                       ; Do different if not initial boot...
+
+;                      745X - Any 7450 family processor
+
+init745X:
+                       bf              firstBoot,init745Xnb                                    ; Do different if not initial boot...
 
                        mfspr   r13,l2cr                                                        ; Get the L2CR
                        rlwinm. r0,r13,0,l2e,l2e                                        ; Any L2?
-                       bne+    i7450hl2                                                        ; Yes...
+                       bne+    init745Xhl2                                                     ; Yes...
                        rlwinm  r17,r17,0,pfL2b+1,pfL2b-1                       ; No L2, turn off feature
                        
-i7450hl2:      lis             r14,hi16(256*1024)                                      ; Base L2 size
+init745Xhl2:   lis             r14,hi16(256*1024)                                      ; Base L2 size
                        rlwinm  r15,r13,22,12,13                                        ; Convert to 256k, 512k, or 768k
                        add             r14,r14,r15                                                     ; Add in minimum
                        
+                       stw             r13,pfl2crOriginal(r30)                                 ; Shadow the L2CR
                        stw             r13,pfl2cr(r30)                                         ; Shadow the L2CR
                        stw             r14,pfl2Size(r30)                                       ; Set the L2 size
                                
@@ -556,25 +567,26 @@ i7450hl2: lis             r14,hi16(256*1024)                                      ; Base L2 size
 
                        mfspr   r13,l3cr                                                        ; Get the L3CR
                        rlwinm. r0,r13,0,l3e,l3e                                        ; Any L3?
-                       bne+    i7450hl3                                                        ; Yes...
+                       bne+    init745Xhl3                                                     ; Yes...
                        rlwinm  r17,r17,0,pfL3b+1,pfL3b-1                       ; No L3, turn off feature
 
-i7450hl3:      cmplwi  cr0,r13,0                                                       ; No L3 if L3CR is zero
-                       beq-    init7450none                                                    ; Go turn off the features...
+init745Xhl3:   cmplwi  cr0,r13,0                                                       ; No L3 if L3CR is zero
+                       beq-    init745Xnone                                                    ; Go turn off the features...
                        lis             r14,hi16(1024*1024)                                     ; Base L3 size
                        rlwinm  r15,r13,4,31,31                                         ; Get size multiplier
                        slw             r14,r14,r15                                                     ; Set 1 or 2MB
                        
+                       stw             r13,pfl3crOriginal(r30)                                 ; Shadow the L3CR
                        stw             r13,pfl3cr(r30)                                         ; Shadow the L3CR
                        stw             r14,pfl3Size(r30)                                       ; Set the L3 size
-                       b               init7450fin                                                     ; Return....
+                       b               init745Xfin                                                     ; Return....
                                
-init7450none:
+init745Xnone:
                        rlwinm  r17,r17,0,pfL3fab+1,pfL3b-1                                     ; No 3rd level cache or assist
                        rlwinm  r11,r17,pfWillNapb-pfCanNapb,pfCanNapb,pfCanNapb                ; Set pfCanNap if pfWillNap is set
                        or      r17,r17,r11
 
-init7450fin:
+init745Xfin:
                        rlwinm  r17,r17,0,pfWillNapb+1,pfWillNapb-1                             ; Make sure pfWillNap is not set
 
                        mfspr   r11,hid0                                                        ; Get the current HID0
@@ -591,10 +603,12 @@ init7450fin:
                        stw             r11,pfLDSTCR(r30)                                       ; Save the LDSTCR value
                        mfspr   r11,ldstdb                                                      ; Get the ldstdb register
                        stw             r11,pfLDSTDB(r30)                                       ; Save the LDSTDB value
+                       mfspr   r11,pir                                                         ; Get the pir register
+                       stw             r11,pfBootConfig(r30)                                   ; Save the BootConfig value
                        blr                                                                                     ; Return....
 
 
-i7450nb:       lwz             r11,pfHID0(r30)                                         ; Get HID0
+init745Xnb:    lwz             r11,pfHID0(r30)                                         ; Get HID0
                        sync
                        mtspr   hid0,r11                                                        ; Set the HID
                        isync
@@ -624,6 +638,21 @@ i7450nb:   lwz             r11,pfHID0(r30)                                         ; Get HID0
                        sync
                        blr
 
+;                      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
+
 
 ;
 ;      Processor to feature table
@@ -833,7 +862,7 @@ processor_types:
        .long   0xFFFFFF00              ; Just revisions 1.xx
        .short  PROCESSOR_VERSION_7450
        .short  0x0100
-       .long   pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfNoMSRir | pfLClck | pfL1i | pfL1d | pfL2 | pfL2fa | pfL2i | pfL3 | pfL3fa | pfL3pdet
+       .long   pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfNoMSRir | pfLClck | pfL1i | pfL1d | pfL2 | pfL2fa | pfL2i | pfL3 | pfL3fa
        .long   init7450
        .long   CPU_SUBTYPE_POWERPC_7450
        .long   105
@@ -848,7 +877,7 @@ processor_types:
        .long   0xFFFFFFFF              ; Just revision 2.0
        .short  PROCESSOR_VERSION_7450
        .short  0x0200
-       .long   pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfNoMSRir | pfLClck | pfL1i | pfL1d | pfL2 | pfL2fa | pfL2i | pfL3 | pfL3fa | pfL3pdet
+       .long   pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfNoMSRir | pfLClck | pfL1i | pfL1d | pfL2 | pfL2fa | pfL2i | pfL3 | pfL3fa
        .long   init7450
        .long   CPU_SUBTYPE_POWERPC_7450
        .long   105
@@ -863,7 +892,7 @@ processor_types:
        .long   0xFFFF0000              ; All other revisions
        .short  PROCESSOR_VERSION_7450
        .short  0
-       .long   pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfWillNap | pfNoMSRir | pfLClck | pfL1i | pfL1d | pfL2 | pfL2fa | pfL2i | pfL3 | pfL3fa | pfL3pdet
+       .long   pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfWillNap | pfNoMSRir | pfLClck | pfL1i | pfL1d | pfL2 | pfL2fa | pfL2i | pfL3 | pfL3fa
        .long   init7450
        .long   CPU_SUBTYPE_POWERPC_7450
        .long   105
@@ -872,6 +901,50 @@ processor_types:
        .long   32*1024
        .long   32*1024
 
+;      7455 (1.xx)  Just like 7450 2.0
+
+       .align  2
+       .long   0xFFFFFF00              ; Just revisions 1.xx
+       .short  PROCESSOR_VERSION_7455
+       .short  0x0100
+       .long   pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfNoMSRir | pfLClck | pfL1i | pfL1d | pfL2 | pfL2fa | pfL2i | pfL3 | pfL3fa
+       .long   init745X
+       .long   CPU_SUBTYPE_POWERPC_7450
+       .long   105
+       .long   90
+       .long   32
+       .long   32*1024
+       .long   32*1024
+
+;      7455 (2.0)
+
+       .align  2
+       .long   0xFFFFFFFF              ; Just revision 2.0
+       .short  PROCESSOR_VERSION_7455
+       .short  0x0200
+       .long   pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfWillNap | pfNoMSRir | pfLClck | pfL1i | pfL1d | pfL2 | pfL2fa | pfL2i | pfL3 | pfL3fa
+       .long   init745X
+       .long   CPU_SUBTYPE_POWERPC_7450
+       .long   105
+       .long   90
+       .long   32
+       .long   32*1024
+       .long   32*1024
+
+;      7455 (2.1)
+
+       .align  2
+       .long   0xFFFF0000              ; All other revisions
+       .short  PROCESSOR_VERSION_7455
+       .short  0
+       .long   pfFloat | pfAltivec | pfSMPcap | pfCanSleep | pfCanNap | pfNoMSRir | pfLClck | pfL1i | pfL1d | pfL2 | pfL2fa | pfL2i | pfL3 | pfL3fa
+       .long   init745X
+       .long   CPU_SUBTYPE_POWERPC_7450
+       .long   105
+       .long   90
+       .long   32
+       .long   32*1024
+       .long   32*1024
 
 ;      Default dumb loser machine