blob: 11c92dc53791bc2d6b62c727c09fe48cc032a7de [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * Processor capabilities determination functions.
3 *
4 * Copyright (C) xxxx the Anonymous
Ralf Baechle010b8532006-01-29 18:42:08 +00005 * Copyright (C) 1994 - 2006 Ralf Baechle
Ralf Baechle41943182005-05-05 16:45:59 +00006 * Copyright (C) 2003, 2004 Maciej W. Rozycki
Ralf Baechle41943182005-05-05 16:45:59 +00007 * Copyright (C) 2001, 2004 MIPS Inc.
Linus Torvalds1da177e2005-04-16 15:20:36 -07008 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070014#include <linux/init.h>
15#include <linux/kernel.h>
16#include <linux/ptrace.h>
17#include <linux/stddef.h>
18
Ralf Baechle57599062007-02-18 19:07:31 +000019#include <asm/bugs.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070020#include <asm/cpu.h>
21#include <asm/fpu.h>
22#include <asm/mipsregs.h>
23#include <asm/system.h>
24
25/*
26 * Not all of the MIPS CPUs have the "wait" instruction available. Moreover,
27 * the implementation of the "wait" feature differs between CPU families. This
28 * points to the function that implements CPU specific wait.
29 * The wait instruction stops the pipeline and reduces the power consumption of
30 * the CPU very much.
31 */
32void (*cpu_wait)(void) = NULL;
33
34static void r3081_wait(void)
35{
36 unsigned long cfg = read_c0_conf();
37 write_c0_conf(cfg | R30XX_CONF_HALT);
38}
39
40static void r39xx_wait(void)
41{
Atsushi Nemoto60a6c372006-06-08 01:09:01 +090042 local_irq_disable();
43 if (!need_resched())
44 write_c0_conf(read_c0_conf() | TX39_CONF_HALT);
45 local_irq_enable();
Linus Torvalds1da177e2005-04-16 15:20:36 -070046}
47
Atsushi Nemotoc65a5482007-11-12 02:05:18 +090048extern void r4k_wait(void);
Atsushi Nemoto60a6c372006-06-08 01:09:01 +090049
50/*
51 * This variant is preferable as it allows testing need_resched and going to
52 * sleep depending on the outcome atomically. Unfortunately the "It is
53 * implementation-dependent whether the pipeline restarts when a non-enabled
54 * interrupt is requested" restriction in the MIPS32/MIPS64 architecture makes
55 * using this version a gamble.
56 */
57static void r4k_wait_irqoff(void)
58{
59 local_irq_disable();
60 if (!need_resched())
61 __asm__(" .set mips3 \n"
62 " wait \n"
63 " .set mips0 \n");
64 local_irq_enable();
Linus Torvalds1da177e2005-04-16 15:20:36 -070065}
66
Ralf Baechle5a812992007-07-17 18:49:48 +010067/*
68 * The RM7000 variant has to handle erratum 38. The workaround is to not
69 * have any pending stores when the WAIT instruction is executed.
70 */
71static void rm7k_wait_irqoff(void)
72{
73 local_irq_disable();
74 if (!need_resched())
75 __asm__(
76 " .set push \n"
77 " .set mips3 \n"
78 " .set noat \n"
79 " mfc0 $1, $12 \n"
80 " sync \n"
81 " mtc0 $1, $12 # stalls until W stage \n"
82 " wait \n"
83 " mtc0 $1, $12 # stalls until W stage \n"
84 " .set pop \n");
85 local_irq_enable();
86}
87
Pete Popov494900a2005-04-07 00:42:10 +000088/* The Au1xxx wait is available only if using 32khz counter or
89 * external timer source, but specifically not CP0 Counter. */
Pete Popovfe359bf2005-04-08 08:34:43 +000090int allow_au1k_wait;
Ralf Baechle10f650d2005-05-25 13:32:49 +000091
Pete Popov494900a2005-04-07 00:42:10 +000092static void au1k_wait(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -070093{
Linus Torvalds1da177e2005-04-16 15:20:36 -070094 /* using the wait instruction makes CP0 counter unusable */
Atsushi Nemoto60a6c372006-06-08 01:09:01 +090095 __asm__(" .set mips3 \n"
96 " cache 0x14, 0(%0) \n"
97 " cache 0x14, 32(%0) \n"
98 " sync \n"
99 " nop \n"
100 " wait \n"
101 " nop \n"
102 " nop \n"
103 " nop \n"
104 " nop \n"
105 " .set mips0 \n"
Ralf Baechle10f650d2005-05-25 13:32:49 +0000106 : : "r" (au1k_wait));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700107}
108
Ralf Baechle55d04df2005-07-13 19:22:45 +0000109static int __initdata nowait = 0;
110
Atsushi Nemotof49a7472007-02-18 01:02:14 +0900111static int __init wait_disable(char *s)
Ralf Baechle55d04df2005-07-13 19:22:45 +0000112{
113 nowait = 1;
114
115 return 1;
116}
117
118__setup("nowait", wait_disable);
119
Atsushi Nemotoc65a5482007-11-12 02:05:18 +0900120void __init check_wait(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700121{
122 struct cpuinfo_mips *c = &current_cpu_data;
123
Ralf Baechle55d04df2005-07-13 19:22:45 +0000124 if (nowait) {
Ralf Baechlec2379232006-11-30 01:14:44 +0000125 printk("Wait instruction disabled.\n");
Ralf Baechle55d04df2005-07-13 19:22:45 +0000126 return;
127 }
128
Linus Torvalds1da177e2005-04-16 15:20:36 -0700129 switch (c->cputype) {
130 case CPU_R3081:
131 case CPU_R3081E:
132 cpu_wait = r3081_wait;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700133 break;
134 case CPU_TX3927:
135 cpu_wait = r39xx_wait;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700136 break;
137 case CPU_R4200:
138/* case CPU_R4300: */
139 case CPU_R4600:
140 case CPU_R4640:
141 case CPU_R4650:
142 case CPU_R4700:
143 case CPU_R5000:
144 case CPU_NEVADA:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700145 case CPU_4KC:
146 case CPU_4KEC:
147 case CPU_4KSC:
148 case CPU_5KC:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700149 case CPU_25KF:
Ralf Baechle4b3e9752007-06-21 00:22:34 +0100150 case CPU_PR4450:
Aurelien Jarno1c0c13e2007-09-25 15:40:12 +0200151 case CPU_BCM3302:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700152 cpu_wait = r4k_wait;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700153 break;
Ralf Baechle4b3e9752007-06-21 00:22:34 +0100154
Ralf Baechle5a812992007-07-17 18:49:48 +0100155 case CPU_RM7000:
156 cpu_wait = rm7k_wait_irqoff;
157 break;
158
Ralf Baechle4b3e9752007-06-21 00:22:34 +0100159 case CPU_24K:
160 case CPU_34K:
Ralf Baechle39b8d522008-04-28 17:14:26 +0100161 case CPU_1004K:
Ralf Baechle4b3e9752007-06-21 00:22:34 +0100162 cpu_wait = r4k_wait;
163 if (read_c0_config7() & MIPS_CONF7_WII)
164 cpu_wait = r4k_wait_irqoff;
165 break;
166
167 case CPU_74K:
168 cpu_wait = r4k_wait;
169 if ((c->processor_id & 0xff) >= PRID_REV_ENCODE_332(2, 1, 0))
170 cpu_wait = r4k_wait_irqoff;
171 break;
172
Atsushi Nemoto60a6c372006-06-08 01:09:01 +0900173 case CPU_TX49XX:
174 cpu_wait = r4k_wait_irqoff;
Atsushi Nemoto60a6c372006-06-08 01:09:01 +0900175 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700176 case CPU_AU1000:
177 case CPU_AU1100:
178 case CPU_AU1500:
Pete Popove3ad1c22005-03-01 06:33:16 +0000179 case CPU_AU1550:
180 case CPU_AU1200:
Manuel Lauss237cfee2007-12-06 09:07:55 +0100181 case CPU_AU1210:
182 case CPU_AU1250:
Ralf Baechlec2379232006-11-30 01:14:44 +0000183 if (allow_au1k_wait)
Pete Popovfe359bf2005-04-08 08:34:43 +0000184 cpu_wait = au1k_wait;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700185 break;
Ralf Baechlec8eae712007-06-12 13:04:09 +0100186 case CPU_20KC:
187 /*
188 * WAIT on Rev1.0 has E1, E2, E3 and E16.
189 * WAIT on Rev2.0 and Rev3.0 has E16.
190 * Rev3.1 WAIT is nop, why bother
191 */
192 if ((c->processor_id & 0xff) <= 0x64)
193 break;
194
Ralf Baechle50da4692007-09-14 19:08:43 +0100195 /*
196 * Another rev is incremeting c0_count at a reduced clock
197 * rate while in WAIT mode. So we basically have the choice
198 * between using the cp0 timer as clocksource or avoiding
199 * the WAIT instruction. Until more details are known,
200 * disable the use of WAIT for 20Kc entirely.
201 cpu_wait = r4k_wait;
202 */
Ralf Baechlec8eae712007-06-12 13:04:09 +0100203 break;
Ralf Baechle441ee342006-06-02 11:48:11 +0100204 case CPU_RM9000:
Ralf Baechlec2379232006-11-30 01:14:44 +0000205 if ((c->processor_id & 0x00ff) >= 0x40)
Ralf Baechle441ee342006-06-02 11:48:11 +0100206 cpu_wait = r4k_wait;
Ralf Baechle441ee342006-06-02 11:48:11 +0100207 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700208 default:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700209 break;
210 }
211}
212
Marc St-Jean9267a302007-06-14 15:55:31 -0600213static inline void check_errata(void)
214{
215 struct cpuinfo_mips *c = &current_cpu_data;
216
217 switch (c->cputype) {
218 case CPU_34K:
219 /*
220 * Erratum "RPS May Cause Incorrect Instruction Execution"
221 * This code only handles VPE0, any SMP/SMTC/RTOS code
222 * making use of VPE1 will be responsable for that VPE.
223 */
224 if ((c->processor_id & PRID_REV_MASK) <= PRID_REV_34K_V1_0_2)
225 write_c0_config7(read_c0_config7() | MIPS_CONF7_RPS);
226 break;
227 default:
228 break;
229 }
230}
231
Linus Torvalds1da177e2005-04-16 15:20:36 -0700232void __init check_bugs32(void)
233{
Marc St-Jean9267a302007-06-14 15:55:31 -0600234 check_errata();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700235}
236
237/*
238 * Probe whether cpu has config register by trying to play with
239 * alternate cache bit and see whether it matters.
240 * It's used by cpu_probe to distinguish between R3000A and R3081.
241 */
242static inline int cpu_has_confreg(void)
243{
244#ifdef CONFIG_CPU_R3000
245 extern unsigned long r3k_cache_size(unsigned long);
246 unsigned long size1, size2;
247 unsigned long cfg = read_c0_conf();
248
249 size1 = r3k_cache_size(ST0_ISC);
250 write_c0_conf(cfg ^ R30XX_CONF_AC);
251 size2 = r3k_cache_size(ST0_ISC);
252 write_c0_conf(cfg);
253 return size1 != size2;
254#else
255 return 0;
256#endif
257}
258
259/*
260 * Get the FPU Implementation/Revision.
261 */
262static inline unsigned long cpu_get_fpu_id(void)
263{
264 unsigned long tmp, fpu_id;
265
266 tmp = read_c0_status();
267 __enable_fpu();
268 fpu_id = read_32bit_cp1_register(CP1_REVISION);
269 write_c0_status(tmp);
270 return fpu_id;
271}
272
273/*
274 * Check the CPU has an FPU the official way.
275 */
276static inline int __cpu_has_fpu(void)
277{
278 return ((cpu_get_fpu_id() & 0xff00) != FPIR_IMP_NONE);
279}
280
Ralf Baechle02cf2112005-10-01 13:06:32 +0100281#define R4K_OPTS (MIPS_CPU_TLB | MIPS_CPU_4KEX | MIPS_CPU_4K_CACHE \
Linus Torvalds1da177e2005-04-16 15:20:36 -0700282 | MIPS_CPU_COUNTER)
283
284static inline void cpu_probe_legacy(struct cpuinfo_mips *c)
285{
286 switch (c->processor_id & 0xff00) {
287 case PRID_IMP_R2000:
288 c->cputype = CPU_R2000;
289 c->isa_level = MIPS_CPU_ISA_I;
Ralf Baechle02cf2112005-10-01 13:06:32 +0100290 c->options = MIPS_CPU_TLB | MIPS_CPU_3K_CACHE |
291 MIPS_CPU_NOFPUEX;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700292 if (__cpu_has_fpu())
293 c->options |= MIPS_CPU_FPU;
294 c->tlbsize = 64;
295 break;
296 case PRID_IMP_R3000:
297 if ((c->processor_id & 0xff) == PRID_REV_R3000A)
298 if (cpu_has_confreg())
299 c->cputype = CPU_R3081E;
300 else
301 c->cputype = CPU_R3000A;
302 else
303 c->cputype = CPU_R3000;
304 c->isa_level = MIPS_CPU_ISA_I;
Ralf Baechle02cf2112005-10-01 13:06:32 +0100305 c->options = MIPS_CPU_TLB | MIPS_CPU_3K_CACHE |
306 MIPS_CPU_NOFPUEX;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700307 if (__cpu_has_fpu())
308 c->options |= MIPS_CPU_FPU;
309 c->tlbsize = 64;
310 break;
311 case PRID_IMP_R4000:
312 if (read_c0_config() & CONF_SC) {
313 if ((c->processor_id & 0xff) >= PRID_REV_R4400)
314 c->cputype = CPU_R4400PC;
315 else
316 c->cputype = CPU_R4000PC;
317 } else {
318 if ((c->processor_id & 0xff) >= PRID_REV_R4400)
319 c->cputype = CPU_R4400SC;
320 else
321 c->cputype = CPU_R4000SC;
322 }
323
324 c->isa_level = MIPS_CPU_ISA_III;
325 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
326 MIPS_CPU_WATCH | MIPS_CPU_VCE |
327 MIPS_CPU_LLSC;
328 c->tlbsize = 48;
329 break;
330 case PRID_IMP_VR41XX:
331 switch (c->processor_id & 0xf0) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700332 case PRID_REV_VR4111:
333 c->cputype = CPU_VR4111;
334 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700335 case PRID_REV_VR4121:
336 c->cputype = CPU_VR4121;
337 break;
338 case PRID_REV_VR4122:
339 if ((c->processor_id & 0xf) < 0x3)
340 c->cputype = CPU_VR4122;
341 else
342 c->cputype = CPU_VR4181A;
343 break;
344 case PRID_REV_VR4130:
345 if ((c->processor_id & 0xf) < 0x4)
346 c->cputype = CPU_VR4131;
347 else
348 c->cputype = CPU_VR4133;
349 break;
350 default:
351 printk(KERN_INFO "Unexpected CPU of NEC VR4100 series\n");
352 c->cputype = CPU_VR41XX;
353 break;
354 }
355 c->isa_level = MIPS_CPU_ISA_III;
356 c->options = R4K_OPTS;
357 c->tlbsize = 32;
358 break;
359 case PRID_IMP_R4300:
360 c->cputype = CPU_R4300;
361 c->isa_level = MIPS_CPU_ISA_III;
362 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
363 MIPS_CPU_LLSC;
364 c->tlbsize = 32;
365 break;
366 case PRID_IMP_R4600:
367 c->cputype = CPU_R4600;
368 c->isa_level = MIPS_CPU_ISA_III;
Thiemo Seufer075e7502005-07-27 21:48:12 +0000369 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
370 MIPS_CPU_LLSC;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700371 c->tlbsize = 48;
372 break;
373 #if 0
374 case PRID_IMP_R4650:
375 /*
376 * This processor doesn't have an MMU, so it's not
377 * "real easy" to run Linux on it. It is left purely
378 * for documentation. Commented out because it shares
379 * it's c0_prid id number with the TX3900.
380 */
Ralf Baechlea3dddd52006-03-11 08:18:41 +0000381 c->cputype = CPU_R4650;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700382 c->isa_level = MIPS_CPU_ISA_III;
383 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_LLSC;
384 c->tlbsize = 48;
385 break;
386 #endif
387 case PRID_IMP_TX39:
388 c->isa_level = MIPS_CPU_ISA_I;
Ralf Baechle02cf2112005-10-01 13:06:32 +0100389 c->options = MIPS_CPU_TLB | MIPS_CPU_TX39_CACHE;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700390
391 if ((c->processor_id & 0xf0) == (PRID_REV_TX3927 & 0xf0)) {
392 c->cputype = CPU_TX3927;
393 c->tlbsize = 64;
394 } else {
395 switch (c->processor_id & 0xff) {
396 case PRID_REV_TX3912:
397 c->cputype = CPU_TX3912;
398 c->tlbsize = 32;
399 break;
400 case PRID_REV_TX3922:
401 c->cputype = CPU_TX3922;
402 c->tlbsize = 64;
403 break;
404 default:
405 c->cputype = CPU_UNKNOWN;
406 break;
407 }
408 }
409 break;
410 case PRID_IMP_R4700:
411 c->cputype = CPU_R4700;
412 c->isa_level = MIPS_CPU_ISA_III;
413 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
414 MIPS_CPU_LLSC;
415 c->tlbsize = 48;
416 break;
417 case PRID_IMP_TX49:
418 c->cputype = CPU_TX49XX;
419 c->isa_level = MIPS_CPU_ISA_III;
420 c->options = R4K_OPTS | MIPS_CPU_LLSC;
421 if (!(c->processor_id & 0x08))
422 c->options |= MIPS_CPU_FPU | MIPS_CPU_32FPR;
423 c->tlbsize = 48;
424 break;
425 case PRID_IMP_R5000:
426 c->cputype = CPU_R5000;
427 c->isa_level = MIPS_CPU_ISA_IV;
428 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
429 MIPS_CPU_LLSC;
430 c->tlbsize = 48;
431 break;
432 case PRID_IMP_R5432:
433 c->cputype = CPU_R5432;
434 c->isa_level = MIPS_CPU_ISA_IV;
435 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
436 MIPS_CPU_WATCH | MIPS_CPU_LLSC;
437 c->tlbsize = 48;
438 break;
439 case PRID_IMP_R5500:
440 c->cputype = CPU_R5500;
441 c->isa_level = MIPS_CPU_ISA_IV;
442 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
443 MIPS_CPU_WATCH | MIPS_CPU_LLSC;
444 c->tlbsize = 48;
445 break;
446 case PRID_IMP_NEVADA:
447 c->cputype = CPU_NEVADA;
448 c->isa_level = MIPS_CPU_ISA_IV;
449 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
450 MIPS_CPU_DIVEC | MIPS_CPU_LLSC;
451 c->tlbsize = 48;
452 break;
453 case PRID_IMP_R6000:
454 c->cputype = CPU_R6000;
455 c->isa_level = MIPS_CPU_ISA_II;
456 c->options = MIPS_CPU_TLB | MIPS_CPU_FPU |
457 MIPS_CPU_LLSC;
458 c->tlbsize = 32;
459 break;
460 case PRID_IMP_R6000A:
461 c->cputype = CPU_R6000A;
462 c->isa_level = MIPS_CPU_ISA_II;
463 c->options = MIPS_CPU_TLB | MIPS_CPU_FPU |
464 MIPS_CPU_LLSC;
465 c->tlbsize = 32;
466 break;
467 case PRID_IMP_RM7000:
468 c->cputype = CPU_RM7000;
469 c->isa_level = MIPS_CPU_ISA_IV;
470 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
471 MIPS_CPU_LLSC;
472 /*
473 * Undocumented RM7000: Bit 29 in the info register of
474 * the RM7000 v2.0 indicates if the TLB has 48 or 64
475 * entries.
476 *
477 * 29 1 => 64 entry JTLB
478 * 0 => 48 entry JTLB
479 */
480 c->tlbsize = (read_c0_info() & (1 << 29)) ? 64 : 48;
481 break;
482 case PRID_IMP_RM9000:
483 c->cputype = CPU_RM9000;
484 c->isa_level = MIPS_CPU_ISA_IV;
485 c->options = R4K_OPTS | MIPS_CPU_FPU | MIPS_CPU_32FPR |
486 MIPS_CPU_LLSC;
487 /*
488 * Bit 29 in the info register of the RM9000
489 * indicates if the TLB has 48 or 64 entries.
490 *
491 * 29 1 => 64 entry JTLB
492 * 0 => 48 entry JTLB
493 */
494 c->tlbsize = (read_c0_info() & (1 << 29)) ? 64 : 48;
495 break;
496 case PRID_IMP_R8000:
497 c->cputype = CPU_R8000;
498 c->isa_level = MIPS_CPU_ISA_IV;
499 c->options = MIPS_CPU_TLB | MIPS_CPU_4KEX |
500 MIPS_CPU_FPU | MIPS_CPU_32FPR |
501 MIPS_CPU_LLSC;
502 c->tlbsize = 384; /* has weird TLB: 3-way x 128 */
503 break;
504 case PRID_IMP_R10000:
505 c->cputype = CPU_R10000;
506 c->isa_level = MIPS_CPU_ISA_IV;
Ralf Baechle8b366122005-11-22 17:53:59 +0000507 c->options = MIPS_CPU_TLB | MIPS_CPU_4K_CACHE | MIPS_CPU_4KEX |
Linus Torvalds1da177e2005-04-16 15:20:36 -0700508 MIPS_CPU_FPU | MIPS_CPU_32FPR |
509 MIPS_CPU_COUNTER | MIPS_CPU_WATCH |
510 MIPS_CPU_LLSC;
511 c->tlbsize = 64;
512 break;
513 case PRID_IMP_R12000:
514 c->cputype = CPU_R12000;
515 c->isa_level = MIPS_CPU_ISA_IV;
Ralf Baechle8b366122005-11-22 17:53:59 +0000516 c->options = MIPS_CPU_TLB | MIPS_CPU_4K_CACHE | MIPS_CPU_4KEX |
Linus Torvalds1da177e2005-04-16 15:20:36 -0700517 MIPS_CPU_FPU | MIPS_CPU_32FPR |
518 MIPS_CPU_COUNTER | MIPS_CPU_WATCH |
519 MIPS_CPU_LLSC;
520 c->tlbsize = 64;
521 break;
Kumba44d921b2006-05-16 22:23:59 -0400522 case PRID_IMP_R14000:
523 c->cputype = CPU_R14000;
524 c->isa_level = MIPS_CPU_ISA_IV;
525 c->options = MIPS_CPU_TLB | MIPS_CPU_4K_CACHE | MIPS_CPU_4KEX |
526 MIPS_CPU_FPU | MIPS_CPU_32FPR |
527 MIPS_CPU_COUNTER | MIPS_CPU_WATCH |
528 MIPS_CPU_LLSC;
529 c->tlbsize = 64;
530 break;
Fuxin Zhang2a21c732007-06-06 14:52:43 +0800531 case PRID_IMP_LOONGSON2:
532 c->cputype = CPU_LOONGSON2;
533 c->isa_level = MIPS_CPU_ISA_III;
534 c->options = R4K_OPTS |
535 MIPS_CPU_FPU | MIPS_CPU_LLSC |
536 MIPS_CPU_32FPR;
537 c->tlbsize = 64;
538 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700539 }
540}
541
Ralf Baechle234fcd12008-03-08 09:56:28 +0000542static char unknown_isa[] __cpuinitdata = KERN_ERR \
Ralf Baechleb4672d32005-12-08 14:04:24 +0000543 "Unsupported ISA type, c0.config0: %d.";
544
Ralf Baechle41943182005-05-05 16:45:59 +0000545static inline unsigned int decode_config0(struct cpuinfo_mips *c)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700546{
Ralf Baechle41943182005-05-05 16:45:59 +0000547 unsigned int config0;
548 int isa;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700549
Ralf Baechle41943182005-05-05 16:45:59 +0000550 config0 = read_c0_config();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700551
Ralf Baechle41943182005-05-05 16:45:59 +0000552 if (((config0 & MIPS_CONF_MT) >> 7) == 1)
Ralf Baechle02cf2112005-10-01 13:06:32 +0100553 c->options |= MIPS_CPU_TLB;
Ralf Baechle41943182005-05-05 16:45:59 +0000554 isa = (config0 & MIPS_CONF_AT) >> 13;
555 switch (isa) {
556 case 0:
Thiemo Seufer3a01c492006-07-03 13:30:01 +0100557 switch ((config0 & MIPS_CONF_AR) >> 10) {
Ralf Baechleb4672d32005-12-08 14:04:24 +0000558 case 0:
559 c->isa_level = MIPS_CPU_ISA_M32R1;
560 break;
561 case 1:
562 c->isa_level = MIPS_CPU_ISA_M32R2;
563 break;
564 default:
565 goto unknown;
566 }
Ralf Baechle41943182005-05-05 16:45:59 +0000567 break;
568 case 2:
Thiemo Seufer3a01c492006-07-03 13:30:01 +0100569 switch ((config0 & MIPS_CONF_AR) >> 10) {
Ralf Baechleb4672d32005-12-08 14:04:24 +0000570 case 0:
571 c->isa_level = MIPS_CPU_ISA_M64R1;
572 break;
573 case 1:
574 c->isa_level = MIPS_CPU_ISA_M64R2;
575 break;
576 default:
577 goto unknown;
578 }
Ralf Baechle41943182005-05-05 16:45:59 +0000579 break;
580 default:
Ralf Baechleb4672d32005-12-08 14:04:24 +0000581 goto unknown;
Ralf Baechle41943182005-05-05 16:45:59 +0000582 }
583
584 return config0 & MIPS_CONF_M;
Ralf Baechleb4672d32005-12-08 14:04:24 +0000585
586unknown:
587 panic(unknown_isa, config0);
Ralf Baechle41943182005-05-05 16:45:59 +0000588}
589
590static inline unsigned int decode_config1(struct cpuinfo_mips *c)
591{
592 unsigned int config1;
593
Linus Torvalds1da177e2005-04-16 15:20:36 -0700594 config1 = read_c0_config1();
Ralf Baechle41943182005-05-05 16:45:59 +0000595
596 if (config1 & MIPS_CONF1_MD)
597 c->ases |= MIPS_ASE_MDMX;
598 if (config1 & MIPS_CONF1_WR)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700599 c->options |= MIPS_CPU_WATCH;
Ralf Baechle41943182005-05-05 16:45:59 +0000600 if (config1 & MIPS_CONF1_CA)
601 c->ases |= MIPS_ASE_MIPS16;
602 if (config1 & MIPS_CONF1_EP)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700603 c->options |= MIPS_CPU_EJTAG;
Ralf Baechle41943182005-05-05 16:45:59 +0000604 if (config1 & MIPS_CONF1_FP) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700605 c->options |= MIPS_CPU_FPU;
606 c->options |= MIPS_CPU_32FPR;
607 }
Ralf Baechle41943182005-05-05 16:45:59 +0000608 if (cpu_has_tlb)
609 c->tlbsize = ((config1 & MIPS_CONF1_TLBS) >> 25) + 1;
610
611 return config1 & MIPS_CONF_M;
612}
613
614static inline unsigned int decode_config2(struct cpuinfo_mips *c)
615{
616 unsigned int config2;
617
618 config2 = read_c0_config2();
619
620 if (config2 & MIPS_CONF2_SL)
621 c->scache.flags &= ~MIPS_CACHE_NOT_PRESENT;
622
623 return config2 & MIPS_CONF_M;
624}
625
626static inline unsigned int decode_config3(struct cpuinfo_mips *c)
627{
628 unsigned int config3;
629
630 config3 = read_c0_config3();
631
632 if (config3 & MIPS_CONF3_SM)
633 c->ases |= MIPS_ASE_SMARTMIPS;
Ralf Baechlee50c0a8f2005-05-31 11:49:19 +0000634 if (config3 & MIPS_CONF3_DSP)
635 c->ases |= MIPS_ASE_DSP;
Ralf Baechle8f406112005-07-14 07:34:18 +0000636 if (config3 & MIPS_CONF3_VINT)
637 c->options |= MIPS_CPU_VINT;
638 if (config3 & MIPS_CONF3_VEIC)
639 c->options |= MIPS_CPU_VEIC;
640 if (config3 & MIPS_CONF3_MT)
Ralf Baechlee0daad42007-02-05 00:10:11 +0000641 c->ases |= MIPS_ASE_MIPSMT;
Ralf Baechlea3692022007-07-10 17:33:02 +0100642 if (config3 & MIPS_CONF3_ULRI)
643 c->options |= MIPS_CPU_ULRI;
Ralf Baechle41943182005-05-05 16:45:59 +0000644
645 return config3 & MIPS_CONF_M;
646}
647
Ralf Baechle234fcd12008-03-08 09:56:28 +0000648static void __cpuinit decode_configs(struct cpuinfo_mips *c)
Ralf Baechle41943182005-05-05 16:45:59 +0000649{
650 /* MIPS32 or MIPS64 compliant CPU. */
Ralf Baechle02cf2112005-10-01 13:06:32 +0100651 c->options = MIPS_CPU_4KEX | MIPS_CPU_4K_CACHE | MIPS_CPU_COUNTER |
652 MIPS_CPU_DIVEC | MIPS_CPU_LLSC | MIPS_CPU_MCHECK;
Ralf Baechle41943182005-05-05 16:45:59 +0000653
Linus Torvalds1da177e2005-04-16 15:20:36 -0700654 c->scache.flags = MIPS_CACHE_NOT_PRESENT;
655
Ralf Baechle41943182005-05-05 16:45:59 +0000656 /* Read Config registers. */
657 if (!decode_config0(c))
658 return; /* actually worth a panic() */
659 if (!decode_config1(c))
660 return;
661 if (!decode_config2(c))
662 return;
663 if (!decode_config3(c))
664 return;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700665}
666
Chris Dearman0b6d4972007-09-13 12:32:02 +0100667#ifdef CONFIG_CPU_MIPSR2
668extern void spram_config(void);
669#else
670static inline void spram_config(void) {}
671#endif
672
Linus Torvalds1da177e2005-04-16 15:20:36 -0700673static inline void cpu_probe_mips(struct cpuinfo_mips *c)
674{
Ralf Baechle41943182005-05-05 16:45:59 +0000675 decode_configs(c);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700676 switch (c->processor_id & 0xff00) {
677 case PRID_IMP_4KC:
678 c->cputype = CPU_4KC;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700679 break;
680 case PRID_IMP_4KEC:
681 c->cputype = CPU_4KEC;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700682 break;
Ralf Baechle2b07bd02005-04-08 20:36:05 +0000683 case PRID_IMP_4KECR2:
684 c->cputype = CPU_4KEC;
Ralf Baechle2b07bd02005-04-08 20:36:05 +0000685 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700686 case PRID_IMP_4KSC:
Ralf Baechle8afcb5d2005-10-04 15:01:26 +0100687 case PRID_IMP_4KSD:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700688 c->cputype = CPU_4KSC;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700689 break;
690 case PRID_IMP_5KC:
691 c->cputype = CPU_5KC;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700692 break;
693 case PRID_IMP_20KC:
694 c->cputype = CPU_20KC;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700695 break;
696 case PRID_IMP_24K:
Ralf Baechlee50c0a8f2005-05-31 11:49:19 +0000697 case PRID_IMP_24KE:
Linus Torvalds1da177e2005-04-16 15:20:36 -0700698 c->cputype = CPU_24K;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700699 break;
700 case PRID_IMP_25KF:
701 c->cputype = CPU_25KF;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700702 break;
Ralf Baechlebbc7f222005-07-12 16:12:05 +0000703 case PRID_IMP_34K:
704 c->cputype = CPU_34K;
Ralf Baechlebbc7f222005-07-12 16:12:05 +0000705 break;
Chris Dearmanc6209532006-05-02 14:08:46 +0100706 case PRID_IMP_74K:
707 c->cputype = CPU_74K;
708 break;
Ralf Baechle39b8d522008-04-28 17:14:26 +0100709 case PRID_IMP_1004K:
710 c->cputype = CPU_1004K;
711 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700712 }
Chris Dearman0b6d4972007-09-13 12:32:02 +0100713
714 spram_config();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700715}
716
717static inline void cpu_probe_alchemy(struct cpuinfo_mips *c)
718{
Ralf Baechle41943182005-05-05 16:45:59 +0000719 decode_configs(c);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700720 switch (c->processor_id & 0xff00) {
721 case PRID_IMP_AU1_REV1:
722 case PRID_IMP_AU1_REV2:
723 switch ((c->processor_id >> 24) & 0xff) {
724 case 0:
Ralf Baechlea3dddd52006-03-11 08:18:41 +0000725 c->cputype = CPU_AU1000;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700726 break;
727 case 1:
728 c->cputype = CPU_AU1500;
729 break;
730 case 2:
731 c->cputype = CPU_AU1100;
732 break;
733 case 3:
734 c->cputype = CPU_AU1550;
735 break;
Pete Popove3ad1c22005-03-01 06:33:16 +0000736 case 4:
737 c->cputype = CPU_AU1200;
Manuel Lauss237cfee2007-12-06 09:07:55 +0100738 if (2 == (c->processor_id & 0xff))
739 c->cputype = CPU_AU1250;
740 break;
741 case 5:
742 c->cputype = CPU_AU1210;
Pete Popove3ad1c22005-03-01 06:33:16 +0000743 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700744 default:
745 panic("Unknown Au Core!");
746 break;
747 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700748 break;
749 }
750}
751
752static inline void cpu_probe_sibyte(struct cpuinfo_mips *c)
753{
Ralf Baechle41943182005-05-05 16:45:59 +0000754 decode_configs(c);
Ralf Baechle02cf2112005-10-01 13:06:32 +0100755
Linus Torvalds1da177e2005-04-16 15:20:36 -0700756 switch (c->processor_id & 0xff00) {
757 case PRID_IMP_SB1:
758 c->cputype = CPU_SB1;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700759 /* FPU in pass1 is known to have issues. */
Ralf Baechleaa323742006-05-29 00:02:12 +0100760 if ((c->processor_id & 0xff) < 0x02)
Ralf Baechle010b8532006-01-29 18:42:08 +0000761 c->options &= ~(MIPS_CPU_FPU | MIPS_CPU_32FPR);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700762 break;
Andrew Isaacson93ce2f522005-10-19 23:56:20 -0700763 case PRID_IMP_SB1A:
764 c->cputype = CPU_SB1A;
765 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700766 }
767}
768
769static inline void cpu_probe_sandcraft(struct cpuinfo_mips *c)
770{
Ralf Baechle41943182005-05-05 16:45:59 +0000771 decode_configs(c);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700772 switch (c->processor_id & 0xff00) {
773 case PRID_IMP_SR71000:
774 c->cputype = CPU_SR71000;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700775 c->scache.ways = 8;
776 c->tlbsize = 64;
777 break;
778 }
779}
780
Daniel Lairda92b0582008-03-06 09:07:18 +0000781static inline void cpu_probe_nxp(struct cpuinfo_mips *c)
Pete Popovbdf21b12005-07-14 17:47:57 +0000782{
783 decode_configs(c);
784 switch (c->processor_id & 0xff00) {
785 case PRID_IMP_PR4450:
786 c->cputype = CPU_PR4450;
Ralf Baechlee7958bb2005-12-08 13:00:20 +0000787 c->isa_level = MIPS_CPU_ISA_M32R1;
Pete Popovbdf21b12005-07-14 17:47:57 +0000788 break;
789 default:
Daniel Lairda92b0582008-03-06 09:07:18 +0000790 panic("Unknown NXP Core!"); /* REVISIT: die? */
Pete Popovbdf21b12005-07-14 17:47:57 +0000791 break;
792 }
793}
794
795
Aurelien Jarno1c0c13e2007-09-25 15:40:12 +0200796static inline void cpu_probe_broadcom(struct cpuinfo_mips *c)
797{
798 decode_configs(c);
799 switch (c->processor_id & 0xff00) {
800 case PRID_IMP_BCM3302:
801 c->cputype = CPU_BCM3302;
802 break;
803 case PRID_IMP_BCM4710:
804 c->cputype = CPU_BCM4710;
805 break;
806 default:
807 c->cputype = CPU_UNKNOWN;
808 break;
809 }
810}
811
Ralf Baechle9966db252007-10-11 23:46:17 +0100812const char *__cpu_name[NR_CPUS];
813
814/*
815 * Name a CPU
816 */
Ralf Baechle234fcd12008-03-08 09:56:28 +0000817static __cpuinit const char *cpu_to_name(struct cpuinfo_mips *c)
Ralf Baechle9966db252007-10-11 23:46:17 +0100818{
819 const char *name = NULL;
820
821 switch (c->cputype) {
822 case CPU_UNKNOWN: name = "unknown"; break;
823 case CPU_R2000: name = "R2000"; break;
824 case CPU_R3000: name = "R3000"; break;
825 case CPU_R3000A: name = "R3000A"; break;
826 case CPU_R3041: name = "R3041"; break;
827 case CPU_R3051: name = "R3051"; break;
828 case CPU_R3052: name = "R3052"; break;
829 case CPU_R3081: name = "R3081"; break;
830 case CPU_R3081E: name = "R3081E"; break;
831 case CPU_R4000PC: name = "R4000PC"; break;
832 case CPU_R4000SC: name = "R4000SC"; break;
833 case CPU_R4000MC: name = "R4000MC"; break;
834 case CPU_R4200: name = "R4200"; break;
835 case CPU_R4400PC: name = "R4400PC"; break;
836 case CPU_R4400SC: name = "R4400SC"; break;
837 case CPU_R4400MC: name = "R4400MC"; break;
838 case CPU_R4600: name = "R4600"; break;
839 case CPU_R6000: name = "R6000"; break;
840 case CPU_R6000A: name = "R6000A"; break;
841 case CPU_R8000: name = "R8000"; break;
842 case CPU_R10000: name = "R10000"; break;
843 case CPU_R12000: name = "R12000"; break;
844 case CPU_R14000: name = "R14000"; break;
845 case CPU_R4300: name = "R4300"; break;
846 case CPU_R4650: name = "R4650"; break;
847 case CPU_R4700: name = "R4700"; break;
848 case CPU_R5000: name = "R5000"; break;
849 case CPU_R5000A: name = "R5000A"; break;
850 case CPU_R4640: name = "R4640"; break;
851 case CPU_NEVADA: name = "Nevada"; break;
852 case CPU_RM7000: name = "RM7000"; break;
853 case CPU_RM9000: name = "RM9000"; break;
854 case CPU_R5432: name = "R5432"; break;
855 case CPU_4KC: name = "MIPS 4Kc"; break;
856 case CPU_5KC: name = "MIPS 5Kc"; break;
857 case CPU_R4310: name = "R4310"; break;
858 case CPU_SB1: name = "SiByte SB1"; break;
859 case CPU_SB1A: name = "SiByte SB1A"; break;
860 case CPU_TX3912: name = "TX3912"; break;
861 case CPU_TX3922: name = "TX3922"; break;
862 case CPU_TX3927: name = "TX3927"; break;
863 case CPU_AU1000: name = "Au1000"; break;
864 case CPU_AU1500: name = "Au1500"; break;
865 case CPU_AU1100: name = "Au1100"; break;
866 case CPU_AU1550: name = "Au1550"; break;
867 case CPU_AU1200: name = "Au1200"; break;
Manuel Lauss237cfee2007-12-06 09:07:55 +0100868 case CPU_AU1210: name = "Au1210"; break;
869 case CPU_AU1250: name = "Au1250"; break;
Ralf Baechle9966db252007-10-11 23:46:17 +0100870 case CPU_4KEC: name = "MIPS 4KEc"; break;
871 case CPU_4KSC: name = "MIPS 4KSc"; break;
872 case CPU_VR41XX: name = "NEC Vr41xx"; break;
873 case CPU_R5500: name = "R5500"; break;
874 case CPU_TX49XX: name = "TX49xx"; break;
875 case CPU_20KC: name = "MIPS 20Kc"; break;
876 case CPU_24K: name = "MIPS 24K"; break;
877 case CPU_25KF: name = "MIPS 25Kf"; break;
878 case CPU_34K: name = "MIPS 34K"; break;
Ralf Baechle39b8d522008-04-28 17:14:26 +0100879 case CPU_1004K: name = "MIPS 1004K"; break;
Ralf Baechle9966db252007-10-11 23:46:17 +0100880 case CPU_74K: name = "MIPS 74K"; break;
881 case CPU_VR4111: name = "NEC VR4111"; break;
882 case CPU_VR4121: name = "NEC VR4121"; break;
883 case CPU_VR4122: name = "NEC VR4122"; break;
884 case CPU_VR4131: name = "NEC VR4131"; break;
885 case CPU_VR4133: name = "NEC VR4133"; break;
886 case CPU_VR4181: name = "NEC VR4181"; break;
887 case CPU_VR4181A: name = "NEC VR4181A"; break;
888 case CPU_SR71000: name = "Sandcraft SR71000"; break;
889 case CPU_BCM3302: name = "Broadcom BCM3302"; break;
890 case CPU_BCM4710: name = "Broadcom BCM4710"; break;
891 case CPU_PR4450: name = "Philips PR4450"; break;
892 case CPU_LOONGSON2: name = "ICT Loongson-2"; break;
893 default:
894 BUG();
895 }
896
897 return name;
898}
899
Ralf Baechle234fcd12008-03-08 09:56:28 +0000900__cpuinit void cpu_probe(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700901{
902 struct cpuinfo_mips *c = &current_cpu_data;
Ralf Baechle9966db252007-10-11 23:46:17 +0100903 unsigned int cpu = smp_processor_id();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700904
905 c->processor_id = PRID_IMP_UNKNOWN;
906 c->fpu_id = FPIR_IMP_NONE;
907 c->cputype = CPU_UNKNOWN;
908
909 c->processor_id = read_c0_prid();
910 switch (c->processor_id & 0xff0000) {
911 case PRID_COMP_LEGACY:
912 cpu_probe_legacy(c);
913 break;
914 case PRID_COMP_MIPS:
915 cpu_probe_mips(c);
916 break;
917 case PRID_COMP_ALCHEMY:
918 cpu_probe_alchemy(c);
919 break;
920 case PRID_COMP_SIBYTE:
921 cpu_probe_sibyte(c);
922 break;
Aurelien Jarno1c0c13e2007-09-25 15:40:12 +0200923 case PRID_COMP_BROADCOM:
924 cpu_probe_broadcom(c);
925 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700926 case PRID_COMP_SANDCRAFT:
927 cpu_probe_sandcraft(c);
928 break;
Daniel Lairda92b0582008-03-06 09:07:18 +0000929 case PRID_COMP_NXP:
930 cpu_probe_nxp(c);
Ralf Baechlea3dddd52006-03-11 08:18:41 +0000931 break;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700932 default:
933 c->cputype = CPU_UNKNOWN;
934 }
Franck Bui-Huudec8b1c2007-10-08 16:11:51 +0200935
936 /*
937 * Platform code can force the cpu type to optimize code
938 * generation. In that case be sure the cpu type is correctly
939 * manually setup otherwise it could trigger some nasty bugs.
940 */
941 BUG_ON(current_cpu_type() != c->cputype);
942
Ralf Baechle41943182005-05-05 16:45:59 +0000943 if (c->options & MIPS_CPU_FPU) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700944 c->fpu_id = cpu_get_fpu_id();
Ralf Baechle41943182005-05-05 16:45:59 +0000945
Ralf Baechlee7958bb2005-12-08 13:00:20 +0000946 if (c->isa_level == MIPS_CPU_ISA_M32R1 ||
Ralf Baechleb4672d32005-12-08 14:04:24 +0000947 c->isa_level == MIPS_CPU_ISA_M32R2 ||
948 c->isa_level == MIPS_CPU_ISA_M64R1 ||
949 c->isa_level == MIPS_CPU_ISA_M64R2) {
Ralf Baechle41943182005-05-05 16:45:59 +0000950 if (c->fpu_id & MIPS_FPIR_3D)
951 c->ases |= MIPS_ASE_MIPS3D;
952 }
953 }
Ralf Baechle9966db252007-10-11 23:46:17 +0100954
955 __cpu_name[cpu] = cpu_to_name(c);
Ralf Baechlef6771db2007-11-08 18:02:29 +0000956
957 if (cpu_has_mips_r2)
958 c->srsets = ((read_c0_srsctl() >> 26) & 0x0f) + 1;
959 else
960 c->srsets = 1;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700961}
962
Ralf Baechle234fcd12008-03-08 09:56:28 +0000963__cpuinit void cpu_report(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700964{
965 struct cpuinfo_mips *c = &current_cpu_data;
966
Ralf Baechle9966db252007-10-11 23:46:17 +0100967 printk(KERN_INFO "CPU revision is: %08x (%s)\n",
968 c->processor_id, cpu_name_string());
Linus Torvalds1da177e2005-04-16 15:20:36 -0700969 if (c->options & MIPS_CPU_FPU)
Ralf Baechle9966db252007-10-11 23:46:17 +0100970 printk(KERN_INFO "FPU revision is: %08x\n", c->fpu_id);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700971}