diff options
Diffstat (limited to 'arch/ppc/kernel/head_fsl_booke.S')
-rw-r--r-- | arch/ppc/kernel/head_fsl_booke.S | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/arch/ppc/kernel/head_fsl_booke.S b/arch/ppc/kernel/head_fsl_booke.S index ce36e88ba627..eb804b7a3cb2 100644 --- a/arch/ppc/kernel/head_fsl_booke.S +++ b/arch/ppc/kernel/head_fsl_booke.S | |||
@@ -102,6 +102,7 @@ invstr: mflr r6 /* Make it accessible */ | |||
102 | or r7,r7,r4 | 102 | or r7,r7,r4 |
103 | mtspr SPRN_MAS6,r7 | 103 | mtspr SPRN_MAS6,r7 |
104 | tlbsx 0,r6 /* search MSR[IS], SPID=PID0 */ | 104 | tlbsx 0,r6 /* search MSR[IS], SPID=PID0 */ |
105 | #ifndef CONFIG_E200 | ||
105 | mfspr r7,SPRN_MAS1 | 106 | mfspr r7,SPRN_MAS1 |
106 | andis. r7,r7,MAS1_VALID@h | 107 | andis. r7,r7,MAS1_VALID@h |
107 | bne match_TLB | 108 | bne match_TLB |
@@ -118,6 +119,7 @@ invstr: mflr r6 /* Make it accessible */ | |||
118 | or r7,r7,r4 | 119 | or r7,r7,r4 |
119 | mtspr SPRN_MAS6,r7 | 120 | mtspr SPRN_MAS6,r7 |
120 | tlbsx 0,r6 /* Fall through, we had to match */ | 121 | tlbsx 0,r6 /* Fall through, we had to match */ |
122 | #endif | ||
121 | match_TLB: | 123 | match_TLB: |
122 | mfspr r7,SPRN_MAS0 | 124 | mfspr r7,SPRN_MAS0 |
123 | rlwinm r3,r7,16,20,31 /* Extract MAS0(Entry) */ | 125 | rlwinm r3,r7,16,20,31 /* Extract MAS0(Entry) */ |
@@ -196,8 +198,10 @@ skpinv: addi r6,r6,1 /* Increment */ | |||
196 | /* 4. Clear out PIDs & Search info */ | 198 | /* 4. Clear out PIDs & Search info */ |
197 | li r6,0 | 199 | li r6,0 |
198 | mtspr SPRN_PID0,r6 | 200 | mtspr SPRN_PID0,r6 |
201 | #ifndef CONFIG_E200 | ||
199 | mtspr SPRN_PID1,r6 | 202 | mtspr SPRN_PID1,r6 |
200 | mtspr SPRN_PID2,r6 | 203 | mtspr SPRN_PID2,r6 |
204 | #endif | ||
201 | mtspr SPRN_MAS6,r6 | 205 | mtspr SPRN_MAS6,r6 |
202 | 206 | ||
203 | /* 5. Invalidate mapping we started in */ | 207 | /* 5. Invalidate mapping we started in */ |
@@ -277,7 +281,9 @@ skpinv: addi r6,r6,1 /* Increment */ | |||
277 | SET_IVOR(32, SPEUnavailable); | 281 | SET_IVOR(32, SPEUnavailable); |
278 | SET_IVOR(33, SPEFloatingPointData); | 282 | SET_IVOR(33, SPEFloatingPointData); |
279 | SET_IVOR(34, SPEFloatingPointRound); | 283 | SET_IVOR(34, SPEFloatingPointRound); |
284 | #ifndef CONFIG_E200 | ||
280 | SET_IVOR(35, PerformanceMonitor); | 285 | SET_IVOR(35, PerformanceMonitor); |
286 | #endif | ||
281 | 287 | ||
282 | /* Establish the interrupt vector base */ | 288 | /* Establish the interrupt vector base */ |
283 | lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */ | 289 | lis r4,interrupt_base@h /* IVPR only uses the high 16-bits */ |
@@ -285,6 +291,9 @@ skpinv: addi r6,r6,1 /* Increment */ | |||
285 | 291 | ||
286 | /* Setup the defaults for TLB entries */ | 292 | /* Setup the defaults for TLB entries */ |
287 | li r2,(MAS4_TSIZED(BOOKE_PAGESZ_4K))@l | 293 | li r2,(MAS4_TSIZED(BOOKE_PAGESZ_4K))@l |
294 | #ifdef CONFIG_E200 | ||
295 | oris r2,r2,MAS4_TLBSELD(1)@h | ||
296 | #endif | ||
288 | mtspr SPRN_MAS4, r2 | 297 | mtspr SPRN_MAS4, r2 |
289 | 298 | ||
290 | #if 0 | 299 | #if 0 |
@@ -293,6 +302,12 @@ skpinv: addi r6,r6,1 /* Increment */ | |||
293 | oris r2,r2,HID0_DOZE@h | 302 | oris r2,r2,HID0_DOZE@h |
294 | mtspr SPRN_HID0, r2 | 303 | mtspr SPRN_HID0, r2 |
295 | #endif | 304 | #endif |
305 | #ifdef CONFIG_E200 | ||
306 | /* enable dedicated debug exception handling resources (Debug APU) */ | ||
307 | mfspr r2,SPRN_HID0 | ||
308 | ori r2,r2,HID0_DAPUEN@l | ||
309 | mtspr SPRN_HID0,r2 | ||
310 | #endif | ||
296 | 311 | ||
297 | #if !defined(CONFIG_BDI_SWITCH) | 312 | #if !defined(CONFIG_BDI_SWITCH) |
298 | /* | 313 | /* |
@@ -414,7 +429,12 @@ interrupt_base: | |||
414 | CRITICAL_EXCEPTION(0x0100, CriticalInput, UnknownException) | 429 | CRITICAL_EXCEPTION(0x0100, CriticalInput, UnknownException) |
415 | 430 | ||
416 | /* Machine Check Interrupt */ | 431 | /* Machine Check Interrupt */ |
432 | #ifdef CONFIG_E200 | ||
433 | /* no RFMCI, MCSRRs on E200 */ | ||
434 | CRITICAL_EXCEPTION(0x0200, MachineCheck, MachineCheckException) | ||
435 | #else | ||
417 | MCHECK_EXCEPTION(0x0200, MachineCheck, MachineCheckException) | 436 | MCHECK_EXCEPTION(0x0200, MachineCheck, MachineCheckException) |
437 | #endif | ||
418 | 438 | ||
419 | /* Data Storage Interrupt */ | 439 | /* Data Storage Interrupt */ |
420 | START_EXCEPTION(DataStorage) | 440 | START_EXCEPTION(DataStorage) |
@@ -520,8 +540,13 @@ interrupt_base: | |||
520 | #ifdef CONFIG_PPC_FPU | 540 | #ifdef CONFIG_PPC_FPU |
521 | FP_UNAVAILABLE_EXCEPTION | 541 | FP_UNAVAILABLE_EXCEPTION |
522 | #else | 542 | #else |
543 | #ifdef CONFIG_E200 | ||
544 | /* E200 treats 'normal' floating point instructions as FP Unavail exception */ | ||
545 | EXCEPTION(0x0800, FloatingPointUnavailable, ProgramCheckException, EXC_XFER_EE) | ||
546 | #else | ||
523 | EXCEPTION(0x0800, FloatingPointUnavailable, UnknownException, EXC_XFER_EE) | 547 | EXCEPTION(0x0800, FloatingPointUnavailable, UnknownException, EXC_XFER_EE) |
524 | #endif | 548 | #endif |
549 | #endif | ||
525 | 550 | ||
526 | /* System Call Interrupt */ | 551 | /* System Call Interrupt */ |
527 | START_EXCEPTION(SystemCall) | 552 | START_EXCEPTION(SystemCall) |
@@ -691,6 +716,7 @@ interrupt_base: | |||
691 | /* | 716 | /* |
692 | * Local functions | 717 | * Local functions |
693 | */ | 718 | */ |
719 | |||
694 | /* | 720 | /* |
695 | * Data TLB exceptions will bail out to this point | 721 | * Data TLB exceptions will bail out to this point |
696 | * if they can't resolve the lightweight TLB fault. | 722 | * if they can't resolve the lightweight TLB fault. |
@@ -761,6 +787,31 @@ END_FTR_SECTION_IFSET(CPU_FTR_BIG_PHYS) | |||
761 | 2: rlwimi r11, r12, 0, 20, 31 /* Extract RPN from PTE and merge with perms */ | 787 | 2: rlwimi r11, r12, 0, 20, 31 /* Extract RPN from PTE and merge with perms */ |
762 | mtspr SPRN_MAS3, r11 | 788 | mtspr SPRN_MAS3, r11 |
763 | #endif | 789 | #endif |
790 | #ifdef CONFIG_E200 | ||
791 | /* Round robin TLB1 entries assignment */ | ||
792 | mfspr r12, SPRN_MAS0 | ||
793 | |||
794 | /* Extract TLB1CFG(NENTRY) */ | ||
795 | mfspr r11, SPRN_TLB1CFG | ||
796 | andi. r11, r11, 0xfff | ||
797 | |||
798 | /* Extract MAS0(NV) */ | ||
799 | andi. r13, r12, 0xfff | ||
800 | addi r13, r13, 1 | ||
801 | cmpw 0, r13, r11 | ||
802 | addi r12, r12, 1 | ||
803 | |||
804 | /* check if we need to wrap */ | ||
805 | blt 7f | ||
806 | |||
807 | /* wrap back to first free tlbcam entry */ | ||
808 | lis r13, tlbcam_index@ha | ||
809 | lwz r13, tlbcam_index@l(r13) | ||
810 | rlwimi r12, r13, 0, 20, 31 | ||
811 | 7: | ||
812 | mtspr SPRN_MAS0,r12 | ||
813 | #endif /* CONFIG_E200 */ | ||
814 | |||
764 | tlbwe | 815 | tlbwe |
765 | 816 | ||
766 | /* Done...restore registers and get out of here. */ | 817 | /* Done...restore registers and get out of here. */ |