xref: /linux/arch/sparc/kernel/cpu.c (revision 0fd7ef1fe0e6e70c7851ce65a2eb8a8d3f49147e)
1d34dd829SSam Ravnborg /* cpu.c: Dinky routines to look for the kind of Sparc cpu
2d34dd829SSam Ravnborg  *        we are on.
3d34dd829SSam Ravnborg  *
4d34dd829SSam Ravnborg  * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
5d34dd829SSam Ravnborg  */
6d34dd829SSam Ravnborg 
7d34dd829SSam Ravnborg #include <linux/kernel.h>
86943f3daSSam Ravnborg #include <linux/module.h>
9d34dd829SSam Ravnborg #include <linux/init.h>
10d34dd829SSam Ravnborg #include <linux/smp.h>
11d34dd829SSam Ravnborg #include <linux/threads.h>
12d34dd829SSam Ravnborg 
13d34dd829SSam Ravnborg #include <asm/spitfire.h>
14d34dd829SSam Ravnborg #include <asm/oplib.h>
15d34dd829SSam Ravnborg #include <asm/page.h>
16d34dd829SSam Ravnborg #include <asm/head.h>
17d34dd829SSam Ravnborg #include <asm/psr.h>
18d34dd829SSam Ravnborg #include <asm/mbus.h>
19d34dd829SSam Ravnborg #include <asm/cpudata.h>
20d34dd829SSam Ravnborg 
21d34dd829SSam Ravnborg #include "kernel.h"
22d34dd829SSam Ravnborg 
23d34dd829SSam Ravnborg DEFINE_PER_CPU(cpuinfo_sparc, __cpu_data) = { 0 };
246943f3daSSam Ravnborg EXPORT_PER_CPU_SYMBOL(__cpu_data);
25d34dd829SSam Ravnborg 
26d34dd829SSam Ravnborg struct cpu_info {
27d34dd829SSam Ravnborg 	int psr_vers;
28d34dd829SSam Ravnborg 	const char *name;
29c3cf5e8cSDavid S. Miller 	const char *pmu_name;
30d34dd829SSam Ravnborg };
31d34dd829SSam Ravnborg 
32d34dd829SSam Ravnborg struct fpu_info {
33d34dd829SSam Ravnborg 	int fp_vers;
34d34dd829SSam Ravnborg 	const char *name;
35d34dd829SSam Ravnborg };
36d34dd829SSam Ravnborg 
37d34dd829SSam Ravnborg #define NOCPU 8
38d34dd829SSam Ravnborg #define NOFPU 8
39d34dd829SSam Ravnborg 
40d34dd829SSam Ravnborg struct manufacturer_info {
41d34dd829SSam Ravnborg 	int psr_impl;
42d34dd829SSam Ravnborg 	struct cpu_info cpu_info[NOCPU];
43d34dd829SSam Ravnborg 	struct fpu_info fpu_info[NOFPU];
44d34dd829SSam Ravnborg };
45d34dd829SSam Ravnborg 
46d34dd829SSam Ravnborg #define CPU(ver, _name) \
47d34dd829SSam Ravnborg { .psr_vers = ver, .name = _name }
48d34dd829SSam Ravnborg 
49c3cf5e8cSDavid S. Miller #define CPU_PMU(ver, _name, _pmu_name)	\
50c3cf5e8cSDavid S. Miller { .psr_vers = ver, .name = _name, .pmu_name = _pmu_name }
51c3cf5e8cSDavid S. Miller 
52d34dd829SSam Ravnborg #define FPU(ver, _name) \
53d34dd829SSam Ravnborg { .fp_vers = ver, .name = _name }
54d34dd829SSam Ravnborg 
55d34dd829SSam Ravnborg static const struct manufacturer_info __initconst manufacturer_info[] = {
56d34dd829SSam Ravnborg {
57d34dd829SSam Ravnborg 	0,
58d34dd829SSam Ravnborg 	/* Sun4/100, 4/200, SLC */
59d34dd829SSam Ravnborg 	.cpu_info = {
60d34dd829SSam Ravnborg 		CPU(0, "Fujitsu  MB86900/1A or LSI L64831 SparcKIT-40"),
61d34dd829SSam Ravnborg 		/* borned STP1012PGA */
62d34dd829SSam Ravnborg 		CPU(4,  "Fujitsu  MB86904"),
63d34dd829SSam Ravnborg 		CPU(5, "Fujitsu TurboSparc MB86907"),
64d34dd829SSam Ravnborg 		CPU(-1, NULL)
65d34dd829SSam Ravnborg 	},
66d34dd829SSam Ravnborg 	.fpu_info = {
67d34dd829SSam Ravnborg 		FPU(0, "Fujitsu MB86910 or Weitek WTL1164/5"),
68d34dd829SSam Ravnborg 		FPU(1, "Fujitsu MB86911 or Weitek WTL1164/5 or LSI L64831"),
69d34dd829SSam Ravnborg 		FPU(2, "LSI Logic L64802 or Texas Instruments ACT8847"),
70d34dd829SSam Ravnborg 		/* SparcStation SLC, SparcStation1 */
71d34dd829SSam Ravnborg 		FPU(3, "Weitek WTL3170/2"),
72d34dd829SSam Ravnborg 		/* SPARCstation-5 */
73d34dd829SSam Ravnborg 		FPU(4, "Lsi Logic/Meiko L64804 or compatible"),
74d34dd829SSam Ravnborg 		FPU(-1, NULL)
75d34dd829SSam Ravnborg 	}
76d34dd829SSam Ravnborg },{
77d34dd829SSam Ravnborg 	1,
78d34dd829SSam Ravnborg 	.cpu_info = {
79d34dd829SSam Ravnborg 		/* SparcStation2, SparcServer 490 & 690 */
80d34dd829SSam Ravnborg 		CPU(0, "LSI Logic Corporation - L64811"),
81d34dd829SSam Ravnborg 		/* SparcStation2 */
82d34dd829SSam Ravnborg 		CPU(1, "Cypress/ROSS CY7C601"),
83d34dd829SSam Ravnborg 		/* Embedded controller */
84d34dd829SSam Ravnborg 		CPU(3, "Cypress/ROSS CY7C611"),
85d34dd829SSam Ravnborg 		/* Ross Technologies HyperSparc */
86d34dd829SSam Ravnborg 		CPU(0xf, "ROSS HyperSparc RT620"),
87d34dd829SSam Ravnborg 		CPU(0xe, "ROSS HyperSparc RT625 or RT626"),
88d34dd829SSam Ravnborg 		CPU(-1, NULL)
89d34dd829SSam Ravnborg 	},
90d34dd829SSam Ravnborg 	.fpu_info = {
91d34dd829SSam Ravnborg 		FPU(0, "ROSS HyperSparc combined IU/FPU"),
92d34dd829SSam Ravnborg 		FPU(1, "Lsi Logic L64814"),
93d34dd829SSam Ravnborg 		FPU(2, "Texas Instruments TMS390-C602A"),
94d34dd829SSam Ravnborg 		FPU(3, "Cypress CY7C602 FPU"),
95d34dd829SSam Ravnborg 		FPU(-1, NULL)
96d34dd829SSam Ravnborg 	}
97d34dd829SSam Ravnborg },{
98d34dd829SSam Ravnborg 	2,
99d34dd829SSam Ravnborg 	.cpu_info = {
100d34dd829SSam Ravnborg 		/* ECL Implementation, CRAY S-MP Supercomputer... AIEEE! */
101d34dd829SSam Ravnborg 		/* Someone please write the code to support this beast! ;) */
102d34dd829SSam Ravnborg 		CPU(0, "Bipolar Integrated Technology - B5010"),
103d34dd829SSam Ravnborg 		CPU(-1, NULL)
104d34dd829SSam Ravnborg 	},
105d34dd829SSam Ravnborg 	.fpu_info = {
106d34dd829SSam Ravnborg 		FPU(-1, NULL)
107d34dd829SSam Ravnborg 	}
108d34dd829SSam Ravnborg },{
109d34dd829SSam Ravnborg 	3,
110d34dd829SSam Ravnborg 	.cpu_info = {
111d34dd829SSam Ravnborg 		CPU(0, "LSI Logic Corporation - unknown-type"),
112d34dd829SSam Ravnborg 		CPU(-1, NULL)
113d34dd829SSam Ravnborg 	},
114d34dd829SSam Ravnborg 	.fpu_info = {
115d34dd829SSam Ravnborg 		FPU(-1, NULL)
116d34dd829SSam Ravnborg 	}
117d34dd829SSam Ravnborg },{
118d34dd829SSam Ravnborg 	4,
119d34dd829SSam Ravnborg 	.cpu_info = {
120d34dd829SSam Ravnborg 		CPU(0, "Texas Instruments, Inc. - SuperSparc-(II)"),
121d34dd829SSam Ravnborg 		/* SparcClassic  --  borned STP1010TAB-50*/
122d34dd829SSam Ravnborg 		CPU(1, "Texas Instruments, Inc. - MicroSparc"),
123d34dd829SSam Ravnborg 		CPU(2, "Texas Instruments, Inc. - MicroSparc II"),
124d34dd829SSam Ravnborg 		CPU(3, "Texas Instruments, Inc. - SuperSparc 51"),
125d34dd829SSam Ravnborg 		CPU(4, "Texas Instruments, Inc. - SuperSparc 61"),
126d34dd829SSam Ravnborg 		CPU(5, "Texas Instruments, Inc. - unknown"),
127d34dd829SSam Ravnborg 		CPU(-1, NULL)
128d34dd829SSam Ravnborg 	},
129d34dd829SSam Ravnborg 	.fpu_info = {
130d34dd829SSam Ravnborg 		/* SuperSparc 50 module */
131d34dd829SSam Ravnborg 		FPU(0, "SuperSparc on-chip FPU"),
132d34dd829SSam Ravnborg 		/* SparcClassic */
133d34dd829SSam Ravnborg 		FPU(4, "TI MicroSparc on chip FPU"),
134d34dd829SSam Ravnborg 		FPU(-1, NULL)
135d34dd829SSam Ravnborg 	}
136d34dd829SSam Ravnborg },{
137d34dd829SSam Ravnborg 	5,
138d34dd829SSam Ravnborg 	.cpu_info = {
139d34dd829SSam Ravnborg 		CPU(0, "Matsushita - MN10501"),
140d34dd829SSam Ravnborg 		CPU(-1, NULL)
141d34dd829SSam Ravnborg 	},
142d34dd829SSam Ravnborg 	.fpu_info = {
143d34dd829SSam Ravnborg 		FPU(0, "Matsushita MN10501"),
144d34dd829SSam Ravnborg 		FPU(-1, NULL)
145d34dd829SSam Ravnborg 	}
146d34dd829SSam Ravnborg },{
147d34dd829SSam Ravnborg 	6,
148d34dd829SSam Ravnborg 	.cpu_info = {
149d34dd829SSam Ravnborg 		CPU(0, "Philips Corporation - unknown"),
150d34dd829SSam Ravnborg 		CPU(-1, NULL)
151d34dd829SSam Ravnborg 	},
152d34dd829SSam Ravnborg 	.fpu_info = {
153d34dd829SSam Ravnborg 		FPU(-1, NULL)
154d34dd829SSam Ravnborg 	}
155d34dd829SSam Ravnborg },{
156d34dd829SSam Ravnborg 	7,
157d34dd829SSam Ravnborg 	.cpu_info = {
158d34dd829SSam Ravnborg 		CPU(0, "Harvest VLSI Design Center, Inc. - unknown"),
159d34dd829SSam Ravnborg 		CPU(-1, NULL)
160d34dd829SSam Ravnborg 	},
161d34dd829SSam Ravnborg 	.fpu_info = {
162d34dd829SSam Ravnborg 		FPU(-1, NULL)
163d34dd829SSam Ravnborg 	}
164d34dd829SSam Ravnborg },{
165d34dd829SSam Ravnborg 	8,
166d34dd829SSam Ravnborg 	.cpu_info = {
167d34dd829SSam Ravnborg 		CPU(0, "Systems and Processes Engineering Corporation (SPEC)"),
168d34dd829SSam Ravnborg 		CPU(-1, NULL)
169d34dd829SSam Ravnborg 	},
170d34dd829SSam Ravnborg 	.fpu_info = {
171d34dd829SSam Ravnborg 		FPU(-1, NULL)
172d34dd829SSam Ravnborg 	}
173d34dd829SSam Ravnborg },{
174d34dd829SSam Ravnborg 	9,
175d34dd829SSam Ravnborg 	.cpu_info = {
176d34dd829SSam Ravnborg 		/* Gallium arsenide 200MHz, BOOOOGOOOOMIPS!!! */
177d34dd829SSam Ravnborg 		CPU(0, "Fujitsu or Weitek Power-UP"),
178d34dd829SSam Ravnborg 		CPU(1, "Fujitsu or Weitek Power-UP"),
179d34dd829SSam Ravnborg 		CPU(2, "Fujitsu or Weitek Power-UP"),
180d34dd829SSam Ravnborg 		CPU(3, "Fujitsu or Weitek Power-UP"),
181d34dd829SSam Ravnborg 		CPU(-1, NULL)
182d34dd829SSam Ravnborg 	},
183d34dd829SSam Ravnborg 	.fpu_info = {
184d34dd829SSam Ravnborg 		FPU(3, "Fujitsu or Weitek on-chip FPU"),
185d34dd829SSam Ravnborg 		FPU(-1, NULL)
186d34dd829SSam Ravnborg 	}
187d34dd829SSam Ravnborg },{
188d34dd829SSam Ravnborg 	0x17,
189d34dd829SSam Ravnborg 	.cpu_info = {
190c3cf5e8cSDavid S. Miller 		CPU_PMU(0x10, "TI UltraSparc I   (SpitFire)", "ultra12"),
191c3cf5e8cSDavid S. Miller 		CPU_PMU(0x11, "TI UltraSparc II  (BlackBird)", "ultra12"),
192c3cf5e8cSDavid S. Miller 		CPU_PMU(0x12, "TI UltraSparc IIi (Sabre)", "ultra12"),
193c3cf5e8cSDavid S. Miller 		CPU_PMU(0x13, "TI UltraSparc IIe (Hummingbird)", "ultra12"),
194d34dd829SSam Ravnborg 		CPU(-1, NULL)
195d34dd829SSam Ravnborg 	},
196d34dd829SSam Ravnborg 	.fpu_info = {
197d34dd829SSam Ravnborg 		FPU(0x10, "UltraSparc I integrated FPU"),
198d34dd829SSam Ravnborg 		FPU(0x11, "UltraSparc II integrated FPU"),
199d34dd829SSam Ravnborg 		FPU(0x12, "UltraSparc IIi integrated FPU"),
200d34dd829SSam Ravnborg 		FPU(0x13, "UltraSparc IIe integrated FPU"),
201d34dd829SSam Ravnborg 		FPU(-1, NULL)
202d34dd829SSam Ravnborg 	}
203d34dd829SSam Ravnborg },{
204d34dd829SSam Ravnborg 	0x22,
205d34dd829SSam Ravnborg 	.cpu_info = {
206c3cf5e8cSDavid S. Miller 		CPU_PMU(0x10, "TI UltraSparc I   (SpitFire)", "ultra12"),
207d34dd829SSam Ravnborg 		CPU(-1, NULL)
208d34dd829SSam Ravnborg 	},
209d34dd829SSam Ravnborg 	.fpu_info = {
210d34dd829SSam Ravnborg 		FPU(0x10, "UltraSparc I integrated FPU"),
211d34dd829SSam Ravnborg 		FPU(-1, NULL)
212d34dd829SSam Ravnborg 	}
213d34dd829SSam Ravnborg },{
214d34dd829SSam Ravnborg 	0x3e,
215d34dd829SSam Ravnborg 	.cpu_info = {
216c3cf5e8cSDavid S. Miller 		CPU_PMU(0x14, "TI UltraSparc III (Cheetah)", "ultra3"),
217c3cf5e8cSDavid S. Miller 		CPU_PMU(0x15, "TI UltraSparc III+ (Cheetah+)", "ultra3+"),
218c3cf5e8cSDavid S. Miller 		CPU_PMU(0x16, "TI UltraSparc IIIi (Jalapeno)", "ultra3i"),
219c3cf5e8cSDavid S. Miller 		CPU_PMU(0x18, "TI UltraSparc IV (Jaguar)", "ultra3+"),
220c3cf5e8cSDavid S. Miller 		CPU_PMU(0x19, "TI UltraSparc IV+ (Panther)", "ultra4+"),
221c3cf5e8cSDavid S. Miller 		CPU_PMU(0x22, "TI UltraSparc IIIi+ (Serrano)", "ultra3i"),
222d34dd829SSam Ravnborg 		CPU(-1, NULL)
223d34dd829SSam Ravnborg 	},
224d34dd829SSam Ravnborg 	.fpu_info = {
225d34dd829SSam Ravnborg 		FPU(0x14, "UltraSparc III integrated FPU"),
226d34dd829SSam Ravnborg 		FPU(0x15, "UltraSparc III+ integrated FPU"),
227d34dd829SSam Ravnborg 		FPU(0x16, "UltraSparc IIIi integrated FPU"),
228d34dd829SSam Ravnborg 		FPU(0x18, "UltraSparc IV integrated FPU"),
229d34dd829SSam Ravnborg 		FPU(0x19, "UltraSparc IV+ integrated FPU"),
230d34dd829SSam Ravnborg 		FPU(0x22, "UltraSparc IIIi+ integrated FPU"),
231d34dd829SSam Ravnborg 		FPU(-1, NULL)
232d34dd829SSam Ravnborg 	}
233d34dd829SSam Ravnborg }};
234d34dd829SSam Ravnborg 
235d34dd829SSam Ravnborg /* In order to get the fpu type correct, you need to take the IDPROM's
236d34dd829SSam Ravnborg  * machine type value into consideration too.  I will fix this.
237d34dd829SSam Ravnborg  */
238d34dd829SSam Ravnborg 
239d34dd829SSam Ravnborg const char *sparc_cpu_type;
240d34dd829SSam Ravnborg const char *sparc_fpu_type;
241c3cf5e8cSDavid S. Miller const char *sparc_pmu_type;
242d34dd829SSam Ravnborg 
243d34dd829SSam Ravnborg unsigned int fsr_storage;
244d34dd829SSam Ravnborg 
245d34dd829SSam Ravnborg static void set_cpu_and_fpu(int psr_impl, int psr_vers, int fpu_vers)
246d34dd829SSam Ravnborg {
247c275ce44SSam Ravnborg 	const struct manufacturer_info *manuf;
248c275ce44SSam Ravnborg 	int i;
249c275ce44SSam Ravnborg 
250d34dd829SSam Ravnborg 	sparc_cpu_type = NULL;
251d34dd829SSam Ravnborg 	sparc_fpu_type = NULL;
252c3cf5e8cSDavid S. Miller 	sparc_pmu_type = NULL;
253c275ce44SSam Ravnborg 	manuf = NULL;
254c275ce44SSam Ravnborg 
255c275ce44SSam Ravnborg 	for (i = 0; i < ARRAY_SIZE(manufacturer_info); i++)
256c275ce44SSam Ravnborg 	{
257c275ce44SSam Ravnborg 		if (psr_impl == manufacturer_info[i].psr_impl) {
258c275ce44SSam Ravnborg 			manuf = &manufacturer_info[i];
259c275ce44SSam Ravnborg 			break;
260c275ce44SSam Ravnborg 		}
261c275ce44SSam Ravnborg 	}
262c275ce44SSam Ravnborg 	if (manuf != NULL)
263d34dd829SSam Ravnborg 	{
264d34dd829SSam Ravnborg 		const struct cpu_info *cpu;
265d34dd829SSam Ravnborg 		const struct fpu_info *fpu;
266d34dd829SSam Ravnborg 
267c275ce44SSam Ravnborg 		cpu = &manuf->cpu_info[0];
268d34dd829SSam Ravnborg 		while (cpu->psr_vers != -1)
269d34dd829SSam Ravnborg 		{
270d34dd829SSam Ravnborg 			if (cpu->psr_vers == psr_vers) {
271d34dd829SSam Ravnborg 				sparc_cpu_type = cpu->name;
272c3cf5e8cSDavid S. Miller 				sparc_pmu_type = cpu->pmu_name;
273d34dd829SSam Ravnborg 				sparc_fpu_type = "No FPU";
274d34dd829SSam Ravnborg 				break;
275d34dd829SSam Ravnborg 			}
276d34dd829SSam Ravnborg 			cpu++;
277d34dd829SSam Ravnborg 		}
278c275ce44SSam Ravnborg 		fpu =  &manuf->fpu_info[0];
279d34dd829SSam Ravnborg 		while (fpu->fp_vers != -1)
280d34dd829SSam Ravnborg 		{
281d34dd829SSam Ravnborg 			if (fpu->fp_vers == fpu_vers) {
282d34dd829SSam Ravnborg 				sparc_fpu_type = fpu->name;
283d34dd829SSam Ravnborg 				break;
284d34dd829SSam Ravnborg 			}
285d34dd829SSam Ravnborg 			fpu++;
286d34dd829SSam Ravnborg 		}
287d34dd829SSam Ravnborg 	}
288d34dd829SSam Ravnborg 	if (sparc_cpu_type == NULL)
289d34dd829SSam Ravnborg 	{
290d34dd829SSam Ravnborg 		printk(KERN_ERR "CPU: Unknown chip, impl[0x%x] vers[0x%x]\n",
291d34dd829SSam Ravnborg 		       psr_impl, psr_vers);
292d34dd829SSam Ravnborg 		sparc_cpu_type = "Unknown CPU";
293d34dd829SSam Ravnborg 	}
294d34dd829SSam Ravnborg 	if (sparc_fpu_type == NULL)
295d34dd829SSam Ravnborg 	{
296d34dd829SSam Ravnborg 		printk(KERN_ERR "FPU: Unknown chip, impl[0x%x] vers[0x%x]\n",
297d34dd829SSam Ravnborg 		       psr_impl, fpu_vers);
298d34dd829SSam Ravnborg 		sparc_fpu_type = "Unknown FPU";
299d34dd829SSam Ravnborg 	}
300c3cf5e8cSDavid S. Miller 	if (sparc_pmu_type == NULL)
301c3cf5e8cSDavid S. Miller 		sparc_pmu_type = "Unknown PMU";
302d34dd829SSam Ravnborg }
303d34dd829SSam Ravnborg 
304d34dd829SSam Ravnborg #ifdef CONFIG_SPARC32
305d34dd829SSam Ravnborg void __cpuinit cpu_probe(void)
306d34dd829SSam Ravnborg {
307d34dd829SSam Ravnborg 	int psr_impl, psr_vers, fpu_vers;
308d34dd829SSam Ravnborg 	int psr;
309d34dd829SSam Ravnborg 
310d34dd829SSam Ravnborg 	psr_impl = ((get_psr() >> 28) & 0xf);
311d34dd829SSam Ravnborg 	psr_vers = ((get_psr() >> 24) & 0xf);
312d34dd829SSam Ravnborg 
313d34dd829SSam Ravnborg 	psr = get_psr();
314d34dd829SSam Ravnborg 	put_psr(psr | PSR_EF);
315*0fd7ef1fSKonrad Eisele #ifdef CONFIG_SPARC_LEON
316*0fd7ef1fSKonrad Eisele 	fpu_vers = 7;
317*0fd7ef1fSKonrad Eisele #else
318d34dd829SSam Ravnborg 	fpu_vers = ((get_fsr() >> 17) & 0x7);
319*0fd7ef1fSKonrad Eisele #endif
320*0fd7ef1fSKonrad Eisele 
321d34dd829SSam Ravnborg 	put_psr(psr);
322d34dd829SSam Ravnborg 
323d34dd829SSam Ravnborg 	set_cpu_and_fpu(psr_impl, psr_vers, fpu_vers);
324d34dd829SSam Ravnborg }
325d34dd829SSam Ravnborg #else
326d34dd829SSam Ravnborg static void __init sun4v_cpu_probe(void)
327d34dd829SSam Ravnborg {
328d34dd829SSam Ravnborg 	switch (sun4v_chip_type) {
329d34dd829SSam Ravnborg 	case SUN4V_CHIP_NIAGARA1:
330d34dd829SSam Ravnborg 		sparc_cpu_type = "UltraSparc T1 (Niagara)";
331d34dd829SSam Ravnborg 		sparc_fpu_type = "UltraSparc T1 integrated FPU";
332c3cf5e8cSDavid S. Miller 		sparc_pmu_type = "niagara";
333d34dd829SSam Ravnborg 		break;
334d34dd829SSam Ravnborg 
335d34dd829SSam Ravnborg 	case SUN4V_CHIP_NIAGARA2:
336d34dd829SSam Ravnborg 		sparc_cpu_type = "UltraSparc T2 (Niagara2)";
337d34dd829SSam Ravnborg 		sparc_fpu_type = "UltraSparc T2 integrated FPU";
338c3cf5e8cSDavid S. Miller 		sparc_pmu_type = "niagara2";
339d34dd829SSam Ravnborg 		break;
340d34dd829SSam Ravnborg 
341d34dd829SSam Ravnborg 	default:
342d34dd829SSam Ravnborg 		printk(KERN_WARNING "CPU: Unknown sun4v cpu type [%s]\n",
343d34dd829SSam Ravnborg 		       prom_cpu_compatible);
344d34dd829SSam Ravnborg 		sparc_cpu_type = "Unknown SUN4V CPU";
345d34dd829SSam Ravnborg 		sparc_fpu_type = "Unknown SUN4V FPU";
346d34dd829SSam Ravnborg 		break;
347d34dd829SSam Ravnborg 	}
348d34dd829SSam Ravnborg }
349d34dd829SSam Ravnborg 
350d34dd829SSam Ravnborg static int __init cpu_type_probe(void)
351d34dd829SSam Ravnborg {
352d34dd829SSam Ravnborg 	if (tlb_type == hypervisor) {
353d34dd829SSam Ravnborg 		sun4v_cpu_probe();
354d34dd829SSam Ravnborg 	} else {
355d34dd829SSam Ravnborg 		unsigned long ver;
356d34dd829SSam Ravnborg 		int manuf, impl;
357d34dd829SSam Ravnborg 
358d34dd829SSam Ravnborg 		__asm__ __volatile__("rdpr %%ver, %0" : "=r" (ver));
359d34dd829SSam Ravnborg 
360d34dd829SSam Ravnborg 		manuf = ((ver >> 48) & 0xffff);
361d34dd829SSam Ravnborg 		impl = ((ver >> 32) & 0xffff);
362d34dd829SSam Ravnborg 		set_cpu_and_fpu(manuf, impl, impl);
363d34dd829SSam Ravnborg 	}
364d34dd829SSam Ravnborg 	return 0;
365d34dd829SSam Ravnborg }
366d34dd829SSam Ravnborg 
367d34dd829SSam Ravnborg arch_initcall(cpu_type_probe);
368d34dd829SSam Ravnborg #endif
369