blob: 8662cf053fa0557b645576a34dea95f921f94b5b [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 * Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org)
3 *
Stephen Rothwell49209602005-10-12 15:55:09 +10004 * Modifications for ppc64:
5 * Copyright (C) 2003 Dave Engebretsen <engebret@us.ibm.com>
6 *
Linus Torvalds1da177e2005-04-16 15:20:36 -07007 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 */
12
Linus Torvalds1da177e2005-04-16 15:20:36 -070013#include <linux/string.h>
14#include <linux/sched.h>
15#include <linux/threads.h>
16#include <linux/init.h>
Kumar Gala400d2212005-09-27 15:13:12 -050017#include <linux/module.h>
18
19#include <asm/oprofile_impl.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070020#include <asm/cputable.h>
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +100021#include <asm/prom.h> /* for PTRRELOC on ARCH=ppc */
Linus Torvalds1da177e2005-04-16 15:20:36 -070022
Kumar Gala400d2212005-09-27 15:13:12 -050023struct cpu_spec* cur_cpu_spec = NULL;
Stephen Rothwell49209602005-10-12 15:55:09 +100024EXPORT_SYMBOL(cur_cpu_spec);
Linus Torvalds1da177e2005-04-16 15:20:36 -070025
Stephen Rothwell49209602005-10-12 15:55:09 +100026/* NOTE:
27 * Unlike ppc32, ppc64 will only call this once for the boot CPU, it's
28 * the responsibility of the appropriate CPU save/restore functions to
29 * eventually copy these settings over. Those save/restore aren't yet
30 * part of the cputable though. That has to be fixed for both ppc32
31 * and ppc64
32 */
Geoff Levandb26f1002006-05-19 14:24:18 +100033#ifdef CONFIG_PPC32
Valentine Barshak81127532007-09-22 00:46:57 +100034extern void __setup_cpu_440ep(unsigned long offset, struct cpu_spec* spec);
35extern void __setup_cpu_440epx(unsigned long offset, struct cpu_spec* spec);
Valentine Barshak340ffd22007-09-22 00:50:09 +100036extern void __setup_cpu_440grx(unsigned long offset, struct cpu_spec* spec);
Kumar Gala400d2212005-09-27 15:13:12 -050037extern void __setup_cpu_603(unsigned long offset, struct cpu_spec* spec);
38extern void __setup_cpu_604(unsigned long offset, struct cpu_spec* spec);
39extern void __setup_cpu_750(unsigned long offset, struct cpu_spec* spec);
40extern void __setup_cpu_750cx(unsigned long offset, struct cpu_spec* spec);
41extern void __setup_cpu_750fx(unsigned long offset, struct cpu_spec* spec);
42extern void __setup_cpu_7400(unsigned long offset, struct cpu_spec* spec);
43extern void __setup_cpu_7410(unsigned long offset, struct cpu_spec* spec);
44extern void __setup_cpu_745x(unsigned long offset, struct cpu_spec* spec);
Stephen Rothwell49209602005-10-12 15:55:09 +100045#endif /* CONFIG_PPC32 */
Olof Johanssonf39b7a52006-08-11 00:07:08 -050046#ifdef CONFIG_PPC64
Kumar Gala400d2212005-09-27 15:13:12 -050047extern void __setup_cpu_ppc970(unsigned long offset, struct cpu_spec* spec);
Olof Johansson5b43d202006-10-04 23:41:41 -050048extern void __setup_cpu_ppc970MP(unsigned long offset, struct cpu_spec* spec);
Olof Johansson11999192007-02-04 16:36:51 -060049extern void __setup_cpu_pa6t(unsigned long offset, struct cpu_spec* spec);
Stephen Rothwell40d244d2007-02-12 22:10:48 +110050extern void __restore_cpu_pa6t(void);
Olof Johanssonf39b7a52006-08-11 00:07:08 -050051extern void __restore_cpu_ppc970(void);
52#endif /* CONFIG_PPC64 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070053
Linus Torvalds1da177e2005-04-16 15:20:36 -070054/* This table only contains "desktop" CPUs, it need to be filled with embedded
55 * ones as well...
56 */
Stephen Rothwell49209602005-10-12 15:55:09 +100057#define COMMON_USER (PPC_FEATURE_32 | PPC_FEATURE_HAS_FPU | \
58 PPC_FEATURE_HAS_MMU)
59#define COMMON_USER_PPC64 (COMMON_USER | PPC_FEATURE_64)
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +110060#define COMMON_USER_POWER4 (COMMON_USER_PPC64 | PPC_FEATURE_POWER4)
Benjamin Herrenschmidtaa5cb022006-03-01 15:07:07 +110061#define COMMON_USER_POWER5 (COMMON_USER_PPC64 | PPC_FEATURE_POWER5 |\
62 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
63#define COMMON_USER_POWER5_PLUS (COMMON_USER_PPC64 | PPC_FEATURE_POWER5_PLUS|\
64 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
Anton Blanchard03054d52006-04-29 09:51:06 +100065#define COMMON_USER_POWER6 (COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_05 |\
Paul Mackerrasfab5db92006-06-07 16:14:40 +100066 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \
67 PPC_FEATURE_TRUE_LE)
Olof Johanssonb3ebd1d2006-09-06 14:35:57 -050068#define COMMON_USER_PA6T (COMMON_USER_PPC64 | PPC_FEATURE_PA6T |\
69 PPC_FEATURE_TRUE_LE | \
70 PPC_FEATURE_HAS_ALTIVEC_COMP)
Paul Mackerras80f15dc2006-01-14 10:11:39 +110071#define COMMON_USER_BOOKE (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \
72 PPC_FEATURE_BOOKE)
Linus Torvalds1da177e2005-04-16 15:20:36 -070073
Paul Mackerras87a72f92007-10-04 14:18:01 +100074static struct cpu_spec __initdata cpu_specs[] = {
Stephen Rothwell49209602005-10-12 15:55:09 +100075#ifdef CONFIG_PPC64
76 { /* Power3 */
77 .pvr_mask = 0xffff0000,
78 .pvr_value = 0x00400000,
79 .cpu_name = "POWER3 (630)",
80 .cpu_features = CPU_FTRS_POWER3,
Paul Mackerrasfab5db92006-06-07 16:14:40 +100081 .cpu_user_features = COMMON_USER_PPC64|PPC_FEATURE_PPC_LE,
Stephen Rothwell49209602005-10-12 15:55:09 +100082 .icache_bsize = 128,
83 .dcache_bsize = 128,
84 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -060085 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +100086 .oprofile_cpu_type = "ppc64/power3",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +000087 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +110088 .platform = "power3",
Stephen Rothwell49209602005-10-12 15:55:09 +100089 },
90 { /* Power3+ */
91 .pvr_mask = 0xffff0000,
92 .pvr_value = 0x00410000,
93 .cpu_name = "POWER3 (630+)",
94 .cpu_features = CPU_FTRS_POWER3,
Paul Mackerrasfab5db92006-06-07 16:14:40 +100095 .cpu_user_features = COMMON_USER_PPC64|PPC_FEATURE_PPC_LE,
Stephen Rothwell49209602005-10-12 15:55:09 +100096 .icache_bsize = 128,
97 .dcache_bsize = 128,
98 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -060099 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000100 .oprofile_cpu_type = "ppc64/power3",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000101 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100102 .platform = "power3",
Stephen Rothwell49209602005-10-12 15:55:09 +1000103 },
104 { /* Northstar */
105 .pvr_mask = 0xffff0000,
106 .pvr_value = 0x00330000,
107 .cpu_name = "RS64-II (northstar)",
108 .cpu_features = CPU_FTRS_RS64,
109 .cpu_user_features = COMMON_USER_PPC64,
110 .icache_bsize = 128,
111 .dcache_bsize = 128,
112 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600113 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000114 .oprofile_cpu_type = "ppc64/rs64",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000115 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100116 .platform = "rs64",
Stephen Rothwell49209602005-10-12 15:55:09 +1000117 },
118 { /* Pulsar */
119 .pvr_mask = 0xffff0000,
120 .pvr_value = 0x00340000,
121 .cpu_name = "RS64-III (pulsar)",
122 .cpu_features = CPU_FTRS_RS64,
123 .cpu_user_features = COMMON_USER_PPC64,
124 .icache_bsize = 128,
125 .dcache_bsize = 128,
126 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600127 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000128 .oprofile_cpu_type = "ppc64/rs64",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000129 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100130 .platform = "rs64",
Stephen Rothwell49209602005-10-12 15:55:09 +1000131 },
132 { /* I-star */
133 .pvr_mask = 0xffff0000,
134 .pvr_value = 0x00360000,
135 .cpu_name = "RS64-III (icestar)",
136 .cpu_features = CPU_FTRS_RS64,
137 .cpu_user_features = COMMON_USER_PPC64,
138 .icache_bsize = 128,
139 .dcache_bsize = 128,
140 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600141 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000142 .oprofile_cpu_type = "ppc64/rs64",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000143 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100144 .platform = "rs64",
Stephen Rothwell49209602005-10-12 15:55:09 +1000145 },
146 { /* S-star */
147 .pvr_mask = 0xffff0000,
148 .pvr_value = 0x00370000,
149 .cpu_name = "RS64-IV (sstar)",
150 .cpu_features = CPU_FTRS_RS64,
151 .cpu_user_features = COMMON_USER_PPC64,
152 .icache_bsize = 128,
153 .dcache_bsize = 128,
154 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600155 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000156 .oprofile_cpu_type = "ppc64/rs64",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000157 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100158 .platform = "rs64",
Stephen Rothwell49209602005-10-12 15:55:09 +1000159 },
160 { /* Power4 */
161 .pvr_mask = 0xffff0000,
162 .pvr_value = 0x00350000,
163 .cpu_name = "POWER4 (gp)",
164 .cpu_features = CPU_FTRS_POWER4,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100165 .cpu_user_features = COMMON_USER_POWER4,
Stephen Rothwell49209602005-10-12 15:55:09 +1000166 .icache_bsize = 128,
167 .dcache_bsize = 128,
168 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600169 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000170 .oprofile_cpu_type = "ppc64/power4",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000171 .oprofile_type = PPC_OPROFILE_POWER4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100172 .platform = "power4",
Stephen Rothwell49209602005-10-12 15:55:09 +1000173 },
174 { /* Power4+ */
175 .pvr_mask = 0xffff0000,
176 .pvr_value = 0x00380000,
177 .cpu_name = "POWER4+ (gq)",
178 .cpu_features = CPU_FTRS_POWER4,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100179 .cpu_user_features = COMMON_USER_POWER4,
Stephen Rothwell49209602005-10-12 15:55:09 +1000180 .icache_bsize = 128,
181 .dcache_bsize = 128,
182 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600183 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000184 .oprofile_cpu_type = "ppc64/power4",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000185 .oprofile_type = PPC_OPROFILE_POWER4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100186 .platform = "power4",
Stephen Rothwell49209602005-10-12 15:55:09 +1000187 },
188 { /* PPC970 */
189 .pvr_mask = 0xffff0000,
190 .pvr_value = 0x00390000,
191 .cpu_name = "PPC970",
192 .cpu_features = CPU_FTRS_PPC970,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100193 .cpu_user_features = COMMON_USER_POWER4 |
Stephen Rothwell49209602005-10-12 15:55:09 +1000194 PPC_FEATURE_HAS_ALTIVEC_COMP,
195 .icache_bsize = 128,
196 .dcache_bsize = 128,
197 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600198 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000199 .cpu_setup = __setup_cpu_ppc970,
Olof Johanssonf39b7a52006-08-11 00:07:08 -0500200 .cpu_restore = __restore_cpu_ppc970,
Stephen Rothwell49209602005-10-12 15:55:09 +1000201 .oprofile_cpu_type = "ppc64/970",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000202 .oprofile_type = PPC_OPROFILE_POWER4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100203 .platform = "ppc970",
Stephen Rothwell49209602005-10-12 15:55:09 +1000204 },
Stephen Rothwell49209602005-10-12 15:55:09 +1000205 { /* PPC970FX */
206 .pvr_mask = 0xffff0000,
207 .pvr_value = 0x003c0000,
208 .cpu_name = "PPC970FX",
Stephen Rothwell49209602005-10-12 15:55:09 +1000209 .cpu_features = CPU_FTRS_PPC970,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100210 .cpu_user_features = COMMON_USER_POWER4 |
Stephen Rothwell49209602005-10-12 15:55:09 +1000211 PPC_FEATURE_HAS_ALTIVEC_COMP,
212 .icache_bsize = 128,
213 .dcache_bsize = 128,
214 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600215 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000216 .cpu_setup = __setup_cpu_ppc970,
Olof Johanssonf39b7a52006-08-11 00:07:08 -0500217 .cpu_restore = __restore_cpu_ppc970,
Stephen Rothwell49209602005-10-12 15:55:09 +1000218 .oprofile_cpu_type = "ppc64/970",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000219 .oprofile_type = PPC_OPROFILE_POWER4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100220 .platform = "ppc970",
Stephen Rothwell49209602005-10-12 15:55:09 +1000221 },
Olof Johansson3546e812007-02-26 00:35:14 -0600222 { /* PPC970MP DD1.0 - no DEEPNAP, use regular 970 init */
223 .pvr_mask = 0xffffffff,
224 .pvr_value = 0x00440100,
225 .cpu_name = "PPC970MP",
226 .cpu_features = CPU_FTRS_PPC970,
227 .cpu_user_features = COMMON_USER_POWER4 |
228 PPC_FEATURE_HAS_ALTIVEC_COMP,
229 .icache_bsize = 128,
230 .dcache_bsize = 128,
231 .num_pmcs = 8,
Anton Blanchard2fae4982007-05-19 15:22:41 +1000232 .pmc_type = PPC_PMC_IBM,
Olof Johansson3546e812007-02-26 00:35:14 -0600233 .cpu_setup = __setup_cpu_ppc970,
234 .cpu_restore = __restore_cpu_ppc970,
235 .oprofile_cpu_type = "ppc64/970MP",
236 .oprofile_type = PPC_OPROFILE_POWER4,
237 .platform = "ppc970",
238 },
Stephen Rothwell49209602005-10-12 15:55:09 +1000239 { /* PPC970MP */
240 .pvr_mask = 0xffff0000,
241 .pvr_value = 0x00440000,
242 .cpu_name = "PPC970MP",
243 .cpu_features = CPU_FTRS_PPC970,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100244 .cpu_user_features = COMMON_USER_POWER4 |
Stephen Rothwell49209602005-10-12 15:55:09 +1000245 PPC_FEATURE_HAS_ALTIVEC_COMP,
246 .icache_bsize = 128,
247 .dcache_bsize = 128,
Anton Blanchard87af41b2006-05-05 05:44:26 +1000248 .num_pmcs = 8,
Anton Blanchard2fae4982007-05-19 15:22:41 +1000249 .pmc_type = PPC_PMC_IBM,
Olof Johansson5b43d202006-10-04 23:41:41 -0500250 .cpu_setup = __setup_cpu_ppc970MP,
Olof Johanssonf39b7a52006-08-11 00:07:08 -0500251 .cpu_restore = __restore_cpu_ppc970,
Mike Wolffecb3522006-11-21 14:41:54 -0600252 .oprofile_cpu_type = "ppc64/970MP",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000253 .oprofile_type = PPC_OPROFILE_POWER4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100254 .platform = "ppc970",
Stephen Rothwell49209602005-10-12 15:55:09 +1000255 },
Jake Moilanen362ff7b2006-10-18 10:47:22 -0500256 { /* PPC970GX */
257 .pvr_mask = 0xffff0000,
258 .pvr_value = 0x00450000,
259 .cpu_name = "PPC970GX",
260 .cpu_features = CPU_FTRS_PPC970,
261 .cpu_user_features = COMMON_USER_POWER4 |
262 PPC_FEATURE_HAS_ALTIVEC_COMP,
263 .icache_bsize = 128,
264 .dcache_bsize = 128,
265 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600266 .pmc_type = PPC_PMC_IBM,
Jake Moilanen362ff7b2006-10-18 10:47:22 -0500267 .cpu_setup = __setup_cpu_ppc970,
268 .oprofile_cpu_type = "ppc64/970",
269 .oprofile_type = PPC_OPROFILE_POWER4,
270 .platform = "ppc970",
271 },
Benjamin Herrenschmidt3c726f82005-11-07 11:06:55 +1100272 { /* Power5 GR */
Stephen Rothwell49209602005-10-12 15:55:09 +1000273 .pvr_mask = 0xffff0000,
274 .pvr_value = 0x003a0000,
275 .cpu_name = "POWER5 (gr)",
276 .cpu_features = CPU_FTRS_POWER5,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100277 .cpu_user_features = COMMON_USER_POWER5,
Stephen Rothwell49209602005-10-12 15:55:09 +1000278 .icache_bsize = 128,
279 .dcache_bsize = 128,
280 .num_pmcs = 6,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600281 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000282 .oprofile_cpu_type = "ppc64/power5",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000283 .oprofile_type = PPC_OPROFILE_POWER4,
Michael Neulinge78dbc82006-06-08 14:42:34 +1000284 /* SIHV / SIPR bits are implemented on POWER4+ (GQ)
285 * and above but only works on POWER5 and above
286 */
287 .oprofile_mmcra_sihv = MMCRA_SIHV,
288 .oprofile_mmcra_sipr = MMCRA_SIPR,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100289 .platform = "power5",
Stephen Rothwell49209602005-10-12 15:55:09 +1000290 },
Mike Wolf31a12ce2007-07-10 13:13:47 -0500291 { /* Power5++ */
292 .pvr_mask = 0xffffff00,
293 .pvr_value = 0x003b0300,
294 .cpu_name = "POWER5+ (gs)",
295 .cpu_features = CPU_FTRS_POWER5,
296 .cpu_user_features = COMMON_USER_POWER5_PLUS,
297 .icache_bsize = 128,
298 .dcache_bsize = 128,
299 .num_pmcs = 6,
300 .oprofile_cpu_type = "ppc64/power5++",
301 .oprofile_type = PPC_OPROFILE_POWER4,
302 .oprofile_mmcra_sihv = MMCRA_SIHV,
303 .oprofile_mmcra_sipr = MMCRA_SIPR,
304 .platform = "power5+",
305 },
Benjamin Herrenschmidt3c726f82005-11-07 11:06:55 +1100306 { /* Power5 GS */
Stephen Rothwell49209602005-10-12 15:55:09 +1000307 .pvr_mask = 0xffff0000,
308 .pvr_value = 0x003b0000,
Anton Blanchard834608f2006-01-09 15:42:30 +1100309 .cpu_name = "POWER5+ (gs)",
Stephen Rothwell49209602005-10-12 15:55:09 +1000310 .cpu_features = CPU_FTRS_POWER5,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100311 .cpu_user_features = COMMON_USER_POWER5_PLUS,
Stephen Rothwell49209602005-10-12 15:55:09 +1000312 .icache_bsize = 128,
313 .dcache_bsize = 128,
314 .num_pmcs = 6,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600315 .pmc_type = PPC_PMC_IBM,
Anton Blanchard834608f2006-01-09 15:42:30 +1100316 .oprofile_cpu_type = "ppc64/power5+",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000317 .oprofile_type = PPC_OPROFILE_POWER4,
Michael Neulinge78dbc82006-06-08 14:42:34 +1000318 .oprofile_mmcra_sihv = MMCRA_SIHV,
319 .oprofile_mmcra_sipr = MMCRA_SIPR,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100320 .platform = "power5+",
Stephen Rothwell49209602005-10-12 15:55:09 +1000321 },
Paul Mackerras974a76f2006-11-10 20:38:53 +1100322 { /* POWER6 in P5+ mode; 2.04-compliant processor */
323 .pvr_mask = 0xffffffff,
324 .pvr_value = 0x0f000001,
325 .cpu_name = "POWER5+",
326 .cpu_features = CPU_FTRS_POWER5,
327 .cpu_user_features = COMMON_USER_POWER5_PLUS,
328 .icache_bsize = 128,
329 .dcache_bsize = 128,
Paul Mackerras974a76f2006-11-10 20:38:53 +1100330 .platform = "power5+",
331 },
Anton Blanchard03054d52006-04-29 09:51:06 +1000332 { /* Power6 */
333 .pvr_mask = 0xffff0000,
334 .pvr_value = 0x003e0000,
Paul Mackerras974a76f2006-11-10 20:38:53 +1100335 .cpu_name = "POWER6 (raw)",
336 .cpu_features = CPU_FTRS_POWER6,
337 .cpu_user_features = COMMON_USER_POWER6 |
338 PPC_FEATURE_POWER6_EXT,
339 .icache_bsize = 128,
340 .dcache_bsize = 128,
341 .num_pmcs = 6,
Anton Blanchard2fae4982007-05-19 15:22:41 +1000342 .pmc_type = PPC_PMC_IBM,
Paul Mackerras974a76f2006-11-10 20:38:53 +1100343 .oprofile_cpu_type = "ppc64/power6",
344 .oprofile_type = PPC_OPROFILE_POWER4,
345 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
346 .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
347 .oprofile_mmcra_clear = POWER6_MMCRA_THRM |
348 POWER6_MMCRA_OTHER,
349 .platform = "power6x",
350 },
351 { /* 2.05-compliant processor, i.e. Power6 "architected" mode */
352 .pvr_mask = 0xffffffff,
353 .pvr_value = 0x0f000002,
354 .cpu_name = "POWER6 (architected)",
Anton Blanchard03054d52006-04-29 09:51:06 +1000355 .cpu_features = CPU_FTRS_POWER6,
356 .cpu_user_features = COMMON_USER_POWER6,
357 .icache_bsize = 128,
358 .dcache_bsize = 128,
Anton Blanchard03054d52006-04-29 09:51:06 +1000359 .platform = "power6",
360 },
Arnd Bergmannc902be72006-01-04 19:55:53 +0000361 { /* Cell Broadband Engine */
Stephen Rothwell49209602005-10-12 15:55:09 +1000362 .pvr_mask = 0xffff0000,
363 .pvr_value = 0x00700000,
364 .cpu_name = "Cell Broadband Engine",
365 .cpu_features = CPU_FTRS_CELL,
366 .cpu_user_features = COMMON_USER_PPC64 |
Benjamin Herrenschmidtaa5cb022006-03-01 15:07:07 +1100367 PPC_FEATURE_CELL | PPC_FEATURE_HAS_ALTIVEC_COMP |
368 PPC_FEATURE_SMT,
Stephen Rothwell49209602005-10-12 15:55:09 +1000369 .icache_bsize = 128,
370 .dcache_bsize = 128,
Maynard Johnson18f21902006-11-20 18:45:16 +0100371 .num_pmcs = 4,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600372 .pmc_type = PPC_PMC_IBM,
Maynard Johnson18f21902006-11-20 18:45:16 +0100373 .oprofile_cpu_type = "ppc64/cell-be",
374 .oprofile_type = PPC_OPROFILE_CELL,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100375 .platform = "ppc-cell-be",
Stephen Rothwell49209602005-10-12 15:55:09 +1000376 },
Olof Johanssonb3ebd1d2006-09-06 14:35:57 -0500377 { /* PA Semi PA6T */
378 .pvr_mask = 0x7fff0000,
379 .pvr_value = 0x00900000,
380 .cpu_name = "PA6T",
381 .cpu_features = CPU_FTRS_PA6T,
382 .cpu_user_features = COMMON_USER_PA6T,
383 .icache_bsize = 64,
384 .dcache_bsize = 64,
385 .num_pmcs = 6,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600386 .pmc_type = PPC_PMC_PA6T,
Olof Johansson11999192007-02-04 16:36:51 -0600387 .cpu_setup = __setup_cpu_pa6t,
388 .cpu_restore = __restore_cpu_pa6t,
Olof Johansson25fc5302007-04-18 16:38:21 +1000389 .oprofile_cpu_type = "ppc64/pa6t",
390 .oprofile_type = PPC_OPROFILE_PA6T,
Olof Johanssonb3ebd1d2006-09-06 14:35:57 -0500391 .platform = "pa6t",
392 },
Stephen Rothwell49209602005-10-12 15:55:09 +1000393 { /* default match */
394 .pvr_mask = 0x00000000,
395 .pvr_value = 0x00000000,
396 .cpu_name = "POWER4 (compatible)",
397 .cpu_features = CPU_FTRS_COMPATIBLE,
398 .cpu_user_features = COMMON_USER_PPC64,
399 .icache_bsize = 128,
400 .dcache_bsize = 128,
401 .num_pmcs = 6,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600402 .pmc_type = PPC_PMC_IBM,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100403 .platform = "power4",
Stephen Rothwell49209602005-10-12 15:55:09 +1000404 }
405#endif /* CONFIG_PPC64 */
406#ifdef CONFIG_PPC32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700407#if CLASSIC_PPC
Stephen Rothwell49209602005-10-12 15:55:09 +1000408 { /* 601 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700409 .pvr_mask = 0xffff0000,
410 .pvr_value = 0x00010000,
411 .cpu_name = "601",
Kumar Gala10b35d92005-09-23 14:08:58 -0500412 .cpu_features = CPU_FTRS_PPC601,
Stephen Rothwell49209602005-10-12 15:55:09 +1000413 .cpu_user_features = COMMON_USER | PPC_FEATURE_601_INSTR |
Paul Mackerras98599012005-10-22 16:51:34 +1000414 PPC_FEATURE_UNIFIED_CACHE | PPC_FEATURE_NO_TB,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700415 .icache_bsize = 32,
416 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100417 .platform = "ppc601",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700418 },
419 { /* 603 */
420 .pvr_mask = 0xffff0000,
421 .pvr_value = 0x00030000,
422 .cpu_name = "603",
Kumar Gala10b35d92005-09-23 14:08:58 -0500423 .cpu_features = CPU_FTRS_603,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000424 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700425 .icache_bsize = 32,
426 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100427 .cpu_setup = __setup_cpu_603,
428 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700429 },
430 { /* 603e */
431 .pvr_mask = 0xffff0000,
432 .pvr_value = 0x00060000,
433 .cpu_name = "603e",
Kumar Gala10b35d92005-09-23 14:08:58 -0500434 .cpu_features = CPU_FTRS_603,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000435 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700436 .icache_bsize = 32,
437 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100438 .cpu_setup = __setup_cpu_603,
439 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700440 },
441 { /* 603ev */
442 .pvr_mask = 0xffff0000,
443 .pvr_value = 0x00070000,
444 .cpu_name = "603ev",
Kumar Gala10b35d92005-09-23 14:08:58 -0500445 .cpu_features = CPU_FTRS_603,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000446 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700447 .icache_bsize = 32,
448 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100449 .cpu_setup = __setup_cpu_603,
450 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700451 },
452 { /* 604 */
453 .pvr_mask = 0xffff0000,
454 .pvr_value = 0x00040000,
455 .cpu_name = "604",
Kumar Gala10b35d92005-09-23 14:08:58 -0500456 .cpu_features = CPU_FTRS_604,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000457 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700458 .icache_bsize = 32,
459 .dcache_bsize = 32,
460 .num_pmcs = 2,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100461 .cpu_setup = __setup_cpu_604,
462 .platform = "ppc604",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700463 },
464 { /* 604e */
465 .pvr_mask = 0xfffff000,
466 .pvr_value = 0x00090000,
467 .cpu_name = "604e",
Kumar Gala10b35d92005-09-23 14:08:58 -0500468 .cpu_features = CPU_FTRS_604,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000469 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700470 .icache_bsize = 32,
471 .dcache_bsize = 32,
472 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100473 .cpu_setup = __setup_cpu_604,
474 .platform = "ppc604",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700475 },
476 { /* 604r */
477 .pvr_mask = 0xffff0000,
478 .pvr_value = 0x00090000,
479 .cpu_name = "604r",
Kumar Gala10b35d92005-09-23 14:08:58 -0500480 .cpu_features = CPU_FTRS_604,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000481 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700482 .icache_bsize = 32,
483 .dcache_bsize = 32,
484 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100485 .cpu_setup = __setup_cpu_604,
486 .platform = "ppc604",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700487 },
488 { /* 604ev */
489 .pvr_mask = 0xffff0000,
490 .pvr_value = 0x000a0000,
491 .cpu_name = "604ev",
Kumar Gala10b35d92005-09-23 14:08:58 -0500492 .cpu_features = CPU_FTRS_604,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000493 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700494 .icache_bsize = 32,
495 .dcache_bsize = 32,
496 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100497 .cpu_setup = __setup_cpu_604,
498 .platform = "ppc604",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700499 },
500 { /* 740/750 (0x4202, don't support TAU ?) */
501 .pvr_mask = 0xffffffff,
502 .pvr_value = 0x00084202,
503 .cpu_name = "740/750",
Kumar Gala10b35d92005-09-23 14:08:58 -0500504 .cpu_features = CPU_FTRS_740_NOTAU,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000505 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700506 .icache_bsize = 32,
507 .dcache_bsize = 32,
508 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100509 .cpu_setup = __setup_cpu_750,
510 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700511 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700512 { /* 750CX (80100 and 8010x?) */
513 .pvr_mask = 0xfffffff0,
514 .pvr_value = 0x00080100,
515 .cpu_name = "750CX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500516 .cpu_features = CPU_FTRS_750,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000517 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700518 .icache_bsize = 32,
519 .dcache_bsize = 32,
520 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100521 .cpu_setup = __setup_cpu_750cx,
522 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700523 },
524 { /* 750CX (82201 and 82202) */
525 .pvr_mask = 0xfffffff0,
526 .pvr_value = 0x00082200,
527 .cpu_name = "750CX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500528 .cpu_features = CPU_FTRS_750,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000529 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700530 .icache_bsize = 32,
531 .dcache_bsize = 32,
532 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100533 .cpu_setup = __setup_cpu_750cx,
534 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700535 },
536 { /* 750CXe (82214) */
537 .pvr_mask = 0xfffffff0,
538 .pvr_value = 0x00082210,
539 .cpu_name = "750CXe",
Kumar Gala10b35d92005-09-23 14:08:58 -0500540 .cpu_features = CPU_FTRS_750,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000541 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700542 .icache_bsize = 32,
543 .dcache_bsize = 32,
544 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100545 .cpu_setup = __setup_cpu_750cx,
546 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700547 },
Arthur Othieno7c316252005-09-03 15:55:52 -0700548 { /* 750CXe "Gekko" (83214) */
549 .pvr_mask = 0xffffffff,
550 .pvr_value = 0x00083214,
551 .cpu_name = "750CXe",
Kumar Gala10b35d92005-09-23 14:08:58 -0500552 .cpu_features = CPU_FTRS_750,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000553 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Arthur Othieno7c316252005-09-03 15:55:52 -0700554 .icache_bsize = 32,
555 .dcache_bsize = 32,
556 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100557 .cpu_setup = __setup_cpu_750cx,
558 .platform = "ppc750",
Arthur Othieno7c316252005-09-03 15:55:52 -0700559 },
Jake Moilanencfbff8a2006-10-03 14:29:34 -0500560 { /* 750CL */
561 .pvr_mask = 0xfffff0f0,
562 .pvr_value = 0x00087010,
563 .cpu_name = "750CL",
Josh Boyera14c4502007-04-13 04:33:25 +1000564 .cpu_features = CPU_FTRS_750CL,
Jake Moilanencfbff8a2006-10-03 14:29:34 -0500565 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
566 .icache_bsize = 32,
567 .dcache_bsize = 32,
568 .num_pmcs = 4,
Josh Boyera14c4502007-04-13 04:33:25 +1000569 .cpu_setup = __setup_cpu_750,
Jake Moilanencfbff8a2006-10-03 14:29:34 -0500570 .platform = "ppc750",
571 },
Arthur Othienoac1ff042005-09-03 15:55:51 -0700572 { /* 745/755 */
573 .pvr_mask = 0xfffff000,
574 .pvr_value = 0x00083000,
575 .cpu_name = "745/755",
Kumar Gala10b35d92005-09-23 14:08:58 -0500576 .cpu_features = CPU_FTRS_750,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000577 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Arthur Othienoac1ff042005-09-03 15:55:51 -0700578 .icache_bsize = 32,
579 .dcache_bsize = 32,
580 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100581 .cpu_setup = __setup_cpu_750,
582 .platform = "ppc750",
Arthur Othienoac1ff042005-09-03 15:55:51 -0700583 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700584 { /* 750FX rev 1.x */
585 .pvr_mask = 0xffffff00,
586 .pvr_value = 0x70000100,
587 .cpu_name = "750FX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500588 .cpu_features = CPU_FTRS_750FX1,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000589 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700590 .icache_bsize = 32,
591 .dcache_bsize = 32,
592 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100593 .cpu_setup = __setup_cpu_750,
594 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700595 },
596 { /* 750FX rev 2.0 must disable HID0[DPM] */
597 .pvr_mask = 0xffffffff,
598 .pvr_value = 0x70000200,
599 .cpu_name = "750FX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500600 .cpu_features = CPU_FTRS_750FX2,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000601 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700602 .icache_bsize = 32,
603 .dcache_bsize = 32,
604 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100605 .cpu_setup = __setup_cpu_750,
606 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700607 },
608 { /* 750FX (All revs except 2.0) */
609 .pvr_mask = 0xffff0000,
610 .pvr_value = 0x70000000,
611 .cpu_name = "750FX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500612 .cpu_features = CPU_FTRS_750FX,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000613 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700614 .icache_bsize = 32,
615 .dcache_bsize = 32,
616 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100617 .cpu_setup = __setup_cpu_750fx,
618 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700619 },
620 { /* 750GX */
621 .pvr_mask = 0xffff0000,
622 .pvr_value = 0x70020000,
623 .cpu_name = "750GX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500624 .cpu_features = CPU_FTRS_750GX,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000625 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700626 .icache_bsize = 32,
627 .dcache_bsize = 32,
628 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100629 .cpu_setup = __setup_cpu_750fx,
630 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700631 },
632 { /* 740/750 (L2CR bit need fixup for 740) */
633 .pvr_mask = 0xffff0000,
634 .pvr_value = 0x00080000,
635 .cpu_name = "740/750",
Kumar Gala10b35d92005-09-23 14:08:58 -0500636 .cpu_features = CPU_FTRS_740,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000637 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700638 .icache_bsize = 32,
639 .dcache_bsize = 32,
640 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100641 .cpu_setup = __setup_cpu_750,
642 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700643 },
644 { /* 7400 rev 1.1 ? (no TAU) */
645 .pvr_mask = 0xffffffff,
646 .pvr_value = 0x000c1101,
647 .cpu_name = "7400 (1.1)",
Kumar Gala10b35d92005-09-23 14:08:58 -0500648 .cpu_features = CPU_FTRS_7400_NOTAU,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000649 .cpu_user_features = COMMON_USER |
650 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700651 .icache_bsize = 32,
652 .dcache_bsize = 32,
653 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100654 .cpu_setup = __setup_cpu_7400,
655 .platform = "ppc7400",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700656 },
657 { /* 7400 */
658 .pvr_mask = 0xffff0000,
659 .pvr_value = 0x000c0000,
660 .cpu_name = "7400",
Kumar Gala10b35d92005-09-23 14:08:58 -0500661 .cpu_features = CPU_FTRS_7400,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000662 .cpu_user_features = COMMON_USER |
663 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700664 .icache_bsize = 32,
665 .dcache_bsize = 32,
666 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100667 .cpu_setup = __setup_cpu_7400,
668 .platform = "ppc7400",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700669 },
670 { /* 7410 */
671 .pvr_mask = 0xffff0000,
672 .pvr_value = 0x800c0000,
673 .cpu_name = "7410",
Kumar Gala10b35d92005-09-23 14:08:58 -0500674 .cpu_features = CPU_FTRS_7400,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000675 .cpu_user_features = COMMON_USER |
676 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700677 .icache_bsize = 32,
678 .dcache_bsize = 32,
679 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100680 .cpu_setup = __setup_cpu_7410,
681 .platform = "ppc7400",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700682 },
683 { /* 7450 2.0 - no doze/nap */
684 .pvr_mask = 0xffffffff,
685 .pvr_value = 0x80000200,
686 .cpu_name = "7450",
Kumar Gala10b35d92005-09-23 14:08:58 -0500687 .cpu_features = CPU_FTRS_7450_20,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000688 .cpu_user_features = COMMON_USER |
689 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700690 .icache_bsize = 32,
691 .dcache_bsize = 32,
692 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600693 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600694 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000695 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100696 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700697 },
698 { /* 7450 2.1 */
699 .pvr_mask = 0xffffffff,
700 .pvr_value = 0x80000201,
701 .cpu_name = "7450",
Kumar Gala10b35d92005-09-23 14:08:58 -0500702 .cpu_features = CPU_FTRS_7450_21,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000703 .cpu_user_features = COMMON_USER |
704 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700705 .icache_bsize = 32,
706 .dcache_bsize = 32,
707 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600708 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600709 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000710 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100711 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700712 },
713 { /* 7450 2.3 and newer */
714 .pvr_mask = 0xffff0000,
715 .pvr_value = 0x80000000,
716 .cpu_name = "7450",
Kumar Gala10b35d92005-09-23 14:08:58 -0500717 .cpu_features = CPU_FTRS_7450_23,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000718 .cpu_user_features = COMMON_USER |
719 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700720 .icache_bsize = 32,
721 .dcache_bsize = 32,
722 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600723 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600724 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000725 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100726 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700727 },
728 { /* 7455 rev 1.x */
729 .pvr_mask = 0xffffff00,
730 .pvr_value = 0x80010100,
731 .cpu_name = "7455",
Kumar Gala10b35d92005-09-23 14:08:58 -0500732 .cpu_features = CPU_FTRS_7455_1,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000733 .cpu_user_features = COMMON_USER |
734 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700735 .icache_bsize = 32,
736 .dcache_bsize = 32,
737 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600738 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600739 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000740 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100741 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700742 },
743 { /* 7455 rev 2.0 */
744 .pvr_mask = 0xffffffff,
745 .pvr_value = 0x80010200,
746 .cpu_name = "7455",
Kumar Gala10b35d92005-09-23 14:08:58 -0500747 .cpu_features = CPU_FTRS_7455_20,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000748 .cpu_user_features = COMMON_USER |
749 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700750 .icache_bsize = 32,
751 .dcache_bsize = 32,
752 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600753 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600754 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000755 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100756 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700757 },
758 { /* 7455 others */
759 .pvr_mask = 0xffff0000,
760 .pvr_value = 0x80010000,
761 .cpu_name = "7455",
Kumar Gala10b35d92005-09-23 14:08:58 -0500762 .cpu_features = CPU_FTRS_7455,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000763 .cpu_user_features = COMMON_USER |
764 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700765 .icache_bsize = 32,
766 .dcache_bsize = 32,
767 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600768 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600769 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000770 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100771 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700772 },
773 { /* 7447/7457 Rev 1.0 */
774 .pvr_mask = 0xffffffff,
775 .pvr_value = 0x80020100,
776 .cpu_name = "7447/7457",
Kumar Gala10b35d92005-09-23 14:08:58 -0500777 .cpu_features = CPU_FTRS_7447_10,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000778 .cpu_user_features = COMMON_USER |
779 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700780 .icache_bsize = 32,
781 .dcache_bsize = 32,
782 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600783 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600784 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000785 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100786 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700787 },
788 { /* 7447/7457 Rev 1.1 */
789 .pvr_mask = 0xffffffff,
790 .pvr_value = 0x80020101,
791 .cpu_name = "7447/7457",
Kumar Gala10b35d92005-09-23 14:08:58 -0500792 .cpu_features = CPU_FTRS_7447_10,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000793 .cpu_user_features = COMMON_USER |
794 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700795 .icache_bsize = 32,
796 .dcache_bsize = 32,
797 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600798 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600799 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000800 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100801 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700802 },
803 { /* 7447/7457 Rev 1.2 and later */
804 .pvr_mask = 0xffff0000,
805 .pvr_value = 0x80020000,
806 .cpu_name = "7447/7457",
Kumar Gala10b35d92005-09-23 14:08:58 -0500807 .cpu_features = CPU_FTRS_7447,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000808 .cpu_user_features = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700809 .icache_bsize = 32,
810 .dcache_bsize = 32,
811 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600812 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600813 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000814 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100815 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700816 },
817 { /* 7447A */
818 .pvr_mask = 0xffff0000,
819 .pvr_value = 0x80030000,
820 .cpu_name = "7447A",
Kumar Gala10b35d92005-09-23 14:08:58 -0500821 .cpu_features = CPU_FTRS_7447A,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000822 .cpu_user_features = COMMON_USER |
823 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700824 .icache_bsize = 32,
825 .dcache_bsize = 32,
826 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600827 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600828 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000829 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100830 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700831 },
Kumar Galabbde6302005-09-03 15:55:55 -0700832 { /* 7448 */
833 .pvr_mask = 0xffff0000,
834 .pvr_value = 0x80040000,
835 .cpu_name = "7448",
James.Yang3d372542007-05-02 16:34:43 -0500836 .cpu_features = CPU_FTRS_7448,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000837 .cpu_user_features = COMMON_USER |
838 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Kumar Galabbde6302005-09-03 15:55:55 -0700839 .icache_bsize = 32,
840 .dcache_bsize = 32,
841 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600842 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600843 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000844 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100845 .platform = "ppc7450",
Kumar Galabbde6302005-09-03 15:55:55 -0700846 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700847 { /* 82xx (8240, 8245, 8260 are all 603e cores) */
848 .pvr_mask = 0x7fff0000,
849 .pvr_value = 0x00810000,
850 .cpu_name = "82xx",
Kumar Gala10b35d92005-09-23 14:08:58 -0500851 .cpu_features = CPU_FTRS_82XX,
Stephen Rothwell49209602005-10-12 15:55:09 +1000852 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700853 .icache_bsize = 32,
854 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100855 .cpu_setup = __setup_cpu_603,
856 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700857 },
858 { /* All G2_LE (603e core, plus some) have the same pvr */
859 .pvr_mask = 0x7fff0000,
860 .pvr_value = 0x00820000,
861 .cpu_name = "G2_LE",
Kumar Gala10b35d92005-09-23 14:08:58 -0500862 .cpu_features = CPU_FTRS_G2_LE,
Stephen Rothwell49209602005-10-12 15:55:09 +1000863 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700864 .icache_bsize = 32,
865 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100866 .cpu_setup = __setup_cpu_603,
867 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700868 },
Kim Phillips6c4a2502006-10-02 20:10:24 -0500869 { /* e300c1 (a 603e core, plus some) on 83xx */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700870 .pvr_mask = 0x7fff0000,
871 .pvr_value = 0x00830000,
Kim Phillips6c4a2502006-10-02 20:10:24 -0500872 .cpu_name = "e300c1",
Kumar Gala10b35d92005-09-23 14:08:58 -0500873 .cpu_features = CPU_FTRS_E300,
Stephen Rothwell49209602005-10-12 15:55:09 +1000874 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700875 .icache_bsize = 32,
876 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100877 .cpu_setup = __setup_cpu_603,
878 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700879 },
Kim Phillips6c4a2502006-10-02 20:10:24 -0500880 { /* e300c2 (an e300c1 core, plus some, minus FPU) on 83xx */
881 .pvr_mask = 0x7fff0000,
882 .pvr_value = 0x00840000,
883 .cpu_name = "e300c2",
Kim Phillipsaa42c692006-12-08 02:43:30 -0600884 .cpu_features = CPU_FTRS_E300C2,
Kim Phillips6c4a2502006-10-02 20:10:24 -0500885 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
886 .icache_bsize = 32,
887 .dcache_bsize = 32,
888 .cpu_setup = __setup_cpu_603,
889 .platform = "ppc603",
890 },
Scott Wood57933f82006-12-01 12:57:05 -0600891 { /* e300c3 on 83xx */
892 .pvr_mask = 0x7fff0000,
893 .pvr_value = 0x00850000,
894 .cpu_name = "e300c3",
895 .cpu_features = CPU_FTRS_E300,
896 .cpu_user_features = COMMON_USER,
897 .icache_bsize = 32,
898 .dcache_bsize = 32,
899 .cpu_setup = __setup_cpu_603,
900 .platform = "ppc603",
901 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700902 { /* default match, we assume split I/D cache & TB (non-601)... */
903 .pvr_mask = 0x00000000,
904 .pvr_value = 0x00000000,
905 .cpu_name = "(generic PPC)",
Kumar Gala10b35d92005-09-23 14:08:58 -0500906 .cpu_features = CPU_FTRS_CLASSIC32,
Stephen Rothwell49209602005-10-12 15:55:09 +1000907 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700908 .icache_bsize = 32,
909 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100910 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700911 },
912#endif /* CLASSIC_PPC */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700913#ifdef CONFIG_8xx
914 { /* 8xx */
915 .pvr_mask = 0xffff0000,
916 .pvr_value = 0x00500000,
917 .cpu_name = "8xx",
918 /* CPU_FTR_MAYBE_CAN_DOZE is possible,
919 * if the 8xx code is there.... */
Kumar Gala10b35d92005-09-23 14:08:58 -0500920 .cpu_features = CPU_FTRS_8XX,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700921 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
922 .icache_bsize = 16,
923 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100924 .platform = "ppc823",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700925 },
926#endif /* CONFIG_8xx */
927#ifdef CONFIG_40x
928 { /* 403GC */
929 .pvr_mask = 0xffffff00,
930 .pvr_value = 0x00200200,
931 .cpu_name = "403GC",
Kumar Gala10b35d92005-09-23 14:08:58 -0500932 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700933 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
934 .icache_bsize = 16,
935 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100936 .platform = "ppc403",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700937 },
938 { /* 403GCX */
939 .pvr_mask = 0xffffff00,
940 .pvr_value = 0x00201400,
941 .cpu_name = "403GCX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500942 .cpu_features = CPU_FTRS_40X,
Paul Mackerras98599012005-10-22 16:51:34 +1000943 .cpu_user_features = PPC_FEATURE_32 |
944 PPC_FEATURE_HAS_MMU | PPC_FEATURE_NO_TB,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700945 .icache_bsize = 16,
946 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100947 .platform = "ppc403",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700948 },
949 { /* 403G ?? */
950 .pvr_mask = 0xffff0000,
951 .pvr_value = 0x00200000,
952 .cpu_name = "403G ??",
Kumar Gala10b35d92005-09-23 14:08:58 -0500953 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700954 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
955 .icache_bsize = 16,
956 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100957 .platform = "ppc403",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700958 },
959 { /* 405GP */
960 .pvr_mask = 0xffff0000,
961 .pvr_value = 0x40110000,
962 .cpu_name = "405GP",
Kumar Gala10b35d92005-09-23 14:08:58 -0500963 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700964 .cpu_user_features = PPC_FEATURE_32 |
965 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
966 .icache_bsize = 32,
967 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100968 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700969 },
970 { /* STB 03xxx */
971 .pvr_mask = 0xffff0000,
972 .pvr_value = 0x40130000,
973 .cpu_name = "STB03xxx",
Kumar Gala10b35d92005-09-23 14:08:58 -0500974 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700975 .cpu_user_features = PPC_FEATURE_32 |
976 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
977 .icache_bsize = 32,
978 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100979 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700980 },
981 { /* STB 04xxx */
982 .pvr_mask = 0xffff0000,
983 .pvr_value = 0x41810000,
984 .cpu_name = "STB04xxx",
Kumar Gala10b35d92005-09-23 14:08:58 -0500985 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700986 .cpu_user_features = PPC_FEATURE_32 |
987 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
988 .icache_bsize = 32,
989 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100990 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700991 },
992 { /* NP405L */
993 .pvr_mask = 0xffff0000,
994 .pvr_value = 0x41610000,
995 .cpu_name = "NP405L",
Kumar Gala10b35d92005-09-23 14:08:58 -0500996 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700997 .cpu_user_features = PPC_FEATURE_32 |
998 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
999 .icache_bsize = 32,
1000 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001001 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001002 },
1003 { /* NP4GS3 */
1004 .pvr_mask = 0xffff0000,
1005 .pvr_value = 0x40B10000,
1006 .cpu_name = "NP4GS3",
Kumar Gala10b35d92005-09-23 14:08:58 -05001007 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001008 .cpu_user_features = PPC_FEATURE_32 |
1009 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1010 .icache_bsize = 32,
1011 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001012 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001013 },
1014 { /* NP405H */
1015 .pvr_mask = 0xffff0000,
1016 .pvr_value = 0x41410000,
1017 .cpu_name = "NP405H",
Kumar Gala10b35d92005-09-23 14:08:58 -05001018 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001019 .cpu_user_features = PPC_FEATURE_32 |
1020 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1021 .icache_bsize = 32,
1022 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001023 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001024 },
1025 { /* 405GPr */
1026 .pvr_mask = 0xffff0000,
1027 .pvr_value = 0x50910000,
1028 .cpu_name = "405GPr",
Kumar Gala10b35d92005-09-23 14:08:58 -05001029 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001030 .cpu_user_features = PPC_FEATURE_32 |
1031 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1032 .icache_bsize = 32,
1033 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001034 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001035 },
1036 { /* STBx25xx */
1037 .pvr_mask = 0xffff0000,
1038 .pvr_value = 0x51510000,
1039 .cpu_name = "STBx25xx",
Kumar Gala10b35d92005-09-23 14:08:58 -05001040 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001041 .cpu_user_features = PPC_FEATURE_32 |
1042 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1043 .icache_bsize = 32,
1044 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001045 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001046 },
1047 { /* 405LP */
1048 .pvr_mask = 0xffff0000,
1049 .pvr_value = 0x41F10000,
1050 .cpu_name = "405LP",
Kumar Gala10b35d92005-09-23 14:08:58 -05001051 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001052 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
1053 .icache_bsize = 32,
1054 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001055 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001056 },
1057 { /* Xilinx Virtex-II Pro */
Grant C. Likely72646c72006-01-19 01:13:20 -07001058 .pvr_mask = 0xfffff000,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001059 .pvr_value = 0x20010000,
1060 .cpu_name = "Virtex-II Pro",
Kumar Gala10b35d92005-09-23 14:08:58 -05001061 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001062 .cpu_user_features = PPC_FEATURE_32 |
1063 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1064 .icache_bsize = 32,
1065 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001066 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001067 },
Grant C. Likely72646c72006-01-19 01:13:20 -07001068 { /* Xilinx Virtex-4 FX */
1069 .pvr_mask = 0xfffff000,
1070 .pvr_value = 0x20011000,
1071 .cpu_name = "Virtex-4 FX",
1072 .cpu_features = CPU_FTRS_40X,
1073 .cpu_user_features = PPC_FEATURE_32 |
1074 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1075 .icache_bsize = 32,
1076 .dcache_bsize = 32,
Peter Bergner838fdb42006-09-14 14:18:38 -05001077 .platform = "ppc405",
Grant C. Likely72646c72006-01-19 01:13:20 -07001078 },
Eugene Suroveginad95d602005-06-07 13:22:09 -07001079 { /* 405EP */
1080 .pvr_mask = 0xffff0000,
1081 .pvr_value = 0x51210000,
1082 .cpu_name = "405EP",
Kumar Gala10b35d92005-09-23 14:08:58 -05001083 .cpu_features = CPU_FTRS_40X,
Eugene Suroveginad95d602005-06-07 13:22:09 -07001084 .cpu_user_features = PPC_FEATURE_32 |
1085 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1086 .icache_bsize = 32,
1087 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001088 .platform = "ppc405",
Eugene Suroveginad95d602005-06-07 13:22:09 -07001089 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001090
1091#endif /* CONFIG_40x */
1092#ifdef CONFIG_44x
Matt Porterc9cf73a2005-07-31 22:34:52 -07001093 {
1094 .pvr_mask = 0xf0000fff,
1095 .pvr_value = 0x40000850,
1096 .cpu_name = "440EP Rev. A",
Kumar Gala10b35d92005-09-23 14:08:58 -05001097 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001098 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
Matt Porterc9cf73a2005-07-31 22:34:52 -07001099 .icache_bsize = 32,
1100 .dcache_bsize = 32,
Valentine Barshak81127532007-09-22 00:46:57 +10001101 .cpu_setup = __setup_cpu_440ep,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001102 .platform = "ppc440",
Matt Porterc9cf73a2005-07-31 22:34:52 -07001103 },
1104 {
1105 .pvr_mask = 0xf0000fff,
1106 .pvr_value = 0x400008d3,
1107 .cpu_name = "440EP Rev. B",
Kumar Gala10b35d92005-09-23 14:08:58 -05001108 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001109 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
Matt Porterc9cf73a2005-07-31 22:34:52 -07001110 .icache_bsize = 32,
1111 .dcache_bsize = 32,
Valentine Barshak81127532007-09-22 00:46:57 +10001112 .cpu_setup = __setup_cpu_440ep,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001113 .platform = "ppc440",
Matt Porterc9cf73a2005-07-31 22:34:52 -07001114 },
Valentine Barshak15fc9932007-08-29 17:40:30 +04001115 { /* 440EPX */
1116 .pvr_mask = 0xf0000ffb,
1117 .pvr_value = 0x200008D0,
1118 .cpu_name = "440EPX",
1119 .cpu_features = CPU_FTRS_44X,
1120 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
1121 .icache_bsize = 32,
1122 .dcache_bsize = 32,
Valentine Barshak81127532007-09-22 00:46:57 +10001123 .cpu_setup = __setup_cpu_440epx,
1124 .platform = "ppc440",
Valentine Barshak15fc9932007-08-29 17:40:30 +04001125 },
1126 { /* 440GRX */
1127 .pvr_mask = 0xf0000ffb,
1128 .pvr_value = 0x200008D8,
1129 .cpu_name = "440GRX",
1130 .cpu_features = CPU_FTRS_44X,
1131 .cpu_user_features = COMMON_USER_BOOKE,
1132 .icache_bsize = 32,
1133 .dcache_bsize = 32,
Valentine Barshak340ffd22007-09-22 00:50:09 +10001134 .cpu_setup = __setup_cpu_440grx,
1135 .platform = "ppc440",
Valentine Barshak15fc9932007-08-29 17:40:30 +04001136 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001137 { /* 440GP Rev. B */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001138 .pvr_mask = 0xf0000fff,
1139 .pvr_value = 0x40000440,
1140 .cpu_name = "440GP Rev. B",
Kumar Gala10b35d92005-09-23 14:08:58 -05001141 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001142 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001143 .icache_bsize = 32,
1144 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001145 .platform = "ppc440gp",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001146 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001147 { /* 440GP Rev. C */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001148 .pvr_mask = 0xf0000fff,
1149 .pvr_value = 0x40000481,
1150 .cpu_name = "440GP Rev. C",
Kumar Gala10b35d92005-09-23 14:08:58 -05001151 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001152 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001153 .icache_bsize = 32,
1154 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001155 .platform = "ppc440gp",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001156 },
1157 { /* 440GX Rev. A */
1158 .pvr_mask = 0xf0000fff,
1159 .pvr_value = 0x50000850,
1160 .cpu_name = "440GX Rev. A",
Kumar Gala10b35d92005-09-23 14:08:58 -05001161 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001162 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001163 .icache_bsize = 32,
1164 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001165 .platform = "ppc440",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001166 },
1167 { /* 440GX Rev. B */
1168 .pvr_mask = 0xf0000fff,
1169 .pvr_value = 0x50000851,
1170 .cpu_name = "440GX Rev. B",
Kumar Gala10b35d92005-09-23 14:08:58 -05001171 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001172 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001173 .icache_bsize = 32,
1174 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001175 .platform = "ppc440",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001176 },
1177 { /* 440GX Rev. C */
1178 .pvr_mask = 0xf0000fff,
1179 .pvr_value = 0x50000892,
1180 .cpu_name = "440GX Rev. C",
Kumar Gala10b35d92005-09-23 14:08:58 -05001181 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001182 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001183 .icache_bsize = 32,
1184 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001185 .platform = "ppc440",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001186 },
Eugene Surovegin9149fb32005-09-03 15:55:40 -07001187 { /* 440GX Rev. F */
1188 .pvr_mask = 0xf0000fff,
1189 .pvr_value = 0x50000894,
1190 .cpu_name = "440GX Rev. F",
Kumar Gala10b35d92005-09-23 14:08:58 -05001191 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001192 .cpu_user_features = COMMON_USER_BOOKE,
Eugene Surovegin9149fb32005-09-03 15:55:40 -07001193 .icache_bsize = 32,
1194 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001195 .platform = "ppc440",
Eugene Surovegin9149fb32005-09-03 15:55:40 -07001196 },
Matt Porter656de7e2005-09-03 15:55:42 -07001197 { /* 440SP Rev. A */
Roland Dreier333e6152007-06-16 05:36:32 +10001198 .pvr_mask = 0xfff00fff,
1199 .pvr_value = 0x53200891,
Matt Porter656de7e2005-09-03 15:55:42 -07001200 .cpu_name = "440SP Rev. A",
Kumar Gala10b35d92005-09-23 14:08:58 -05001201 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001202 .cpu_user_features = COMMON_USER_BOOKE,
Matt Porter656de7e2005-09-03 15:55:42 -07001203 .icache_bsize = 32,
1204 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001205 .platform = "ppc440",
Matt Porter656de7e2005-09-03 15:55:42 -07001206 },
Roland Dreierb0f7b8b2005-11-07 00:58:13 -08001207 { /* 440SPe Rev. A */
Roland Dreier333e6152007-06-16 05:36:32 +10001208 .pvr_mask = 0xfff00fff,
1209 .pvr_value = 0x53400890,
1210 .cpu_name = "440SPe Rev. A",
1211 .cpu_features = CPU_FTRS_44X,
1212 .cpu_user_features = COMMON_USER_BOOKE,
1213 .icache_bsize = 32,
1214 .dcache_bsize = 32,
1215 .platform = "ppc440",
1216 },
1217 { /* 440SPe Rev. B */
1218 .pvr_mask = 0xfff00fff,
1219 .pvr_value = 0x53400891,
1220 .cpu_name = "440SPe Rev. B",
Kumar Galaa147c582006-12-08 02:34:38 -06001221 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001222 .cpu_user_features = COMMON_USER_BOOKE,
Roland Dreierb0f7b8b2005-11-07 00:58:13 -08001223 .icache_bsize = 32,
1224 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001225 .platform = "ppc440",
Roland Dreierb0f7b8b2005-11-07 00:58:13 -08001226 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001227#endif /* CONFIG_44x */
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001228#ifdef CONFIG_FSL_BOOKE
Stephen Rothwell49209602005-10-12 15:55:09 +10001229 { /* e200z5 */
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001230 .pvr_mask = 0xfff00000,
1231 .pvr_value = 0x81000000,
1232 .cpu_name = "e200z5",
1233 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001234 .cpu_features = CPU_FTRS_E200,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001235 .cpu_user_features = COMMON_USER_BOOKE |
1236 PPC_FEATURE_HAS_EFP_SINGLE |
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001237 PPC_FEATURE_UNIFIED_CACHE,
1238 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001239 .platform = "ppc5554",
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001240 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001241 { /* e200z6 */
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001242 .pvr_mask = 0xfff00000,
1243 .pvr_value = 0x81100000,
1244 .cpu_name = "e200z6",
1245 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001246 .cpu_features = CPU_FTRS_E200,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001247 .cpu_user_features = COMMON_USER_BOOKE |
Kumar Gala5e14d212007-09-13 01:44:20 -05001248 PPC_FEATURE_HAS_SPE_COMP |
1249 PPC_FEATURE_HAS_EFP_SINGLE_COMP |
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001250 PPC_FEATURE_UNIFIED_CACHE,
1251 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001252 .platform = "ppc5554",
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001253 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001254 { /* e500 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001255 .pvr_mask = 0xffff0000,
1256 .pvr_value = 0x80200000,
1257 .cpu_name = "e500",
1258 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001259 .cpu_features = CPU_FTRS_E500,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001260 .cpu_user_features = COMMON_USER_BOOKE |
Kumar Gala5e14d212007-09-13 01:44:20 -05001261 PPC_FEATURE_HAS_SPE_COMP |
1262 PPC_FEATURE_HAS_EFP_SINGLE_COMP,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001263 .icache_bsize = 32,
1264 .dcache_bsize = 32,
1265 .num_pmcs = 4,
Andy Fleming555d97a2005-12-15 20:02:04 -06001266 .oprofile_cpu_type = "ppc/e500",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +00001267 .oprofile_type = PPC_OPROFILE_BOOKE,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001268 .platform = "ppc8540",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001269 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001270 { /* e500v2 */
Kumar Gala5b37b702005-06-21 17:15:18 -07001271 .pvr_mask = 0xffff0000,
1272 .pvr_value = 0x80210000,
1273 .cpu_name = "e500v2",
1274 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001275 .cpu_features = CPU_FTRS_E500_2,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001276 .cpu_user_features = COMMON_USER_BOOKE |
Kumar Gala5e14d212007-09-13 01:44:20 -05001277 PPC_FEATURE_HAS_SPE_COMP |
1278 PPC_FEATURE_HAS_EFP_SINGLE_COMP |
1279 PPC_FEATURE_HAS_EFP_DOUBLE_COMP,
Kumar Gala5b37b702005-06-21 17:15:18 -07001280 .icache_bsize = 32,
1281 .dcache_bsize = 32,
1282 .num_pmcs = 4,
Andy Fleming555d97a2005-12-15 20:02:04 -06001283 .oprofile_cpu_type = "ppc/e500",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +00001284 .oprofile_type = PPC_OPROFILE_BOOKE,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001285 .platform = "ppc8548",
Kumar Gala5b37b702005-06-21 17:15:18 -07001286 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001287#endif
1288#if !CLASSIC_PPC
1289 { /* default match */
1290 .pvr_mask = 0x00000000,
1291 .pvr_value = 0x00000000,
1292 .cpu_name = "(generic PPC)",
Kumar Gala10b35d92005-09-23 14:08:58 -05001293 .cpu_features = CPU_FTRS_GENERIC_32,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001294 .cpu_user_features = PPC_FEATURE_32,
1295 .icache_bsize = 32,
1296 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001297 .platform = "powerpc",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001298 }
1299#endif /* !CLASSIC_PPC */
Stephen Rothwell49209602005-10-12 15:55:09 +10001300#endif /* CONFIG_PPC32 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001301};
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001302
Paul Mackerras87a72f92007-10-04 14:18:01 +10001303static struct cpu_spec the_cpu_spec;
1304
1305struct cpu_spec * __init identify_cpu(unsigned long offset, unsigned int pvr)
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001306{
1307 struct cpu_spec *s = cpu_specs;
Paul Mackerras87a72f92007-10-04 14:18:01 +10001308 struct cpu_spec *t = &the_cpu_spec;
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001309 int i;
1310
1311 s = PTRRELOC(s);
Paul Mackerras87a72f92007-10-04 14:18:01 +10001312 t = PTRRELOC(t);
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001313
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001314 for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++)
1315 if ((pvr & s->pvr_mask) == s->pvr_value) {
Paul Mackerras87a72f92007-10-04 14:18:01 +10001316 /*
1317 * If we are overriding a previous value derived
1318 * from the real PVR with a new value obtained
1319 * using a logical PVR value, don't modify the
1320 * performance monitor fields.
1321 */
1322 if (t->num_pmcs && !s->num_pmcs) {
1323 t->cpu_name = s->cpu_name;
1324 t->cpu_features = s->cpu_features;
1325 t->cpu_user_features = s->cpu_user_features;
1326 t->icache_bsize = s->icache_bsize;
1327 t->dcache_bsize = s->dcache_bsize;
1328 t->cpu_setup = s->cpu_setup;
1329 t->cpu_restore = s->cpu_restore;
1330 t->platform = s->platform;
1331 } else
1332 *t = *s;
1333 *PTRRELOC(&cur_cpu_spec) = &the_cpu_spec;
Valentine Barshak84e3ad52007-09-22 00:44:38 +10001334#if defined(CONFIG_PPC64) || defined(CONFIG_BOOKE)
1335 /* ppc64 and booke expect identify_cpu to also call
1336 * setup_cpu for that processor. I will consolidate
1337 * that at a later time, for now, just use #ifdef.
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001338 * we also don't need to PTRRELOC the function pointer
Valentine Barshak84e3ad52007-09-22 00:44:38 +10001339 * on ppc64 and booke as we are running at 0 in real
1340 * mode on ppc64 and reloc_offset is always 0 on booke.
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001341 */
1342 if (s->cpu_setup) {
1343 s->cpu_setup(offset, s);
1344 }
Valentine Barshak84e3ad52007-09-22 00:44:38 +10001345#endif /* CONFIG_PPC64 || CONFIG_BOOKE */
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001346 return s;
1347 }
1348 BUG();
1349 return NULL;
1350}
1351
Benjamin Herrenschmidt0909c8c2006-10-20 11:47:18 +10001352void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end)
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001353{
1354 struct fixup_entry {
1355 unsigned long mask;
1356 unsigned long value;
Benjamin Herrenschmidt0909c8c2006-10-20 11:47:18 +10001357 long start_off;
1358 long end_off;
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001359 } *fcur, *fend;
1360
1361 fcur = fixup_start;
1362 fend = fixup_end;
1363
1364 for (; fcur < fend; fcur++) {
1365 unsigned int *pstart, *pend, *p;
1366
1367 if ((value & fcur->mask) == fcur->value)
1368 continue;
1369
1370 /* These PTRRELOCs will disappear once the new scheme for
1371 * modules and vdso is implemented
1372 */
Benjamin Herrenschmidt0909c8c2006-10-20 11:47:18 +10001373 pstart = ((unsigned int *)fcur) + (fcur->start_off / 4);
1374 pend = ((unsigned int *)fcur) + (fcur->end_off / 4);
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001375
1376 for (p = pstart; p < pend; p++) {
1377 *p = 0x60000000u;
1378 asm volatile ("dcbst 0, %0" : : "r" (p));
1379 }
1380 asm volatile ("sync" : : : "memory");
1381 for (p = pstart; p < pend; p++)
1382 asm volatile ("icbi 0,%0" : : "r" (p));
1383 asm volatile ("sync; isync" : : : "memory");
1384 }
1385}