1 /* cpu.c: Dinky routines to look for the kind of Sparc cpu
4 * Copyright (C) 1996, 2007, 2008 David S. Miller (davem@davemloft.net)
7 #include <linux/kernel.h>
8 #include <linux/init.h>
9 #include <linux/sched.h>
10 #include <linux/smp.h>
12 #include <asm/system.h>
13 #include <asm/fpumacro.h>
14 #include <asm/cpudata.h>
15 #include <asm/spitfire.h>
16 #include <asm/oplib.h>
21 DEFINE_PER_CPU(cpuinfo_sparc
, __cpu_data
) = { 0 };
23 struct cpu_chip_info
{
30 static const struct cpu_chip_info cpu_chips
[] = {
34 .cpu_name
= "TI UltraSparc I (SpitFire)",
35 .fp_name
= "UltraSparc I integrated FPU",
40 .cpu_name
= "TI UltraSparc I (SpitFire)",
41 .fp_name
= "UltraSparc I integrated FPU",
46 .cpu_name
= "TI UltraSparc II (BlackBird)",
47 .fp_name
= "UltraSparc II integrated FPU",
52 .cpu_name
= "TI UltraSparc IIi (Sabre)",
53 .fp_name
= "UltraSparc IIi integrated FPU",
58 .cpu_name
= "TI UltraSparc IIe (Hummingbird)",
59 .fp_name
= "UltraSparc IIe integrated FPU",
64 .cpu_name
= "TI UltraSparc III (Cheetah)",
65 .fp_name
= "UltraSparc III integrated FPU",
70 .cpu_name
= "TI UltraSparc III+ (Cheetah+)",
71 .fp_name
= "UltraSparc III+ integrated FPU",
76 .cpu_name
= "TI UltraSparc IIIi (Jalapeno)",
77 .fp_name
= "UltraSparc IIIi integrated FPU",
82 .cpu_name
= "TI UltraSparc IV (Jaguar)",
83 .fp_name
= "UltraSparc IV integrated FPU",
88 .cpu_name
= "TI UltraSparc IV+ (Panther)",
89 .fp_name
= "UltraSparc IV+ integrated FPU",
94 .cpu_name
= "TI UltraSparc IIIi+ (Serrano)",
95 .fp_name
= "UltraSparc IIIi+ integrated FPU",
99 #define NSPARCCHIPS ARRAY_SIZE(linux_sparc_chips)
101 const char *sparc_cpu_type
;
102 const char *sparc_fpu_type
;
104 static void __init
sun4v_cpu_probe(void)
106 switch (sun4v_chip_type
) {
107 case SUN4V_CHIP_NIAGARA1
:
108 sparc_cpu_type
= "UltraSparc T1 (Niagara)";
109 sparc_fpu_type
= "UltraSparc T1 integrated FPU";
112 case SUN4V_CHIP_NIAGARA2
:
113 sparc_cpu_type
= "UltraSparc T2 (Niagara2)";
114 sparc_fpu_type
= "UltraSparc T2 integrated FPU";
118 printk(KERN_WARNING
"CPU: Unknown sun4v cpu type [%s]\n",
119 prom_cpu_compatible
);
120 sparc_cpu_type
= "Unknown SUN4V CPU";
121 sparc_fpu_type
= "Unknown SUN4V FPU";
126 static const struct cpu_chip_info
* __init
find_cpu_chip(unsigned short manuf
,
131 for (i
= 0; i
< ARRAY_SIZE(cpu_chips
); i
++) {
132 const struct cpu_chip_info
*p
= &cpu_chips
[i
];
134 if (p
->manuf
== manuf
&& p
->impl
== impl
)
140 static int __init
cpu_type_probe(void)
142 if (tlb_type
== hypervisor
) {
145 unsigned long ver
, manuf
, impl
;
146 const struct cpu_chip_info
*p
;
148 __asm__
__volatile__("rdpr %%ver, %0" : "=r" (ver
));
150 manuf
= ((ver
>> 48) & 0xffff);
151 impl
= ((ver
>> 32) & 0xffff);
153 p
= find_cpu_chip(manuf
, impl
);
155 sparc_cpu_type
= p
->cpu_name
;
156 sparc_fpu_type
= p
->fp_name
;
158 printk(KERN_ERR
"CPU: Unknown chip, manuf[%lx] impl[%lx]\n",
160 sparc_cpu_type
= "Unknown CPU";
161 sparc_fpu_type
= "Unknown FPU";
167 arch_initcall(cpu_type_probe
);
This page took 0.085541 seconds and 5 git commands to generate.