blob: 1e4ed0731d15d02dab603f7228474219db20efdd [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 Herrenschmidtaa5cb022006-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 },
Anton Blanchard03054d52006-04-29 09:51:06 +1000280 { /* Power6 */
281 .pvr_mask = 0xffff0000,
282 .pvr_value = 0x003e0000,
283 .cpu_name = "POWER6",
284 .cpu_features = CPU_FTRS_POWER6,
285 .cpu_user_features = COMMON_USER_POWER6,
286 .icache_bsize = 128,
287 .dcache_bsize = 128,
Anton Blanchard99f48612006-10-13 12:13:12 +1000288 .num_pmcs = 6,
Anton Blanchard03054d52006-04-29 09:51:06 +1000289 .oprofile_cpu_type = "ppc64/power6",
290 .oprofile_type = PPC_OPROFILE_POWER4,
Michael Neulinge78dbc82006-06-08 14:42:34 +1000291 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
292 .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
293 .oprofile_mmcra_clear = POWER6_MMCRA_THRM |
294 POWER6_MMCRA_OTHER,
Anton Blanchard03054d52006-04-29 09:51:06 +1000295 .platform = "power6",
296 },
Arnd Bergmannc902be72006-01-04 19:55:53 +0000297 { /* Cell Broadband Engine */
Stephen Rothwell49209602005-10-12 15:55:09 +1000298 .pvr_mask = 0xffff0000,
299 .pvr_value = 0x00700000,
300 .cpu_name = "Cell Broadband Engine",
301 .cpu_features = CPU_FTRS_CELL,
302 .cpu_user_features = COMMON_USER_PPC64 |
Benjamin Herrenschmidtaa5cb022006-03-01 15:07:07 +1100303 PPC_FEATURE_CELL | PPC_FEATURE_HAS_ALTIVEC_COMP |
304 PPC_FEATURE_SMT,
Stephen Rothwell49209602005-10-12 15:55:09 +1000305 .icache_bsize = 128,
306 .dcache_bsize = 128,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100307 .platform = "ppc-cell-be",
Stephen Rothwell49209602005-10-12 15:55:09 +1000308 },
Olof Johanssonb3ebd1d2006-09-06 14:35:57 -0500309 { /* PA Semi PA6T */
310 .pvr_mask = 0x7fff0000,
311 .pvr_value = 0x00900000,
312 .cpu_name = "PA6T",
313 .cpu_features = CPU_FTRS_PA6T,
314 .cpu_user_features = COMMON_USER_PA6T,
315 .icache_bsize = 64,
316 .dcache_bsize = 64,
317 .num_pmcs = 6,
318 .platform = "pa6t",
319 },
Stephen Rothwell49209602005-10-12 15:55:09 +1000320 { /* default match */
321 .pvr_mask = 0x00000000,
322 .pvr_value = 0x00000000,
323 .cpu_name = "POWER4 (compatible)",
324 .cpu_features = CPU_FTRS_COMPATIBLE,
325 .cpu_user_features = COMMON_USER_PPC64,
326 .icache_bsize = 128,
327 .dcache_bsize = 128,
328 .num_pmcs = 6,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100329 .platform = "power4",
Stephen Rothwell49209602005-10-12 15:55:09 +1000330 }
331#endif /* CONFIG_PPC64 */
332#ifdef CONFIG_PPC32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700333#if CLASSIC_PPC
Stephen Rothwell49209602005-10-12 15:55:09 +1000334 { /* 601 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700335 .pvr_mask = 0xffff0000,
336 .pvr_value = 0x00010000,
337 .cpu_name = "601",
Kumar Gala10b35d92005-09-23 14:08:58 -0500338 .cpu_features = CPU_FTRS_PPC601,
Stephen Rothwell49209602005-10-12 15:55:09 +1000339 .cpu_user_features = COMMON_USER | PPC_FEATURE_601_INSTR |
Paul Mackerras98599012005-10-22 16:51:34 +1000340 PPC_FEATURE_UNIFIED_CACHE | PPC_FEATURE_NO_TB,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700341 .icache_bsize = 32,
342 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100343 .platform = "ppc601",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700344 },
345 { /* 603 */
346 .pvr_mask = 0xffff0000,
347 .pvr_value = 0x00030000,
348 .cpu_name = "603",
Kumar Gala10b35d92005-09-23 14:08:58 -0500349 .cpu_features = CPU_FTRS_603,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000350 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700351 .icache_bsize = 32,
352 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100353 .cpu_setup = __setup_cpu_603,
354 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700355 },
356 { /* 603e */
357 .pvr_mask = 0xffff0000,
358 .pvr_value = 0x00060000,
359 .cpu_name = "603e",
Kumar Gala10b35d92005-09-23 14:08:58 -0500360 .cpu_features = CPU_FTRS_603,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000361 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700362 .icache_bsize = 32,
363 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100364 .cpu_setup = __setup_cpu_603,
365 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700366 },
367 { /* 603ev */
368 .pvr_mask = 0xffff0000,
369 .pvr_value = 0x00070000,
370 .cpu_name = "603ev",
Kumar Gala10b35d92005-09-23 14:08:58 -0500371 .cpu_features = CPU_FTRS_603,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000372 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700373 .icache_bsize = 32,
374 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100375 .cpu_setup = __setup_cpu_603,
376 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700377 },
378 { /* 604 */
379 .pvr_mask = 0xffff0000,
380 .pvr_value = 0x00040000,
381 .cpu_name = "604",
Kumar Gala10b35d92005-09-23 14:08:58 -0500382 .cpu_features = CPU_FTRS_604,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000383 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700384 .icache_bsize = 32,
385 .dcache_bsize = 32,
386 .num_pmcs = 2,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100387 .cpu_setup = __setup_cpu_604,
388 .platform = "ppc604",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700389 },
390 { /* 604e */
391 .pvr_mask = 0xfffff000,
392 .pvr_value = 0x00090000,
393 .cpu_name = "604e",
Kumar Gala10b35d92005-09-23 14:08:58 -0500394 .cpu_features = CPU_FTRS_604,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000395 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700396 .icache_bsize = 32,
397 .dcache_bsize = 32,
398 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100399 .cpu_setup = __setup_cpu_604,
400 .platform = "ppc604",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700401 },
402 { /* 604r */
403 .pvr_mask = 0xffff0000,
404 .pvr_value = 0x00090000,
405 .cpu_name = "604r",
Kumar Gala10b35d92005-09-23 14:08:58 -0500406 .cpu_features = CPU_FTRS_604,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000407 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700408 .icache_bsize = 32,
409 .dcache_bsize = 32,
410 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100411 .cpu_setup = __setup_cpu_604,
412 .platform = "ppc604",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700413 },
414 { /* 604ev */
415 .pvr_mask = 0xffff0000,
416 .pvr_value = 0x000a0000,
417 .cpu_name = "604ev",
Kumar Gala10b35d92005-09-23 14:08:58 -0500418 .cpu_features = CPU_FTRS_604,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000419 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700420 .icache_bsize = 32,
421 .dcache_bsize = 32,
422 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100423 .cpu_setup = __setup_cpu_604,
424 .platform = "ppc604",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700425 },
426 { /* 740/750 (0x4202, don't support TAU ?) */
427 .pvr_mask = 0xffffffff,
428 .pvr_value = 0x00084202,
429 .cpu_name = "740/750",
Kumar Gala10b35d92005-09-23 14:08:58 -0500430 .cpu_features = CPU_FTRS_740_NOTAU,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000431 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700432 .icache_bsize = 32,
433 .dcache_bsize = 32,
434 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100435 .cpu_setup = __setup_cpu_750,
436 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700437 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700438 { /* 750CX (80100 and 8010x?) */
439 .pvr_mask = 0xfffffff0,
440 .pvr_value = 0x00080100,
441 .cpu_name = "750CX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500442 .cpu_features = CPU_FTRS_750,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000443 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700444 .icache_bsize = 32,
445 .dcache_bsize = 32,
446 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100447 .cpu_setup = __setup_cpu_750cx,
448 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700449 },
450 { /* 750CX (82201 and 82202) */
451 .pvr_mask = 0xfffffff0,
452 .pvr_value = 0x00082200,
453 .cpu_name = "750CX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500454 .cpu_features = CPU_FTRS_750,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000455 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700456 .icache_bsize = 32,
457 .dcache_bsize = 32,
458 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100459 .cpu_setup = __setup_cpu_750cx,
460 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700461 },
462 { /* 750CXe (82214) */
463 .pvr_mask = 0xfffffff0,
464 .pvr_value = 0x00082210,
465 .cpu_name = "750CXe",
Kumar Gala10b35d92005-09-23 14:08:58 -0500466 .cpu_features = CPU_FTRS_750,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000467 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700468 .icache_bsize = 32,
469 .dcache_bsize = 32,
470 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100471 .cpu_setup = __setup_cpu_750cx,
472 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700473 },
Arthur Othieno7c316252005-09-03 15:55:52 -0700474 { /* 750CXe "Gekko" (83214) */
475 .pvr_mask = 0xffffffff,
476 .pvr_value = 0x00083214,
477 .cpu_name = "750CXe",
Kumar Gala10b35d92005-09-23 14:08:58 -0500478 .cpu_features = CPU_FTRS_750,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000479 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Arthur Othieno7c316252005-09-03 15:55:52 -0700480 .icache_bsize = 32,
481 .dcache_bsize = 32,
482 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100483 .cpu_setup = __setup_cpu_750cx,
484 .platform = "ppc750",
Arthur Othieno7c316252005-09-03 15:55:52 -0700485 },
Arthur Othienoac1ff042005-09-03 15:55:51 -0700486 { /* 745/755 */
487 .pvr_mask = 0xfffff000,
488 .pvr_value = 0x00083000,
489 .cpu_name = "745/755",
Kumar Gala10b35d92005-09-23 14:08:58 -0500490 .cpu_features = CPU_FTRS_750,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000491 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Arthur Othienoac1ff042005-09-03 15:55:51 -0700492 .icache_bsize = 32,
493 .dcache_bsize = 32,
494 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100495 .cpu_setup = __setup_cpu_750,
496 .platform = "ppc750",
Arthur Othienoac1ff042005-09-03 15:55:51 -0700497 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700498 { /* 750FX rev 1.x */
499 .pvr_mask = 0xffffff00,
500 .pvr_value = 0x70000100,
501 .cpu_name = "750FX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500502 .cpu_features = CPU_FTRS_750FX1,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000503 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700504 .icache_bsize = 32,
505 .dcache_bsize = 32,
506 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100507 .cpu_setup = __setup_cpu_750,
508 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700509 },
510 { /* 750FX rev 2.0 must disable HID0[DPM] */
511 .pvr_mask = 0xffffffff,
512 .pvr_value = 0x70000200,
513 .cpu_name = "750FX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500514 .cpu_features = CPU_FTRS_750FX2,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000515 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700516 .icache_bsize = 32,
517 .dcache_bsize = 32,
518 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100519 .cpu_setup = __setup_cpu_750,
520 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700521 },
522 { /* 750FX (All revs except 2.0) */
523 .pvr_mask = 0xffff0000,
524 .pvr_value = 0x70000000,
525 .cpu_name = "750FX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500526 .cpu_features = CPU_FTRS_750FX,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000527 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700528 .icache_bsize = 32,
529 .dcache_bsize = 32,
530 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100531 .cpu_setup = __setup_cpu_750fx,
532 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700533 },
534 { /* 750GX */
535 .pvr_mask = 0xffff0000,
536 .pvr_value = 0x70020000,
537 .cpu_name = "750GX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500538 .cpu_features = CPU_FTRS_750GX,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000539 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700540 .icache_bsize = 32,
541 .dcache_bsize = 32,
542 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100543 .cpu_setup = __setup_cpu_750fx,
544 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700545 },
546 { /* 740/750 (L2CR bit need fixup for 740) */
547 .pvr_mask = 0xffff0000,
548 .pvr_value = 0x00080000,
549 .cpu_name = "740/750",
Kumar Gala10b35d92005-09-23 14:08:58 -0500550 .cpu_features = CPU_FTRS_740,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000551 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700552 .icache_bsize = 32,
553 .dcache_bsize = 32,
554 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100555 .cpu_setup = __setup_cpu_750,
556 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700557 },
558 { /* 7400 rev 1.1 ? (no TAU) */
559 .pvr_mask = 0xffffffff,
560 .pvr_value = 0x000c1101,
561 .cpu_name = "7400 (1.1)",
Kumar Gala10b35d92005-09-23 14:08:58 -0500562 .cpu_features = CPU_FTRS_7400_NOTAU,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000563 .cpu_user_features = COMMON_USER |
564 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700565 .icache_bsize = 32,
566 .dcache_bsize = 32,
567 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100568 .cpu_setup = __setup_cpu_7400,
569 .platform = "ppc7400",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700570 },
571 { /* 7400 */
572 .pvr_mask = 0xffff0000,
573 .pvr_value = 0x000c0000,
574 .cpu_name = "7400",
Kumar Gala10b35d92005-09-23 14:08:58 -0500575 .cpu_features = CPU_FTRS_7400,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000576 .cpu_user_features = COMMON_USER |
577 PPC_FEATURE_HAS_ALTIVEC_COMP | 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_7400,
582 .platform = "ppc7400",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700583 },
584 { /* 7410 */
585 .pvr_mask = 0xffff0000,
586 .pvr_value = 0x800c0000,
587 .cpu_name = "7410",
Kumar Gala10b35d92005-09-23 14:08:58 -0500588 .cpu_features = CPU_FTRS_7400,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000589 .cpu_user_features = COMMON_USER |
590 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700591 .icache_bsize = 32,
592 .dcache_bsize = 32,
593 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100594 .cpu_setup = __setup_cpu_7410,
595 .platform = "ppc7400",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700596 },
597 { /* 7450 2.0 - no doze/nap */
598 .pvr_mask = 0xffffffff,
599 .pvr_value = 0x80000200,
600 .cpu_name = "7450",
Kumar Gala10b35d92005-09-23 14:08:58 -0500601 .cpu_features = CPU_FTRS_7450_20,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000602 .cpu_user_features = COMMON_USER |
603 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700604 .icache_bsize = 32,
605 .dcache_bsize = 32,
606 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600607 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600608 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000609 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100610 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700611 },
612 { /* 7450 2.1 */
613 .pvr_mask = 0xffffffff,
614 .pvr_value = 0x80000201,
615 .cpu_name = "7450",
Kumar Gala10b35d92005-09-23 14:08:58 -0500616 .cpu_features = CPU_FTRS_7450_21,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000617 .cpu_user_features = COMMON_USER |
618 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700619 .icache_bsize = 32,
620 .dcache_bsize = 32,
621 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600622 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600623 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000624 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100625 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700626 },
627 { /* 7450 2.3 and newer */
628 .pvr_mask = 0xffff0000,
629 .pvr_value = 0x80000000,
630 .cpu_name = "7450",
Kumar Gala10b35d92005-09-23 14:08:58 -0500631 .cpu_features = CPU_FTRS_7450_23,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000632 .cpu_user_features = COMMON_USER |
633 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700634 .icache_bsize = 32,
635 .dcache_bsize = 32,
636 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600637 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600638 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000639 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100640 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700641 },
642 { /* 7455 rev 1.x */
643 .pvr_mask = 0xffffff00,
644 .pvr_value = 0x80010100,
645 .cpu_name = "7455",
Kumar Gala10b35d92005-09-23 14:08:58 -0500646 .cpu_features = CPU_FTRS_7455_1,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000647 .cpu_user_features = COMMON_USER |
648 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700649 .icache_bsize = 32,
650 .dcache_bsize = 32,
651 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600652 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600653 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000654 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100655 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700656 },
657 { /* 7455 rev 2.0 */
658 .pvr_mask = 0xffffffff,
659 .pvr_value = 0x80010200,
660 .cpu_name = "7455",
Kumar Gala10b35d92005-09-23 14:08:58 -0500661 .cpu_features = CPU_FTRS_7455_20,
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 = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600667 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600668 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000669 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100670 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700671 },
672 { /* 7455 others */
673 .pvr_mask = 0xffff0000,
674 .pvr_value = 0x80010000,
675 .cpu_name = "7455",
Kumar Gala10b35d92005-09-23 14:08:58 -0500676 .cpu_features = CPU_FTRS_7455,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000677 .cpu_user_features = COMMON_USER |
678 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700679 .icache_bsize = 32,
680 .dcache_bsize = 32,
681 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600682 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600683 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000684 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100685 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700686 },
687 { /* 7447/7457 Rev 1.0 */
688 .pvr_mask = 0xffffffff,
689 .pvr_value = 0x80020100,
690 .cpu_name = "7447/7457",
Kumar Gala10b35d92005-09-23 14:08:58 -0500691 .cpu_features = CPU_FTRS_7447_10,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000692 .cpu_user_features = COMMON_USER |
693 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700694 .icache_bsize = 32,
695 .dcache_bsize = 32,
696 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600697 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600698 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000699 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100700 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700701 },
702 { /* 7447/7457 Rev 1.1 */
703 .pvr_mask = 0xffffffff,
704 .pvr_value = 0x80020101,
705 .cpu_name = "7447/7457",
Kumar Gala10b35d92005-09-23 14:08:58 -0500706 .cpu_features = CPU_FTRS_7447_10,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000707 .cpu_user_features = COMMON_USER |
708 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700709 .icache_bsize = 32,
710 .dcache_bsize = 32,
711 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600712 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600713 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000714 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100715 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700716 },
717 { /* 7447/7457 Rev 1.2 and later */
718 .pvr_mask = 0xffff0000,
719 .pvr_value = 0x80020000,
720 .cpu_name = "7447/7457",
Kumar Gala10b35d92005-09-23 14:08:58 -0500721 .cpu_features = CPU_FTRS_7447,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000722 .cpu_user_features = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700723 .icache_bsize = 32,
724 .dcache_bsize = 32,
725 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600726 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600727 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000728 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100729 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700730 },
731 { /* 7447A */
732 .pvr_mask = 0xffff0000,
733 .pvr_value = 0x80030000,
734 .cpu_name = "7447A",
Kumar Gala10b35d92005-09-23 14:08:58 -0500735 .cpu_features = CPU_FTRS_7447A,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000736 .cpu_user_features = COMMON_USER |
737 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700738 .icache_bsize = 32,
739 .dcache_bsize = 32,
740 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600741 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600742 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000743 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100744 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700745 },
Kumar Galabbde6302005-09-03 15:55:55 -0700746 { /* 7448 */
747 .pvr_mask = 0xffff0000,
748 .pvr_value = 0x80040000,
749 .cpu_name = "7448",
Kumar Gala10b35d92005-09-23 14:08:58 -0500750 .cpu_features = CPU_FTRS_7447A,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000751 .cpu_user_features = COMMON_USER |
752 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Kumar Galabbde6302005-09-03 15:55:55 -0700753 .icache_bsize = 32,
754 .dcache_bsize = 32,
755 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600756 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600757 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000758 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100759 .platform = "ppc7450",
Kumar Galabbde6302005-09-03 15:55:55 -0700760 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700761 { /* 82xx (8240, 8245, 8260 are all 603e cores) */
762 .pvr_mask = 0x7fff0000,
763 .pvr_value = 0x00810000,
764 .cpu_name = "82xx",
Kumar Gala10b35d92005-09-23 14:08:58 -0500765 .cpu_features = CPU_FTRS_82XX,
Stephen Rothwell49209602005-10-12 15:55:09 +1000766 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700767 .icache_bsize = 32,
768 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100769 .cpu_setup = __setup_cpu_603,
770 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700771 },
772 { /* All G2_LE (603e core, plus some) have the same pvr */
773 .pvr_mask = 0x7fff0000,
774 .pvr_value = 0x00820000,
775 .cpu_name = "G2_LE",
Kumar Gala10b35d92005-09-23 14:08:58 -0500776 .cpu_features = CPU_FTRS_G2_LE,
Stephen Rothwell49209602005-10-12 15:55:09 +1000777 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700778 .icache_bsize = 32,
779 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100780 .cpu_setup = __setup_cpu_603,
781 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700782 },
Kim Phillips6c4a2502006-10-02 20:10:24 -0500783 { /* e300c1 (a 603e core, plus some) on 83xx */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700784 .pvr_mask = 0x7fff0000,
785 .pvr_value = 0x00830000,
Kim Phillips6c4a2502006-10-02 20:10:24 -0500786 .cpu_name = "e300c1",
Kumar Gala10b35d92005-09-23 14:08:58 -0500787 .cpu_features = CPU_FTRS_E300,
Stephen Rothwell49209602005-10-12 15:55:09 +1000788 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700789 .icache_bsize = 32,
790 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100791 .cpu_setup = __setup_cpu_603,
792 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700793 },
Kim Phillips6c4a2502006-10-02 20:10:24 -0500794 { /* e300c2 (an e300c1 core, plus some, minus FPU) on 83xx */
795 .pvr_mask = 0x7fff0000,
796 .pvr_value = 0x00840000,
797 .cpu_name = "e300c2",
798 .cpu_features = CPU_FTRS_E300,
799 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
800 .icache_bsize = 32,
801 .dcache_bsize = 32,
802 .cpu_setup = __setup_cpu_603,
803 .platform = "ppc603",
804 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700805 { /* default match, we assume split I/D cache & TB (non-601)... */
806 .pvr_mask = 0x00000000,
807 .pvr_value = 0x00000000,
808 .cpu_name = "(generic PPC)",
Kumar Gala10b35d92005-09-23 14:08:58 -0500809 .cpu_features = CPU_FTRS_CLASSIC32,
Stephen Rothwell49209602005-10-12 15:55:09 +1000810 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700811 .icache_bsize = 32,
812 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100813 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700814 },
815#endif /* CLASSIC_PPC */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700816#ifdef CONFIG_8xx
817 { /* 8xx */
818 .pvr_mask = 0xffff0000,
819 .pvr_value = 0x00500000,
820 .cpu_name = "8xx",
821 /* CPU_FTR_MAYBE_CAN_DOZE is possible,
822 * if the 8xx code is there.... */
Kumar Gala10b35d92005-09-23 14:08:58 -0500823 .cpu_features = CPU_FTRS_8XX,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700824 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
825 .icache_bsize = 16,
826 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100827 .platform = "ppc823",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700828 },
829#endif /* CONFIG_8xx */
830#ifdef CONFIG_40x
831 { /* 403GC */
832 .pvr_mask = 0xffffff00,
833 .pvr_value = 0x00200200,
834 .cpu_name = "403GC",
Kumar Gala10b35d92005-09-23 14:08:58 -0500835 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700836 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
837 .icache_bsize = 16,
838 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100839 .platform = "ppc403",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700840 },
841 { /* 403GCX */
842 .pvr_mask = 0xffffff00,
843 .pvr_value = 0x00201400,
844 .cpu_name = "403GCX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500845 .cpu_features = CPU_FTRS_40X,
Paul Mackerras98599012005-10-22 16:51:34 +1000846 .cpu_user_features = PPC_FEATURE_32 |
847 PPC_FEATURE_HAS_MMU | PPC_FEATURE_NO_TB,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700848 .icache_bsize = 16,
849 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100850 .platform = "ppc403",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700851 },
852 { /* 403G ?? */
853 .pvr_mask = 0xffff0000,
854 .pvr_value = 0x00200000,
855 .cpu_name = "403G ??",
Kumar Gala10b35d92005-09-23 14:08:58 -0500856 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700857 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
858 .icache_bsize = 16,
859 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100860 .platform = "ppc403",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700861 },
862 { /* 405GP */
863 .pvr_mask = 0xffff0000,
864 .pvr_value = 0x40110000,
865 .cpu_name = "405GP",
Kumar Gala10b35d92005-09-23 14:08:58 -0500866 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700867 .cpu_user_features = PPC_FEATURE_32 |
868 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
869 .icache_bsize = 32,
870 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100871 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700872 },
873 { /* STB 03xxx */
874 .pvr_mask = 0xffff0000,
875 .pvr_value = 0x40130000,
876 .cpu_name = "STB03xxx",
Kumar Gala10b35d92005-09-23 14:08:58 -0500877 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700878 .cpu_user_features = PPC_FEATURE_32 |
879 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
880 .icache_bsize = 32,
881 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100882 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700883 },
884 { /* STB 04xxx */
885 .pvr_mask = 0xffff0000,
886 .pvr_value = 0x41810000,
887 .cpu_name = "STB04xxx",
Kumar Gala10b35d92005-09-23 14:08:58 -0500888 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700889 .cpu_user_features = PPC_FEATURE_32 |
890 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
891 .icache_bsize = 32,
892 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100893 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700894 },
895 { /* NP405L */
896 .pvr_mask = 0xffff0000,
897 .pvr_value = 0x41610000,
898 .cpu_name = "NP405L",
Kumar Gala10b35d92005-09-23 14:08:58 -0500899 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700900 .cpu_user_features = PPC_FEATURE_32 |
901 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
902 .icache_bsize = 32,
903 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100904 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700905 },
906 { /* NP4GS3 */
907 .pvr_mask = 0xffff0000,
908 .pvr_value = 0x40B10000,
909 .cpu_name = "NP4GS3",
Kumar Gala10b35d92005-09-23 14:08:58 -0500910 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700911 .cpu_user_features = PPC_FEATURE_32 |
912 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
913 .icache_bsize = 32,
914 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100915 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700916 },
917 { /* NP405H */
918 .pvr_mask = 0xffff0000,
919 .pvr_value = 0x41410000,
920 .cpu_name = "NP405H",
Kumar Gala10b35d92005-09-23 14:08:58 -0500921 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700922 .cpu_user_features = PPC_FEATURE_32 |
923 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
924 .icache_bsize = 32,
925 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100926 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700927 },
928 { /* 405GPr */
929 .pvr_mask = 0xffff0000,
930 .pvr_value = 0x50910000,
931 .cpu_name = "405GPr",
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 |
934 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
935 .icache_bsize = 32,
936 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100937 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700938 },
939 { /* STBx25xx */
940 .pvr_mask = 0xffff0000,
941 .pvr_value = 0x51510000,
942 .cpu_name = "STBx25xx",
Kumar Gala10b35d92005-09-23 14:08:58 -0500943 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700944 .cpu_user_features = PPC_FEATURE_32 |
945 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
946 .icache_bsize = 32,
947 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100948 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700949 },
950 { /* 405LP */
951 .pvr_mask = 0xffff0000,
952 .pvr_value = 0x41F10000,
953 .cpu_name = "405LP",
Kumar Gala10b35d92005-09-23 14:08:58 -0500954 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700955 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
956 .icache_bsize = 32,
957 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100958 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700959 },
960 { /* Xilinx Virtex-II Pro */
Grant C. Likely72646c72006-01-19 01:13:20 -0700961 .pvr_mask = 0xfffff000,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700962 .pvr_value = 0x20010000,
963 .cpu_name = "Virtex-II Pro",
Kumar Gala10b35d92005-09-23 14:08:58 -0500964 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700965 .cpu_user_features = PPC_FEATURE_32 |
966 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
967 .icache_bsize = 32,
968 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100969 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700970 },
Grant C. Likely72646c72006-01-19 01:13:20 -0700971 { /* Xilinx Virtex-4 FX */
972 .pvr_mask = 0xfffff000,
973 .pvr_value = 0x20011000,
974 .cpu_name = "Virtex-4 FX",
975 .cpu_features = CPU_FTRS_40X,
976 .cpu_user_features = PPC_FEATURE_32 |
977 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
978 .icache_bsize = 32,
979 .dcache_bsize = 32,
Peter Bergner838fdb42006-09-14 14:18:38 -0500980 .platform = "ppc405",
Grant C. Likely72646c72006-01-19 01:13:20 -0700981 },
Eugene Suroveginad95d602005-06-07 13:22:09 -0700982 { /* 405EP */
983 .pvr_mask = 0xffff0000,
984 .pvr_value = 0x51210000,
985 .cpu_name = "405EP",
Kumar Gala10b35d92005-09-23 14:08:58 -0500986 .cpu_features = CPU_FTRS_40X,
Eugene Suroveginad95d602005-06-07 13:22:09 -0700987 .cpu_user_features = PPC_FEATURE_32 |
988 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
989 .icache_bsize = 32,
990 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100991 .platform = "ppc405",
Eugene Suroveginad95d602005-06-07 13:22:09 -0700992 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700993
994#endif /* CONFIG_40x */
995#ifdef CONFIG_44x
Matt Porterc9cf73a2005-07-31 22:34:52 -0700996 {
997 .pvr_mask = 0xf0000fff,
998 .pvr_value = 0x40000850,
999 .cpu_name = "440EP Rev. A",
Kumar Gala10b35d92005-09-23 14:08:58 -05001000 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001001 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
Matt Porterc9cf73a2005-07-31 22:34:52 -07001002 .icache_bsize = 32,
1003 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001004 .platform = "ppc440",
Matt Porterc9cf73a2005-07-31 22:34:52 -07001005 },
1006 {
1007 .pvr_mask = 0xf0000fff,
1008 .pvr_value = 0x400008d3,
1009 .cpu_name = "440EP Rev. B",
Kumar Gala10b35d92005-09-23 14:08:58 -05001010 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001011 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
Matt Porterc9cf73a2005-07-31 22:34:52 -07001012 .icache_bsize = 32,
1013 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001014 .platform = "ppc440",
Matt Porterc9cf73a2005-07-31 22:34:52 -07001015 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001016 { /* 440GP Rev. B */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001017 .pvr_mask = 0xf0000fff,
1018 .pvr_value = 0x40000440,
1019 .cpu_name = "440GP Rev. B",
Kumar Gala10b35d92005-09-23 14:08:58 -05001020 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001021 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001022 .icache_bsize = 32,
1023 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001024 .platform = "ppc440gp",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001025 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001026 { /* 440GP Rev. C */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001027 .pvr_mask = 0xf0000fff,
1028 .pvr_value = 0x40000481,
1029 .cpu_name = "440GP Rev. C",
Kumar Gala10b35d92005-09-23 14:08:58 -05001030 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001031 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001032 .icache_bsize = 32,
1033 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001034 .platform = "ppc440gp",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001035 },
1036 { /* 440GX Rev. A */
1037 .pvr_mask = 0xf0000fff,
1038 .pvr_value = 0x50000850,
1039 .cpu_name = "440GX Rev. A",
Kumar Gala10b35d92005-09-23 14:08:58 -05001040 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001041 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001042 .icache_bsize = 32,
1043 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001044 .platform = "ppc440",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001045 },
1046 { /* 440GX Rev. B */
1047 .pvr_mask = 0xf0000fff,
1048 .pvr_value = 0x50000851,
1049 .cpu_name = "440GX Rev. B",
Kumar Gala10b35d92005-09-23 14:08:58 -05001050 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001051 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001052 .icache_bsize = 32,
1053 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001054 .platform = "ppc440",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001055 },
1056 { /* 440GX Rev. C */
1057 .pvr_mask = 0xf0000fff,
1058 .pvr_value = 0x50000892,
1059 .cpu_name = "440GX Rev. C",
Kumar Gala10b35d92005-09-23 14:08:58 -05001060 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001061 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001062 .icache_bsize = 32,
1063 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001064 .platform = "ppc440",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001065 },
Eugene Surovegin9149fb32005-09-03 15:55:40 -07001066 { /* 440GX Rev. F */
1067 .pvr_mask = 0xf0000fff,
1068 .pvr_value = 0x50000894,
1069 .cpu_name = "440GX Rev. F",
Kumar Gala10b35d92005-09-23 14:08:58 -05001070 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001071 .cpu_user_features = COMMON_USER_BOOKE,
Eugene Surovegin9149fb32005-09-03 15:55:40 -07001072 .icache_bsize = 32,
1073 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001074 .platform = "ppc440",
Eugene Surovegin9149fb32005-09-03 15:55:40 -07001075 },
Matt Porter656de7e2005-09-03 15:55:42 -07001076 { /* 440SP Rev. A */
1077 .pvr_mask = 0xff000fff,
1078 .pvr_value = 0x53000891,
1079 .cpu_name = "440SP Rev. A",
Kumar Gala10b35d92005-09-23 14:08:58 -05001080 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001081 .cpu_user_features = COMMON_USER_BOOKE,
Matt Porter656de7e2005-09-03 15:55:42 -07001082 .icache_bsize = 32,
1083 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001084 .platform = "ppc440",
Matt Porter656de7e2005-09-03 15:55:42 -07001085 },
Roland Dreierb0f7b8b2005-11-07 00:58:13 -08001086 { /* 440SPe Rev. A */
1087 .pvr_mask = 0xff000fff,
1088 .pvr_value = 0x53000890,
1089 .cpu_name = "440SPe Rev. A",
1090 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
1091 CPU_FTR_USE_TB,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001092 .cpu_user_features = COMMON_USER_BOOKE,
Roland Dreierb0f7b8b2005-11-07 00:58:13 -08001093 .icache_bsize = 32,
1094 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001095 .platform = "ppc440",
Roland Dreierb0f7b8b2005-11-07 00:58:13 -08001096 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001097#endif /* CONFIG_44x */
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001098#ifdef CONFIG_FSL_BOOKE
Stephen Rothwell49209602005-10-12 15:55:09 +10001099 { /* e200z5 */
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001100 .pvr_mask = 0xfff00000,
1101 .pvr_value = 0x81000000,
1102 .cpu_name = "e200z5",
1103 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001104 .cpu_features = CPU_FTRS_E200,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001105 .cpu_user_features = COMMON_USER_BOOKE |
1106 PPC_FEATURE_HAS_EFP_SINGLE |
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001107 PPC_FEATURE_UNIFIED_CACHE,
1108 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001109 .platform = "ppc5554",
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001110 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001111 { /* e200z6 */
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001112 .pvr_mask = 0xfff00000,
1113 .pvr_value = 0x81100000,
1114 .cpu_name = "e200z6",
1115 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001116 .cpu_features = CPU_FTRS_E200,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001117 .cpu_user_features = COMMON_USER_BOOKE |
1118 PPC_FEATURE_SPE_COMP |
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001119 PPC_FEATURE_HAS_EFP_SINGLE |
1120 PPC_FEATURE_UNIFIED_CACHE,
1121 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001122 .platform = "ppc5554",
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001123 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001124 { /* e500 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001125 .pvr_mask = 0xffff0000,
1126 .pvr_value = 0x80200000,
1127 .cpu_name = "e500",
1128 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001129 .cpu_features = CPU_FTRS_E500,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001130 .cpu_user_features = COMMON_USER_BOOKE |
1131 PPC_FEATURE_SPE_COMP |
Linus Torvalds1da177e2005-04-16 15:20:36 -07001132 PPC_FEATURE_HAS_EFP_SINGLE,
1133 .icache_bsize = 32,
1134 .dcache_bsize = 32,
1135 .num_pmcs = 4,
Andy Fleming555d97a2005-12-15 20:02:04 -06001136 .oprofile_cpu_type = "ppc/e500",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +00001137 .oprofile_type = PPC_OPROFILE_BOOKE,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001138 .platform = "ppc8540",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001139 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001140 { /* e500v2 */
Kumar Gala5b37b702005-06-21 17:15:18 -07001141 .pvr_mask = 0xffff0000,
1142 .pvr_value = 0x80210000,
1143 .cpu_name = "e500v2",
1144 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001145 .cpu_features = CPU_FTRS_E500_2,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001146 .cpu_user_features = COMMON_USER_BOOKE |
1147 PPC_FEATURE_SPE_COMP |
1148 PPC_FEATURE_HAS_EFP_SINGLE |
1149 PPC_FEATURE_HAS_EFP_DOUBLE,
Kumar Gala5b37b702005-06-21 17:15:18 -07001150 .icache_bsize = 32,
1151 .dcache_bsize = 32,
1152 .num_pmcs = 4,
Andy Fleming555d97a2005-12-15 20:02:04 -06001153 .oprofile_cpu_type = "ppc/e500",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +00001154 .oprofile_type = PPC_OPROFILE_BOOKE,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001155 .platform = "ppc8548",
Kumar Gala5b37b702005-06-21 17:15:18 -07001156 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001157#endif
1158#if !CLASSIC_PPC
1159 { /* default match */
1160 .pvr_mask = 0x00000000,
1161 .pvr_value = 0x00000000,
1162 .cpu_name = "(generic PPC)",
Kumar Gala10b35d92005-09-23 14:08:58 -05001163 .cpu_features = CPU_FTRS_GENERIC_32,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001164 .cpu_user_features = PPC_FEATURE_32,
1165 .icache_bsize = 32,
1166 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001167 .platform = "powerpc",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001168 }
1169#endif /* !CLASSIC_PPC */
Stephen Rothwell49209602005-10-12 15:55:09 +10001170#endif /* CONFIG_PPC32 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001171};
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001172
1173struct cpu_spec *identify_cpu(unsigned long offset)
1174{
1175 struct cpu_spec *s = cpu_specs;
1176 struct cpu_spec **cur = &cur_cpu_spec;
1177 unsigned int pvr = mfspr(SPRN_PVR);
1178 int i;
1179
1180 s = PTRRELOC(s);
1181 cur = PTRRELOC(cur);
1182
1183 if (*cur != NULL)
1184 return PTRRELOC(*cur);
1185
1186 for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++)
1187 if ((pvr & s->pvr_mask) == s->pvr_value) {
1188 *cur = cpu_specs + i;
1189#ifdef CONFIG_PPC64
1190 /* ppc64 expects identify_cpu to also call setup_cpu
1191 * for that processor. I will consolidate that at a
1192 * later time, for now, just use our friend #ifdef.
1193 * we also don't need to PTRRELOC the function pointer
1194 * on ppc64 as we are running at 0 in real mode.
1195 */
1196 if (s->cpu_setup) {
1197 s->cpu_setup(offset, s);
1198 }
1199#endif /* CONFIG_PPC64 */
1200 return s;
1201 }
1202 BUG();
1203 return NULL;
1204}
1205
Benjamin Herrenschmidt0909c8c2006-10-20 11:47:18 +10001206void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end)
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001207{
1208 struct fixup_entry {
1209 unsigned long mask;
1210 unsigned long value;
Benjamin Herrenschmidt0909c8c2006-10-20 11:47:18 +10001211 long start_off;
1212 long end_off;
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001213 } *fcur, *fend;
1214
1215 fcur = fixup_start;
1216 fend = fixup_end;
1217
1218 for (; fcur < fend; fcur++) {
1219 unsigned int *pstart, *pend, *p;
1220
1221 if ((value & fcur->mask) == fcur->value)
1222 continue;
1223
1224 /* These PTRRELOCs will disappear once the new scheme for
1225 * modules and vdso is implemented
1226 */
Benjamin Herrenschmidt0909c8c2006-10-20 11:47:18 +10001227 pstart = ((unsigned int *)fcur) + (fcur->start_off / 4);
1228 pend = ((unsigned int *)fcur) + (fcur->end_off / 4);
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001229
1230 for (p = pstart; p < pend; p++) {
1231 *p = 0x60000000u;
1232 asm volatile ("dcbst 0, %0" : : "r" (p));
1233 }
1234 asm volatile ("sync" : : : "memory");
1235 for (p = pstart; p < pend; p++)
1236 asm volatile ("icbi 0,%0" : : "r" (p));
1237 asm volatile ("sync; isync" : : : "memory");
1238 }
1239}