blob: 992121b2d261614d88d25afd2282298ca49bca49 [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,
Maynard Johnson18f21902006-11-20 18:45:16 +0100307 .num_pmcs = 4,
308 .oprofile_cpu_type = "ppc64/cell-be",
309 .oprofile_type = PPC_OPROFILE_CELL,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100310 .platform = "ppc-cell-be",
Stephen Rothwell49209602005-10-12 15:55:09 +1000311 },
Olof Johanssonb3ebd1d2006-09-06 14:35:57 -0500312 { /* PA Semi PA6T */
313 .pvr_mask = 0x7fff0000,
314 .pvr_value = 0x00900000,
315 .cpu_name = "PA6T",
316 .cpu_features = CPU_FTRS_PA6T,
317 .cpu_user_features = COMMON_USER_PA6T,
318 .icache_bsize = 64,
319 .dcache_bsize = 64,
320 .num_pmcs = 6,
321 .platform = "pa6t",
322 },
Stephen Rothwell49209602005-10-12 15:55:09 +1000323 { /* default match */
324 .pvr_mask = 0x00000000,
325 .pvr_value = 0x00000000,
326 .cpu_name = "POWER4 (compatible)",
327 .cpu_features = CPU_FTRS_COMPATIBLE,
328 .cpu_user_features = COMMON_USER_PPC64,
329 .icache_bsize = 128,
330 .dcache_bsize = 128,
331 .num_pmcs = 6,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100332 .platform = "power4",
Stephen Rothwell49209602005-10-12 15:55:09 +1000333 }
334#endif /* CONFIG_PPC64 */
335#ifdef CONFIG_PPC32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700336#if CLASSIC_PPC
Stephen Rothwell49209602005-10-12 15:55:09 +1000337 { /* 601 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700338 .pvr_mask = 0xffff0000,
339 .pvr_value = 0x00010000,
340 .cpu_name = "601",
Kumar Gala10b35d92005-09-23 14:08:58 -0500341 .cpu_features = CPU_FTRS_PPC601,
Stephen Rothwell49209602005-10-12 15:55:09 +1000342 .cpu_user_features = COMMON_USER | PPC_FEATURE_601_INSTR |
Paul Mackerras98599012005-10-22 16:51:34 +1000343 PPC_FEATURE_UNIFIED_CACHE | PPC_FEATURE_NO_TB,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700344 .icache_bsize = 32,
345 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100346 .platform = "ppc601",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700347 },
348 { /* 603 */
349 .pvr_mask = 0xffff0000,
350 .pvr_value = 0x00030000,
351 .cpu_name = "603",
Kumar Gala10b35d92005-09-23 14:08:58 -0500352 .cpu_features = CPU_FTRS_603,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000353 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700354 .icache_bsize = 32,
355 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100356 .cpu_setup = __setup_cpu_603,
357 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700358 },
359 { /* 603e */
360 .pvr_mask = 0xffff0000,
361 .pvr_value = 0x00060000,
362 .cpu_name = "603e",
Kumar Gala10b35d92005-09-23 14:08:58 -0500363 .cpu_features = CPU_FTRS_603,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000364 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700365 .icache_bsize = 32,
366 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100367 .cpu_setup = __setup_cpu_603,
368 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700369 },
370 { /* 603ev */
371 .pvr_mask = 0xffff0000,
372 .pvr_value = 0x00070000,
373 .cpu_name = "603ev",
Kumar Gala10b35d92005-09-23 14:08:58 -0500374 .cpu_features = CPU_FTRS_603,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000375 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700376 .icache_bsize = 32,
377 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100378 .cpu_setup = __setup_cpu_603,
379 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700380 },
381 { /* 604 */
382 .pvr_mask = 0xffff0000,
383 .pvr_value = 0x00040000,
384 .cpu_name = "604",
Kumar Gala10b35d92005-09-23 14:08:58 -0500385 .cpu_features = CPU_FTRS_604,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000386 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700387 .icache_bsize = 32,
388 .dcache_bsize = 32,
389 .num_pmcs = 2,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100390 .cpu_setup = __setup_cpu_604,
391 .platform = "ppc604",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700392 },
393 { /* 604e */
394 .pvr_mask = 0xfffff000,
395 .pvr_value = 0x00090000,
396 .cpu_name = "604e",
Kumar Gala10b35d92005-09-23 14:08:58 -0500397 .cpu_features = CPU_FTRS_604,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000398 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700399 .icache_bsize = 32,
400 .dcache_bsize = 32,
401 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100402 .cpu_setup = __setup_cpu_604,
403 .platform = "ppc604",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700404 },
405 { /* 604r */
406 .pvr_mask = 0xffff0000,
407 .pvr_value = 0x00090000,
408 .cpu_name = "604r",
Kumar Gala10b35d92005-09-23 14:08:58 -0500409 .cpu_features = CPU_FTRS_604,
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,
413 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100414 .cpu_setup = __setup_cpu_604,
415 .platform = "ppc604",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700416 },
417 { /* 604ev */
418 .pvr_mask = 0xffff0000,
419 .pvr_value = 0x000a0000,
420 .cpu_name = "604ev",
Kumar Gala10b35d92005-09-23 14:08:58 -0500421 .cpu_features = CPU_FTRS_604,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000422 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700423 .icache_bsize = 32,
424 .dcache_bsize = 32,
425 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100426 .cpu_setup = __setup_cpu_604,
427 .platform = "ppc604",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700428 },
429 { /* 740/750 (0x4202, don't support TAU ?) */
430 .pvr_mask = 0xffffffff,
431 .pvr_value = 0x00084202,
432 .cpu_name = "740/750",
Kumar Gala10b35d92005-09-23 14:08:58 -0500433 .cpu_features = CPU_FTRS_740_NOTAU,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000434 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700435 .icache_bsize = 32,
436 .dcache_bsize = 32,
437 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100438 .cpu_setup = __setup_cpu_750,
439 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700440 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700441 { /* 750CX (80100 and 8010x?) */
442 .pvr_mask = 0xfffffff0,
443 .pvr_value = 0x00080100,
444 .cpu_name = "750CX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500445 .cpu_features = CPU_FTRS_750,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000446 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700447 .icache_bsize = 32,
448 .dcache_bsize = 32,
449 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100450 .cpu_setup = __setup_cpu_750cx,
451 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700452 },
453 { /* 750CX (82201 and 82202) */
454 .pvr_mask = 0xfffffff0,
455 .pvr_value = 0x00082200,
456 .cpu_name = "750CX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500457 .cpu_features = CPU_FTRS_750,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000458 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700459 .icache_bsize = 32,
460 .dcache_bsize = 32,
461 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100462 .cpu_setup = __setup_cpu_750cx,
463 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700464 },
465 { /* 750CXe (82214) */
466 .pvr_mask = 0xfffffff0,
467 .pvr_value = 0x00082210,
468 .cpu_name = "750CXe",
Kumar Gala10b35d92005-09-23 14:08:58 -0500469 .cpu_features = CPU_FTRS_750,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000470 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700471 .icache_bsize = 32,
472 .dcache_bsize = 32,
473 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100474 .cpu_setup = __setup_cpu_750cx,
475 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700476 },
Arthur Othieno7c316252005-09-03 15:55:52 -0700477 { /* 750CXe "Gekko" (83214) */
478 .pvr_mask = 0xffffffff,
479 .pvr_value = 0x00083214,
480 .cpu_name = "750CXe",
Kumar Gala10b35d92005-09-23 14:08:58 -0500481 .cpu_features = CPU_FTRS_750,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000482 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Arthur Othieno7c316252005-09-03 15:55:52 -0700483 .icache_bsize = 32,
484 .dcache_bsize = 32,
485 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100486 .cpu_setup = __setup_cpu_750cx,
487 .platform = "ppc750",
Arthur Othieno7c316252005-09-03 15:55:52 -0700488 },
Arthur Othienoac1ff042005-09-03 15:55:51 -0700489 { /* 745/755 */
490 .pvr_mask = 0xfffff000,
491 .pvr_value = 0x00083000,
492 .cpu_name = "745/755",
Kumar Gala10b35d92005-09-23 14:08:58 -0500493 .cpu_features = CPU_FTRS_750,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000494 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Arthur Othienoac1ff042005-09-03 15:55:51 -0700495 .icache_bsize = 32,
496 .dcache_bsize = 32,
497 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100498 .cpu_setup = __setup_cpu_750,
499 .platform = "ppc750",
Arthur Othienoac1ff042005-09-03 15:55:51 -0700500 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700501 { /* 750FX rev 1.x */
502 .pvr_mask = 0xffffff00,
503 .pvr_value = 0x70000100,
504 .cpu_name = "750FX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500505 .cpu_features = CPU_FTRS_750FX1,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000506 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700507 .icache_bsize = 32,
508 .dcache_bsize = 32,
509 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100510 .cpu_setup = __setup_cpu_750,
511 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700512 },
513 { /* 750FX rev 2.0 must disable HID0[DPM] */
514 .pvr_mask = 0xffffffff,
515 .pvr_value = 0x70000200,
516 .cpu_name = "750FX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500517 .cpu_features = CPU_FTRS_750FX2,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000518 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700519 .icache_bsize = 32,
520 .dcache_bsize = 32,
521 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100522 .cpu_setup = __setup_cpu_750,
523 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700524 },
525 { /* 750FX (All revs except 2.0) */
526 .pvr_mask = 0xffff0000,
527 .pvr_value = 0x70000000,
528 .cpu_name = "750FX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500529 .cpu_features = CPU_FTRS_750FX,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000530 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700531 .icache_bsize = 32,
532 .dcache_bsize = 32,
533 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100534 .cpu_setup = __setup_cpu_750fx,
535 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700536 },
537 { /* 750GX */
538 .pvr_mask = 0xffff0000,
539 .pvr_value = 0x70020000,
540 .cpu_name = "750GX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500541 .cpu_features = CPU_FTRS_750GX,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000542 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700543 .icache_bsize = 32,
544 .dcache_bsize = 32,
545 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100546 .cpu_setup = __setup_cpu_750fx,
547 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700548 },
549 { /* 740/750 (L2CR bit need fixup for 740) */
550 .pvr_mask = 0xffff0000,
551 .pvr_value = 0x00080000,
552 .cpu_name = "740/750",
Kumar Gala10b35d92005-09-23 14:08:58 -0500553 .cpu_features = CPU_FTRS_740,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000554 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700555 .icache_bsize = 32,
556 .dcache_bsize = 32,
557 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100558 .cpu_setup = __setup_cpu_750,
559 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700560 },
561 { /* 7400 rev 1.1 ? (no TAU) */
562 .pvr_mask = 0xffffffff,
563 .pvr_value = 0x000c1101,
564 .cpu_name = "7400 (1.1)",
Kumar Gala10b35d92005-09-23 14:08:58 -0500565 .cpu_features = CPU_FTRS_7400_NOTAU,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000566 .cpu_user_features = COMMON_USER |
567 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700568 .icache_bsize = 32,
569 .dcache_bsize = 32,
570 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100571 .cpu_setup = __setup_cpu_7400,
572 .platform = "ppc7400",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700573 },
574 { /* 7400 */
575 .pvr_mask = 0xffff0000,
576 .pvr_value = 0x000c0000,
577 .cpu_name = "7400",
Kumar Gala10b35d92005-09-23 14:08:58 -0500578 .cpu_features = CPU_FTRS_7400,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000579 .cpu_user_features = COMMON_USER |
580 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700581 .icache_bsize = 32,
582 .dcache_bsize = 32,
583 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100584 .cpu_setup = __setup_cpu_7400,
585 .platform = "ppc7400",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700586 },
587 { /* 7410 */
588 .pvr_mask = 0xffff0000,
589 .pvr_value = 0x800c0000,
590 .cpu_name = "7410",
Kumar Gala10b35d92005-09-23 14:08:58 -0500591 .cpu_features = CPU_FTRS_7400,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000592 .cpu_user_features = COMMON_USER |
593 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700594 .icache_bsize = 32,
595 .dcache_bsize = 32,
596 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100597 .cpu_setup = __setup_cpu_7410,
598 .platform = "ppc7400",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700599 },
600 { /* 7450 2.0 - no doze/nap */
601 .pvr_mask = 0xffffffff,
602 .pvr_value = 0x80000200,
603 .cpu_name = "7450",
Kumar Gala10b35d92005-09-23 14:08:58 -0500604 .cpu_features = CPU_FTRS_7450_20,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000605 .cpu_user_features = COMMON_USER |
606 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700607 .icache_bsize = 32,
608 .dcache_bsize = 32,
609 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600610 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600611 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000612 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100613 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700614 },
615 { /* 7450 2.1 */
616 .pvr_mask = 0xffffffff,
617 .pvr_value = 0x80000201,
618 .cpu_name = "7450",
Kumar Gala10b35d92005-09-23 14:08:58 -0500619 .cpu_features = CPU_FTRS_7450_21,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000620 .cpu_user_features = COMMON_USER |
621 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700622 .icache_bsize = 32,
623 .dcache_bsize = 32,
624 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600625 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600626 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000627 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100628 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700629 },
630 { /* 7450 2.3 and newer */
631 .pvr_mask = 0xffff0000,
632 .pvr_value = 0x80000000,
633 .cpu_name = "7450",
Kumar Gala10b35d92005-09-23 14:08:58 -0500634 .cpu_features = CPU_FTRS_7450_23,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000635 .cpu_user_features = COMMON_USER |
636 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700637 .icache_bsize = 32,
638 .dcache_bsize = 32,
639 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600640 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600641 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000642 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100643 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700644 },
645 { /* 7455 rev 1.x */
646 .pvr_mask = 0xffffff00,
647 .pvr_value = 0x80010100,
648 .cpu_name = "7455",
Kumar Gala10b35d92005-09-23 14:08:58 -0500649 .cpu_features = CPU_FTRS_7455_1,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000650 .cpu_user_features = COMMON_USER |
651 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700652 .icache_bsize = 32,
653 .dcache_bsize = 32,
654 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600655 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600656 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000657 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100658 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700659 },
660 { /* 7455 rev 2.0 */
661 .pvr_mask = 0xffffffff,
662 .pvr_value = 0x80010200,
663 .cpu_name = "7455",
Kumar Gala10b35d92005-09-23 14:08:58 -0500664 .cpu_features = CPU_FTRS_7455_20,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000665 .cpu_user_features = COMMON_USER |
666 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700667 .icache_bsize = 32,
668 .dcache_bsize = 32,
669 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600670 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600671 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000672 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100673 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700674 },
675 { /* 7455 others */
676 .pvr_mask = 0xffff0000,
677 .pvr_value = 0x80010000,
678 .cpu_name = "7455",
Kumar Gala10b35d92005-09-23 14:08:58 -0500679 .cpu_features = CPU_FTRS_7455,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000680 .cpu_user_features = COMMON_USER |
681 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700682 .icache_bsize = 32,
683 .dcache_bsize = 32,
684 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600685 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600686 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000687 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100688 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700689 },
690 { /* 7447/7457 Rev 1.0 */
691 .pvr_mask = 0xffffffff,
692 .pvr_value = 0x80020100,
693 .cpu_name = "7447/7457",
Kumar Gala10b35d92005-09-23 14:08:58 -0500694 .cpu_features = CPU_FTRS_7447_10,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000695 .cpu_user_features = COMMON_USER |
696 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700697 .icache_bsize = 32,
698 .dcache_bsize = 32,
699 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600700 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600701 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000702 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100703 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700704 },
705 { /* 7447/7457 Rev 1.1 */
706 .pvr_mask = 0xffffffff,
707 .pvr_value = 0x80020101,
708 .cpu_name = "7447/7457",
Kumar Gala10b35d92005-09-23 14:08:58 -0500709 .cpu_features = CPU_FTRS_7447_10,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000710 .cpu_user_features = COMMON_USER |
711 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700712 .icache_bsize = 32,
713 .dcache_bsize = 32,
714 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600715 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600716 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000717 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100718 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700719 },
720 { /* 7447/7457 Rev 1.2 and later */
721 .pvr_mask = 0xffff0000,
722 .pvr_value = 0x80020000,
723 .cpu_name = "7447/7457",
Kumar Gala10b35d92005-09-23 14:08:58 -0500724 .cpu_features = CPU_FTRS_7447,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000725 .cpu_user_features = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700726 .icache_bsize = 32,
727 .dcache_bsize = 32,
728 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600729 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600730 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000731 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100732 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700733 },
734 { /* 7447A */
735 .pvr_mask = 0xffff0000,
736 .pvr_value = 0x80030000,
737 .cpu_name = "7447A",
Kumar Gala10b35d92005-09-23 14:08:58 -0500738 .cpu_features = CPU_FTRS_7447A,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000739 .cpu_user_features = COMMON_USER |
740 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700741 .icache_bsize = 32,
742 .dcache_bsize = 32,
743 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600744 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600745 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000746 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100747 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700748 },
Kumar Galabbde6302005-09-03 15:55:55 -0700749 { /* 7448 */
750 .pvr_mask = 0xffff0000,
751 .pvr_value = 0x80040000,
752 .cpu_name = "7448",
Kumar Gala10b35d92005-09-23 14:08:58 -0500753 .cpu_features = CPU_FTRS_7447A,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000754 .cpu_user_features = COMMON_USER |
755 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Kumar Galabbde6302005-09-03 15:55:55 -0700756 .icache_bsize = 32,
757 .dcache_bsize = 32,
758 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600759 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600760 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000761 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100762 .platform = "ppc7450",
Kumar Galabbde6302005-09-03 15:55:55 -0700763 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700764 { /* 82xx (8240, 8245, 8260 are all 603e cores) */
765 .pvr_mask = 0x7fff0000,
766 .pvr_value = 0x00810000,
767 .cpu_name = "82xx",
Kumar Gala10b35d92005-09-23 14:08:58 -0500768 .cpu_features = CPU_FTRS_82XX,
Stephen Rothwell49209602005-10-12 15:55:09 +1000769 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700770 .icache_bsize = 32,
771 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100772 .cpu_setup = __setup_cpu_603,
773 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700774 },
775 { /* All G2_LE (603e core, plus some) have the same pvr */
776 .pvr_mask = 0x7fff0000,
777 .pvr_value = 0x00820000,
778 .cpu_name = "G2_LE",
Kumar Gala10b35d92005-09-23 14:08:58 -0500779 .cpu_features = CPU_FTRS_G2_LE,
Stephen Rothwell49209602005-10-12 15:55:09 +1000780 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700781 .icache_bsize = 32,
782 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100783 .cpu_setup = __setup_cpu_603,
784 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700785 },
Kim Phillips6c4a2502006-10-02 20:10:24 -0500786 { /* e300c1 (a 603e core, plus some) on 83xx */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700787 .pvr_mask = 0x7fff0000,
788 .pvr_value = 0x00830000,
Kim Phillips6c4a2502006-10-02 20:10:24 -0500789 .cpu_name = "e300c1",
Kumar Gala10b35d92005-09-23 14:08:58 -0500790 .cpu_features = CPU_FTRS_E300,
Stephen Rothwell49209602005-10-12 15:55:09 +1000791 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700792 .icache_bsize = 32,
793 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100794 .cpu_setup = __setup_cpu_603,
795 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700796 },
Kim Phillips6c4a2502006-10-02 20:10:24 -0500797 { /* e300c2 (an e300c1 core, plus some, minus FPU) on 83xx */
798 .pvr_mask = 0x7fff0000,
799 .pvr_value = 0x00840000,
800 .cpu_name = "e300c2",
801 .cpu_features = CPU_FTRS_E300,
802 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
803 .icache_bsize = 32,
804 .dcache_bsize = 32,
805 .cpu_setup = __setup_cpu_603,
806 .platform = "ppc603",
807 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700808 { /* default match, we assume split I/D cache & TB (non-601)... */
809 .pvr_mask = 0x00000000,
810 .pvr_value = 0x00000000,
811 .cpu_name = "(generic PPC)",
Kumar Gala10b35d92005-09-23 14:08:58 -0500812 .cpu_features = CPU_FTRS_CLASSIC32,
Stephen Rothwell49209602005-10-12 15:55:09 +1000813 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700814 .icache_bsize = 32,
815 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100816 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700817 },
818#endif /* CLASSIC_PPC */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700819#ifdef CONFIG_8xx
820 { /* 8xx */
821 .pvr_mask = 0xffff0000,
822 .pvr_value = 0x00500000,
823 .cpu_name = "8xx",
824 /* CPU_FTR_MAYBE_CAN_DOZE is possible,
825 * if the 8xx code is there.... */
Kumar Gala10b35d92005-09-23 14:08:58 -0500826 .cpu_features = CPU_FTRS_8XX,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700827 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
828 .icache_bsize = 16,
829 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100830 .platform = "ppc823",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700831 },
832#endif /* CONFIG_8xx */
833#ifdef CONFIG_40x
834 { /* 403GC */
835 .pvr_mask = 0xffffff00,
836 .pvr_value = 0x00200200,
837 .cpu_name = "403GC",
Kumar Gala10b35d92005-09-23 14:08:58 -0500838 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700839 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
840 .icache_bsize = 16,
841 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100842 .platform = "ppc403",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700843 },
844 { /* 403GCX */
845 .pvr_mask = 0xffffff00,
846 .pvr_value = 0x00201400,
847 .cpu_name = "403GCX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500848 .cpu_features = CPU_FTRS_40X,
Paul Mackerras98599012005-10-22 16:51:34 +1000849 .cpu_user_features = PPC_FEATURE_32 |
850 PPC_FEATURE_HAS_MMU | PPC_FEATURE_NO_TB,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700851 .icache_bsize = 16,
852 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100853 .platform = "ppc403",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700854 },
855 { /* 403G ?? */
856 .pvr_mask = 0xffff0000,
857 .pvr_value = 0x00200000,
858 .cpu_name = "403G ??",
Kumar Gala10b35d92005-09-23 14:08:58 -0500859 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700860 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
861 .icache_bsize = 16,
862 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100863 .platform = "ppc403",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700864 },
865 { /* 405GP */
866 .pvr_mask = 0xffff0000,
867 .pvr_value = 0x40110000,
868 .cpu_name = "405GP",
Kumar Gala10b35d92005-09-23 14:08:58 -0500869 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700870 .cpu_user_features = PPC_FEATURE_32 |
871 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
872 .icache_bsize = 32,
873 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100874 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700875 },
876 { /* STB 03xxx */
877 .pvr_mask = 0xffff0000,
878 .pvr_value = 0x40130000,
879 .cpu_name = "STB03xxx",
Kumar Gala10b35d92005-09-23 14:08:58 -0500880 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700881 .cpu_user_features = PPC_FEATURE_32 |
882 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
883 .icache_bsize = 32,
884 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100885 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700886 },
887 { /* STB 04xxx */
888 .pvr_mask = 0xffff0000,
889 .pvr_value = 0x41810000,
890 .cpu_name = "STB04xxx",
Kumar Gala10b35d92005-09-23 14:08:58 -0500891 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700892 .cpu_user_features = PPC_FEATURE_32 |
893 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
894 .icache_bsize = 32,
895 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100896 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700897 },
898 { /* NP405L */
899 .pvr_mask = 0xffff0000,
900 .pvr_value = 0x41610000,
901 .cpu_name = "NP405L",
Kumar Gala10b35d92005-09-23 14:08:58 -0500902 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700903 .cpu_user_features = PPC_FEATURE_32 |
904 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
905 .icache_bsize = 32,
906 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100907 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700908 },
909 { /* NP4GS3 */
910 .pvr_mask = 0xffff0000,
911 .pvr_value = 0x40B10000,
912 .cpu_name = "NP4GS3",
Kumar Gala10b35d92005-09-23 14:08:58 -0500913 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700914 .cpu_user_features = PPC_FEATURE_32 |
915 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
916 .icache_bsize = 32,
917 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100918 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700919 },
920 { /* NP405H */
921 .pvr_mask = 0xffff0000,
922 .pvr_value = 0x41410000,
923 .cpu_name = "NP405H",
Kumar Gala10b35d92005-09-23 14:08:58 -0500924 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700925 .cpu_user_features = PPC_FEATURE_32 |
926 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
927 .icache_bsize = 32,
928 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100929 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700930 },
931 { /* 405GPr */
932 .pvr_mask = 0xffff0000,
933 .pvr_value = 0x50910000,
934 .cpu_name = "405GPr",
Kumar Gala10b35d92005-09-23 14:08:58 -0500935 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700936 .cpu_user_features = PPC_FEATURE_32 |
937 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
938 .icache_bsize = 32,
939 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100940 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700941 },
942 { /* STBx25xx */
943 .pvr_mask = 0xffff0000,
944 .pvr_value = 0x51510000,
945 .cpu_name = "STBx25xx",
Kumar Gala10b35d92005-09-23 14:08:58 -0500946 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700947 .cpu_user_features = PPC_FEATURE_32 |
948 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
949 .icache_bsize = 32,
950 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100951 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700952 },
953 { /* 405LP */
954 .pvr_mask = 0xffff0000,
955 .pvr_value = 0x41F10000,
956 .cpu_name = "405LP",
Kumar Gala10b35d92005-09-23 14:08:58 -0500957 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700958 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
959 .icache_bsize = 32,
960 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100961 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700962 },
963 { /* Xilinx Virtex-II Pro */
Grant C. Likely72646c72006-01-19 01:13:20 -0700964 .pvr_mask = 0xfffff000,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700965 .pvr_value = 0x20010000,
966 .cpu_name = "Virtex-II Pro",
Kumar Gala10b35d92005-09-23 14:08:58 -0500967 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700968 .cpu_user_features = PPC_FEATURE_32 |
969 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
970 .icache_bsize = 32,
971 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100972 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700973 },
Grant C. Likely72646c72006-01-19 01:13:20 -0700974 { /* Xilinx Virtex-4 FX */
975 .pvr_mask = 0xfffff000,
976 .pvr_value = 0x20011000,
977 .cpu_name = "Virtex-4 FX",
978 .cpu_features = CPU_FTRS_40X,
979 .cpu_user_features = PPC_FEATURE_32 |
980 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
981 .icache_bsize = 32,
982 .dcache_bsize = 32,
Peter Bergner838fdb42006-09-14 14:18:38 -0500983 .platform = "ppc405",
Grant C. Likely72646c72006-01-19 01:13:20 -0700984 },
Eugene Suroveginad95d602005-06-07 13:22:09 -0700985 { /* 405EP */
986 .pvr_mask = 0xffff0000,
987 .pvr_value = 0x51210000,
988 .cpu_name = "405EP",
Kumar Gala10b35d92005-09-23 14:08:58 -0500989 .cpu_features = CPU_FTRS_40X,
Eugene Suroveginad95d602005-06-07 13:22:09 -0700990 .cpu_user_features = PPC_FEATURE_32 |
991 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
992 .icache_bsize = 32,
993 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100994 .platform = "ppc405",
Eugene Suroveginad95d602005-06-07 13:22:09 -0700995 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700996
997#endif /* CONFIG_40x */
998#ifdef CONFIG_44x
Matt Porterc9cf73a2005-07-31 22:34:52 -0700999 {
1000 .pvr_mask = 0xf0000fff,
1001 .pvr_value = 0x40000850,
1002 .cpu_name = "440EP Rev. A",
Kumar Gala10b35d92005-09-23 14:08:58 -05001003 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001004 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
Matt Porterc9cf73a2005-07-31 22:34:52 -07001005 .icache_bsize = 32,
1006 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001007 .platform = "ppc440",
Matt Porterc9cf73a2005-07-31 22:34:52 -07001008 },
1009 {
1010 .pvr_mask = 0xf0000fff,
1011 .pvr_value = 0x400008d3,
1012 .cpu_name = "440EP Rev. B",
Kumar Gala10b35d92005-09-23 14:08:58 -05001013 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001014 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
Matt Porterc9cf73a2005-07-31 22:34:52 -07001015 .icache_bsize = 32,
1016 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001017 .platform = "ppc440",
Matt Porterc9cf73a2005-07-31 22:34:52 -07001018 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001019 { /* 440GP Rev. B */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001020 .pvr_mask = 0xf0000fff,
1021 .pvr_value = 0x40000440,
1022 .cpu_name = "440GP Rev. B",
Kumar Gala10b35d92005-09-23 14:08:58 -05001023 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001024 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001025 .icache_bsize = 32,
1026 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001027 .platform = "ppc440gp",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001028 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001029 { /* 440GP Rev. C */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001030 .pvr_mask = 0xf0000fff,
1031 .pvr_value = 0x40000481,
1032 .cpu_name = "440GP Rev. C",
Kumar Gala10b35d92005-09-23 14:08:58 -05001033 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001034 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001035 .icache_bsize = 32,
1036 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001037 .platform = "ppc440gp",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001038 },
1039 { /* 440GX Rev. A */
1040 .pvr_mask = 0xf0000fff,
1041 .pvr_value = 0x50000850,
1042 .cpu_name = "440GX Rev. A",
Kumar Gala10b35d92005-09-23 14:08:58 -05001043 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001044 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001045 .icache_bsize = 32,
1046 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001047 .platform = "ppc440",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001048 },
1049 { /* 440GX Rev. B */
1050 .pvr_mask = 0xf0000fff,
1051 .pvr_value = 0x50000851,
1052 .cpu_name = "440GX Rev. B",
Kumar Gala10b35d92005-09-23 14:08:58 -05001053 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001054 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001055 .icache_bsize = 32,
1056 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001057 .platform = "ppc440",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001058 },
1059 { /* 440GX Rev. C */
1060 .pvr_mask = 0xf0000fff,
1061 .pvr_value = 0x50000892,
1062 .cpu_name = "440GX Rev. C",
Kumar Gala10b35d92005-09-23 14:08:58 -05001063 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001064 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001065 .icache_bsize = 32,
1066 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001067 .platform = "ppc440",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001068 },
Eugene Surovegin9149fb32005-09-03 15:55:40 -07001069 { /* 440GX Rev. F */
1070 .pvr_mask = 0xf0000fff,
1071 .pvr_value = 0x50000894,
1072 .cpu_name = "440GX Rev. F",
Kumar Gala10b35d92005-09-23 14:08:58 -05001073 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001074 .cpu_user_features = COMMON_USER_BOOKE,
Eugene Surovegin9149fb32005-09-03 15:55:40 -07001075 .icache_bsize = 32,
1076 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001077 .platform = "ppc440",
Eugene Surovegin9149fb32005-09-03 15:55:40 -07001078 },
Matt Porter656de7e2005-09-03 15:55:42 -07001079 { /* 440SP Rev. A */
1080 .pvr_mask = 0xff000fff,
1081 .pvr_value = 0x53000891,
1082 .cpu_name = "440SP Rev. A",
Kumar Gala10b35d92005-09-23 14:08:58 -05001083 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001084 .cpu_user_features = COMMON_USER_BOOKE,
Matt Porter656de7e2005-09-03 15:55:42 -07001085 .icache_bsize = 32,
1086 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001087 .platform = "ppc440",
Matt Porter656de7e2005-09-03 15:55:42 -07001088 },
Roland Dreierb0f7b8b2005-11-07 00:58:13 -08001089 { /* 440SPe Rev. A */
1090 .pvr_mask = 0xff000fff,
1091 .pvr_value = 0x53000890,
1092 .cpu_name = "440SPe Rev. A",
1093 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
1094 CPU_FTR_USE_TB,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001095 .cpu_user_features = COMMON_USER_BOOKE,
Roland Dreierb0f7b8b2005-11-07 00:58:13 -08001096 .icache_bsize = 32,
1097 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001098 .platform = "ppc440",
Roland Dreierb0f7b8b2005-11-07 00:58:13 -08001099 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001100#endif /* CONFIG_44x */
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001101#ifdef CONFIG_FSL_BOOKE
Stephen Rothwell49209602005-10-12 15:55:09 +10001102 { /* e200z5 */
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001103 .pvr_mask = 0xfff00000,
1104 .pvr_value = 0x81000000,
1105 .cpu_name = "e200z5",
1106 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001107 .cpu_features = CPU_FTRS_E200,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001108 .cpu_user_features = COMMON_USER_BOOKE |
1109 PPC_FEATURE_HAS_EFP_SINGLE |
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001110 PPC_FEATURE_UNIFIED_CACHE,
1111 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001112 .platform = "ppc5554",
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001113 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001114 { /* e200z6 */
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001115 .pvr_mask = 0xfff00000,
1116 .pvr_value = 0x81100000,
1117 .cpu_name = "e200z6",
1118 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001119 .cpu_features = CPU_FTRS_E200,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001120 .cpu_user_features = COMMON_USER_BOOKE |
1121 PPC_FEATURE_SPE_COMP |
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001122 PPC_FEATURE_HAS_EFP_SINGLE |
1123 PPC_FEATURE_UNIFIED_CACHE,
1124 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001125 .platform = "ppc5554",
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001126 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001127 { /* e500 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001128 .pvr_mask = 0xffff0000,
1129 .pvr_value = 0x80200000,
1130 .cpu_name = "e500",
1131 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001132 .cpu_features = CPU_FTRS_E500,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001133 .cpu_user_features = COMMON_USER_BOOKE |
1134 PPC_FEATURE_SPE_COMP |
Linus Torvalds1da177e2005-04-16 15:20:36 -07001135 PPC_FEATURE_HAS_EFP_SINGLE,
1136 .icache_bsize = 32,
1137 .dcache_bsize = 32,
1138 .num_pmcs = 4,
Andy Fleming555d97a2005-12-15 20:02:04 -06001139 .oprofile_cpu_type = "ppc/e500",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +00001140 .oprofile_type = PPC_OPROFILE_BOOKE,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001141 .platform = "ppc8540",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001142 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001143 { /* e500v2 */
Kumar Gala5b37b702005-06-21 17:15:18 -07001144 .pvr_mask = 0xffff0000,
1145 .pvr_value = 0x80210000,
1146 .cpu_name = "e500v2",
1147 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001148 .cpu_features = CPU_FTRS_E500_2,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001149 .cpu_user_features = COMMON_USER_BOOKE |
1150 PPC_FEATURE_SPE_COMP |
1151 PPC_FEATURE_HAS_EFP_SINGLE |
1152 PPC_FEATURE_HAS_EFP_DOUBLE,
Kumar Gala5b37b702005-06-21 17:15:18 -07001153 .icache_bsize = 32,
1154 .dcache_bsize = 32,
1155 .num_pmcs = 4,
Andy Fleming555d97a2005-12-15 20:02:04 -06001156 .oprofile_cpu_type = "ppc/e500",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +00001157 .oprofile_type = PPC_OPROFILE_BOOKE,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001158 .platform = "ppc8548",
Kumar Gala5b37b702005-06-21 17:15:18 -07001159 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001160#endif
1161#if !CLASSIC_PPC
1162 { /* default match */
1163 .pvr_mask = 0x00000000,
1164 .pvr_value = 0x00000000,
1165 .cpu_name = "(generic PPC)",
Kumar Gala10b35d92005-09-23 14:08:58 -05001166 .cpu_features = CPU_FTRS_GENERIC_32,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001167 .cpu_user_features = PPC_FEATURE_32,
1168 .icache_bsize = 32,
1169 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001170 .platform = "powerpc",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001171 }
1172#endif /* !CLASSIC_PPC */
Stephen Rothwell49209602005-10-12 15:55:09 +10001173#endif /* CONFIG_PPC32 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001174};
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001175
1176struct cpu_spec *identify_cpu(unsigned long offset)
1177{
1178 struct cpu_spec *s = cpu_specs;
1179 struct cpu_spec **cur = &cur_cpu_spec;
1180 unsigned int pvr = mfspr(SPRN_PVR);
1181 int i;
1182
1183 s = PTRRELOC(s);
1184 cur = PTRRELOC(cur);
1185
1186 if (*cur != NULL)
1187 return PTRRELOC(*cur);
1188
1189 for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++)
1190 if ((pvr & s->pvr_mask) == s->pvr_value) {
1191 *cur = cpu_specs + i;
1192#ifdef CONFIG_PPC64
1193 /* ppc64 expects identify_cpu to also call setup_cpu
1194 * for that processor. I will consolidate that at a
1195 * later time, for now, just use our friend #ifdef.
1196 * we also don't need to PTRRELOC the function pointer
1197 * on ppc64 as we are running at 0 in real mode.
1198 */
1199 if (s->cpu_setup) {
1200 s->cpu_setup(offset, s);
1201 }
1202#endif /* CONFIG_PPC64 */
1203 return s;
1204 }
1205 BUG();
1206 return NULL;
1207}
1208
Benjamin Herrenschmidt0909c8c2006-10-20 11:47:18 +10001209void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end)
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001210{
1211 struct fixup_entry {
1212 unsigned long mask;
1213 unsigned long value;
Benjamin Herrenschmidt0909c8c2006-10-20 11:47:18 +10001214 long start_off;
1215 long end_off;
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001216 } *fcur, *fend;
1217
1218 fcur = fixup_start;
1219 fend = fixup_end;
1220
1221 for (; fcur < fend; fcur++) {
1222 unsigned int *pstart, *pend, *p;
1223
1224 if ((value & fcur->mask) == fcur->value)
1225 continue;
1226
1227 /* These PTRRELOCs will disappear once the new scheme for
1228 * modules and vdso is implemented
1229 */
Benjamin Herrenschmidt0909c8c2006-10-20 11:47:18 +10001230 pstart = ((unsigned int *)fcur) + (fcur->start_off / 4);
1231 pend = ((unsigned int *)fcur) + (fcur->end_off / 4);
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001232
1233 for (p = pstart; p < pend; p++) {
1234 *p = 0x60000000u;
1235 asm volatile ("dcbst 0, %0" : : "r" (p));
1236 }
1237 asm volatile ("sync" : : : "memory");
1238 for (p = pstart; p < pend; p++)
1239 asm volatile ("icbi 0,%0" : : "r" (p));
1240 asm volatile ("sync; isync" : : : "memory");
1241 }
1242}