Skip to content

Commit 8b8aa63

Browse files
Leonid YegoshinMarkos Chandras
authored andcommitted
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: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com> Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
1 parent 54dac95 commit 8b8aa63

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

arch/mips/kernel/cpu-probe.c

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,13 @@ static void set_isa(struct cpuinfo_mips *c, unsigned int isa)
237237
c->isa_level |= MIPS_CPU_ISA_II | MIPS_CPU_ISA_III;
238238
break;
239239

240+
/* R6 incompatible with everything else */
241+
case MIPS_CPU_ISA_M64R6:
242+
c->isa_level |= MIPS_CPU_ISA_M32R6 | MIPS_CPU_ISA_M64R6;
243+
case MIPS_CPU_ISA_M32R6:
244+
c->isa_level |= MIPS_CPU_ISA_M32R6;
245+
/* Break here so we don't add incompatible ISAs */
246+
break;
240247
case MIPS_CPU_ISA_M32R2:
241248
c->isa_level |= MIPS_CPU_ISA_M32R2;
242249
case MIPS_CPU_ISA_M32R1:
@@ -326,6 +333,9 @@ static inline unsigned int decode_config0(struct cpuinfo_mips *c)
326333
case 1:
327334
set_isa(c, MIPS_CPU_ISA_M32R2);
328335
break;
336+
case 2:
337+
set_isa(c, MIPS_CPU_ISA_M32R6);
338+
break;
329339
default:
330340
goto unknown;
331341
}
@@ -338,6 +348,9 @@ static inline unsigned int decode_config0(struct cpuinfo_mips *c)
338348
case 1:
339349
set_isa(c, MIPS_CPU_ISA_M64R2);
340350
break;
351+
case 2:
352+
set_isa(c, MIPS_CPU_ISA_M64R6);
353+
break;
341354
default:
342355
goto unknown;
343356
}
@@ -543,7 +556,7 @@ static void decode_configs(struct cpuinfo_mips *c)
543556
}
544557

545558
#ifndef CONFIG_MIPS_CPS
546-
if (cpu_has_mips_r2) {
559+
if (cpu_has_mips_r2_r6) {
547560
c->core = get_ebase_cpunum();
548561
if (cpu_has_mipsmt)
549562
c->core >>= fls(core_nvpes()) - 1;
@@ -1352,16 +1365,15 @@ void cpu_probe(void)
13521365
if (c->options & MIPS_CPU_FPU) {
13531366
c->fpu_id = cpu_get_fpu_id();
13541367

1355-
if (c->isa_level & (MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M32R2 |
1356-
MIPS_CPU_ISA_M64R1 | MIPS_CPU_ISA_M64R2)) {
1368+
if (c->isa_level & cpu_has_mips_r) {
13571369
if (c->fpu_id & MIPS_FPIR_3D)
13581370
c->ases |= MIPS_ASE_MIPS3D;
13591371
if (c->fpu_id & MIPS_FPIR_FREP)
13601372
c->options |= MIPS_CPU_FRE;
13611373
}
13621374
}
13631375

1364-
if (cpu_has_mips_r2) {
1376+
if (cpu_has_mips_r2_r6) {
13651377
c->srsets = ((read_c0_srsctl() >> 26) & 0x0f) + 1;
13661378
/* R2 has Performance Counter Interrupt indicator */
13671379
c->options |= MIPS_CPU_PCI;

0 commit comments

Comments
 (0)