diff options
author | LEROY Christophe <christophe.leroy@c-s.fr> | 2014-09-19 04:36:09 -0400 |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-11-07 19:10:41 -0500 |
commit | ac21951fa8a356e2aab6e93a61aa99b561100e67 (patch) | |
tree | bbe69b96f156251adb91e93d944d131196e7a609 | |
parent | d14068035c3f6fd0d6514e061e4324a277be83e2 (diff) |
powerpc/8xx: Const for TLB RPN forced value
Value 0x00f0 is used to force bits in TLB level 2 entry. This value is linked
to the page size and will vary when we change the page size. Lets define a const
for it in order to have it at only one place.
Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Scott Wood <scottwood@freescale.com>
-rw-r--r-- | arch/powerpc/kernel/head_8xx.S | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S index e126adf15528..38efa8622176 100644 --- a/arch/powerpc/kernel/head_8xx.S +++ b/arch/powerpc/kernel/head_8xx.S | |||
@@ -40,6 +40,13 @@ | |||
40 | #else | 40 | #else |
41 | #define DO_8xx_CPU6(val, reg) | 41 | #define DO_8xx_CPU6(val, reg) |
42 | #endif | 42 | #endif |
43 | |||
44 | /* | ||
45 | * Value for the bits that have fixed value in RPN entries. | ||
46 | * Also used for tagging DAR for DTLBerror. | ||
47 | */ | ||
48 | #define RPN_PATTERN 0x00f0 | ||
49 | |||
43 | __HEAD | 50 | __HEAD |
44 | _ENTRY(_stext); | 51 | _ENTRY(_stext); |
45 | _ENTRY(_start); | 52 | _ENTRY(_start); |
@@ -211,7 +218,7 @@ MachineCheck: | |||
211 | EXCEPTION_PROLOG | 218 | EXCEPTION_PROLOG |
212 | mfspr r4,SPRN_DAR | 219 | mfspr r4,SPRN_DAR |
213 | stw r4,_DAR(r11) | 220 | stw r4,_DAR(r11) |
214 | li r5,0x00f0 | 221 | li r5,RPN_PATTERN |
215 | mtspr SPRN_DAR,r5 /* Tag DAR, to be used in DTLB Error */ | 222 | mtspr SPRN_DAR,r5 /* Tag DAR, to be used in DTLB Error */ |
216 | mfspr r5,SPRN_DSISR | 223 | mfspr r5,SPRN_DSISR |
217 | stw r5,_DSISR(r11) | 224 | stw r5,_DSISR(r11) |
@@ -239,7 +246,7 @@ Alignment: | |||
239 | EXCEPTION_PROLOG | 246 | EXCEPTION_PROLOG |
240 | mfspr r4,SPRN_DAR | 247 | mfspr r4,SPRN_DAR |
241 | stw r4,_DAR(r11) | 248 | stw r4,_DAR(r11) |
242 | li r5,0x00f0 | 249 | li r5,RPN_PATTERN |
243 | mtspr SPRN_DAR,r5 /* Tag DAR, to be used in DTLB Error */ | 250 | mtspr SPRN_DAR,r5 /* Tag DAR, to be used in DTLB Error */ |
244 | mfspr r5,SPRN_DSISR | 251 | mfspr r5,SPRN_DSISR |
245 | stw r5,_DSISR(r11) | 252 | stw r5,_DSISR(r11) |
@@ -343,7 +350,7 @@ InstructionTLBMiss: | |||
343 | * set. All other Linux PTE bits control the behavior | 350 | * set. All other Linux PTE bits control the behavior |
344 | * of the MMU. | 351 | * of the MMU. |
345 | */ | 352 | */ |
346 | li r11, 0x00f0 | 353 | li r11, RPN_PATTERN |
347 | rlwimi r10, r11, 0, 0x07f8 /* Set 24-27, clear 21-23,28 */ | 354 | rlwimi r10, r11, 0, 0x07f8 /* Set 24-27, clear 21-23,28 */ |
348 | DO_8xx_CPU6(0x2d80, r3) | 355 | DO_8xx_CPU6(0x2d80, r3) |
349 | mtspr SPRN_MI_RPN, r10 /* Update TLB entry */ | 356 | mtspr SPRN_MI_RPN, r10 /* Update TLB entry */ |
@@ -447,7 +454,7 @@ DataStoreTLBMiss: | |||
447 | * set. All other Linux PTE bits control the behavior | 454 | * set. All other Linux PTE bits control the behavior |
448 | * of the MMU. | 455 | * of the MMU. |
449 | */ | 456 | */ |
450 | 2: li r11, 0x00f0 | 457 | 2: li r11, RPN_PATTERN |
451 | rlwimi r10, r11, 0, 24, 28 /* Set 24-27, clear 28 */ | 458 | rlwimi r10, r11, 0, 24, 28 /* Set 24-27, clear 28 */ |
452 | DO_8xx_CPU6(0x3d80, r3) | 459 | DO_8xx_CPU6(0x3d80, r3) |
453 | mtspr SPRN_MD_RPN, r10 /* Update TLB entry */ | 460 | mtspr SPRN_MD_RPN, r10 /* Update TLB entry */ |
@@ -482,7 +489,7 @@ DataTLBError: | |||
482 | EXCEPTION_PROLOG_0 | 489 | EXCEPTION_PROLOG_0 |
483 | 490 | ||
484 | mfspr r11, SPRN_DAR | 491 | mfspr r11, SPRN_DAR |
485 | cmpwi cr0, r11, 0x00f0 | 492 | cmpwi cr0, r11, RPN_PATTERN |
486 | beq- FixupDAR /* must be a buggy dcbX, icbi insn. */ | 493 | beq- FixupDAR /* must be a buggy dcbX, icbi insn. */ |
487 | DARFixed:/* Return from dcbx instruction bug workaround */ | 494 | DARFixed:/* Return from dcbx instruction bug workaround */ |
488 | EXCEPTION_PROLOG_1 | 495 | EXCEPTION_PROLOG_1 |
@@ -491,7 +498,7 @@ DARFixed:/* Return from dcbx instruction bug workaround */ | |||
491 | stw r10,_DSISR(r11) | 498 | stw r10,_DSISR(r11) |
492 | mr r5,r10 | 499 | mr r5,r10 |
493 | mfspr r4,SPRN_DAR | 500 | mfspr r4,SPRN_DAR |
494 | li r10,0x00f0 | 501 | li r10,RPN_PATTERN |
495 | mtspr SPRN_DAR,r10 /* Tag DAR, to be used in DTLB Error */ | 502 | mtspr SPRN_DAR,r10 /* Tag DAR, to be used in DTLB Error */ |
496 | /* 0x300 is DataAccess exception, needed by bad_page_fault() */ | 503 | /* 0x300 is DataAccess exception, needed by bad_page_fault() */ |
497 | EXC_XFER_LITE(0x300, handle_page_fault) | 504 | EXC_XFER_LITE(0x300, handle_page_fault) |