aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/kernel/cpu.c')
-rw-r--r--arch/sparc/kernel/cpu.c51
1 files changed, 37 insertions, 14 deletions
diff --git a/arch/sparc/kernel/cpu.c b/arch/sparc/kernel/cpu.c
index f0b825505da5..d85c3dc4953a 100644
--- a/arch/sparc/kernel/cpu.c
+++ b/arch/sparc/kernel/cpu.c
@@ -26,6 +26,7 @@ EXPORT_PER_CPU_SYMBOL(__cpu_data);
26struct cpu_info { 26struct cpu_info {
27 int psr_vers; 27 int psr_vers;
28 const char *name; 28 const char *name;
29 const char *pmu_name;
29}; 30};
30 31
31struct fpu_info { 32struct fpu_info {
@@ -45,6 +46,9 @@ struct manufacturer_info {
45#define CPU(ver, _name) \ 46#define CPU(ver, _name) \
46{ .psr_vers = ver, .name = _name } 47{ .psr_vers = ver, .name = _name }
47 48
49#define CPU_PMU(ver, _name, _pmu_name) \
50{ .psr_vers = ver, .name = _name, .pmu_name = _pmu_name }
51
48#define FPU(ver, _name) \ 52#define FPU(ver, _name) \
49{ .fp_vers = ver, .name = _name } 53{ .fp_vers = ver, .name = _name }
50 54
@@ -183,10 +187,10 @@ static const struct manufacturer_info __initconst manufacturer_info[] = {
183},{ 187},{
184 0x17, 188 0x17,
185 .cpu_info = { 189 .cpu_info = {
186 CPU(0x10, "TI UltraSparc I (SpitFire)"), 190 CPU_PMU(0x10, "TI UltraSparc I (SpitFire)", "ultra12"),
187 CPU(0x11, "TI UltraSparc II (BlackBird)"), 191 CPU_PMU(0x11, "TI UltraSparc II (BlackBird)", "ultra12"),
188 CPU(0x12, "TI UltraSparc IIi (Sabre)"), 192 CPU_PMU(0x12, "TI UltraSparc IIi (Sabre)", "ultra12"),
189 CPU(0x13, "TI UltraSparc IIe (Hummingbird)"), 193 CPU_PMU(0x13, "TI UltraSparc IIe (Hummingbird)", "ultra12"),
190 CPU(-1, NULL) 194 CPU(-1, NULL)
191 }, 195 },
192 .fpu_info = { 196 .fpu_info = {
@@ -199,7 +203,7 @@ static const struct manufacturer_info __initconst manufacturer_info[] = {
199},{ 203},{
200 0x22, 204 0x22,
201 .cpu_info = { 205 .cpu_info = {
202 CPU(0x10, "TI UltraSparc I (SpitFire)"), 206 CPU_PMU(0x10, "TI UltraSparc I (SpitFire)", "ultra12"),
203 CPU(-1, NULL) 207 CPU(-1, NULL)
204 }, 208 },
205 .fpu_info = { 209 .fpu_info = {
@@ -209,12 +213,12 @@ static const struct manufacturer_info __initconst manufacturer_info[] = {
209},{ 213},{
210 0x3e, 214 0x3e,
211 .cpu_info = { 215 .cpu_info = {
212 CPU(0x14, "TI UltraSparc III (Cheetah)"), 216 CPU_PMU(0x14, "TI UltraSparc III (Cheetah)", "ultra3"),
213 CPU(0x15, "TI UltraSparc III+ (Cheetah+)"), 217 CPU_PMU(0x15, "TI UltraSparc III+ (Cheetah+)", "ultra3+"),
214 CPU(0x16, "TI UltraSparc IIIi (Jalapeno)"), 218 CPU_PMU(0x16, "TI UltraSparc IIIi (Jalapeno)", "ultra3i"),
215 CPU(0x18, "TI UltraSparc IV (Jaguar)"), 219 CPU_PMU(0x18, "TI UltraSparc IV (Jaguar)", "ultra3+"),
216 CPU(0x19, "TI UltraSparc IV+ (Panther)"), 220 CPU_PMU(0x19, "TI UltraSparc IV+ (Panther)", "ultra4+"),
217 CPU(0x22, "TI UltraSparc IIIi+ (Serrano)"), 221 CPU_PMU(0x22, "TI UltraSparc IIIi+ (Serrano)", "ultra3i"),
218 CPU(-1, NULL) 222 CPU(-1, NULL)
219 }, 223 },
220 .fpu_info = { 224 .fpu_info = {
@@ -234,29 +238,44 @@ static const struct manufacturer_info __initconst manufacturer_info[] = {
234 238
235const char *sparc_cpu_type; 239const char *sparc_cpu_type;
236const char *sparc_fpu_type; 240const char *sparc_fpu_type;
241const char *sparc_pmu_type;
237 242
238unsigned int fsr_storage; 243unsigned int fsr_storage;
239 244
240static void set_cpu_and_fpu(int psr_impl, int psr_vers, int fpu_vers) 245static void set_cpu_and_fpu(int psr_impl, int psr_vers, int fpu_vers)
241{ 246{
247 const struct manufacturer_info *manuf;
248 int i;
249
242 sparc_cpu_type = NULL; 250 sparc_cpu_type = NULL;
243 sparc_fpu_type = NULL; 251 sparc_fpu_type = NULL;
244 if (psr_impl < ARRAY_SIZE(manufacturer_info)) 252 sparc_pmu_type = NULL;
253 manuf = NULL;
254
255 for (i = 0; i < ARRAY_SIZE(manufacturer_info); i++)
256 {
257 if (psr_impl == manufacturer_info[i].psr_impl) {
258 manuf = &manufacturer_info[i];
259 break;
260 }
261 }
262 if (manuf != NULL)
245 { 263 {
246 const struct cpu_info *cpu; 264 const struct cpu_info *cpu;
247 const struct fpu_info *fpu; 265 const struct fpu_info *fpu;
248 266
249 cpu = &manufacturer_info[psr_impl].cpu_info[0]; 267 cpu = &manuf->cpu_info[0];
250 while (cpu->psr_vers != -1) 268 while (cpu->psr_vers != -1)
251 { 269 {
252 if (cpu->psr_vers == psr_vers) { 270 if (cpu->psr_vers == psr_vers) {
253 sparc_cpu_type = cpu->name; 271 sparc_cpu_type = cpu->name;
272 sparc_pmu_type = cpu->pmu_name;
254 sparc_fpu_type = "No FPU"; 273 sparc_fpu_type = "No FPU";
255 break; 274 break;
256 } 275 }
257 cpu++; 276 cpu++;
258 } 277 }
259 fpu = &manufacturer_info[psr_impl].fpu_info[0]; 278 fpu = &manuf->fpu_info[0];
260 while (fpu->fp_vers != -1) 279 while (fpu->fp_vers != -1)
261 { 280 {
262 if (fpu->fp_vers == fpu_vers) { 281 if (fpu->fp_vers == fpu_vers) {
@@ -278,6 +297,8 @@ static void set_cpu_and_fpu(int psr_impl, int psr_vers, int fpu_vers)
278 psr_impl, fpu_vers); 297 psr_impl, fpu_vers);
279 sparc_fpu_type = "Unknown FPU"; 298 sparc_fpu_type = "Unknown FPU";
280 } 299 }
300 if (sparc_pmu_type == NULL)
301 sparc_pmu_type = "Unknown PMU";
281} 302}
282 303
283#ifdef CONFIG_SPARC32 304#ifdef CONFIG_SPARC32
@@ -303,11 +324,13 @@ static void __init sun4v_cpu_probe(void)
303 case SUN4V_CHIP_NIAGARA1: 324 case SUN4V_CHIP_NIAGARA1:
304 sparc_cpu_type = "UltraSparc T1 (Niagara)"; 325 sparc_cpu_type = "UltraSparc T1 (Niagara)";
305 sparc_fpu_type = "UltraSparc T1 integrated FPU"; 326 sparc_fpu_type = "UltraSparc T1 integrated FPU";
327 sparc_pmu_type = "niagara";
306 break; 328 break;
307 329
308 case SUN4V_CHIP_NIAGARA2: 330 case SUN4V_CHIP_NIAGARA2:
309 sparc_cpu_type = "UltraSparc T2 (Niagara2)"; 331 sparc_cpu_type = "UltraSparc T2 (Niagara2)";
310 sparc_fpu_type = "UltraSparc T2 integrated FPU"; 332 sparc_fpu_type = "UltraSparc T2 integrated FPU";
333 sparc_pmu_type = "niagara2";
311 break; 334 break;
312 335
313 default: 336 default: