aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Kinard <kumba@gentoo.org>2015-01-21 07:59:45 -0500
committerRalf Baechle <ralf@linux-mips.org>2015-04-01 11:22:13 -0400
commit3057739138eb8fbaa5154b149a864f5218898c73 (patch)
treef9544e76cc2afad7333aa07ac3d7842bb2d149dc
parent5b4e845393d313af1d319b8bd01c9daaca3aa487 (diff)
MIPS: Add R16000 detection
This allows the kernel to correctly detect an R16000 MIPS CPU on systems that have those. Otherwise, such systems will detect the CPU as an R14000, due to similarities in the CPU PRId value. Signed-off-by: Joshua Kinard <kumba@gentoo.org> Cc: Linux MIPS List <linux-mips@linux-mips.org> Patchwork: https://patchwork.linux-mips.org/patch/9092/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/include/asm/cpu-type.h1
-rw-r--r--arch/mips/include/asm/cpu.h6
-rw-r--r--arch/mips/kernel/cpu-probe.c9
-rw-r--r--arch/mips/kernel/perf_event_mipsxx.c1
-rw-r--r--arch/mips/mm/c-r4k.c10
-rw-r--r--arch/mips/mm/page.c1
-rw-r--r--arch/mips/mm/tlb-r4k.c3
-rw-r--r--arch/mips/mm/tlbex.c1
-rw-r--r--arch/mips/oprofile/common.c1
-rw-r--r--arch/mips/oprofile/op_model_mipsxx.c5
10 files changed, 29 insertions, 9 deletions
diff --git a/arch/mips/include/asm/cpu-type.h b/arch/mips/include/asm/cpu-type.h
index 8245875f8b33..33f3cab9e689 100644
--- a/arch/mips/include/asm/cpu-type.h
+++ b/arch/mips/include/asm/cpu-type.h
@@ -157,6 +157,7 @@ static inline int __pure __get_cpu_type(const int cpu_type)
157 case CPU_R10000: 157 case CPU_R10000:
158 case CPU_R12000: 158 case CPU_R12000:
159 case CPU_R14000: 159 case CPU_R14000:
160 case CPU_R16000:
160#endif 161#endif
161#ifdef CONFIG_SYS_HAS_CPU_RM7000 162#ifdef CONFIG_SYS_HAS_CPU_RM7000
162 case CPU_RM7000: 163 case CPU_RM7000:
diff --git a/arch/mips/include/asm/cpu.h b/arch/mips/include/asm/cpu.h
index 15903cad1c6f..fd2e893e9d9f 100644
--- a/arch/mips/include/asm/cpu.h
+++ b/arch/mips/include/asm/cpu.h
@@ -67,7 +67,7 @@
67#define PRID_IMP_R4300 0x0b00 67#define PRID_IMP_R4300 0x0b00
68#define PRID_IMP_VR41XX 0x0c00 68#define PRID_IMP_VR41XX 0x0c00
69#define PRID_IMP_R12000 0x0e00 69#define PRID_IMP_R12000 0x0e00
70#define PRID_IMP_R14000 0x0f00 70#define PRID_IMP_R14000 0x0f00 /* R14K && R16K */
71#define PRID_IMP_R8000 0x1000 71#define PRID_IMP_R8000 0x1000
72#define PRID_IMP_PR4450 0x1200 72#define PRID_IMP_PR4450 0x1200
73#define PRID_IMP_R4600 0x2000 73#define PRID_IMP_R4600 0x2000
@@ -284,8 +284,8 @@ enum cpu_type_enum {
284 CPU_R4000PC, CPU_R4000SC, CPU_R4000MC, CPU_R4200, CPU_R4300, CPU_R4310, 284 CPU_R4000PC, CPU_R4000SC, CPU_R4000MC, CPU_R4200, CPU_R4300, CPU_R4310,
285 CPU_R4400PC, CPU_R4400SC, CPU_R4400MC, CPU_R4600, CPU_R4640, CPU_R4650, 285 CPU_R4400PC, CPU_R4400SC, CPU_R4400MC, CPU_R4600, CPU_R4640, CPU_R4650,
286 CPU_R4700, CPU_R5000, CPU_R5500, CPU_NEVADA, CPU_R5432, CPU_R10000, 286 CPU_R4700, CPU_R5000, CPU_R5500, CPU_NEVADA, CPU_R5432, CPU_R10000,
287 CPU_R12000, CPU_R14000, CPU_VR41XX, CPU_VR4111, CPU_VR4121, CPU_VR4122, 287 CPU_R12000, CPU_R14000, CPU_R16000, CPU_VR41XX, CPU_VR4111, CPU_VR4121,
288 CPU_VR4131, CPU_VR4133, CPU_VR4181, CPU_VR4181A, CPU_RM7000, 288 CPU_VR4122, CPU_VR4131, CPU_VR4133, CPU_VR4181, CPU_VR4181A, CPU_RM7000,
289 CPU_SR71000, CPU_TX49XX, 289 CPU_SR71000, CPU_TX49XX,
290 290
291 /* 291 /*
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 1bae00678b9b..cb436f585bfa 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -852,8 +852,13 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c, unsigned int cpu)
852 c->tlbsize = 64; 852 c->tlbsize = 64;
853 break; 853 break;
854 case PRID_IMP_R14000: 854 case PRID_IMP_R14000:
855 c->cputype = CPU_R14000; 855 if (((c->processor_id >> 4) & 0x0f) > 2) {
856 __cpu_name[cpu] = "R14000"; 856 c->cputype = CPU_R16000;
857 __cpu_name[cpu] = "R16000";
858 } else {
859 c->cputype = CPU_R14000;
860 __cpu_name[cpu] = "R14000";
861 }
857 set_isa(c, MIPS_CPU_ISA_IV); 862 set_isa(c, MIPS_CPU_ISA_IV);
858 c->options = MIPS_CPU_TLB | MIPS_CPU_4K_CACHE | MIPS_CPU_4KEX | 863 c->options = MIPS_CPU_TLB | MIPS_CPU_4K_CACHE | MIPS_CPU_4KEX |
859 MIPS_CPU_FPU | MIPS_CPU_32FPR | 864 MIPS_CPU_FPU | MIPS_CPU_32FPR |
diff --git a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_event_mipsxx.c
index 9d90efea8bb0..192e7f59245e 100644
--- a/arch/mips/kernel/perf_event_mipsxx.c
+++ b/arch/mips/kernel/perf_event_mipsxx.c
@@ -777,6 +777,7 @@ static int n_counters(void)
777 777
778 case CPU_R12000: 778 case CPU_R12000:
779 case CPU_R14000: 779 case CPU_R14000:
780 case CPU_R16000:
780 counters = 4; 781 counters = 4;
781 break; 782 break;
782 783
diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c
index 3f8059602765..58e2eeddc391 100644
--- a/arch/mips/mm/c-r4k.c
+++ b/arch/mips/mm/c-r4k.c
@@ -430,6 +430,7 @@ static inline void local_r4k___flush_cache_all(void * args)
430 case CPU_R10000: 430 case CPU_R10000:
431 case CPU_R12000: 431 case CPU_R12000:
432 case CPU_R14000: 432 case CPU_R14000:
433 case CPU_R16000:
433 /* 434 /*
434 * These caches are inclusive caches, that is, if something 435 * These caches are inclusive caches, that is, if something
435 * is not cached in the S-cache, we know it also won't be 436 * is not cached in the S-cache, we know it also won't be
@@ -506,7 +507,7 @@ static inline void local_r4k_flush_cache_mm(void * args)
506 507
507 /* 508 /*
508 * Kludge alert. For obscure reasons R4000SC and R4400SC go nuts if we 509 * Kludge alert. For obscure reasons R4000SC and R4400SC go nuts if we
509 * only flush the primary caches but R10000 and R12000 behave sane ... 510 * only flush the primary caches but R1x000 behave sane ...
510 * R4000SC and R4400SC indexed S-cache ops also invalidate primary 511 * R4000SC and R4400SC indexed S-cache ops also invalidate primary
511 * caches, so we can bail out early. 512 * caches, so we can bail out early.
512 */ 513 */
@@ -1012,6 +1013,7 @@ static void probe_pcache(void)
1012 case CPU_R10000: 1013 case CPU_R10000:
1013 case CPU_R12000: 1014 case CPU_R12000:
1014 case CPU_R14000: 1015 case CPU_R14000:
1016 case CPU_R16000:
1015 icache_size = 1 << (12 + ((config & R10K_CONF_IC) >> 29)); 1017 icache_size = 1 << (12 + ((config & R10K_CONF_IC) >> 29));
1016 c->icache.linesz = 64; 1018 c->icache.linesz = 64;
1017 c->icache.ways = 2; 1019 c->icache.ways = 2;
@@ -1223,8 +1225,8 @@ static void probe_pcache(void)
1223 dcache_size / (c->dcache.linesz * c->dcache.ways) : 0; 1225 dcache_size / (c->dcache.linesz * c->dcache.ways) : 0;
1224 1226
1225 /* 1227 /*
1226 * R10000 and R12000 P-caches are odd in a positive way. They're 32kB 1228 * R1x000 P-caches are odd in a positive way. They're 32kB 2-way
1227 * 2-way virtually indexed so normally would suffer from aliases. So 1229 * virtually indexed so normally would suffer from aliases. So
1228 * normally they'd suffer from aliases but magic in the hardware deals 1230 * normally they'd suffer from aliases but magic in the hardware deals
1229 * with that for us so we don't need to take care ourselves. 1231 * with that for us so we don't need to take care ourselves.
1230 */ 1232 */
@@ -1240,6 +1242,7 @@ static void probe_pcache(void)
1240 case CPU_R10000: 1242 case CPU_R10000:
1241 case CPU_R12000: 1243 case CPU_R12000:
1242 case CPU_R14000: 1244 case CPU_R14000:
1245 case CPU_R16000:
1243 break; 1246 break;
1244 1247
1245 case CPU_74K: 1248 case CPU_74K:
@@ -1438,6 +1441,7 @@ static void setup_scache(void)
1438 case CPU_R10000: 1441 case CPU_R10000:
1439 case CPU_R12000: 1442 case CPU_R12000:
1440 case CPU_R14000: 1443 case CPU_R14000:
1444 case CPU_R16000:
1441 scache_size = 0x80000 << ((config & R10K_CONF_SS) >> 16); 1445 scache_size = 0x80000 << ((config & R10K_CONF_SS) >> 16);
1442 c->scache.linesz = 64 << ((config >> 13) & 1); 1446 c->scache.linesz = 64 << ((config >> 13) & 1);
1443 c->scache.ways = 2; 1447 c->scache.ways = 2;
diff --git a/arch/mips/mm/page.c b/arch/mips/mm/page.c
index 3f85f921801b..885d73ffd6fb 100644
--- a/arch/mips/mm/page.c
+++ b/arch/mips/mm/page.c
@@ -157,6 +157,7 @@ static void set_prefetch_parameters(void)
157 case CPU_R10000: 157 case CPU_R10000:
158 case CPU_R12000: 158 case CPU_R12000:
159 case CPU_R14000: 159 case CPU_R14000:
160 case CPU_R16000:
160 /* 161 /*
161 * Those values have been experimentally tuned for an 162 * Those values have been experimentally tuned for an
162 * Origin 200. 163 * Origin 200.
diff --git a/arch/mips/mm/tlb-r4k.c b/arch/mips/mm/tlb-r4k.c
index b2afa49beab0..37ad381c3e5f 100644
--- a/arch/mips/mm/tlb-r4k.c
+++ b/arch/mips/mm/tlb-r4k.c
@@ -477,7 +477,8 @@ static void r4k_tlb_configure(void)
477 write_c0_wired(0); 477 write_c0_wired(0);
478 if (current_cpu_type() == CPU_R10000 || 478 if (current_cpu_type() == CPU_R10000 ||
479 current_cpu_type() == CPU_R12000 || 479 current_cpu_type() == CPU_R12000 ||
480 current_cpu_type() == CPU_R14000) 480 current_cpu_type() == CPU_R14000 ||
481 current_cpu_type() == CPU_R16000)
481 write_c0_framemask(0); 482 write_c0_framemask(0);
482 483
483 if (cpu_has_rixi) { 484 if (cpu_has_rixi) {
diff --git a/arch/mips/mm/tlbex.c b/arch/mips/mm/tlbex.c
index d75ff73a2012..7c7469f56ec3 100644
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -569,6 +569,7 @@ static void build_tlb_write_entry(u32 **p, struct uasm_label **l,
569 case CPU_R10000: 569 case CPU_R10000:
570 case CPU_R12000: 570 case CPU_R12000:
571 case CPU_R14000: 571 case CPU_R14000:
572 case CPU_R16000:
572 case CPU_4KC: 573 case CPU_4KC:
573 case CPU_4KEC: 574 case CPU_4KEC:
574 case CPU_M14KC: 575 case CPU_M14KC:
diff --git a/arch/mips/oprofile/common.c b/arch/mips/oprofile/common.c
index a26cbe372e06..81f58958cf08 100644
--- a/arch/mips/oprofile/common.c
+++ b/arch/mips/oprofile/common.c
@@ -98,6 +98,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
98 case CPU_R10000: 98 case CPU_R10000:
99 case CPU_R12000: 99 case CPU_R12000:
100 case CPU_R14000: 100 case CPU_R14000:
101 case CPU_R16000:
101 case CPU_XLR: 102 case CPU_XLR:
102 lmodel = &op_model_mipsxx_ops; 103 lmodel = &op_model_mipsxx_ops;
103 break; 104 break;
diff --git a/arch/mips/oprofile/op_model_mipsxx.c b/arch/mips/oprofile/op_model_mipsxx.c
index d6b9e69e7c69..6a6e2cc55b89 100644
--- a/arch/mips/oprofile/op_model_mipsxx.c
+++ b/arch/mips/oprofile/op_model_mipsxx.c
@@ -296,6 +296,7 @@ static inline int n_counters(void)
296 296
297 case CPU_R12000: 297 case CPU_R12000:
298 case CPU_R14000: 298 case CPU_R14000:
299 case CPU_R16000:
299 counters = 4; 300 counters = 4;
300 break; 301 break;
301 302
@@ -411,6 +412,10 @@ static int __init mipsxx_init(void)
411 op_model_mipsxx_ops.cpu_type = "mips/r12000"; 412 op_model_mipsxx_ops.cpu_type = "mips/r12000";
412 break; 413 break;
413 414
415 case CPU_R16000:
416 op_model_mipsxx_ops.cpu_type = "mips/r16000";
417 break;
418
414 case CPU_SB1: 419 case CPU_SB1:
415 case CPU_SB1A: 420 case CPU_SB1A:
416 op_model_mipsxx_ops.cpu_type = "mips/sb1"; 421 op_model_mipsxx_ops.cpu_type = "mips/sb1";