blob: 911ac442f44a6aa495903bbafc9c5c11e3d0bb79 [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
Kumar Gala400d2212005-09-27 15:13:12 -050034extern void __setup_cpu_603(unsigned long offset, struct cpu_spec* spec);
35extern void __setup_cpu_604(unsigned long offset, struct cpu_spec* spec);
36extern void __setup_cpu_750(unsigned long offset, struct cpu_spec* spec);
37extern void __setup_cpu_750cx(unsigned long offset, struct cpu_spec* spec);
38extern void __setup_cpu_750fx(unsigned long offset, struct cpu_spec* spec);
39extern void __setup_cpu_7400(unsigned long offset, struct cpu_spec* spec);
40extern void __setup_cpu_7410(unsigned long offset, struct cpu_spec* spec);
41extern void __setup_cpu_745x(unsigned long offset, struct cpu_spec* spec);
Stephen Rothwell49209602005-10-12 15:55:09 +100042#endif /* CONFIG_PPC32 */
Olof Johanssonf39b7a52006-08-11 00:07:08 -050043#ifdef CONFIG_PPC64
Kumar Gala400d2212005-09-27 15:13:12 -050044extern void __setup_cpu_ppc970(unsigned long offset, struct cpu_spec* spec);
Olof Johansson5b43d202006-10-04 23:41:41 -050045extern void __setup_cpu_ppc970MP(unsigned long offset, struct cpu_spec* spec);
Olof Johanssonf39b7a52006-08-11 00:07:08 -050046extern void __restore_cpu_ppc970(void);
47#endif /* CONFIG_PPC64 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070048
Linus Torvalds1da177e2005-04-16 15:20:36 -070049/* This table only contains "desktop" CPUs, it need to be filled with embedded
50 * ones as well...
51 */
Stephen Rothwell49209602005-10-12 15:55:09 +100052#define COMMON_USER (PPC_FEATURE_32 | PPC_FEATURE_HAS_FPU | \
53 PPC_FEATURE_HAS_MMU)
54#define COMMON_USER_PPC64 (COMMON_USER | PPC_FEATURE_64)
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +110055#define COMMON_USER_POWER4 (COMMON_USER_PPC64 | PPC_FEATURE_POWER4)
Benjamin Herrenschmidtaa5cb0212006-03-01 15:07:07 +110056#define COMMON_USER_POWER5 (COMMON_USER_PPC64 | PPC_FEATURE_POWER5 |\
57 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
58#define COMMON_USER_POWER5_PLUS (COMMON_USER_PPC64 | PPC_FEATURE_POWER5_PLUS|\
59 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
Anton Blanchard03054d52006-04-29 09:51:06 +100060#define COMMON_USER_POWER6 (COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_05 |\
Paul Mackerrasfab5db92006-06-07 16:14:40 +100061 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \
62 PPC_FEATURE_TRUE_LE)
Olof Johanssonb3ebd1d2006-09-06 14:35:57 -050063#define COMMON_USER_PA6T (COMMON_USER_PPC64 | PPC_FEATURE_PA6T |\
64 PPC_FEATURE_TRUE_LE | \
65 PPC_FEATURE_HAS_ALTIVEC_COMP)
Paul Mackerras80f15dc2006-01-14 10:11:39 +110066#define COMMON_USER_BOOKE (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \
67 PPC_FEATURE_BOOKE)
Linus Torvalds1da177e2005-04-16 15:20:36 -070068
Linus Torvalds1da177e2005-04-16 15:20:36 -070069/* We only set the spe features if the kernel was compiled with
70 * spe support
71 */
72#ifdef CONFIG_SPE
Stephen Rothwell49209602005-10-12 15:55:09 +100073#define PPC_FEATURE_SPE_COMP PPC_FEATURE_HAS_SPE
Linus Torvalds1da177e2005-04-16 15:20:36 -070074#else
Stephen Rothwell49209602005-10-12 15:55:09 +100075#define PPC_FEATURE_SPE_COMP 0
Linus Torvalds1da177e2005-04-16 15:20:36 -070076#endif
77
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +100078static struct cpu_spec cpu_specs[] = {
Stephen Rothwell49209602005-10-12 15:55:09 +100079#ifdef CONFIG_PPC64
80 { /* Power3 */
81 .pvr_mask = 0xffff0000,
82 .pvr_value = 0x00400000,
83 .cpu_name = "POWER3 (630)",
84 .cpu_features = CPU_FTRS_POWER3,
Paul Mackerrasfab5db92006-06-07 16:14:40 +100085 .cpu_user_features = COMMON_USER_PPC64|PPC_FEATURE_PPC_LE,
Stephen Rothwell49209602005-10-12 15:55:09 +100086 .icache_bsize = 128,
87 .dcache_bsize = 128,
88 .num_pmcs = 8,
Stephen Rothwell49209602005-10-12 15:55:09 +100089 .oprofile_cpu_type = "ppc64/power3",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +000090 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +110091 .platform = "power3",
Stephen Rothwell49209602005-10-12 15:55:09 +100092 },
93 { /* Power3+ */
94 .pvr_mask = 0xffff0000,
95 .pvr_value = 0x00410000,
96 .cpu_name = "POWER3 (630+)",
97 .cpu_features = CPU_FTRS_POWER3,
Paul Mackerrasfab5db92006-06-07 16:14:40 +100098 .cpu_user_features = COMMON_USER_PPC64|PPC_FEATURE_PPC_LE,
Stephen Rothwell49209602005-10-12 15:55:09 +100099 .icache_bsize = 128,
100 .dcache_bsize = 128,
101 .num_pmcs = 8,
Stephen Rothwell49209602005-10-12 15:55:09 +1000102 .oprofile_cpu_type = "ppc64/power3",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000103 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100104 .platform = "power3",
Stephen Rothwell49209602005-10-12 15:55:09 +1000105 },
106 { /* Northstar */
107 .pvr_mask = 0xffff0000,
108 .pvr_value = 0x00330000,
109 .cpu_name = "RS64-II (northstar)",
110 .cpu_features = CPU_FTRS_RS64,
111 .cpu_user_features = COMMON_USER_PPC64,
112 .icache_bsize = 128,
113 .dcache_bsize = 128,
114 .num_pmcs = 8,
Stephen Rothwell49209602005-10-12 15:55:09 +1000115 .oprofile_cpu_type = "ppc64/rs64",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000116 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100117 .platform = "rs64",
Stephen Rothwell49209602005-10-12 15:55:09 +1000118 },
119 { /* Pulsar */
120 .pvr_mask = 0xffff0000,
121 .pvr_value = 0x00340000,
122 .cpu_name = "RS64-III (pulsar)",
123 .cpu_features = CPU_FTRS_RS64,
124 .cpu_user_features = COMMON_USER_PPC64,
125 .icache_bsize = 128,
126 .dcache_bsize = 128,
127 .num_pmcs = 8,
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,
Stephen Rothwell49209602005-10-12 15:55:09 +1000141 .oprofile_cpu_type = "ppc64/rs64",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000142 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100143 .platform = "rs64",
Stephen Rothwell49209602005-10-12 15:55:09 +1000144 },
145 { /* S-star */
146 .pvr_mask = 0xffff0000,
147 .pvr_value = 0x00370000,
148 .cpu_name = "RS64-IV (sstar)",
149 .cpu_features = CPU_FTRS_RS64,
150 .cpu_user_features = COMMON_USER_PPC64,
151 .icache_bsize = 128,
152 .dcache_bsize = 128,
153 .num_pmcs = 8,
Stephen Rothwell49209602005-10-12 15:55:09 +1000154 .oprofile_cpu_type = "ppc64/rs64",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000155 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100156 .platform = "rs64",
Stephen Rothwell49209602005-10-12 15:55:09 +1000157 },
158 { /* Power4 */
159 .pvr_mask = 0xffff0000,
160 .pvr_value = 0x00350000,
161 .cpu_name = "POWER4 (gp)",
162 .cpu_features = CPU_FTRS_POWER4,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100163 .cpu_user_features = COMMON_USER_POWER4,
Stephen Rothwell49209602005-10-12 15:55:09 +1000164 .icache_bsize = 128,
165 .dcache_bsize = 128,
166 .num_pmcs = 8,
Stephen Rothwell49209602005-10-12 15:55:09 +1000167 .oprofile_cpu_type = "ppc64/power4",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000168 .oprofile_type = PPC_OPROFILE_POWER4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100169 .platform = "power4",
Stephen Rothwell49209602005-10-12 15:55:09 +1000170 },
171 { /* Power4+ */
172 .pvr_mask = 0xffff0000,
173 .pvr_value = 0x00380000,
174 .cpu_name = "POWER4+ (gq)",
175 .cpu_features = CPU_FTRS_POWER4,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100176 .cpu_user_features = COMMON_USER_POWER4,
Stephen Rothwell49209602005-10-12 15:55:09 +1000177 .icache_bsize = 128,
178 .dcache_bsize = 128,
179 .num_pmcs = 8,
Stephen Rothwell49209602005-10-12 15:55:09 +1000180 .oprofile_cpu_type = "ppc64/power4",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000181 .oprofile_type = PPC_OPROFILE_POWER4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100182 .platform = "power4",
Stephen Rothwell49209602005-10-12 15:55:09 +1000183 },
184 { /* PPC970 */
185 .pvr_mask = 0xffff0000,
186 .pvr_value = 0x00390000,
187 .cpu_name = "PPC970",
188 .cpu_features = CPU_FTRS_PPC970,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100189 .cpu_user_features = COMMON_USER_POWER4 |
Stephen Rothwell49209602005-10-12 15:55:09 +1000190 PPC_FEATURE_HAS_ALTIVEC_COMP,
191 .icache_bsize = 128,
192 .dcache_bsize = 128,
193 .num_pmcs = 8,
194 .cpu_setup = __setup_cpu_ppc970,
Olof Johanssonf39b7a52006-08-11 00:07:08 -0500195 .cpu_restore = __restore_cpu_ppc970,
Stephen Rothwell49209602005-10-12 15:55:09 +1000196 .oprofile_cpu_type = "ppc64/970",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000197 .oprofile_type = PPC_OPROFILE_POWER4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100198 .platform = "ppc970",
Stephen Rothwell49209602005-10-12 15:55:09 +1000199 },
Stephen Rothwell49209602005-10-12 15:55:09 +1000200 { /* PPC970FX */
201 .pvr_mask = 0xffff0000,
202 .pvr_value = 0x003c0000,
203 .cpu_name = "PPC970FX",
Stephen Rothwell49209602005-10-12 15:55:09 +1000204 .cpu_features = CPU_FTRS_PPC970,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100205 .cpu_user_features = COMMON_USER_POWER4 |
Stephen Rothwell49209602005-10-12 15:55:09 +1000206 PPC_FEATURE_HAS_ALTIVEC_COMP,
207 .icache_bsize = 128,
208 .dcache_bsize = 128,
209 .num_pmcs = 8,
210 .cpu_setup = __setup_cpu_ppc970,
Olof Johanssonf39b7a52006-08-11 00:07:08 -0500211 .cpu_restore = __restore_cpu_ppc970,
Stephen Rothwell49209602005-10-12 15:55:09 +1000212 .oprofile_cpu_type = "ppc64/970",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000213 .oprofile_type = PPC_OPROFILE_POWER4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100214 .platform = "ppc970",
Stephen Rothwell49209602005-10-12 15:55:09 +1000215 },
Stephen Rothwell49209602005-10-12 15:55:09 +1000216 { /* PPC970MP */
217 .pvr_mask = 0xffff0000,
218 .pvr_value = 0x00440000,
219 .cpu_name = "PPC970MP",
220 .cpu_features = CPU_FTRS_PPC970,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100221 .cpu_user_features = COMMON_USER_POWER4 |
Stephen Rothwell49209602005-10-12 15:55:09 +1000222 PPC_FEATURE_HAS_ALTIVEC_COMP,
223 .icache_bsize = 128,
224 .dcache_bsize = 128,
Anton Blanchard87af41b2006-05-05 05:44:26 +1000225 .num_pmcs = 8,
Olof Johansson5b43d202006-10-04 23:41:41 -0500226 .cpu_setup = __setup_cpu_ppc970MP,
Olof Johanssonf39b7a52006-08-11 00:07:08 -0500227 .cpu_restore = __restore_cpu_ppc970,
Stephen Rothwell49209602005-10-12 15:55:09 +1000228 .oprofile_cpu_type = "ppc64/970",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000229 .oprofile_type = PPC_OPROFILE_POWER4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100230 .platform = "ppc970",
Stephen Rothwell49209602005-10-12 15:55:09 +1000231 },
Jake Moilanen362ff7b2006-10-18 10:47:22 -0500232 { /* PPC970GX */
233 .pvr_mask = 0xffff0000,
234 .pvr_value = 0x00450000,
235 .cpu_name = "PPC970GX",
236 .cpu_features = CPU_FTRS_PPC970,
237 .cpu_user_features = COMMON_USER_POWER4 |
238 PPC_FEATURE_HAS_ALTIVEC_COMP,
239 .icache_bsize = 128,
240 .dcache_bsize = 128,
241 .num_pmcs = 8,
242 .cpu_setup = __setup_cpu_ppc970,
243 .oprofile_cpu_type = "ppc64/970",
244 .oprofile_type = PPC_OPROFILE_POWER4,
245 .platform = "ppc970",
246 },
Benjamin Herrenschmidt3c726f82005-11-07 11:06:55 +1100247 { /* Power5 GR */
Stephen Rothwell49209602005-10-12 15:55:09 +1000248 .pvr_mask = 0xffff0000,
249 .pvr_value = 0x003a0000,
250 .cpu_name = "POWER5 (gr)",
251 .cpu_features = CPU_FTRS_POWER5,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100252 .cpu_user_features = COMMON_USER_POWER5,
Stephen Rothwell49209602005-10-12 15:55:09 +1000253 .icache_bsize = 128,
254 .dcache_bsize = 128,
255 .num_pmcs = 6,
Stephen Rothwell49209602005-10-12 15:55:09 +1000256 .oprofile_cpu_type = "ppc64/power5",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000257 .oprofile_type = PPC_OPROFILE_POWER4,
Michael Neulinge78dbc82006-06-08 14:42:34 +1000258 /* SIHV / SIPR bits are implemented on POWER4+ (GQ)
259 * and above but only works on POWER5 and above
260 */
261 .oprofile_mmcra_sihv = MMCRA_SIHV,
262 .oprofile_mmcra_sipr = MMCRA_SIPR,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100263 .platform = "power5",
Stephen Rothwell49209602005-10-12 15:55:09 +1000264 },
Benjamin Herrenschmidt3c726f82005-11-07 11:06:55 +1100265 { /* Power5 GS */
Stephen Rothwell49209602005-10-12 15:55:09 +1000266 .pvr_mask = 0xffff0000,
267 .pvr_value = 0x003b0000,
Anton Blanchard834608f2006-01-09 15:42:30 +1100268 .cpu_name = "POWER5+ (gs)",
Stephen Rothwell49209602005-10-12 15:55:09 +1000269 .cpu_features = CPU_FTRS_POWER5,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100270 .cpu_user_features = COMMON_USER_POWER5_PLUS,
Stephen Rothwell49209602005-10-12 15:55:09 +1000271 .icache_bsize = 128,
272 .dcache_bsize = 128,
273 .num_pmcs = 6,
Anton Blanchard834608f2006-01-09 15:42:30 +1100274 .oprofile_cpu_type = "ppc64/power5+",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000275 .oprofile_type = PPC_OPROFILE_POWER4,
Michael Neulinge78dbc82006-06-08 14:42:34 +1000276 .oprofile_mmcra_sihv = MMCRA_SIHV,
277 .oprofile_mmcra_sipr = MMCRA_SIPR,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100278 .platform = "power5+",
Stephen Rothwell49209602005-10-12 15:55:09 +1000279 },
Paul Mackerras974a76f2006-11-10 20:38:53 +1100280 { /* POWER6 in P5+ mode; 2.04-compliant processor */
281 .pvr_mask = 0xffffffff,
282 .pvr_value = 0x0f000001,
283 .cpu_name = "POWER5+",
284 .cpu_features = CPU_FTRS_POWER5,
285 .cpu_user_features = COMMON_USER_POWER5_PLUS,
286 .icache_bsize = 128,
287 .dcache_bsize = 128,
288 .num_pmcs = 6,
289 .oprofile_cpu_type = "ppc64/power6",
290 .oprofile_type = PPC_OPROFILE_POWER4,
291 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
292 .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
293 .oprofile_mmcra_clear = POWER6_MMCRA_THRM |
294 POWER6_MMCRA_OTHER,
295 .platform = "power5+",
296 },
Anton Blanchard03054d52006-04-29 09:51:06 +1000297 { /* Power6 */
298 .pvr_mask = 0xffff0000,
299 .pvr_value = 0x003e0000,
Paul Mackerras974a76f2006-11-10 20:38:53 +1100300 .cpu_name = "POWER6 (raw)",
301 .cpu_features = CPU_FTRS_POWER6,
302 .cpu_user_features = COMMON_USER_POWER6 |
303 PPC_FEATURE_POWER6_EXT,
304 .icache_bsize = 128,
305 .dcache_bsize = 128,
306 .num_pmcs = 6,
307 .oprofile_cpu_type = "ppc64/power6",
308 .oprofile_type = PPC_OPROFILE_POWER4,
309 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
310 .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
311 .oprofile_mmcra_clear = POWER6_MMCRA_THRM |
312 POWER6_MMCRA_OTHER,
313 .platform = "power6x",
314 },
315 { /* 2.05-compliant processor, i.e. Power6 "architected" mode */
316 .pvr_mask = 0xffffffff,
317 .pvr_value = 0x0f000002,
318 .cpu_name = "POWER6 (architected)",
Anton Blanchard03054d52006-04-29 09:51:06 +1000319 .cpu_features = CPU_FTRS_POWER6,
320 .cpu_user_features = COMMON_USER_POWER6,
321 .icache_bsize = 128,
322 .dcache_bsize = 128,
Anton Blanchard99f48612006-10-13 12:13:12 +1000323 .num_pmcs = 6,
Anton Blanchard03054d52006-04-29 09:51:06 +1000324 .oprofile_cpu_type = "ppc64/power6",
325 .oprofile_type = PPC_OPROFILE_POWER4,
Michael Neulinge78dbc82006-06-08 14:42:34 +1000326 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
327 .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
328 .oprofile_mmcra_clear = POWER6_MMCRA_THRM |
329 POWER6_MMCRA_OTHER,
Anton Blanchard03054d52006-04-29 09:51:06 +1000330 .platform = "power6",
331 },
Arnd Bergmannc902be72006-01-04 19:55:53 +0000332 { /* Cell Broadband Engine */
Stephen Rothwell49209602005-10-12 15:55:09 +1000333 .pvr_mask = 0xffff0000,
334 .pvr_value = 0x00700000,
335 .cpu_name = "Cell Broadband Engine",
336 .cpu_features = CPU_FTRS_CELL,
337 .cpu_user_features = COMMON_USER_PPC64 |
Benjamin Herrenschmidtaa5cb0212006-03-01 15:07:07 +1100338 PPC_FEATURE_CELL | PPC_FEATURE_HAS_ALTIVEC_COMP |
339 PPC_FEATURE_SMT,
Stephen Rothwell49209602005-10-12 15:55:09 +1000340 .icache_bsize = 128,
341 .dcache_bsize = 128,
Maynard Johnson18f21902006-11-20 18:45:16 +0100342 .num_pmcs = 4,
343 .oprofile_cpu_type = "ppc64/cell-be",
344 .oprofile_type = PPC_OPROFILE_CELL,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100345 .platform = "ppc-cell-be",
Stephen Rothwell49209602005-10-12 15:55:09 +1000346 },
Olof Johanssonb3ebd1d2006-09-06 14:35:57 -0500347 { /* PA Semi PA6T */
348 .pvr_mask = 0x7fff0000,
349 .pvr_value = 0x00900000,
350 .cpu_name = "PA6T",
351 .cpu_features = CPU_FTRS_PA6T,
352 .cpu_user_features = COMMON_USER_PA6T,
353 .icache_bsize = 64,
354 .dcache_bsize = 64,
355 .num_pmcs = 6,
356 .platform = "pa6t",
357 },
Stephen Rothwell49209602005-10-12 15:55:09 +1000358 { /* default match */
359 .pvr_mask = 0x00000000,
360 .pvr_value = 0x00000000,
361 .cpu_name = "POWER4 (compatible)",
362 .cpu_features = CPU_FTRS_COMPATIBLE,
363 .cpu_user_features = COMMON_USER_PPC64,
364 .icache_bsize = 128,
365 .dcache_bsize = 128,
366 .num_pmcs = 6,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100367 .platform = "power4",
Stephen Rothwell49209602005-10-12 15:55:09 +1000368 }
369#endif /* CONFIG_PPC64 */
370#ifdef CONFIG_PPC32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700371#if CLASSIC_PPC
Stephen Rothwell49209602005-10-12 15:55:09 +1000372 { /* 601 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700373 .pvr_mask = 0xffff0000,
374 .pvr_value = 0x00010000,
375 .cpu_name = "601",
Kumar Gala10b35d92005-09-23 14:08:58 -0500376 .cpu_features = CPU_FTRS_PPC601,
Stephen Rothwell49209602005-10-12 15:55:09 +1000377 .cpu_user_features = COMMON_USER | PPC_FEATURE_601_INSTR |
Paul Mackerras98599012005-10-22 16:51:34 +1000378 PPC_FEATURE_UNIFIED_CACHE | PPC_FEATURE_NO_TB,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700379 .icache_bsize = 32,
380 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100381 .platform = "ppc601",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700382 },
383 { /* 603 */
384 .pvr_mask = 0xffff0000,
385 .pvr_value = 0x00030000,
386 .cpu_name = "603",
Kumar Gala10b35d92005-09-23 14:08:58 -0500387 .cpu_features = CPU_FTRS_603,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000388 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700389 .icache_bsize = 32,
390 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100391 .cpu_setup = __setup_cpu_603,
392 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700393 },
394 { /* 603e */
395 .pvr_mask = 0xffff0000,
396 .pvr_value = 0x00060000,
397 .cpu_name = "603e",
Kumar Gala10b35d92005-09-23 14:08:58 -0500398 .cpu_features = CPU_FTRS_603,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000399 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700400 .icache_bsize = 32,
401 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100402 .cpu_setup = __setup_cpu_603,
403 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700404 },
405 { /* 603ev */
406 .pvr_mask = 0xffff0000,
407 .pvr_value = 0x00070000,
408 .cpu_name = "603ev",
Kumar Gala10b35d92005-09-23 14:08:58 -0500409 .cpu_features = CPU_FTRS_603,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000410 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700411 .icache_bsize = 32,
412 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100413 .cpu_setup = __setup_cpu_603,
414 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700415 },
416 { /* 604 */
417 .pvr_mask = 0xffff0000,
418 .pvr_value = 0x00040000,
419 .cpu_name = "604",
Kumar Gala10b35d92005-09-23 14:08:58 -0500420 .cpu_features = CPU_FTRS_604,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000421 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700422 .icache_bsize = 32,
423 .dcache_bsize = 32,
424 .num_pmcs = 2,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100425 .cpu_setup = __setup_cpu_604,
426 .platform = "ppc604",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700427 },
428 { /* 604e */
429 .pvr_mask = 0xfffff000,
430 .pvr_value = 0x00090000,
431 .cpu_name = "604e",
Kumar Gala10b35d92005-09-23 14:08:58 -0500432 .cpu_features = CPU_FTRS_604,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000433 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700434 .icache_bsize = 32,
435 .dcache_bsize = 32,
436 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100437 .cpu_setup = __setup_cpu_604,
438 .platform = "ppc604",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700439 },
440 { /* 604r */
441 .pvr_mask = 0xffff0000,
442 .pvr_value = 0x00090000,
443 .cpu_name = "604r",
Kumar Gala10b35d92005-09-23 14:08:58 -0500444 .cpu_features = CPU_FTRS_604,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000445 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700446 .icache_bsize = 32,
447 .dcache_bsize = 32,
448 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100449 .cpu_setup = __setup_cpu_604,
450 .platform = "ppc604",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700451 },
452 { /* 604ev */
453 .pvr_mask = 0xffff0000,
454 .pvr_value = 0x000a0000,
455 .cpu_name = "604ev",
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 = 4,
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 { /* 740/750 (0x4202, don't support TAU ?) */
465 .pvr_mask = 0xffffffff,
466 .pvr_value = 0x00084202,
467 .cpu_name = "740/750",
Kumar Gala10b35d92005-09-23 14:08:58 -0500468 .cpu_features = CPU_FTRS_740_NOTAU,
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_750,
474 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700475 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700476 { /* 750CX (80100 and 8010x?) */
477 .pvr_mask = 0xfffffff0,
478 .pvr_value = 0x00080100,
479 .cpu_name = "750CX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500480 .cpu_features = CPU_FTRS_750,
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_750cx,
486 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700487 },
488 { /* 750CX (82201 and 82202) */
489 .pvr_mask = 0xfffffff0,
490 .pvr_value = 0x00082200,
491 .cpu_name = "750CX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500492 .cpu_features = CPU_FTRS_750,
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_750cx,
498 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700499 },
500 { /* 750CXe (82214) */
501 .pvr_mask = 0xfffffff0,
502 .pvr_value = 0x00082210,
503 .cpu_name = "750CXe",
Kumar Gala10b35d92005-09-23 14:08:58 -0500504 .cpu_features = CPU_FTRS_750,
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_750cx,
510 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700511 },
Arthur Othieno7c316252005-09-03 15:55:52 -0700512 { /* 750CXe "Gekko" (83214) */
513 .pvr_mask = 0xffffffff,
514 .pvr_value = 0x00083214,
515 .cpu_name = "750CXe",
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,
Arthur Othieno7c316252005-09-03 15:55:52 -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",
Arthur Othieno7c316252005-09-03 15:55:52 -0700523 },
Arthur Othienoac1ff042005-09-03 15:55:51 -0700524 { /* 745/755 */
525 .pvr_mask = 0xfffff000,
526 .pvr_value = 0x00083000,
527 .cpu_name = "745/755",
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,
Arthur Othienoac1ff042005-09-03 15:55:51 -0700530 .icache_bsize = 32,
531 .dcache_bsize = 32,
532 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100533 .cpu_setup = __setup_cpu_750,
534 .platform = "ppc750",
Arthur Othienoac1ff042005-09-03 15:55:51 -0700535 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700536 { /* 750FX rev 1.x */
537 .pvr_mask = 0xffffff00,
538 .pvr_value = 0x70000100,
539 .cpu_name = "750FX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500540 .cpu_features = CPU_FTRS_750FX1,
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_750,
546 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700547 },
548 { /* 750FX rev 2.0 must disable HID0[DPM] */
549 .pvr_mask = 0xffffffff,
550 .pvr_value = 0x70000200,
551 .cpu_name = "750FX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500552 .cpu_features = CPU_FTRS_750FX2,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000553 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700554 .icache_bsize = 32,
555 .dcache_bsize = 32,
556 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100557 .cpu_setup = __setup_cpu_750,
558 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700559 },
560 { /* 750FX (All revs except 2.0) */
561 .pvr_mask = 0xffff0000,
562 .pvr_value = 0x70000000,
563 .cpu_name = "750FX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500564 .cpu_features = CPU_FTRS_750FX,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000565 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700566 .icache_bsize = 32,
567 .dcache_bsize = 32,
568 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100569 .cpu_setup = __setup_cpu_750fx,
570 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700571 },
572 { /* 750GX */
573 .pvr_mask = 0xffff0000,
574 .pvr_value = 0x70020000,
575 .cpu_name = "750GX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500576 .cpu_features = CPU_FTRS_750GX,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000577 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700578 .icache_bsize = 32,
579 .dcache_bsize = 32,
580 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100581 .cpu_setup = __setup_cpu_750fx,
582 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700583 },
584 { /* 740/750 (L2CR bit need fixup for 740) */
585 .pvr_mask = 0xffff0000,
586 .pvr_value = 0x00080000,
587 .cpu_name = "740/750",
Kumar Gala10b35d92005-09-23 14:08:58 -0500588 .cpu_features = CPU_FTRS_740,
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 { /* 7400 rev 1.1 ? (no TAU) */
597 .pvr_mask = 0xffffffff,
598 .pvr_value = 0x000c1101,
599 .cpu_name = "7400 (1.1)",
Kumar Gala10b35d92005-09-23 14:08:58 -0500600 .cpu_features = CPU_FTRS_7400_NOTAU,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000601 .cpu_user_features = COMMON_USER |
602 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700603 .icache_bsize = 32,
604 .dcache_bsize = 32,
605 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100606 .cpu_setup = __setup_cpu_7400,
607 .platform = "ppc7400",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700608 },
609 { /* 7400 */
610 .pvr_mask = 0xffff0000,
611 .pvr_value = 0x000c0000,
612 .cpu_name = "7400",
Kumar Gala10b35d92005-09-23 14:08:58 -0500613 .cpu_features = CPU_FTRS_7400,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000614 .cpu_user_features = COMMON_USER |
615 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700616 .icache_bsize = 32,
617 .dcache_bsize = 32,
618 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100619 .cpu_setup = __setup_cpu_7400,
620 .platform = "ppc7400",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700621 },
622 { /* 7410 */
623 .pvr_mask = 0xffff0000,
624 .pvr_value = 0x800c0000,
625 .cpu_name = "7410",
Kumar Gala10b35d92005-09-23 14:08:58 -0500626 .cpu_features = CPU_FTRS_7400,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000627 .cpu_user_features = COMMON_USER |
628 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700629 .icache_bsize = 32,
630 .dcache_bsize = 32,
631 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100632 .cpu_setup = __setup_cpu_7410,
633 .platform = "ppc7400",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700634 },
635 { /* 7450 2.0 - no doze/nap */
636 .pvr_mask = 0xffffffff,
637 .pvr_value = 0x80000200,
638 .cpu_name = "7450",
Kumar Gala10b35d92005-09-23 14:08:58 -0500639 .cpu_features = CPU_FTRS_7450_20,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000640 .cpu_user_features = COMMON_USER |
641 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700642 .icache_bsize = 32,
643 .dcache_bsize = 32,
644 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600645 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600646 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000647 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100648 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700649 },
650 { /* 7450 2.1 */
651 .pvr_mask = 0xffffffff,
652 .pvr_value = 0x80000201,
653 .cpu_name = "7450",
Kumar Gala10b35d92005-09-23 14:08:58 -0500654 .cpu_features = CPU_FTRS_7450_21,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000655 .cpu_user_features = COMMON_USER |
656 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700657 .icache_bsize = 32,
658 .dcache_bsize = 32,
659 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600660 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600661 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000662 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100663 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700664 },
665 { /* 7450 2.3 and newer */
666 .pvr_mask = 0xffff0000,
667 .pvr_value = 0x80000000,
668 .cpu_name = "7450",
Kumar Gala10b35d92005-09-23 14:08:58 -0500669 .cpu_features = CPU_FTRS_7450_23,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000670 .cpu_user_features = COMMON_USER |
671 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700672 .icache_bsize = 32,
673 .dcache_bsize = 32,
674 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600675 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600676 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000677 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100678 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700679 },
680 { /* 7455 rev 1.x */
681 .pvr_mask = 0xffffff00,
682 .pvr_value = 0x80010100,
683 .cpu_name = "7455",
Kumar Gala10b35d92005-09-23 14:08:58 -0500684 .cpu_features = CPU_FTRS_7455_1,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000685 .cpu_user_features = COMMON_USER |
686 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700687 .icache_bsize = 32,
688 .dcache_bsize = 32,
689 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600690 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600691 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000692 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100693 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700694 },
695 { /* 7455 rev 2.0 */
696 .pvr_mask = 0xffffffff,
697 .pvr_value = 0x80010200,
698 .cpu_name = "7455",
Kumar Gala10b35d92005-09-23 14:08:58 -0500699 .cpu_features = CPU_FTRS_7455_20,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000700 .cpu_user_features = COMMON_USER |
701 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700702 .icache_bsize = 32,
703 .dcache_bsize = 32,
704 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600705 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600706 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000707 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100708 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700709 },
710 { /* 7455 others */
711 .pvr_mask = 0xffff0000,
712 .pvr_value = 0x80010000,
713 .cpu_name = "7455",
Kumar Gala10b35d92005-09-23 14:08:58 -0500714 .cpu_features = CPU_FTRS_7455,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000715 .cpu_user_features = COMMON_USER |
716 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700717 .icache_bsize = 32,
718 .dcache_bsize = 32,
719 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600720 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600721 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000722 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100723 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700724 },
725 { /* 7447/7457 Rev 1.0 */
726 .pvr_mask = 0xffffffff,
727 .pvr_value = 0x80020100,
728 .cpu_name = "7447/7457",
Kumar Gala10b35d92005-09-23 14:08:58 -0500729 .cpu_features = CPU_FTRS_7447_10,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000730 .cpu_user_features = COMMON_USER |
731 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700732 .icache_bsize = 32,
733 .dcache_bsize = 32,
734 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600735 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600736 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000737 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100738 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700739 },
740 { /* 7447/7457 Rev 1.1 */
741 .pvr_mask = 0xffffffff,
742 .pvr_value = 0x80020101,
743 .cpu_name = "7447/7457",
Kumar Gala10b35d92005-09-23 14:08:58 -0500744 .cpu_features = CPU_FTRS_7447_10,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000745 .cpu_user_features = COMMON_USER |
746 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700747 .icache_bsize = 32,
748 .dcache_bsize = 32,
749 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600750 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600751 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000752 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100753 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700754 },
755 { /* 7447/7457 Rev 1.2 and later */
756 .pvr_mask = 0xffff0000,
757 .pvr_value = 0x80020000,
758 .cpu_name = "7447/7457",
Kumar Gala10b35d92005-09-23 14:08:58 -0500759 .cpu_features = CPU_FTRS_7447,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000760 .cpu_user_features = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700761 .icache_bsize = 32,
762 .dcache_bsize = 32,
763 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600764 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600765 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000766 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100767 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700768 },
769 { /* 7447A */
770 .pvr_mask = 0xffff0000,
771 .pvr_value = 0x80030000,
772 .cpu_name = "7447A",
Kumar Gala10b35d92005-09-23 14:08:58 -0500773 .cpu_features = CPU_FTRS_7447A,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000774 .cpu_user_features = COMMON_USER |
775 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700776 .icache_bsize = 32,
777 .dcache_bsize = 32,
778 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600779 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600780 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000781 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100782 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700783 },
Kumar Galabbde6302005-09-03 15:55:55 -0700784 { /* 7448 */
785 .pvr_mask = 0xffff0000,
786 .pvr_value = 0x80040000,
787 .cpu_name = "7448",
Kumar Gala10b35d92005-09-23 14:08:58 -0500788 .cpu_features = CPU_FTRS_7447A,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000789 .cpu_user_features = COMMON_USER |
790 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Kumar Galabbde6302005-09-03 15:55:55 -0700791 .icache_bsize = 32,
792 .dcache_bsize = 32,
793 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600794 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600795 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000796 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100797 .platform = "ppc7450",
Kumar Galabbde6302005-09-03 15:55:55 -0700798 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700799 { /* 82xx (8240, 8245, 8260 are all 603e cores) */
800 .pvr_mask = 0x7fff0000,
801 .pvr_value = 0x00810000,
802 .cpu_name = "82xx",
Kumar Gala10b35d92005-09-23 14:08:58 -0500803 .cpu_features = CPU_FTRS_82XX,
Stephen Rothwell49209602005-10-12 15:55:09 +1000804 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700805 .icache_bsize = 32,
806 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100807 .cpu_setup = __setup_cpu_603,
808 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700809 },
810 { /* All G2_LE (603e core, plus some) have the same pvr */
811 .pvr_mask = 0x7fff0000,
812 .pvr_value = 0x00820000,
813 .cpu_name = "G2_LE",
Kumar Gala10b35d92005-09-23 14:08:58 -0500814 .cpu_features = CPU_FTRS_G2_LE,
Stephen Rothwell49209602005-10-12 15:55:09 +1000815 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700816 .icache_bsize = 32,
817 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100818 .cpu_setup = __setup_cpu_603,
819 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700820 },
Kim Phillips6c4a2502006-10-02 20:10:24 -0500821 { /* e300c1 (a 603e core, plus some) on 83xx */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700822 .pvr_mask = 0x7fff0000,
823 .pvr_value = 0x00830000,
Kim Phillips6c4a2502006-10-02 20:10:24 -0500824 .cpu_name = "e300c1",
Kumar Gala10b35d92005-09-23 14:08:58 -0500825 .cpu_features = CPU_FTRS_E300,
Stephen Rothwell49209602005-10-12 15:55:09 +1000826 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700827 .icache_bsize = 32,
828 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100829 .cpu_setup = __setup_cpu_603,
830 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700831 },
Kim Phillips6c4a2502006-10-02 20:10:24 -0500832 { /* e300c2 (an e300c1 core, plus some, minus FPU) on 83xx */
833 .pvr_mask = 0x7fff0000,
834 .pvr_value = 0x00840000,
835 .cpu_name = "e300c2",
836 .cpu_features = CPU_FTRS_E300,
837 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
838 .icache_bsize = 32,
839 .dcache_bsize = 32,
840 .cpu_setup = __setup_cpu_603,
841 .platform = "ppc603",
842 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700843 { /* default match, we assume split I/D cache & TB (non-601)... */
844 .pvr_mask = 0x00000000,
845 .pvr_value = 0x00000000,
846 .cpu_name = "(generic PPC)",
Kumar Gala10b35d92005-09-23 14:08:58 -0500847 .cpu_features = CPU_FTRS_CLASSIC32,
Stephen Rothwell49209602005-10-12 15:55:09 +1000848 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700849 .icache_bsize = 32,
850 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100851 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700852 },
853#endif /* CLASSIC_PPC */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700854#ifdef CONFIG_8xx
855 { /* 8xx */
856 .pvr_mask = 0xffff0000,
857 .pvr_value = 0x00500000,
858 .cpu_name = "8xx",
859 /* CPU_FTR_MAYBE_CAN_DOZE is possible,
860 * if the 8xx code is there.... */
Kumar Gala10b35d92005-09-23 14:08:58 -0500861 .cpu_features = CPU_FTRS_8XX,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700862 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
863 .icache_bsize = 16,
864 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100865 .platform = "ppc823",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700866 },
867#endif /* CONFIG_8xx */
868#ifdef CONFIG_40x
869 { /* 403GC */
870 .pvr_mask = 0xffffff00,
871 .pvr_value = 0x00200200,
872 .cpu_name = "403GC",
Kumar Gala10b35d92005-09-23 14:08:58 -0500873 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700874 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
875 .icache_bsize = 16,
876 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100877 .platform = "ppc403",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700878 },
879 { /* 403GCX */
880 .pvr_mask = 0xffffff00,
881 .pvr_value = 0x00201400,
882 .cpu_name = "403GCX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500883 .cpu_features = CPU_FTRS_40X,
Paul Mackerras98599012005-10-22 16:51:34 +1000884 .cpu_user_features = PPC_FEATURE_32 |
885 PPC_FEATURE_HAS_MMU | PPC_FEATURE_NO_TB,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700886 .icache_bsize = 16,
887 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100888 .platform = "ppc403",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700889 },
890 { /* 403G ?? */
891 .pvr_mask = 0xffff0000,
892 .pvr_value = 0x00200000,
893 .cpu_name = "403G ??",
Kumar Gala10b35d92005-09-23 14:08:58 -0500894 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700895 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
896 .icache_bsize = 16,
897 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100898 .platform = "ppc403",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700899 },
900 { /* 405GP */
901 .pvr_mask = 0xffff0000,
902 .pvr_value = 0x40110000,
903 .cpu_name = "405GP",
Kumar Gala10b35d92005-09-23 14:08:58 -0500904 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700905 .cpu_user_features = PPC_FEATURE_32 |
906 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
907 .icache_bsize = 32,
908 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100909 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700910 },
911 { /* STB 03xxx */
912 .pvr_mask = 0xffff0000,
913 .pvr_value = 0x40130000,
914 .cpu_name = "STB03xxx",
Kumar Gala10b35d92005-09-23 14:08:58 -0500915 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700916 .cpu_user_features = PPC_FEATURE_32 |
917 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
918 .icache_bsize = 32,
919 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100920 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700921 },
922 { /* STB 04xxx */
923 .pvr_mask = 0xffff0000,
924 .pvr_value = 0x41810000,
925 .cpu_name = "STB04xxx",
Kumar Gala10b35d92005-09-23 14:08:58 -0500926 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700927 .cpu_user_features = PPC_FEATURE_32 |
928 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
929 .icache_bsize = 32,
930 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100931 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700932 },
933 { /* NP405L */
934 .pvr_mask = 0xffff0000,
935 .pvr_value = 0x41610000,
936 .cpu_name = "NP405L",
Kumar Gala10b35d92005-09-23 14:08:58 -0500937 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700938 .cpu_user_features = PPC_FEATURE_32 |
939 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
940 .icache_bsize = 32,
941 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100942 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700943 },
944 { /* NP4GS3 */
945 .pvr_mask = 0xffff0000,
946 .pvr_value = 0x40B10000,
947 .cpu_name = "NP4GS3",
Kumar Gala10b35d92005-09-23 14:08:58 -0500948 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700949 .cpu_user_features = PPC_FEATURE_32 |
950 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
951 .icache_bsize = 32,
952 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100953 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700954 },
955 { /* NP405H */
956 .pvr_mask = 0xffff0000,
957 .pvr_value = 0x41410000,
958 .cpu_name = "NP405H",
Kumar Gala10b35d92005-09-23 14:08:58 -0500959 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700960 .cpu_user_features = PPC_FEATURE_32 |
961 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
962 .icache_bsize = 32,
963 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100964 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700965 },
966 { /* 405GPr */
967 .pvr_mask = 0xffff0000,
968 .pvr_value = 0x50910000,
969 .cpu_name = "405GPr",
Kumar Gala10b35d92005-09-23 14:08:58 -0500970 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700971 .cpu_user_features = PPC_FEATURE_32 |
972 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
973 .icache_bsize = 32,
974 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100975 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700976 },
977 { /* STBx25xx */
978 .pvr_mask = 0xffff0000,
979 .pvr_value = 0x51510000,
980 .cpu_name = "STBx25xx",
Kumar Gala10b35d92005-09-23 14:08:58 -0500981 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700982 .cpu_user_features = PPC_FEATURE_32 |
983 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
984 .icache_bsize = 32,
985 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100986 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700987 },
988 { /* 405LP */
989 .pvr_mask = 0xffff0000,
990 .pvr_value = 0x41F10000,
991 .cpu_name = "405LP",
Kumar Gala10b35d92005-09-23 14:08:58 -0500992 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700993 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
994 .icache_bsize = 32,
995 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100996 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700997 },
998 { /* Xilinx Virtex-II Pro */
Grant C. Likely72646c72006-01-19 01:13:20 -0700999 .pvr_mask = 0xfffff000,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001000 .pvr_value = 0x20010000,
1001 .cpu_name = "Virtex-II Pro",
Kumar Gala10b35d92005-09-23 14:08:58 -05001002 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001003 .cpu_user_features = PPC_FEATURE_32 |
1004 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1005 .icache_bsize = 32,
1006 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001007 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001008 },
Grant C. Likely72646c72006-01-19 01:13:20 -07001009 { /* Xilinx Virtex-4 FX */
1010 .pvr_mask = 0xfffff000,
1011 .pvr_value = 0x20011000,
1012 .cpu_name = "Virtex-4 FX",
1013 .cpu_features = CPU_FTRS_40X,
1014 .cpu_user_features = PPC_FEATURE_32 |
1015 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1016 .icache_bsize = 32,
1017 .dcache_bsize = 32,
Peter Bergner838fdb42006-09-14 14:18:38 -05001018 .platform = "ppc405",
Grant C. Likely72646c72006-01-19 01:13:20 -07001019 },
Eugene Suroveginad95d602005-06-07 13:22:09 -07001020 { /* 405EP */
1021 .pvr_mask = 0xffff0000,
1022 .pvr_value = 0x51210000,
1023 .cpu_name = "405EP",
Kumar Gala10b35d92005-09-23 14:08:58 -05001024 .cpu_features = CPU_FTRS_40X,
Eugene Suroveginad95d602005-06-07 13:22:09 -07001025 .cpu_user_features = PPC_FEATURE_32 |
1026 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1027 .icache_bsize = 32,
1028 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001029 .platform = "ppc405",
Eugene Suroveginad95d602005-06-07 13:22:09 -07001030 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001031
1032#endif /* CONFIG_40x */
1033#ifdef CONFIG_44x
Matt Porterc9cf73a2005-07-31 22:34:52 -07001034 {
1035 .pvr_mask = 0xf0000fff,
1036 .pvr_value = 0x40000850,
1037 .cpu_name = "440EP Rev. A",
Kumar Gala10b35d92005-09-23 14:08:58 -05001038 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001039 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
Matt Porterc9cf73a2005-07-31 22:34:52 -07001040 .icache_bsize = 32,
1041 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001042 .platform = "ppc440",
Matt Porterc9cf73a2005-07-31 22:34:52 -07001043 },
1044 {
1045 .pvr_mask = 0xf0000fff,
1046 .pvr_value = 0x400008d3,
1047 .cpu_name = "440EP Rev. B",
Kumar Gala10b35d92005-09-23 14:08:58 -05001048 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001049 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
Matt Porterc9cf73a2005-07-31 22:34:52 -07001050 .icache_bsize = 32,
1051 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001052 .platform = "ppc440",
Matt Porterc9cf73a2005-07-31 22:34:52 -07001053 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001054 { /* 440GP Rev. B */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001055 .pvr_mask = 0xf0000fff,
1056 .pvr_value = 0x40000440,
1057 .cpu_name = "440GP Rev. B",
Kumar Gala10b35d92005-09-23 14:08:58 -05001058 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001059 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001060 .icache_bsize = 32,
1061 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001062 .platform = "ppc440gp",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001063 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001064 { /* 440GP Rev. C */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001065 .pvr_mask = 0xf0000fff,
1066 .pvr_value = 0x40000481,
1067 .cpu_name = "440GP Rev. C",
Kumar Gala10b35d92005-09-23 14:08:58 -05001068 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001069 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001070 .icache_bsize = 32,
1071 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001072 .platform = "ppc440gp",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001073 },
1074 { /* 440GX Rev. A */
1075 .pvr_mask = 0xf0000fff,
1076 .pvr_value = 0x50000850,
1077 .cpu_name = "440GX Rev. A",
Kumar Gala10b35d92005-09-23 14:08:58 -05001078 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001079 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001080 .icache_bsize = 32,
1081 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001082 .platform = "ppc440",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001083 },
1084 { /* 440GX Rev. B */
1085 .pvr_mask = 0xf0000fff,
1086 .pvr_value = 0x50000851,
1087 .cpu_name = "440GX Rev. B",
Kumar Gala10b35d92005-09-23 14:08:58 -05001088 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001089 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001090 .icache_bsize = 32,
1091 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001092 .platform = "ppc440",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001093 },
1094 { /* 440GX Rev. C */
1095 .pvr_mask = 0xf0000fff,
1096 .pvr_value = 0x50000892,
1097 .cpu_name = "440GX Rev. C",
Kumar Gala10b35d92005-09-23 14:08:58 -05001098 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001099 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001100 .icache_bsize = 32,
1101 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001102 .platform = "ppc440",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001103 },
Eugene Surovegin9149fb32005-09-03 15:55:40 -07001104 { /* 440GX Rev. F */
1105 .pvr_mask = 0xf0000fff,
1106 .pvr_value = 0x50000894,
1107 .cpu_name = "440GX Rev. F",
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,
Eugene Surovegin9149fb32005-09-03 15:55:40 -07001110 .icache_bsize = 32,
1111 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001112 .platform = "ppc440",
Eugene Surovegin9149fb32005-09-03 15:55:40 -07001113 },
Matt Porter656de7e2005-09-03 15:55:42 -07001114 { /* 440SP Rev. A */
1115 .pvr_mask = 0xff000fff,
1116 .pvr_value = 0x53000891,
1117 .cpu_name = "440SP Rev. A",
Kumar Gala10b35d92005-09-23 14:08:58 -05001118 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001119 .cpu_user_features = COMMON_USER_BOOKE,
Matt Porter656de7e2005-09-03 15:55:42 -07001120 .icache_bsize = 32,
1121 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001122 .platform = "ppc440",
Matt Porter656de7e2005-09-03 15:55:42 -07001123 },
Roland Dreierb0f7b8b2005-11-07 00:58:13 -08001124 { /* 440SPe Rev. A */
1125 .pvr_mask = 0xff000fff,
1126 .pvr_value = 0x53000890,
1127 .cpu_name = "440SPe Rev. A",
1128 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
1129 CPU_FTR_USE_TB,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001130 .cpu_user_features = COMMON_USER_BOOKE,
Roland Dreierb0f7b8b2005-11-07 00:58:13 -08001131 .icache_bsize = 32,
1132 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001133 .platform = "ppc440",
Roland Dreierb0f7b8b2005-11-07 00:58:13 -08001134 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001135#endif /* CONFIG_44x */
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001136#ifdef CONFIG_FSL_BOOKE
Stephen Rothwell49209602005-10-12 15:55:09 +10001137 { /* e200z5 */
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001138 .pvr_mask = 0xfff00000,
1139 .pvr_value = 0x81000000,
1140 .cpu_name = "e200z5",
1141 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001142 .cpu_features = CPU_FTRS_E200,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001143 .cpu_user_features = COMMON_USER_BOOKE |
1144 PPC_FEATURE_HAS_EFP_SINGLE |
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001145 PPC_FEATURE_UNIFIED_CACHE,
1146 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001147 .platform = "ppc5554",
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001148 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001149 { /* e200z6 */
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001150 .pvr_mask = 0xfff00000,
1151 .pvr_value = 0x81100000,
1152 .cpu_name = "e200z6",
1153 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001154 .cpu_features = CPU_FTRS_E200,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001155 .cpu_user_features = COMMON_USER_BOOKE |
1156 PPC_FEATURE_SPE_COMP |
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001157 PPC_FEATURE_HAS_EFP_SINGLE |
1158 PPC_FEATURE_UNIFIED_CACHE,
1159 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001160 .platform = "ppc5554",
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001161 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001162 { /* e500 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001163 .pvr_mask = 0xffff0000,
1164 .pvr_value = 0x80200000,
1165 .cpu_name = "e500",
1166 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001167 .cpu_features = CPU_FTRS_E500,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001168 .cpu_user_features = COMMON_USER_BOOKE |
1169 PPC_FEATURE_SPE_COMP |
Linus Torvalds1da177e2005-04-16 15:20:36 -07001170 PPC_FEATURE_HAS_EFP_SINGLE,
1171 .icache_bsize = 32,
1172 .dcache_bsize = 32,
1173 .num_pmcs = 4,
Andy Fleming555d97a2005-12-15 20:02:04 -06001174 .oprofile_cpu_type = "ppc/e500",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +00001175 .oprofile_type = PPC_OPROFILE_BOOKE,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001176 .platform = "ppc8540",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001177 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001178 { /* e500v2 */
Kumar Gala5b37b702005-06-21 17:15:18 -07001179 .pvr_mask = 0xffff0000,
1180 .pvr_value = 0x80210000,
1181 .cpu_name = "e500v2",
1182 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001183 .cpu_features = CPU_FTRS_E500_2,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001184 .cpu_user_features = COMMON_USER_BOOKE |
1185 PPC_FEATURE_SPE_COMP |
1186 PPC_FEATURE_HAS_EFP_SINGLE |
1187 PPC_FEATURE_HAS_EFP_DOUBLE,
Kumar Gala5b37b702005-06-21 17:15:18 -07001188 .icache_bsize = 32,
1189 .dcache_bsize = 32,
1190 .num_pmcs = 4,
Andy Fleming555d97a2005-12-15 20:02:04 -06001191 .oprofile_cpu_type = "ppc/e500",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +00001192 .oprofile_type = PPC_OPROFILE_BOOKE,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001193 .platform = "ppc8548",
Kumar Gala5b37b702005-06-21 17:15:18 -07001194 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001195#endif
1196#if !CLASSIC_PPC
1197 { /* default match */
1198 .pvr_mask = 0x00000000,
1199 .pvr_value = 0x00000000,
1200 .cpu_name = "(generic PPC)",
Kumar Gala10b35d92005-09-23 14:08:58 -05001201 .cpu_features = CPU_FTRS_GENERIC_32,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001202 .cpu_user_features = PPC_FEATURE_32,
1203 .icache_bsize = 32,
1204 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001205 .platform = "powerpc",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001206 }
1207#endif /* !CLASSIC_PPC */
Stephen Rothwell49209602005-10-12 15:55:09 +10001208#endif /* CONFIG_PPC32 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001209};
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001210
Paul Mackerras974a76f2006-11-10 20:38:53 +11001211struct cpu_spec *identify_cpu(unsigned long offset, unsigned int pvr)
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001212{
1213 struct cpu_spec *s = cpu_specs;
1214 struct cpu_spec **cur = &cur_cpu_spec;
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001215 int i;
1216
1217 s = PTRRELOC(s);
1218 cur = PTRRELOC(cur);
1219
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001220 for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++)
1221 if ((pvr & s->pvr_mask) == s->pvr_value) {
1222 *cur = cpu_specs + i;
1223#ifdef CONFIG_PPC64
1224 /* ppc64 expects identify_cpu to also call setup_cpu
1225 * for that processor. I will consolidate that at a
1226 * later time, for now, just use our friend #ifdef.
1227 * we also don't need to PTRRELOC the function pointer
1228 * on ppc64 as we are running at 0 in real mode.
1229 */
1230 if (s->cpu_setup) {
1231 s->cpu_setup(offset, s);
1232 }
1233#endif /* CONFIG_PPC64 */
1234 return s;
1235 }
1236 BUG();
1237 return NULL;
1238}
1239
Benjamin Herrenschmidt0909c8c2006-10-20 11:47:18 +10001240void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end)
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001241{
1242 struct fixup_entry {
1243 unsigned long mask;
1244 unsigned long value;
Benjamin Herrenschmidt0909c8c2006-10-20 11:47:18 +10001245 long start_off;
1246 long end_off;
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001247 } *fcur, *fend;
1248
1249 fcur = fixup_start;
1250 fend = fixup_end;
1251
1252 for (; fcur < fend; fcur++) {
1253 unsigned int *pstart, *pend, *p;
1254
1255 if ((value & fcur->mask) == fcur->value)
1256 continue;
1257
1258 /* These PTRRELOCs will disappear once the new scheme for
1259 * modules and vdso is implemented
1260 */
Benjamin Herrenschmidt0909c8c2006-10-20 11:47:18 +10001261 pstart = ((unsigned int *)fcur) + (fcur->start_off / 4);
1262 pend = ((unsigned int *)fcur) + (fcur->end_off / 4);
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001263
1264 for (p = pstart; p < pend; p++) {
1265 *p = 0x60000000u;
1266 asm volatile ("dcbst 0, %0" : : "r" (p));
1267 }
1268 asm volatile ("sync" : : : "memory");
1269 for (p = pstart; p < pend; p++)
1270 asm volatile ("icbi 0,%0" : : "r" (p));
1271 asm volatile ("sync; isync" : : : "memory");
1272 }
1273}