diff options
Diffstat (limited to 'arch/mips/kernel/cpu-probe.c')
-rw-r--r-- | arch/mips/kernel/cpu-probe.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c index 228ae864c92e..81f0aedbba0f 100644 --- a/arch/mips/kernel/cpu-probe.c +++ b/arch/mips/kernel/cpu-probe.c | |||
@@ -237,6 +237,13 @@ static void set_isa(struct cpuinfo_mips *c, unsigned int isa) | |||
237 | c->isa_level |= MIPS_CPU_ISA_II | MIPS_CPU_ISA_III; | 237 | c->isa_level |= MIPS_CPU_ISA_II | MIPS_CPU_ISA_III; |
238 | break; | 238 | break; |
239 | 239 | ||
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; | ||
240 | case MIPS_CPU_ISA_M32R2: | 247 | case MIPS_CPU_ISA_M32R2: |
241 | c->isa_level |= MIPS_CPU_ISA_M32R2; | 248 | c->isa_level |= MIPS_CPU_ISA_M32R2; |
242 | case MIPS_CPU_ISA_M32R1: | 249 | case MIPS_CPU_ISA_M32R1: |
@@ -326,6 +333,9 @@ static inline unsigned int decode_config0(struct cpuinfo_mips *c) | |||
326 | case 1: | 333 | case 1: |
327 | set_isa(c, MIPS_CPU_ISA_M32R2); | 334 | set_isa(c, MIPS_CPU_ISA_M32R2); |
328 | break; | 335 | break; |
336 | case 2: | ||
337 | set_isa(c, MIPS_CPU_ISA_M32R6); | ||
338 | break; | ||
329 | default: | 339 | default: |
330 | goto unknown; | 340 | goto unknown; |
331 | } | 341 | } |
@@ -338,6 +348,9 @@ static inline unsigned int decode_config0(struct cpuinfo_mips *c) | |||
338 | case 1: | 348 | case 1: |
339 | set_isa(c, MIPS_CPU_ISA_M64R2); | 349 | set_isa(c, MIPS_CPU_ISA_M64R2); |
340 | break; | 350 | break; |
351 | case 2: | ||
352 | set_isa(c, MIPS_CPU_ISA_M64R6); | ||
353 | break; | ||
341 | default: | 354 | default: |
342 | goto unknown; | 355 | goto unknown; |
343 | } | 356 | } |
@@ -501,6 +514,8 @@ static inline unsigned int decode_config5(struct cpuinfo_mips *c) | |||
501 | c->options |= MIPS_CPU_EVA; | 514 | c->options |= MIPS_CPU_EVA; |
502 | if (config5 & MIPS_CONF5_MRP) | 515 | if (config5 & MIPS_CONF5_MRP) |
503 | c->options |= MIPS_CPU_MAAR; | 516 | c->options |= MIPS_CPU_MAAR; |
517 | if (config5 & MIPS_CONF5_LLB) | ||
518 | c->options |= MIPS_CPU_RW_LLB; | ||
504 | 519 | ||
505 | return config5 & MIPS_CONF_M; | 520 | return config5 & MIPS_CONF_M; |
506 | } | 521 | } |
@@ -543,7 +558,7 @@ static void decode_configs(struct cpuinfo_mips *c) | |||
543 | } | 558 | } |
544 | 559 | ||
545 | #ifndef CONFIG_MIPS_CPS | 560 | #ifndef CONFIG_MIPS_CPS |
546 | if (cpu_has_mips_r2) { | 561 | if (cpu_has_mips_r2_r6) { |
547 | c->core = get_ebase_cpunum(); | 562 | c->core = get_ebase_cpunum(); |
548 | if (cpu_has_mipsmt) | 563 | if (cpu_has_mipsmt) |
549 | c->core >>= fls(core_nvpes()) - 1; | 564 | c->core >>= fls(core_nvpes()) - 1; |
@@ -898,6 +913,11 @@ static inline void cpu_probe_mips(struct cpuinfo_mips *c, unsigned int cpu) | |||
898 | { | 913 | { |
899 | c->writecombine = _CACHE_UNCACHED_ACCELERATED; | 914 | c->writecombine = _CACHE_UNCACHED_ACCELERATED; |
900 | switch (c->processor_id & PRID_IMP_MASK) { | 915 | switch (c->processor_id & PRID_IMP_MASK) { |
916 | case PRID_IMP_QEMU_GENERIC: | ||
917 | c->writecombine = _CACHE_UNCACHED; | ||
918 | c->cputype = CPU_QEMU_GENERIC; | ||
919 | __cpu_name[cpu] = "MIPS GENERIC QEMU"; | ||
920 | break; | ||
901 | case PRID_IMP_4KC: | 921 | case PRID_IMP_4KC: |
902 | c->cputype = CPU_4KC; | 922 | c->cputype = CPU_4KC; |
903 | c->writecombine = _CACHE_UNCACHED; | 923 | c->writecombine = _CACHE_UNCACHED; |
@@ -1347,8 +1367,7 @@ void cpu_probe(void) | |||
1347 | if (c->options & MIPS_CPU_FPU) { | 1367 | if (c->options & MIPS_CPU_FPU) { |
1348 | c->fpu_id = cpu_get_fpu_id(); | 1368 | c->fpu_id = cpu_get_fpu_id(); |
1349 | 1369 | ||
1350 | if (c->isa_level & (MIPS_CPU_ISA_M32R1 | MIPS_CPU_ISA_M32R2 | | 1370 | if (c->isa_level & cpu_has_mips_r) { |
1351 | MIPS_CPU_ISA_M64R1 | MIPS_CPU_ISA_M64R2)) { | ||
1352 | if (c->fpu_id & MIPS_FPIR_3D) | 1371 | if (c->fpu_id & MIPS_FPIR_3D) |
1353 | c->ases |= MIPS_ASE_MIPS3D; | 1372 | c->ases |= MIPS_ASE_MIPS3D; |
1354 | if (c->fpu_id & MIPS_FPIR_FREP) | 1373 | if (c->fpu_id & MIPS_FPIR_FREP) |
@@ -1356,7 +1375,7 @@ void cpu_probe(void) | |||
1356 | } | 1375 | } |
1357 | } | 1376 | } |
1358 | 1377 | ||
1359 | if (cpu_has_mips_r2) { | 1378 | if (cpu_has_mips_r2_r6) { |
1360 | c->srsets = ((read_c0_srsctl() >> 26) & 0x0f) + 1; | 1379 | c->srsets = ((read_c0_srsctl() >> 26) & 0x0f) + 1; |
1361 | /* R2 has Performance Counter Interrupt indicator */ | 1380 | /* R2 has Performance Counter Interrupt indicator */ |
1362 | c->options |= MIPS_CPU_PCI; | 1381 | c->options |= MIPS_CPU_PCI; |