blob: 5134c53d536dcf34dd23370a6009703957cee7ad [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * arch/ppc64/kernel/cputable.c
3 *
4 * Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org)
5 *
6 * Modifications for ppc64:
7 * Copyright (C) 2003 Dave Engebretsen <engebret@us.ibm.com>
Stephen Rothwell8d15a3e2005-08-03 14:40:16 +10008 *
Linus Torvalds1da177e2005-04-16 15:20:36 -07009 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version
12 * 2 of the License, or (at your option) any later version.
13 */
14
15#include <linux/config.h>
16#include <linux/string.h>
17#include <linux/sched.h>
18#include <linux/threads.h>
19#include <linux/init.h>
20#include <linux/module.h>
21
Anton Blanchard8fef0302005-09-06 14:57:52 +100022#include <asm/oprofile_impl.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070023#include <asm/cputable.h>
24
25struct cpu_spec* cur_cpu_spec = NULL;
26EXPORT_SYMBOL(cur_cpu_spec);
27
28/* NOTE:
29 * Unlike ppc32, ppc64 will only call this once for the boot CPU, it's
30 * the responsibility of the appropriate CPU save/restore functions to
31 * eventually copy these settings over. Those save/restore aren't yet
32 * part of the cputable though. That has to be fixed for both ppc32
33 * and ppc64
34 */
35extern void __setup_cpu_power3(unsigned long offset, struct cpu_spec* spec);
36extern void __setup_cpu_power4(unsigned long offset, struct cpu_spec* spec);
37extern void __setup_cpu_ppc970(unsigned long offset, struct cpu_spec* spec);
Arnd Bergmannfef1c772005-06-23 09:43:37 +100038extern void __setup_cpu_be(unsigned long offset, struct cpu_spec* spec);
Linus Torvalds1da177e2005-04-16 15:20:36 -070039
Linus Torvalds1da177e2005-04-16 15:20:36 -070040struct cpu_spec cpu_specs[] = {
Anton Blanchard315a6992005-07-07 17:56:11 -070041 { /* Power3 */
42 .pvr_mask = 0xffff0000,
43 .pvr_value = 0x00400000,
44 .cpu_name = "POWER3 (630)",
Kumar Gala10b35d92005-09-23 14:08:58 -050045 .cpu_features = CPU_FTRS_POWER3,
46 .cpu_user_features = COMMON_USER_PPC64,
Anton Blanchard315a6992005-07-07 17:56:11 -070047 .icache_bsize = 128,
48 .dcache_bsize = 128,
Anton Blanchardfd5b4372005-09-06 14:47:49 +100049 .num_pmcs = 8,
Anton Blanchard315a6992005-07-07 17:56:11 -070050 .cpu_setup = __setup_cpu_power3,
Anton Blanchard0fdf0b82005-09-06 14:59:16 +100051#ifdef CONFIG_OPROFILE
Anton Blanchard1a410d82005-09-06 14:53:57 +100052 .oprofile_cpu_type = "ppc64/power3",
Anton Blanchard8fef0302005-09-06 14:57:52 +100053 .oprofile_model = &op_model_rs64,
Anton Blanchard0fdf0b82005-09-06 14:59:16 +100054#endif
Anton Blanchard315a6992005-07-07 17:56:11 -070055 },
56 { /* Power3+ */
57 .pvr_mask = 0xffff0000,
58 .pvr_value = 0x00410000,
59 .cpu_name = "POWER3 (630+)",
Kumar Gala10b35d92005-09-23 14:08:58 -050060 .cpu_features = CPU_FTRS_POWER3,
Anton Blanchard315a6992005-07-07 17:56:11 -070061 .cpu_user_features = COMMON_USER_PPC64,
62 .icache_bsize = 128,
63 .dcache_bsize = 128,
Anton Blanchardfd5b4372005-09-06 14:47:49 +100064 .num_pmcs = 8,
Anton Blanchard315a6992005-07-07 17:56:11 -070065 .cpu_setup = __setup_cpu_power3,
Anton Blanchard0fdf0b82005-09-06 14:59:16 +100066#ifdef CONFIG_OPROFILE
Anton Blanchard1a410d82005-09-06 14:53:57 +100067 .oprofile_cpu_type = "ppc64/power3",
Anton Blanchard8fef0302005-09-06 14:57:52 +100068 .oprofile_model = &op_model_rs64,
Anton Blanchard0fdf0b82005-09-06 14:59:16 +100069#endif
Anton Blanchard315a6992005-07-07 17:56:11 -070070 },
71 { /* Northstar */
72 .pvr_mask = 0xffff0000,
73 .pvr_value = 0x00330000,
74 .cpu_name = "RS64-II (northstar)",
Kumar Gala10b35d92005-09-23 14:08:58 -050075 .cpu_features = CPU_FTRS_RS64,
Anton Blanchard315a6992005-07-07 17:56:11 -070076 .cpu_user_features = COMMON_USER_PPC64,
77 .icache_bsize = 128,
78 .dcache_bsize = 128,
Anton Blanchardfd5b4372005-09-06 14:47:49 +100079 .num_pmcs = 8,
Anton Blanchard315a6992005-07-07 17:56:11 -070080 .cpu_setup = __setup_cpu_power3,
Anton Blanchard0fdf0b82005-09-06 14:59:16 +100081#ifdef CONFIG_OPROFILE
Anton Blanchard1a410d82005-09-06 14:53:57 +100082 .oprofile_cpu_type = "ppc64/rs64",
Anton Blanchard8fef0302005-09-06 14:57:52 +100083 .oprofile_model = &op_model_rs64,
Anton Blanchard0fdf0b82005-09-06 14:59:16 +100084#endif
Anton Blanchard315a6992005-07-07 17:56:11 -070085 },
86 { /* Pulsar */
87 .pvr_mask = 0xffff0000,
88 .pvr_value = 0x00340000,
89 .cpu_name = "RS64-III (pulsar)",
Kumar Gala10b35d92005-09-23 14:08:58 -050090 .cpu_features = CPU_FTRS_RS64,
Anton Blanchard315a6992005-07-07 17:56:11 -070091 .cpu_user_features = COMMON_USER_PPC64,
92 .icache_bsize = 128,
93 .dcache_bsize = 128,
Anton Blanchardfd5b4372005-09-06 14:47:49 +100094 .num_pmcs = 8,
Anton Blanchard315a6992005-07-07 17:56:11 -070095 .cpu_setup = __setup_cpu_power3,
Anton Blanchard0fdf0b82005-09-06 14:59:16 +100096#ifdef CONFIG_OPROFILE
Anton Blanchard1a410d82005-09-06 14:53:57 +100097 .oprofile_cpu_type = "ppc64/rs64",
Anton Blanchard8fef0302005-09-06 14:57:52 +100098 .oprofile_model = &op_model_rs64,
Anton Blanchard0fdf0b82005-09-06 14:59:16 +100099#endif
Anton Blanchard315a6992005-07-07 17:56:11 -0700100 },
101 { /* I-star */
102 .pvr_mask = 0xffff0000,
103 .pvr_value = 0x00360000,
104 .cpu_name = "RS64-III (icestar)",
Kumar Gala10b35d92005-09-23 14:08:58 -0500105 .cpu_features = CPU_FTRS_RS64,
Anton Blanchard315a6992005-07-07 17:56:11 -0700106 .cpu_user_features = COMMON_USER_PPC64,
107 .icache_bsize = 128,
108 .dcache_bsize = 128,
Anton Blanchardfd5b4372005-09-06 14:47:49 +1000109 .num_pmcs = 8,
Anton Blanchard315a6992005-07-07 17:56:11 -0700110 .cpu_setup = __setup_cpu_power3,
Anton Blanchard0fdf0b82005-09-06 14:59:16 +1000111#ifdef CONFIG_OPROFILE
Anton Blanchard1a410d82005-09-06 14:53:57 +1000112 .oprofile_cpu_type = "ppc64/rs64",
Anton Blanchard8fef0302005-09-06 14:57:52 +1000113 .oprofile_model = &op_model_rs64,
Anton Blanchard0fdf0b82005-09-06 14:59:16 +1000114#endif
Anton Blanchard315a6992005-07-07 17:56:11 -0700115 },
116 { /* S-star */
117 .pvr_mask = 0xffff0000,
118 .pvr_value = 0x00370000,
119 .cpu_name = "RS64-IV (sstar)",
Kumar Gala10b35d92005-09-23 14:08:58 -0500120 .cpu_features = CPU_FTRS_RS64,
Anton Blanchard315a6992005-07-07 17:56:11 -0700121 .cpu_user_features = COMMON_USER_PPC64,
122 .icache_bsize = 128,
123 .dcache_bsize = 128,
Anton Blanchardfd5b4372005-09-06 14:47:49 +1000124 .num_pmcs = 8,
Anton Blanchard315a6992005-07-07 17:56:11 -0700125 .cpu_setup = __setup_cpu_power3,
Anton Blanchard0fdf0b82005-09-06 14:59:16 +1000126#ifdef CONFIG_OPROFILE
Anton Blanchard1a410d82005-09-06 14:53:57 +1000127 .oprofile_cpu_type = "ppc64/rs64",
Anton Blanchard8fef0302005-09-06 14:57:52 +1000128 .oprofile_model = &op_model_rs64,
Anton Blanchard0fdf0b82005-09-06 14:59:16 +1000129#endif
Anton Blanchard315a6992005-07-07 17:56:11 -0700130 },
131 { /* Power4 */
132 .pvr_mask = 0xffff0000,
133 .pvr_value = 0x00350000,
134 .cpu_name = "POWER4 (gp)",
Kumar Gala10b35d92005-09-23 14:08:58 -0500135 .cpu_features = CPU_FTRS_POWER4,
Anton Blanchard315a6992005-07-07 17:56:11 -0700136 .cpu_user_features = COMMON_USER_PPC64,
137 .icache_bsize = 128,
138 .dcache_bsize = 128,
Anton Blanchardfd5b4372005-09-06 14:47:49 +1000139 .num_pmcs = 8,
Anton Blanchard315a6992005-07-07 17:56:11 -0700140 .cpu_setup = __setup_cpu_power4,
Anton Blanchard0fdf0b82005-09-06 14:59:16 +1000141#ifdef CONFIG_OPROFILE
Anton Blanchard1a410d82005-09-06 14:53:57 +1000142 .oprofile_cpu_type = "ppc64/power4",
Anton Blanchard8fef0302005-09-06 14:57:52 +1000143 .oprofile_model = &op_model_rs64,
Anton Blanchard0fdf0b82005-09-06 14:59:16 +1000144#endif
Anton Blanchard315a6992005-07-07 17:56:11 -0700145 },
146 { /* Power4+ */
147 .pvr_mask = 0xffff0000,
148 .pvr_value = 0x00380000,
149 .cpu_name = "POWER4+ (gq)",
Kumar Gala10b35d92005-09-23 14:08:58 -0500150 .cpu_features = CPU_FTRS_POWER4,
Anton Blanchard315a6992005-07-07 17:56:11 -0700151 .cpu_user_features = COMMON_USER_PPC64,
152 .icache_bsize = 128,
153 .dcache_bsize = 128,
Anton Blanchardfd5b4372005-09-06 14:47:49 +1000154 .num_pmcs = 8,
Anton Blanchard315a6992005-07-07 17:56:11 -0700155 .cpu_setup = __setup_cpu_power4,
Anton Blanchard0fdf0b82005-09-06 14:59:16 +1000156#ifdef CONFIG_OPROFILE
Anton Blanchard1a410d82005-09-06 14:53:57 +1000157 .oprofile_cpu_type = "ppc64/power4",
Anton Blanchard8fef0302005-09-06 14:57:52 +1000158 .oprofile_model = &op_model_power4,
Anton Blanchard0fdf0b82005-09-06 14:59:16 +1000159#endif
Anton Blanchard315a6992005-07-07 17:56:11 -0700160 },
161 { /* PPC970 */
162 .pvr_mask = 0xffff0000,
163 .pvr_value = 0x00390000,
164 .cpu_name = "PPC970",
Kumar Gala10b35d92005-09-23 14:08:58 -0500165 .cpu_features = CPU_FTRS_PPC970,
Anton Blanchard315a6992005-07-07 17:56:11 -0700166 .cpu_user_features = COMMON_USER_PPC64 |
167 PPC_FEATURE_HAS_ALTIVEC_COMP,
168 .icache_bsize = 128,
169 .dcache_bsize = 128,
Anton Blanchardfd5b4372005-09-06 14:47:49 +1000170 .num_pmcs = 8,
Anton Blanchard315a6992005-07-07 17:56:11 -0700171 .cpu_setup = __setup_cpu_ppc970,
Anton Blanchard0fdf0b82005-09-06 14:59:16 +1000172#ifdef CONFIG_OPROFILE
Anton Blanchard1a410d82005-09-06 14:53:57 +1000173 .oprofile_cpu_type = "ppc64/970",
Anton Blanchard8fef0302005-09-06 14:57:52 +1000174 .oprofile_model = &op_model_power4,
Anton Blanchard0fdf0b82005-09-06 14:59:16 +1000175#endif
Anton Blanchard315a6992005-07-07 17:56:11 -0700176 },
177 { /* PPC970FX */
178 .pvr_mask = 0xffff0000,
179 .pvr_value = 0x003c0000,
180 .cpu_name = "PPC970FX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500181 .cpu_features = CPU_FTRS_PPC970,
Anton Blanchard315a6992005-07-07 17:56:11 -0700182 .cpu_user_features = COMMON_USER_PPC64 |
183 PPC_FEATURE_HAS_ALTIVEC_COMP,
184 .icache_bsize = 128,
185 .dcache_bsize = 128,
Anton Blanchardfd5b4372005-09-06 14:47:49 +1000186 .num_pmcs = 8,
Anton Blanchard315a6992005-07-07 17:56:11 -0700187 .cpu_setup = __setup_cpu_ppc970,
Anton Blanchard0fdf0b82005-09-06 14:59:16 +1000188#ifdef CONFIG_OPROFILE
Anton Blanchard1a410d82005-09-06 14:53:57 +1000189 .oprofile_cpu_type = "ppc64/970",
Anton Blanchard8fef0302005-09-06 14:57:52 +1000190 .oprofile_model = &op_model_power4,
Anton Blanchard0fdf0b82005-09-06 14:59:16 +1000191#endif
Anton Blanchard315a6992005-07-07 17:56:11 -0700192 },
Olof Johanssonf264cc22005-07-13 01:11:44 -0700193 { /* PPC970MP */
194 .pvr_mask = 0xffff0000,
195 .pvr_value = 0x00440000,
196 .cpu_name = "PPC970MP",
Kumar Gala10b35d92005-09-23 14:08:58 -0500197 .cpu_features = CPU_FTRS_PPC970,
Olof Johanssonf264cc22005-07-13 01:11:44 -0700198 .cpu_user_features = COMMON_USER_PPC64 |
199 PPC_FEATURE_HAS_ALTIVEC_COMP,
200 .icache_bsize = 128,
201 .dcache_bsize = 128,
202 .cpu_setup = __setup_cpu_ppc970,
Anton Blanchard0fdf0b82005-09-06 14:59:16 +1000203#ifdef CONFIG_OPROFILE
Anton Blanchard1a410d82005-09-06 14:53:57 +1000204 .oprofile_cpu_type = "ppc64/970",
Anton Blanchard8fef0302005-09-06 14:57:52 +1000205 .oprofile_model = &op_model_power4,
Anton Blanchard0fdf0b82005-09-06 14:59:16 +1000206#endif
Olof Johanssonf264cc22005-07-13 01:11:44 -0700207 },
Anton Blanchard315a6992005-07-07 17:56:11 -0700208 { /* Power5 */
209 .pvr_mask = 0xffff0000,
210 .pvr_value = 0x003a0000,
211 .cpu_name = "POWER5 (gr)",
Kumar Gala10b35d92005-09-23 14:08:58 -0500212 .cpu_features = CPU_FTRS_POWER5,
Anton Blanchard315a6992005-07-07 17:56:11 -0700213 .cpu_user_features = COMMON_USER_PPC64,
214 .icache_bsize = 128,
215 .dcache_bsize = 128,
Anton Blanchardfd5b4372005-09-06 14:47:49 +1000216 .num_pmcs = 6,
Anton Blanchard315a6992005-07-07 17:56:11 -0700217 .cpu_setup = __setup_cpu_power4,
Anton Blanchard0fdf0b82005-09-06 14:59:16 +1000218#ifdef CONFIG_OPROFILE
Anton Blanchard1a410d82005-09-06 14:53:57 +1000219 .oprofile_cpu_type = "ppc64/power5",
Anton Blanchard8fef0302005-09-06 14:57:52 +1000220 .oprofile_model = &op_model_power4,
Anton Blanchard0fdf0b82005-09-06 14:59:16 +1000221#endif
Anton Blanchard315a6992005-07-07 17:56:11 -0700222 },
223 { /* Power5 */
224 .pvr_mask = 0xffff0000,
225 .pvr_value = 0x003b0000,
226 .cpu_name = "POWER5 (gs)",
Kumar Gala10b35d92005-09-23 14:08:58 -0500227 .cpu_features = CPU_FTRS_POWER5,
Anton Blanchard315a6992005-07-07 17:56:11 -0700228 .cpu_user_features = COMMON_USER_PPC64,
229 .icache_bsize = 128,
230 .dcache_bsize = 128,
Anton Blanchardfd5b4372005-09-06 14:47:49 +1000231 .num_pmcs = 6,
Anton Blanchard315a6992005-07-07 17:56:11 -0700232 .cpu_setup = __setup_cpu_power4,
Anton Blanchard0fdf0b82005-09-06 14:59:16 +1000233#ifdef CONFIG_OPROFILE
Anton Blanchard1a410d82005-09-06 14:53:57 +1000234 .oprofile_cpu_type = "ppc64/power5",
Anton Blanchard8fef0302005-09-06 14:57:52 +1000235 .oprofile_model = &op_model_power4,
Anton Blanchard0fdf0b82005-09-06 14:59:16 +1000236#endif
Anton Blanchard315a6992005-07-07 17:56:11 -0700237 },
238 { /* BE DD1.x */
239 .pvr_mask = 0xffff0000,
240 .pvr_value = 0x00700000,
Kumar Gala10b35d92005-09-23 14:08:58 -0500241 .cpu_name = "Cell Broadband Engine",
242 .cpu_features = CPU_FTRS_CELL,
Anton Blanchard315a6992005-07-07 17:56:11 -0700243 .cpu_user_features = COMMON_USER_PPC64 |
244 PPC_FEATURE_HAS_ALTIVEC_COMP,
245 .icache_bsize = 128,
246 .dcache_bsize = 128,
247 .cpu_setup = __setup_cpu_be,
Anton Blanchard315a6992005-07-07 17:56:11 -0700248 },
249 { /* default match */
250 .pvr_mask = 0x00000000,
251 .pvr_value = 0x00000000,
252 .cpu_name = "POWER4 (compatible)",
Kumar Gala10b35d92005-09-23 14:08:58 -0500253 .cpu_features = CPU_FTRS_COMPATIBLE,
Anton Blanchard315a6992005-07-07 17:56:11 -0700254 .cpu_user_features = COMMON_USER_PPC64,
255 .icache_bsize = 128,
256 .dcache_bsize = 128,
Anton Blanchardfd5b4372005-09-06 14:47:49 +1000257 .num_pmcs = 6,
Anton Blanchard315a6992005-07-07 17:56:11 -0700258 .cpu_setup = __setup_cpu_power4,
Anton Blanchard315a6992005-07-07 17:56:11 -0700259 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700260};