aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/cpu-probe.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2005-10-01 08:06:32 -0400
committerRalf Baechle <ralf@linux-mips.org>2005-10-29 14:32:32 -0400
commit02cf2119684e52e97a8a90bd7630386e0f1a250a (patch)
treefbe051feacc403d7703bf27043ac048b5d2f2369 /arch/mips/kernel/cpu-probe.c
parent942d042d17c77febab9af6815b2e77f665d0f9c1 (diff)
Cleanup the mess in cpu_cache_init.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/cpu-probe.c')
-rw-r--r--arch/mips/kernel/cpu-probe.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 5d71eca41575..8e6427a50916 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -191,7 +191,7 @@ static inline int __cpu_has_fpu(void)
191 return ((cpu_get_fpu_id() & 0xff00) != FPIR_IMP_NONE); 191 return ((cpu_get_fpu_id() & 0xff00) != FPIR_IMP_NONE);
192} 192}
193 193
194#define R4K_OPTS (MIPS_CPU_TLB | MIPS_CPU_4KEX | MIPS_CPU_4KTLB \ 194#define R4K_OPTS (MIPS_CPU_TLB | MIPS_CPU_4KEX | MIPS_CPU_4K_CACHE \
195 | MIPS_CPU_COUNTER) 195 | MIPS_CPU_COUNTER)
196 196
197static inline void cpu_probe_legacy(struct cpuinfo_mips *c) 197static inline void cpu_probe_legacy(struct cpuinfo_mips *c)
@@ -200,7 +200,8 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c)
200 case PRID_IMP_R2000: 200 case PRID_IMP_R2000:
201 c->cputype = CPU_R2000; 201 c->cputype = CPU_R2000;
202 c->isa_level = MIPS_CPU_ISA_I; 202 c->isa_level = MIPS_CPU_ISA_I;
203 c->options = MIPS_CPU_TLB | MIPS_CPU_NOFPUEX; 203 c->options = MIPS_CPU_TLB | MIPS_CPU_3K_CACHE |
204 MIPS_CPU_NOFPUEX;
204 if (__cpu_has_fpu()) 205 if (__cpu_has_fpu())
205 c->options |= MIPS_CPU_FPU; 206 c->options |= MIPS_CPU_FPU;
206 c->tlbsize = 64; 207 c->tlbsize = 64;
@@ -214,7 +215,8 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c)
214 else 215 else
215 c->cputype = CPU_R3000; 216 c->cputype = CPU_R3000;
216 c->isa_level = MIPS_CPU_ISA_I; 217 c->isa_level = MIPS_CPU_ISA_I;
217 c->options = MIPS_CPU_TLB | MIPS_CPU_NOFPUEX; 218 c->options = MIPS_CPU_TLB | MIPS_CPU_3K_CACHE |
219 MIPS_CPU_NOFPUEX;
218 if (__cpu_has_fpu()) 220 if (__cpu_has_fpu())
219 c->options |= MIPS_CPU_FPU; 221 c->options |= MIPS_CPU_FPU;
220 c->tlbsize = 64; 222 c->tlbsize = 64;
@@ -297,7 +299,7 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c)
297 #endif 299 #endif
298 case PRID_IMP_TX39: 300 case PRID_IMP_TX39:
299 c->isa_level = MIPS_CPU_ISA_I; 301 c->isa_level = MIPS_CPU_ISA_I;
300 c->options = MIPS_CPU_TLB; 302 c->options = MIPS_CPU_TLB | MIPS_CPU_TX39_CACHE;
301 303
302 if ((c->processor_id & 0xf0) == (PRID_REV_TX3927 & 0xf0)) { 304 if ((c->processor_id & 0xf0) == (PRID_REV_TX3927 & 0xf0)) {
303 c->cputype = CPU_TX3927; 305 c->cputype = CPU_TX3927;
@@ -441,7 +443,7 @@ static inline unsigned int decode_config0(struct cpuinfo_mips *c)
441 config0 = read_c0_config(); 443 config0 = read_c0_config();
442 444
443 if (((config0 & MIPS_CONF_MT) >> 7) == 1) 445 if (((config0 & MIPS_CONF_MT) >> 7) == 1)
444 c->options |= MIPS_CPU_TLB | MIPS_CPU_4KTLB; 446 c->options |= MIPS_CPU_TLB;
445 isa = (config0 & MIPS_CONF_AT) >> 13; 447 isa = (config0 & MIPS_CONF_AT) >> 13;
446 switch (isa) { 448 switch (isa) {
447 case 0: 449 case 0:
@@ -516,8 +518,8 @@ static inline unsigned int decode_config3(struct cpuinfo_mips *c)
516static inline void decode_configs(struct cpuinfo_mips *c) 518static inline void decode_configs(struct cpuinfo_mips *c)
517{ 519{
518 /* MIPS32 or MIPS64 compliant CPU. */ 520 /* MIPS32 or MIPS64 compliant CPU. */
519 c->options = MIPS_CPU_4KEX | MIPS_CPU_COUNTER | MIPS_CPU_DIVEC | 521 c->options = MIPS_CPU_4KEX | MIPS_CPU_4K_CACHE | MIPS_CPU_COUNTER |
520 MIPS_CPU_LLSC | MIPS_CPU_MCHECK; 522 MIPS_CPU_DIVEC | MIPS_CPU_LLSC | MIPS_CPU_MCHECK;
521 523
522 c->scache.flags = MIPS_CACHE_NOT_PRESENT; 524 c->scache.flags = MIPS_CACHE_NOT_PRESENT;
523 525
@@ -603,6 +605,15 @@ static inline void cpu_probe_alchemy(struct cpuinfo_mips *c)
603static inline void cpu_probe_sibyte(struct cpuinfo_mips *c) 605static inline void cpu_probe_sibyte(struct cpuinfo_mips *c)
604{ 606{
605 decode_configs(c); 607 decode_configs(c);
608
609 /*
610 * For historical reasons the SB1 comes with it's own variant of
611 * cache code which eventually will be folded into c-r4k.c. Until
612 * then we pretend it's got it's own cache architecture.
613 */
614 c->options &= MIPS_CPU_4K_CACHE;
615 c->options |= MIPS_CPU_SB1_CACHE;
616
606 switch (c->processor_id & 0xff00) { 617 switch (c->processor_id & 0xff00) {
607 case PRID_IMP_SB1: 618 case PRID_IMP_SB1:
608 c->cputype = CPU_SB1; 619 c->cputype = CPU_SB1;