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/config.h>
8 #include <linux/kernel.h>
9 #include <linux/init.h>
10 #include <linux/sched.h>
11 #include <linux/smp.h>
13 #include <asm/system.h>
14 #include <asm/fpumacro.h>
15 #include <asm/cpudata.h>
17 DEFINE_PER_CPU(cpuinfo_sparc
, __cpu_data
) = { 0 };
22 char* cpu_name
; /* should be enough I hope... */
32 struct cpu_fp_info linux_sparc_fpu
[] = {
33 { 0x17, 0x10, 0, "UltraSparc I integrated FPU"},
34 { 0x22, 0x10, 0, "UltraSparc I integrated FPU"},
35 { 0x17, 0x11, 0, "UltraSparc II integrated FPU"},
36 { 0x17, 0x12, 0, "UltraSparc IIi integrated FPU"},
37 { 0x17, 0x13, 0, "UltraSparc IIe integrated FPU"},
38 { 0x3e, 0x14, 0, "UltraSparc III integrated FPU"},
39 { 0x3e, 0x15, 0, "UltraSparc III+ integrated FPU"},
40 { 0x3e, 0x16, 0, "UltraSparc IIIi integrated FPU"},
41 { 0x3e, 0x18, 0, "UltraSparc IV integrated FPU"},
42 { 0x3e, 0x19, 0, "UltraSparc IV+ integrated FPU"},
43 { 0x3e, 0x22, 0, "UltraSparc IIIi+ integrated FPU"},
46 #define NSPARCFPU (sizeof(linux_sparc_fpu)/sizeof(struct cpu_fp_info))
48 struct cpu_iu_info linux_sparc_chips
[] = {
49 { 0x17, 0x10, "TI UltraSparc I (SpitFire)"},
50 { 0x22, 0x10, "TI UltraSparc I (SpitFire)"},
51 { 0x17, 0x11, "TI UltraSparc II (BlackBird)"},
52 { 0x17, 0x12, "TI UltraSparc IIi (Sabre)"},
53 { 0x17, 0x13, "TI UltraSparc IIe (Hummingbird)"},
54 { 0x3e, 0x14, "TI UltraSparc III (Cheetah)"},
55 { 0x3e, 0x15, "TI UltraSparc III+ (Cheetah+)"},
56 { 0x3e, 0x16, "TI UltraSparc IIIi (Jalapeno)"},
57 { 0x3e, 0x18, "TI UltraSparc IV (Jaguar)"},
58 { 0x3e, 0x19, "TI UltraSparc IV+ (Panther)"},
59 { 0x3e, 0x22, "TI UltraSparc IIIi+ (Serrano)"},
62 #define NSPARCCHIPS (sizeof(linux_sparc_chips)/sizeof(struct cpu_iu_info))
64 char *sparc_cpu_type
= "cpu-oops";
65 char *sparc_fpu_type
= "fpu-oops";
67 unsigned int fsr_storage
;
69 void __init
cpu_probe(void)
71 unsigned long ver
, fpu_vers
, manuf
, impl
, fprs
;
76 __asm__
__volatile__ ("rdpr %%ver, %0; stx %%fsr, [%1]"
81 manuf
= ((ver
>> 48) & 0xffff);
82 impl
= ((ver
>> 32) & 0xffff);
84 fpu_vers
= ((fpu_vers
>> 17) & 0x7);
87 for (i
= 0; i
< NSPARCCHIPS
; i
++) {
88 if (linux_sparc_chips
[i
].manuf
== manuf
) {
89 if (linux_sparc_chips
[i
].impl
== impl
) {
91 linux_sparc_chips
[i
].cpu_name
;
97 if (i
== NSPARCCHIPS
) {
98 /* Maybe it is a cheetah+ derivative, report it as cheetah+
99 * in that case until we learn the real names.
106 printk("DEBUG: manuf[%lx] impl[%lx]\n",
109 sparc_cpu_type
= "Unknown CPU";
112 for (i
= 0; i
< NSPARCFPU
; i
++) {
113 if (linux_sparc_fpu
[i
].manuf
== manuf
&&
114 linux_sparc_fpu
[i
].impl
== impl
) {
115 if (linux_sparc_fpu
[i
].fpu_vers
== fpu_vers
) {
117 linux_sparc_fpu
[i
].fp_name
;
123 if (i
== NSPARCFPU
) {
124 printk("DEBUG: manuf[%lx] impl[%lx] fsr.vers[%lx]\n",
125 manuf
, impl
, fpu_vers
);
126 sparc_fpu_type
= "Unknown FPU";