aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/cpu-probe.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/kernel/cpu-probe.c')
-rw-r--r--arch/mips/kernel/cpu-probe.c57
1 files changed, 54 insertions, 3 deletions
diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index ab755ea26c6a..c6b8b074a81a 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -137,14 +137,24 @@ static inline void check_wait(void)
137 case CPU_4KEC: 137 case CPU_4KEC:
138 case CPU_4KSC: 138 case CPU_4KSC:
139 case CPU_5KC: 139 case CPU_5KC:
140/* case CPU_20KC:*/
141 case CPU_24K:
142 case CPU_25KF: 140 case CPU_25KF:
141 case CPU_PR4450:
142 cpu_wait = r4k_wait;
143 break;
144
145 case CPU_24K:
143 case CPU_34K: 146 case CPU_34K:
147 cpu_wait = r4k_wait;
148 if (read_c0_config7() & MIPS_CONF7_WII)
149 cpu_wait = r4k_wait_irqoff;
150 break;
151
144 case CPU_74K: 152 case CPU_74K:
145 case CPU_PR4450:
146 cpu_wait = r4k_wait; 153 cpu_wait = r4k_wait;
154 if ((c->processor_id & 0xff) >= PRID_REV_ENCODE_332(2, 1, 0))
155 cpu_wait = r4k_wait_irqoff;
147 break; 156 break;
157
148 case CPU_TX49XX: 158 case CPU_TX49XX:
149 cpu_wait = r4k_wait_irqoff; 159 cpu_wait = r4k_wait_irqoff;
150 break; 160 break;
@@ -156,6 +166,17 @@ static inline void check_wait(void)
156 if (allow_au1k_wait) 166 if (allow_au1k_wait)
157 cpu_wait = au1k_wait; 167 cpu_wait = au1k_wait;
158 break; 168 break;
169 case CPU_20KC:
170 /*
171 * WAIT on Rev1.0 has E1, E2, E3 and E16.
172 * WAIT on Rev2.0 and Rev3.0 has E16.
173 * Rev3.1 WAIT is nop, why bother
174 */
175 if ((c->processor_id & 0xff) <= 0x64)
176 break;
177
178 cpu_wait = r4k_wait;
179 break;
159 case CPU_RM9000: 180 case CPU_RM9000:
160 if ((c->processor_id & 0x00ff) >= 0x40) 181 if ((c->processor_id & 0x00ff) >= 0x40)
161 cpu_wait = r4k_wait; 182 cpu_wait = r4k_wait;
@@ -165,9 +186,29 @@ static inline void check_wait(void)
165 } 186 }
166} 187}
167 188
189static inline void check_errata(void)
190{
191 struct cpuinfo_mips *c = &current_cpu_data;
192
193 switch (c->cputype) {
194 case CPU_34K:
195 /*
196 * Erratum "RPS May Cause Incorrect Instruction Execution"
197 * This code only handles VPE0, any SMP/SMTC/RTOS code
198 * making use of VPE1 will be responsable for that VPE.
199 */
200 if ((c->processor_id & PRID_REV_MASK) <= PRID_REV_34K_V1_0_2)
201 write_c0_config7(read_c0_config7() | MIPS_CONF7_RPS);
202 break;
203 default:
204 break;
205 }
206}
207
168void __init check_bugs32(void) 208void __init check_bugs32(void)
169{ 209{
170 check_wait(); 210 check_wait();
211 check_errata();
171} 212}
172 213
173/* 214/*
@@ -464,6 +505,14 @@ static inline void cpu_probe_legacy(struct cpuinfo_mips *c)
464 MIPS_CPU_LLSC; 505 MIPS_CPU_LLSC;
465 c->tlbsize = 64; 506 c->tlbsize = 64;
466 break; 507 break;
508 case PRID_IMP_LOONGSON2:
509 c->cputype = CPU_LOONGSON2;
510 c->isa_level = MIPS_CPU_ISA_III;
511 c->options = R4K_OPTS |
512 MIPS_CPU_FPU | MIPS_CPU_LLSC |
513 MIPS_CPU_32FPR;
514 c->tlbsize = 64;
515 break;
467 } 516 }
468} 517}
469 518
@@ -567,6 +616,8 @@ static inline unsigned int decode_config3(struct cpuinfo_mips *c)
567 c->options |= MIPS_CPU_VEIC; 616 c->options |= MIPS_CPU_VEIC;
568 if (config3 & MIPS_CONF3_MT) 617 if (config3 & MIPS_CONF3_MT)
569 c->ases |= MIPS_ASE_MIPSMT; 618 c->ases |= MIPS_ASE_MIPSMT;
619 if (config3 & MIPS_CONF3_ULRI)
620 c->options |= MIPS_CPU_ULRI;
570 621
571 return config3 & MIPS_CONF_M; 622 return config3 & MIPS_CONF_M;
572} 623}