aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/mm
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2012-10-16 16:13:06 -0400
committerRalf Baechle <ralf@linux-mips.org>2012-10-16 16:22:23 -0400
commit359187d647a7a7813444ff5932d0b862f970bb0f (patch)
tree1516d43b7b33e03f8b531552764a3e8406dde8bf /arch/mips/mm
parent02a5417751c31cd64197652c000a5ab0d3261465 (diff)
MIPS: R5000: Fix TLB hazard handling.
R5000 and the Nevada CPUs (RM5230, RM5231, RM5260, RM5261, RM5270 and RM5271) are basically the same CPU core and all are documented to require two instructions separating a write to c0_pagemask, c0_entryhi, c0_entrylo0, c0_entrylo1 or c0_index. So far we were only providing on cycle before / after a TLBR/TLBWI for R5000 but 3 cycles before and 1 cycles after for the Nevadas. Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/mm')
-rw-r--r--arch/mips/mm/tlbex.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index 6ea152552e51..2833dcb67b5a 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -511,13 +511,19 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l,
511 511
512 case CPU_R4600: 512 case CPU_R4600:
513 case CPU_R4700: 513 case CPU_R4700:
514 case CPU_R5000:
515 case CPU_R5000A:
516 uasm_i_nop(p); 514 uasm_i_nop(p);
517 tlbw(p); 515 tlbw(p);
518 uasm_i_nop(p); 516 uasm_i_nop(p);
519 break; 517 break;
520 518
519 case CPU_R5000:
520 case CPU_R5000A:
521 case CPU_NEVADA:
522 uasm_i_nop(p); /* QED specifies 2 nops hazard */
523 uasm_i_nop(p); /* QED specifies 2 nops hazard */
524 tlbw(p);
525 break;
526
521 case CPU_R4300: 527 case CPU_R4300:
522 case CPU_5KC: 528 case CPU_5KC:
523 case CPU_TX49XX: 529 case CPU_TX49XX:
@@ -551,19 +557,6 @@ static void __cpuinit build_tlb_write_entry(u32 **p, struct uasm_label **l,
551 tlbw(p); 557 tlbw(p);
552 break; 558 break;
553 559
554 case CPU_NEVADA:
555 uasm_i_nop(p); /* QED specifies 2 nops hazard */
556 uasm_i_nop(p); /* QED specifies 2 nops hazard */
557 /*
558 * This branch uses up a mtc0 hazard nop slot and saves
559 * a nop after the tlbw instruction.
560 */
561 uasm_bgezl_hazard(p, r, hazard_instance);
562 tlbw(p);
563 uasm_bgezl_label(l, p, hazard_instance);
564 hazard_instance++;
565 break;
566
567 case CPU_RM7000: 560 case CPU_RM7000:
568 uasm_i_nop(p); 561 uasm_i_nop(p);
569 uasm_i_nop(p); 562 uasm_i_nop(p);