Commit 8b8aa636 authored by Leonid Yegoshin's avatar Leonid Yegoshin Committed by Markos Chandras

MIPS: kernel: cpu-probe.c: Add support for MIPS R6

Add MIPS R6 support when decoding the config0 c0 register.
Also add MIPS R6 support when examining the ebase c0 register
to get the core number and when getting the shadow set number
from the srsctl c0 register.
Signed-off-by: default avatarLeonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Signed-off-by: default avatarMarkos Chandras <markos.chandras@imgtec.com>
parent 54dac950
...@@ -237,6 +237,13 @@ static void set_isa(struct cpuinfo_mips *c, unsigned int isa) ...@@ -237,6 +237,13 @@ static void set_isa(struct cpuinfo_mips *c, unsigned int isa)
c->isa_level |= MIPS_CPU_ISA_II | MIPS_CPU_ISA_III; c->isa_level |= MIPS_CPU_ISA_II | MIPS_CPU_ISA_III;
break; break;
/* R6 incompatible with everything else */
case MIPS_CPU_ISA_M64R6:
c->isa_level |= MIPS_CPU_ISA_M32R6 | MIPS_CPU_ISA_M64R6;
case MIPS_CPU_ISA_M32R6:
c->isa_level |= MIPS_CPU_ISA_M32R6;
/* Break here so we don't add incompatible ISAs */
break;
case MIPS_CPU_ISA_M32R2: case MIPS_CPU_ISA_M32R2:
c->isa_level |= MIPS_CPU_ISA_M32R2; c->isa_level |= MIPS_CPU_ISA_M32R2;
case MIPS_CPU_ISA_M32R1: case MIPS_CPU_ISA_M32R1:
...@@ -326,6 +333,9 @@ static inline unsigned int decode_config0(struct cpuinfo_mips *c) ...@@ -326,6 +333,9 @@ static inline unsigned int decode_config0(struct cpuinfo_mips *c)
case 1: case 1:
set_isa(c, MIPS_CPU_ISA_M32R2); set_isa(c, MIPS_CPU_ISA_M32R2);
break; break;
case 2:
set_isa(c, MIPS_CPU_ISA_M32R6);
break;
default: default:
goto unknown; goto unknown;
} }
...@@ -338,6 +348,9 @@ static inline unsigned int decode_config0(struct cpuinfo_mips *c) ...@@ -338,6 +348,9 @@ static inline unsigned int decode_config0(struct cpuinfo_mips *c)
case 1: case 1:
set_isa(c, MIPS_CPU_ISA_M64R2); set_isa(c, MIPS_CPU_ISA_M64R2);
break; break;
case 2:
set_isa(c, MIPS_CPU_ISA_M64R6);
break;
default: default:
goto unknown; goto unknown;
} }
...@@ -543,7 +556,7 @@ static void decode_configs(struct cpuinfo_mips *c) ...@@ -543,7 +556,7 @@ static void decode_configs(struct cpuinfo_mips *c)
} }
#ifndef CONFIG_MIPS_CPS #ifndef CONFIG_MIPS_CPS
if (cpu_has_mips_r2) { if (cpu_has_mips_r2_r6) {
c->core = get_ebase_cpunum(); c->core = get_ebase_cpunum();
if (cpu_has_mipsmt) if (cpu_has_mipsmt)
c->core >>= fls(core_nvpes()) - 1; c->core >>= fls(core_nvpes()) - 1;
...@@ -1352,8 +1365,7 @@ void cpu_probe(void) ...@@ -1352,8 +1365,7 @@ void cpu_probe(void)
if (c->options & MIPS_CPU_FPU) { if (c->options & MIPS_CPU_FPU) {
c->fpu_id = cpu_get_fpu_id(); c->fpu_id = cpu_get_fpu_id();
if (c->isa_level & (MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M32R2 | if (c->isa_level & cpu_has_mips_r) {
MIPS_CPU_ISA_M64R1 | MIPS_CPU_ISA_M64R2)) {
if (c->fpu_id & MIPS_FPIR_3D) if (c->fpu_id & MIPS_FPIR_3D)
c->ases |= MIPS_ASE_MIPS3D; c->ases |= MIPS_ASE_MIPS3D;
if (c->fpu_id & MIPS_FPIR_FREP) if (c->fpu_id & MIPS_FPIR_FREP)
...@@ -1361,7 +1373,7 @@ void cpu_probe(void) ...@@ -1361,7 +1373,7 @@ void cpu_probe(void)
} }
} }
if (cpu_has_mips_r2) { if (cpu_has_mips_r2_r6) {
c->srsets = ((read_c0_srsctl() >> 26) & 0x0f) + 1; c->srsets = ((read_c0_srsctl() >> 26) & 0x0f) + 1;
/* R2 has Performance Counter Interrupt indicator */ /* R2 has Performance Counter Interrupt indicator */
c->options |= MIPS_CPU_PCI; c->options |= MIPS_CPU_PCI;
......
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