1 /* cpu.c: Dinky routines to look for the kind of Sparc cpu
4 * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
7 #include <linux/kernel.h>
8 #include <linux/init.h>
10 #include <linux/threads.h>
11 #include <asm/oplib.h>
16 #include <asm/cpudata.h>
20 DEFINE_PER_CPU(cpuinfo_sparc
, __cpu_data
) = { 0 };
35 struct manufacturer_info
{
37 struct cpu_info cpu_info
[NOCPU
];
38 struct fpu_info fpu_info
[NOFPU
];
41 #define CPU(ver, _name) \
42 { .psr_vers = ver, .name = _name }
44 #define FPU(ver, _name) \
45 { .fp_vers = ver, .name = _name }
47 static const struct manufacturer_info __initconst manufacturer_info
[] = {
50 /* Sun4/100, 4/200, SLC */
52 CPU(0, "Fujitsu MB86900/1A or LSI L64831 SparcKIT-40"),
53 /* borned STP1012PGA */
54 CPU(4, "Fujitsu MB86904"),
55 CPU(5, "Fujitsu TurboSparc MB86907"),
59 FPU(0, "Fujitsu MB86910 or Weitek WTL1164/5"),
60 FPU(1, "Fujitsu MB86911 or Weitek WTL1164/5 or LSI L64831"),
61 FPU(2, "LSI Logic L64802 or Texas Instruments ACT8847"),
62 /* SparcStation SLC, SparcStation1 */
63 FPU(3, "Weitek WTL3170/2"),
65 FPU(4, "Lsi Logic/Meiko L64804 or compatible"),
71 /* SparcStation2, SparcServer 490 & 690 */
72 CPU(0, "LSI Logic Corporation - L64811"),
74 CPU(1, "Cypress/ROSS CY7C601"),
75 /* Embedded controller */
76 CPU(3, "Cypress/ROSS CY7C611"),
77 /* Ross Technologies HyperSparc */
78 CPU(0xf, "ROSS HyperSparc RT620"),
79 CPU(0xe, "ROSS HyperSparc RT625 or RT626"),
83 FPU(0, "ROSS HyperSparc combined IU/FPU"),
84 FPU(1, "Lsi Logic L64814"),
85 FPU(2, "Texas Instruments TMS390-C602A"),
86 FPU(3, "Cypress CY7C602 FPU"),
92 /* ECL Implementation, CRAY S-MP Supercomputer... AIEEE! */
93 /* Someone please write the code to support this beast! ;) */
94 CPU(0, "Bipolar Integrated Technology - B5010"),
103 CPU(0, "LSI Logic Corporation - unknown-type"),
112 CPU(0, "Texas Instruments, Inc. - SuperSparc-(II)"),
113 /* SparcClassic -- borned STP1010TAB-50*/
114 CPU(1, "Texas Instruments, Inc. - MicroSparc"),
115 CPU(2, "Texas Instruments, Inc. - MicroSparc II"),
116 CPU(3, "Texas Instruments, Inc. - SuperSparc 51"),
117 CPU(4, "Texas Instruments, Inc. - SuperSparc 61"),
118 CPU(5, "Texas Instruments, Inc. - unknown"),
122 /* SuperSparc 50 module */
123 FPU(0, "SuperSparc on-chip FPU"),
125 FPU(4, "TI MicroSparc on chip FPU"),
131 CPU(0, "Matsushita - MN10501"),
135 FPU(0, "Matsushita MN10501"),
141 CPU(0, "Philips Corporation - unknown"),
150 CPU(0, "Harvest VLSI Design Center, Inc. - unknown"),
159 CPU(0, "Systems and Processes Engineering Corporation (SPEC)"),
168 /* Gallium arsenide 200MHz, BOOOOGOOOOMIPS!!! */
169 CPU(0, "Fujitsu or Weitek Power-UP"),
170 CPU(1, "Fujitsu or Weitek Power-UP"),
171 CPU(2, "Fujitsu or Weitek Power-UP"),
172 CPU(3, "Fujitsu or Weitek Power-UP"),
176 FPU(3, "Fujitsu or Weitek on-chip FPU"),
181 /* In order to get the fpu type correct, you need to take the IDPROM's
182 * machine type value into consideration too. I will fix this.
185 const char *sparc_cpu_type
;
186 const char *sparc_fpu_type
;
188 unsigned int fsr_storage
;
190 static void set_cpu_and_fpu(int psr_impl
, int psr_vers
, int fpu_vers
)
192 sparc_cpu_type
= NULL
;
193 sparc_fpu_type
= NULL
;
194 if (psr_impl
< ARRAY_SIZE(manufacturer_info
))
196 const struct cpu_info
*cpu
;
197 const struct fpu_info
*fpu
;
199 cpu
= &manufacturer_info
[psr_impl
].cpu_info
[0];
200 while (cpu
->psr_vers
!= -1)
202 if (cpu
->psr_vers
== psr_vers
) {
203 sparc_cpu_type
= cpu
->name
;
204 sparc_fpu_type
= "No FPU";
209 fpu
= &manufacturer_info
[psr_impl
].fpu_info
[0];
210 while (fpu
->fp_vers
!= -1)
212 if (fpu
->fp_vers
== fpu_vers
) {
213 sparc_fpu_type
= fpu
->name
;
219 if (sparc_cpu_type
== NULL
)
221 printk(KERN_ERR
"CPU: Unknown chip, impl[0x%x] vers[0x%x]\n",
223 sparc_cpu_type
= "Unknown CPU";
225 if (sparc_fpu_type
== NULL
)
227 printk(KERN_ERR
"FPU: Unknown chip, impl[0x%x] vers[0x%x]\n",
229 sparc_fpu_type
= "Unknown FPU";
233 void __cpuinit
cpu_probe(void)
235 int psr_impl
, psr_vers
, fpu_vers
;
238 psr_impl
= ((get_psr() >> 28) & 0xf);
239 psr_vers
= ((get_psr() >> 24) & 0xf);
242 put_psr(psr
| PSR_EF
);
243 fpu_vers
= ((get_fsr() >> 17) & 0x7);
246 set_cpu_and_fpu(psr_impl
, psr_vers
, fpu_vers
);