8 #include <linux/kernel.h>
9 #include <linux/export.h>
15 #include <asm/pgtable.h>
16 #include <asm/oplib.h>
17 #include <asm/setup.h>
52 #define CPU(ver, _name) \
53 { .psr_vers = ver, .name = _name }
55 #define CPU_PMU(ver, _name, _pmu_name) \
56 { .psr_vers = ver, .name = _name, .pmu_name = _pmu_name }
58 #define FPU(ver, _name) \
59 { .fp_vers = ver, .name = _name }
66 CPU(0,
"Fujitsu MB86900/1A or LSI L64831 SparcKIT-40"),
68 CPU(4,
"Fujitsu MB86904"),
69 CPU(5,
"Fujitsu TurboSparc MB86907"),
73 FPU(0,
"Fujitsu MB86910 or Weitek WTL1164/5"),
74 FPU(1,
"Fujitsu MB86911 or Weitek WTL1164/5 or LSI L64831"),
75 FPU(2,
"LSI Logic L64802 or Texas Instruments ACT8847"),
77 FPU(3,
"Weitek WTL3170/2"),
79 FPU(4,
"Lsi Logic/Meiko L64804 or compatible"),
86 CPU(0,
"LSI Logic Corporation - L64811"),
88 CPU(1,
"Cypress/ROSS CY7C601"),
90 CPU(3,
"Cypress/ROSS CY7C611"),
92 CPU(0xf,
"ROSS HyperSparc RT620"),
93 CPU(0
xe,
"ROSS HyperSparc RT625 or RT626"),
97 FPU(0,
"ROSS HyperSparc combined IU/FPU"),
98 FPU(1,
"Lsi Logic L64814"),
99 FPU(2,
"Texas Instruments TMS390-C602A"),
100 FPU(3,
"Cypress CY7C602 FPU"),
108 CPU(0,
"Bipolar Integrated Technology - B5010"),
117 CPU(0,
"LSI Logic Corporation - unknown-type"),
126 CPU(0,
"Texas Instruments, Inc. - SuperSparc-(II)"),
128 CPU(1,
"Texas Instruments, Inc. - MicroSparc"),
129 CPU(2,
"Texas Instruments, Inc. - MicroSparc II"),
130 CPU(3,
"Texas Instruments, Inc. - SuperSparc 51"),
131 CPU(4,
"Texas Instruments, Inc. - SuperSparc 61"),
132 CPU(5,
"Texas Instruments, Inc. - unknown"),
137 FPU(0,
"SuperSparc on-chip FPU"),
139 FPU(4,
"TI MicroSparc on chip FPU"),
145 CPU(0,
"Matsushita - MN10501"),
149 FPU(0,
"Matsushita MN10501"),
155 CPU(0,
"Philips Corporation - unknown"),
164 CPU(0,
"Harvest VLSI Design Center, Inc. - unknown"),
173 CPU(0,
"Systems and Processes Engineering Corporation (SPEC)"),
183 CPU(0,
"Fujitsu or Weitek Power-UP"),
184 CPU(1,
"Fujitsu or Weitek Power-UP"),
185 CPU(2,
"Fujitsu or Weitek Power-UP"),
186 CPU(3,
"Fujitsu or Weitek Power-UP"),
190 FPU(3,
"Fujitsu or Weitek on-chip FPU"),
201 FPU(3,
"GRFPU-Lite"),
207 CPU_PMU(0x10,
"TI UltraSparc I (SpitFire)",
"ultra12"),
208 CPU_PMU(0x11,
"TI UltraSparc II (BlackBird)",
"ultra12"),
209 CPU_PMU(0x12,
"TI UltraSparc IIi (Sabre)",
"ultra12"),
210 CPU_PMU(0x13,
"TI UltraSparc IIe (Hummingbird)",
"ultra12"),
214 FPU(0x10,
"UltraSparc I integrated FPU"),
215 FPU(0x11,
"UltraSparc II integrated FPU"),
216 FPU(0x12,
"UltraSparc IIi integrated FPU"),
217 FPU(0x13,
"UltraSparc IIe integrated FPU"),
223 CPU_PMU(0x10,
"TI UltraSparc I (SpitFire)",
"ultra12"),
227 FPU(0x10,
"UltraSparc I integrated FPU"),
233 CPU_PMU(0x14,
"TI UltraSparc III (Cheetah)",
"ultra3"),
234 CPU_PMU(0x15,
"TI UltraSparc III+ (Cheetah+)",
"ultra3+"),
235 CPU_PMU(0x16,
"TI UltraSparc IIIi (Jalapeno)",
"ultra3i"),
236 CPU_PMU(0x18,
"TI UltraSparc IV (Jaguar)",
"ultra3+"),
237 CPU_PMU(0x19,
"TI UltraSparc IV+ (Panther)",
"ultra4+"),
238 CPU_PMU(0x22,
"TI UltraSparc IIIi+ (Serrano)",
"ultra3i"),
242 FPU(0x14,
"UltraSparc III integrated FPU"),
243 FPU(0x15,
"UltraSparc III+ integrated FPU"),
244 FPU(0x16,
"UltraSparc IIIi integrated FPU"),
245 FPU(0x18,
"UltraSparc IV integrated FPU"),
246 FPU(0x19,
"UltraSparc IV+ integrated FPU"),
247 FPU(0x22,
"UltraSparc IIIi+ integrated FPU"),
256 static const char *sparc_cpu_type;
257 static const char *sparc_fpu_type;
261 static void __init set_cpu_and_fpu(
int psr_impl,
int psr_vers,
int fpu_vers)
263 const struct manufacturer_info *manuf;
266 sparc_cpu_type =
NULL;
267 sparc_fpu_type =
NULL;
271 for (i = 0; i <
ARRAY_SIZE(manufacturer_info); i++)
273 if (psr_impl == manufacturer_info[i].psr_impl) {
274 manuf = &manufacturer_info[
i];
287 sparc_cpu_type = cpu->
name;
289 sparc_fpu_type =
"No FPU";
297 if (fpu->
fp_vers == fpu_vers) {
298 sparc_fpu_type = fpu->
name;
304 if (sparc_cpu_type ==
NULL)
308 sparc_cpu_type =
"Unknown CPU";
310 if (sparc_fpu_type ==
NULL)
314 sparc_fpu_type =
"Unknown FPU";
320 #ifdef CONFIG_SPARC32
326 "promlib\t\t: Version %d Revision %d\n"
329 "ncpus probed\t: %d\n"
330 "ncpus active\t: %d\n"
332 "CPU0Bogo\t: %lu.%02lu\n"
333 "CPU0ClkTck\t: %ld\n"
340 romvec->pv_printrev >> 16,
341 romvec->pv_printrev & 0xffff,
363 #ifdef CONFIG_SPARC64
376 "ncpus probed\t: %d\n"
377 "ncpus active\t: %d\n"
378 "D$ parity tl1\t: %u\n"
379 "I$ parity tl1\t: %u\n"
381 "Cpu0ClkTck\t: %016lx\n"
393 dcache_parity_tl1_occurred,
394 icache_parity_tl1_occurred
420 static void *c_next(
struct seq_file *m,
void *
v, loff_t *
pos)
426 static void c_stop(
struct seq_file *m,
void *
v)
437 #ifdef CONFIG_SPARC32
438 static int __init cpu_type_probe(
void)
440 int psr_impl, psr_vers, fpu_vers;
450 fpu_vers = get_psr() &
PSR_EF ? ((get_fsr() >> 17) & 0x7) : 7;
452 fpu_vers = ((get_fsr() >> 17) & 0x7);
456 set_cpu_and_fpu(psr_impl, psr_vers, fpu_vers);
462 #ifdef CONFIG_SPARC64
463 static void __init sun4v_cpu_probe(
void)
465 switch (sun4v_chip_type) {
466 case SUN4V_CHIP_NIAGARA1:
467 sparc_cpu_type =
"UltraSparc T1 (Niagara)";
468 sparc_fpu_type =
"UltraSparc T1 integrated FPU";
472 case SUN4V_CHIP_NIAGARA2:
473 sparc_cpu_type =
"UltraSparc T2 (Niagara2)";
474 sparc_fpu_type =
"UltraSparc T2 integrated FPU";
478 case SUN4V_CHIP_NIAGARA3:
479 sparc_cpu_type =
"UltraSparc T3 (Niagara3)";
480 sparc_fpu_type =
"UltraSparc T3 integrated FPU";
484 case SUN4V_CHIP_NIAGARA4:
485 sparc_cpu_type =
"UltraSparc T4 (Niagara4)";
486 sparc_fpu_type =
"UltraSparc T4 integrated FPU";
490 case SUN4V_CHIP_NIAGARA5:
491 sparc_cpu_type =
"UltraSparc T5 (Niagara5)";
492 sparc_fpu_type =
"UltraSparc T5 integrated FPU";
498 prom_cpu_compatible);
499 sparc_cpu_type =
"Unknown SUN4V CPU";
500 sparc_fpu_type =
"Unknown SUN4V FPU";
506 static int __init cpu_type_probe(
void)
514 __asm__ __volatile__(
"rdpr %%ver, %0" :
"=r" (ver));
516 manuf = ((ver >> 48) & 0xffff);
517 impl = ((ver >> 32) & 0xffff);
518 set_cpu_and_fpu(manuf, impl, impl);