aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/cpu.c
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2008-12-03 06:11:52 -0500
committerDavid S. Miller <davem@davemloft.net>2008-12-04 12:17:21 -0500
commita88b5ba8bd8ac18aad65ee6c6a254e2e74876db3 (patch)
treeeb3d0ffaf53c3f7ec6083752c2097cecd1cb892a /arch/sparc64/kernel/cpu.c
parentd670bd4f803c8b646acd20f3ba21e65458293faf (diff)
sparc,sparc64: unify kernel/
o Move all files from sparc64/kernel/ to sparc/kernel - rename as appropriate o Update sparc/Makefile to the changes o Update sparc/kernel/Makefile to include the sparc64 files NOTE: This commit changes link order on sparc64! Link order had to change for either of sparc32 and sparc64. And assuming sparc64 see more testing than sparc32 change link order on sparc64 where issues will be caught faster. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/cpu.c')
-rw-r--r--arch/sparc64/kernel/cpu.c166
1 files changed, 0 insertions, 166 deletions
diff --git a/arch/sparc64/kernel/cpu.c b/arch/sparc64/kernel/cpu.c
deleted file mode 100644
index 0c9ac83ed0a8..000000000000
--- a/arch/sparc64/kernel/cpu.c
+++ /dev/null
@@ -1,166 +0,0 @@
1/* cpu.c: Dinky routines to look for the kind of Sparc cpu
2 * we are on.
3 *
4 * Copyright (C) 1996, 2007, 2008 David S. Miller (davem@davemloft.net)
5 */
6
7#include <linux/kernel.h>
8#include <linux/init.h>
9#include <linux/sched.h>
10#include <linux/smp.h>
11#include <asm/asi.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>
17
18#include "entry.h"
19
20DEFINE_PER_CPU(cpuinfo_sparc, __cpu_data) = { 0 };
21
22struct cpu_chip_info {
23 unsigned short manuf;
24 unsigned short impl;
25 const char *cpu_name;
26 const char *fp_name;
27};
28
29static const struct cpu_chip_info cpu_chips[] = {
30 {
31 .manuf = 0x17,
32 .impl = 0x10,
33 .cpu_name = "TI UltraSparc I (SpitFire)",
34 .fp_name = "UltraSparc I integrated FPU",
35 },
36 {
37 .manuf = 0x22,
38 .impl = 0x10,
39 .cpu_name = "TI UltraSparc I (SpitFire)",
40 .fp_name = "UltraSparc I integrated FPU",
41 },
42 {
43 .manuf = 0x17,
44 .impl = 0x11,
45 .cpu_name = "TI UltraSparc II (BlackBird)",
46 .fp_name = "UltraSparc II integrated FPU",
47 },
48 {
49 .manuf = 0x17,
50 .impl = 0x12,
51 .cpu_name = "TI UltraSparc IIi (Sabre)",
52 .fp_name = "UltraSparc IIi integrated FPU",
53 },
54 {
55 .manuf = 0x17,
56 .impl = 0x13,
57 .cpu_name = "TI UltraSparc IIe (Hummingbird)",
58 .fp_name = "UltraSparc IIe integrated FPU",
59 },
60 {
61 .manuf = 0x3e,
62 .impl = 0x14,
63 .cpu_name = "TI UltraSparc III (Cheetah)",
64 .fp_name = "UltraSparc III integrated FPU",
65 },
66 {
67 .manuf = 0x3e,
68 .impl = 0x15,
69 .cpu_name = "TI UltraSparc III+ (Cheetah+)",
70 .fp_name = "UltraSparc III+ integrated FPU",
71 },
72 {
73 .manuf = 0x3e,
74 .impl = 0x16,
75 .cpu_name = "TI UltraSparc IIIi (Jalapeno)",
76 .fp_name = "UltraSparc IIIi integrated FPU",
77 },
78 {
79 .manuf = 0x3e,
80 .impl = 0x18,
81 .cpu_name = "TI UltraSparc IV (Jaguar)",
82 .fp_name = "UltraSparc IV integrated FPU",
83 },
84 {
85 .manuf = 0x3e,
86 .impl = 0x19,
87 .cpu_name = "TI UltraSparc IV+ (Panther)",
88 .fp_name = "UltraSparc IV+ integrated FPU",
89 },
90 {
91 .manuf = 0x3e,
92 .impl = 0x22,
93 .cpu_name = "TI UltraSparc IIIi+ (Serrano)",
94 .fp_name = "UltraSparc IIIi+ integrated FPU",
95 },
96};
97
98#define NSPARCCHIPS ARRAY_SIZE(linux_sparc_chips)
99
100const char *sparc_cpu_type;
101const char *sparc_fpu_type;
102
103static void __init sun4v_cpu_probe(void)
104{
105 switch (sun4v_chip_type) {
106 case SUN4V_CHIP_NIAGARA1:
107 sparc_cpu_type = "UltraSparc T1 (Niagara)";
108 sparc_fpu_type = "UltraSparc T1 integrated FPU";
109 break;
110
111 case SUN4V_CHIP_NIAGARA2:
112 sparc_cpu_type = "UltraSparc T2 (Niagara2)";
113 sparc_fpu_type = "UltraSparc T2 integrated FPU";
114 break;
115
116 default:
117 printk(KERN_WARNING "CPU: Unknown sun4v cpu type [%s]\n",
118 prom_cpu_compatible);
119 sparc_cpu_type = "Unknown SUN4V CPU";
120 sparc_fpu_type = "Unknown SUN4V FPU";
121 break;
122 }
123}
124
125static const struct cpu_chip_info * __init find_cpu_chip(unsigned short manuf,
126 unsigned short impl)
127{
128 int i;
129
130 for (i = 0; i < ARRAY_SIZE(cpu_chips); i++) {
131 const struct cpu_chip_info *p = &cpu_chips[i];
132
133 if (p->manuf == manuf && p->impl == impl)
134 return p;
135 }
136 return NULL;
137}
138
139static int __init cpu_type_probe(void)
140{
141 if (tlb_type == hypervisor) {
142 sun4v_cpu_probe();
143 } else {
144 unsigned long ver, manuf, impl;
145 const struct cpu_chip_info *p;
146
147 __asm__ __volatile__("rdpr %%ver, %0" : "=r" (ver));
148
149 manuf = ((ver >> 48) & 0xffff);
150 impl = ((ver >> 32) & 0xffff);
151
152 p = find_cpu_chip(manuf, impl);
153 if (p) {
154 sparc_cpu_type = p->cpu_name;
155 sparc_fpu_type = p->fp_name;
156 } else {
157 printk(KERN_ERR "CPU: Unknown chip, manuf[%lx] impl[%lx]\n",
158 manuf, impl);
159 sparc_cpu_type = "Unknown CPU";
160 sparc_fpu_type = "Unknown FPU";
161 }
162 }
163 return 0;
164}
165
166arch_initcall(cpu_type_probe);