MIPS: Allow FTLB to be turned on for CPU_P5600

Allow FTLB to be turned on or off for CPU_P5600 as well as CPU_PROAPTIV.
The existing if statement is converted into a switch to allow for future
expansion.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Reviewed-by: Markos Chandras <markos.chandras@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/6411/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
This commit is contained in:
James Hogan 2014-01-22 16:19:40 +00:00 committed by Ralf Baechle
parent 829dcc0a95
commit d83b0e82ad

View file

@ -181,11 +181,12 @@ static char unknown_isa[] = KERN_ERR \
static void set_ftlb_enable(struct cpuinfo_mips *c, int enable) static void set_ftlb_enable(struct cpuinfo_mips *c, int enable)
{ {
unsigned int config6; unsigned int config6;
/*
* Config6 is implementation dependent and it's currently only /* It's implementation dependent how the FTLB can be enabled */
* used by proAptiv switch (c->cputype) {
*/ case CPU_PROAPTIV:
if (c->cputype == CPU_PROAPTIV) { case CPU_P5600:
/* proAptiv & related cores use Config6 to enable the FTLB */
config6 = read_c0_config6(); config6 = read_c0_config6();
if (enable) if (enable)
/* Enable FTLB */ /* Enable FTLB */
@ -194,6 +195,7 @@ static void set_ftlb_enable(struct cpuinfo_mips *c, int enable)
/* Disable FTLB */ /* Disable FTLB */
write_c0_config6(config6 & ~MIPS_CONF6_FTLBEN); write_c0_config6(config6 & ~MIPS_CONF6_FTLBEN);
back_to_back_c0_hazard(); back_to_back_c0_hazard();
break;
} }
} }