aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2015-09-17 12:49:21 -0400
committerRalf Baechle <ralf@linux-mips.org>2015-09-22 15:11:39 -0400
commit43d104db596977a8fddc1e71245859a7fe85a658 (patch)
tree83b2af66d43918817540497b78aeb8ffc29f80ce
parent2f6f31363cb7890784458d7805140687b4de5b59 (diff)
MIPS: Fix FTLB detection for R6
R6 removed the Config4.MMUExtDef field, with the low 16 bits only allowed to contain FTLB fields, and commit e87569cd6c57 ("MIPS: cpu-probe: Fix VTLB/FTLB configuration for R6") updated the probing of this field to assume an FTLB is always present for R6. However the FTLB may still be absent. The presence of those fields is actually specified by the MMU type in the Config.MT field, so use that (the new cpu_has_ftlb) to determine whether the FTLB is actually present. Fixes: e87569cd6c57 ("MIPS: cpu-probe: Fix VTLB/FTLB configuration for R6") Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: Ralf Baechle <ralf@linux-mips.org> Cc: Markos Chandras <markos.chandras@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/11160/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/kernel/cpu-probe.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 397551cf2e7b..09a51d091941 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -561,15 +561,18 @@ static inline unsigned int decode_config4(struct cpuinfo_mips *c)
561 if (cpu_has_tlb) { 561 if (cpu_has_tlb) {
562 if (((config4 & MIPS_CONF4_IE) >> 29) == 2) 562 if (((config4 & MIPS_CONF4_IE) >> 29) == 2)
563 c->options |= MIPS_CPU_TLBINV; 563 c->options |= MIPS_CPU_TLBINV;
564
564 /* 565 /*
565 * This is a bit ugly. R6 has dropped that field from 566 * R6 has dropped the MMUExtDef field from config4.
566 * config4 and the only valid configuration is VTLB+FTLB so 567 * On R6 the fields always describe the FTLB, and only if it is
567 * set a good value for mmuextdef for that case. 568 * present according to Config.MT.
568 */ 569 */
569 if (cpu_has_mips_r6) 570 if (!cpu_has_mips_r6)
571 mmuextdef = config4 & MIPS_CONF4_MMUEXTDEF;
572 else if (cpu_has_ftlb)
570 mmuextdef = MIPS_CONF4_MMUEXTDEF_VTLBSIZEEXT; 573 mmuextdef = MIPS_CONF4_MMUEXTDEF_VTLBSIZEEXT;
571 else 574 else
572 mmuextdef = config4 & MIPS_CONF4_MMUEXTDEF; 575 mmuextdef = 0;
573 576
574 switch (mmuextdef) { 577 switch (mmuextdef) {
575 case MIPS_CONF4_MMUEXTDEF_MMUSIZEEXT: 578 case MIPS_CONF4_MMUEXTDEF_MMUSIZEEXT: