Commit 43d104db authored by James Hogan's avatar James Hogan Committed by Ralf Baechle

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 e87569cd ("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: e87569cd ("MIPS: cpu-probe: Fix VTLB/FTLB configuration for R6")
Signed-off-by: default avatarJames 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: default avatarRalf Baechle <ralf@linux-mips.org>
parent 2f6f3136
...@@ -561,15 +561,18 @@ static inline unsigned int decode_config4(struct cpuinfo_mips *c) ...@@ -561,15 +561,18 @@ static inline unsigned int decode_config4(struct cpuinfo_mips *c)
if (cpu_has_tlb) { if (cpu_has_tlb) {
if (((config4 & MIPS_CONF4_IE) >> 29) == 2) if (((config4 & MIPS_CONF4_IE) >> 29) == 2)
c->options |= MIPS_CPU_TLBINV; c->options |= MIPS_CPU_TLBINV;
/* /*
* This is a bit ugly. R6 has dropped that field from * R6 has dropped the MMUExtDef field from config4.
* config4 and the only valid configuration is VTLB+FTLB so * On R6 the fields always describe the FTLB, and only if it is
* set a good value for mmuextdef for that case. * present according to Config.MT.
*/ */
if (cpu_has_mips_r6) if (!cpu_has_mips_r6)
mmuextdef = config4 & MIPS_CONF4_MMUEXTDEF;
else if (cpu_has_ftlb)
mmuextdef = MIPS_CONF4_MMUEXTDEF_VTLBSIZEEXT; mmuextdef = MIPS_CONF4_MMUEXTDEF_VTLBSIZEEXT;
else else
mmuextdef = config4 & MIPS_CONF4_MMUEXTDEF; mmuextdef = 0;
switch (mmuextdef) { switch (mmuextdef) {
case MIPS_CONF4_MMUEXTDEF_MMUSIZEEXT: case MIPS_CONF4_MMUEXTDEF_MMUSIZEEXT:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment