blob: bfd499ee37530807a070886409b03a504ccca8e9 [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 Johanssonf39b7a52006-08-11 00:07:08 -050045extern void __restore_cpu_ppc970(void);
46#endif /* CONFIG_PPC64 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070047
Linus Torvalds1da177e2005-04-16 15:20:36 -070048/* This table only contains "desktop" CPUs, it need to be filled with embedded
49 * ones as well...
50 */
Stephen Rothwell49209602005-10-12 15:55:09 +100051#define COMMON_USER (PPC_FEATURE_32 | PPC_FEATURE_HAS_FPU | \
52 PPC_FEATURE_HAS_MMU)
53#define COMMON_USER_PPC64 (COMMON_USER | PPC_FEATURE_64)
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +110054#define COMMON_USER_POWER4 (COMMON_USER_PPC64 | PPC_FEATURE_POWER4)
Benjamin Herrenschmidtaa5cb022006-03-01 15:07:07 +110055#define COMMON_USER_POWER5 (COMMON_USER_PPC64 | PPC_FEATURE_POWER5 |\
56 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
57#define COMMON_USER_POWER5_PLUS (COMMON_USER_PPC64 | PPC_FEATURE_POWER5_PLUS|\
58 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
Anton Blanchard03054d52006-04-29 09:51:06 +100059#define COMMON_USER_POWER6 (COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_05 |\
Paul Mackerrasfab5db92006-06-07 16:14:40 +100060 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \
61 PPC_FEATURE_TRUE_LE)
Olof Johanssonb3ebd1d2006-09-06 14:35:57 -050062#define COMMON_USER_PA6T (COMMON_USER_PPC64 | PPC_FEATURE_PA6T |\
63 PPC_FEATURE_TRUE_LE | \
64 PPC_FEATURE_HAS_ALTIVEC_COMP)
Paul Mackerras80f15dc2006-01-14 10:11:39 +110065#define COMMON_USER_BOOKE (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \
66 PPC_FEATURE_BOOKE)
Linus Torvalds1da177e2005-04-16 15:20:36 -070067
Linus Torvalds1da177e2005-04-16 15:20:36 -070068/* We only set the spe features if the kernel was compiled with
69 * spe support
70 */
71#ifdef CONFIG_SPE
Stephen Rothwell49209602005-10-12 15:55:09 +100072#define PPC_FEATURE_SPE_COMP PPC_FEATURE_HAS_SPE
Linus Torvalds1da177e2005-04-16 15:20:36 -070073#else
Stephen Rothwell49209602005-10-12 15:55:09 +100074#define PPC_FEATURE_SPE_COMP 0
Linus Torvalds1da177e2005-04-16 15:20:36 -070075#endif
76
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +100077static struct cpu_spec cpu_specs[] = {
Stephen Rothwell49209602005-10-12 15:55:09 +100078#ifdef CONFIG_PPC64
79 { /* Power3 */
80 .pvr_mask = 0xffff0000,
81 .pvr_value = 0x00400000,
82 .cpu_name = "POWER3 (630)",
83 .cpu_features = CPU_FTRS_POWER3,
Paul Mackerrasfab5db92006-06-07 16:14:40 +100084 .cpu_user_features = COMMON_USER_PPC64|PPC_FEATURE_PPC_LE,
Stephen Rothwell49209602005-10-12 15:55:09 +100085 .icache_bsize = 128,
86 .dcache_bsize = 128,
87 .num_pmcs = 8,
Stephen Rothwell49209602005-10-12 15:55:09 +100088 .oprofile_cpu_type = "ppc64/power3",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +000089 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +110090 .platform = "power3",
Stephen Rothwell49209602005-10-12 15:55:09 +100091 },
92 { /* Power3+ */
93 .pvr_mask = 0xffff0000,
94 .pvr_value = 0x00410000,
95 .cpu_name = "POWER3 (630+)",
96 .cpu_features = CPU_FTRS_POWER3,
Paul Mackerrasfab5db92006-06-07 16:14:40 +100097 .cpu_user_features = COMMON_USER_PPC64|PPC_FEATURE_PPC_LE,
Stephen Rothwell49209602005-10-12 15:55:09 +100098 .icache_bsize = 128,
99 .dcache_bsize = 128,
100 .num_pmcs = 8,
Stephen Rothwell49209602005-10-12 15:55:09 +1000101 .oprofile_cpu_type = "ppc64/power3",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000102 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100103 .platform = "power3",
Stephen Rothwell49209602005-10-12 15:55:09 +1000104 },
105 { /* Northstar */
106 .pvr_mask = 0xffff0000,
107 .pvr_value = 0x00330000,
108 .cpu_name = "RS64-II (northstar)",
109 .cpu_features = CPU_FTRS_RS64,
110 .cpu_user_features = COMMON_USER_PPC64,
111 .icache_bsize = 128,
112 .dcache_bsize = 128,
113 .num_pmcs = 8,
Stephen Rothwell49209602005-10-12 15:55:09 +1000114 .oprofile_cpu_type = "ppc64/rs64",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000115 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100116 .platform = "rs64",
Stephen Rothwell49209602005-10-12 15:55:09 +1000117 },
118 { /* Pulsar */
119 .pvr_mask = 0xffff0000,
120 .pvr_value = 0x00340000,
121 .cpu_name = "RS64-III (pulsar)",
122 .cpu_features = CPU_FTRS_RS64,
123 .cpu_user_features = COMMON_USER_PPC64,
124 .icache_bsize = 128,
125 .dcache_bsize = 128,
126 .num_pmcs = 8,
Stephen Rothwell49209602005-10-12 15:55:09 +1000127 .oprofile_cpu_type = "ppc64/rs64",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000128 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100129 .platform = "rs64",
Stephen Rothwell49209602005-10-12 15:55:09 +1000130 },
131 { /* I-star */
132 .pvr_mask = 0xffff0000,
133 .pvr_value = 0x00360000,
134 .cpu_name = "RS64-III (icestar)",
135 .cpu_features = CPU_FTRS_RS64,
136 .cpu_user_features = COMMON_USER_PPC64,
137 .icache_bsize = 128,
138 .dcache_bsize = 128,
139 .num_pmcs = 8,
Stephen Rothwell49209602005-10-12 15:55:09 +1000140 .oprofile_cpu_type = "ppc64/rs64",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000141 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100142 .platform = "rs64",
Stephen Rothwell49209602005-10-12 15:55:09 +1000143 },
144 { /* S-star */
145 .pvr_mask = 0xffff0000,
146 .pvr_value = 0x00370000,
147 .cpu_name = "RS64-IV (sstar)",
148 .cpu_features = CPU_FTRS_RS64,
149 .cpu_user_features = COMMON_USER_PPC64,
150 .icache_bsize = 128,
151 .dcache_bsize = 128,
152 .num_pmcs = 8,
Stephen Rothwell49209602005-10-12 15:55:09 +1000153 .oprofile_cpu_type = "ppc64/rs64",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000154 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100155 .platform = "rs64",
Stephen Rothwell49209602005-10-12 15:55:09 +1000156 },
157 { /* Power4 */
158 .pvr_mask = 0xffff0000,
159 .pvr_value = 0x00350000,
160 .cpu_name = "POWER4 (gp)",
161 .cpu_features = CPU_FTRS_POWER4,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100162 .cpu_user_features = COMMON_USER_POWER4,
Stephen Rothwell49209602005-10-12 15:55:09 +1000163 .icache_bsize = 128,
164 .dcache_bsize = 128,
165 .num_pmcs = 8,
Stephen Rothwell49209602005-10-12 15:55:09 +1000166 .oprofile_cpu_type = "ppc64/power4",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000167 .oprofile_type = PPC_OPROFILE_POWER4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100168 .platform = "power4",
Stephen Rothwell49209602005-10-12 15:55:09 +1000169 },
170 { /* Power4+ */
171 .pvr_mask = 0xffff0000,
172 .pvr_value = 0x00380000,
173 .cpu_name = "POWER4+ (gq)",
174 .cpu_features = CPU_FTRS_POWER4,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100175 .cpu_user_features = COMMON_USER_POWER4,
Stephen Rothwell49209602005-10-12 15:55:09 +1000176 .icache_bsize = 128,
177 .dcache_bsize = 128,
178 .num_pmcs = 8,
Stephen Rothwell49209602005-10-12 15:55:09 +1000179 .oprofile_cpu_type = "ppc64/power4",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000180 .oprofile_type = PPC_OPROFILE_POWER4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100181 .platform = "power4",
Stephen Rothwell49209602005-10-12 15:55:09 +1000182 },
183 { /* PPC970 */
184 .pvr_mask = 0xffff0000,
185 .pvr_value = 0x00390000,
186 .cpu_name = "PPC970",
187 .cpu_features = CPU_FTRS_PPC970,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100188 .cpu_user_features = COMMON_USER_POWER4 |
Stephen Rothwell49209602005-10-12 15:55:09 +1000189 PPC_FEATURE_HAS_ALTIVEC_COMP,
190 .icache_bsize = 128,
191 .dcache_bsize = 128,
192 .num_pmcs = 8,
193 .cpu_setup = __setup_cpu_ppc970,
Olof Johanssonf39b7a52006-08-11 00:07:08 -0500194 .cpu_restore = __restore_cpu_ppc970,
Stephen Rothwell49209602005-10-12 15:55:09 +1000195 .oprofile_cpu_type = "ppc64/970",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000196 .oprofile_type = PPC_OPROFILE_POWER4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100197 .platform = "ppc970",
Stephen Rothwell49209602005-10-12 15:55:09 +1000198 },
Stephen Rothwell49209602005-10-12 15:55:09 +1000199 { /* PPC970FX */
200 .pvr_mask = 0xffff0000,
201 .pvr_value = 0x003c0000,
202 .cpu_name = "PPC970FX",
Stephen Rothwell49209602005-10-12 15:55:09 +1000203 .cpu_features = CPU_FTRS_PPC970,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100204 .cpu_user_features = COMMON_USER_POWER4 |
Stephen Rothwell49209602005-10-12 15:55:09 +1000205 PPC_FEATURE_HAS_ALTIVEC_COMP,
206 .icache_bsize = 128,
207 .dcache_bsize = 128,
208 .num_pmcs = 8,
209 .cpu_setup = __setup_cpu_ppc970,
Olof Johanssonf39b7a52006-08-11 00:07:08 -0500210 .cpu_restore = __restore_cpu_ppc970,
Stephen Rothwell49209602005-10-12 15:55:09 +1000211 .oprofile_cpu_type = "ppc64/970",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000212 .oprofile_type = PPC_OPROFILE_POWER4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100213 .platform = "ppc970",
Stephen Rothwell49209602005-10-12 15:55:09 +1000214 },
Stephen Rothwell49209602005-10-12 15:55:09 +1000215 { /* PPC970MP */
216 .pvr_mask = 0xffff0000,
217 .pvr_value = 0x00440000,
218 .cpu_name = "PPC970MP",
219 .cpu_features = CPU_FTRS_PPC970,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100220 .cpu_user_features = COMMON_USER_POWER4 |
Stephen Rothwell49209602005-10-12 15:55:09 +1000221 PPC_FEATURE_HAS_ALTIVEC_COMP,
222 .icache_bsize = 128,
223 .dcache_bsize = 128,
Anton Blanchard87af41b2006-05-05 05:44:26 +1000224 .num_pmcs = 8,
Stephen Rothwell49209602005-10-12 15:55:09 +1000225 .cpu_setup = __setup_cpu_ppc970,
Olof Johanssonf39b7a52006-08-11 00:07:08 -0500226 .cpu_restore = __restore_cpu_ppc970,
Stephen Rothwell49209602005-10-12 15:55:09 +1000227 .oprofile_cpu_type = "ppc64/970",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000228 .oprofile_type = PPC_OPROFILE_POWER4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100229 .platform = "ppc970",
Stephen Rothwell49209602005-10-12 15:55:09 +1000230 },
Jake Moilanen362ff7b2006-10-18 10:47:22 -0500231 { /* PPC970GX */
232 .pvr_mask = 0xffff0000,
233 .pvr_value = 0x00450000,
234 .cpu_name = "PPC970GX",
235 .cpu_features = CPU_FTRS_PPC970,
236 .cpu_user_features = COMMON_USER_POWER4 |
237 PPC_FEATURE_HAS_ALTIVEC_COMP,
238 .icache_bsize = 128,
239 .dcache_bsize = 128,
240 .num_pmcs = 8,
241 .cpu_setup = __setup_cpu_ppc970,
242 .oprofile_cpu_type = "ppc64/970",
243 .oprofile_type = PPC_OPROFILE_POWER4,
244 .platform = "ppc970",
245 },
Benjamin Herrenschmidt3c726f82005-11-07 11:06:55 +1100246 { /* Power5 GR */
Stephen Rothwell49209602005-10-12 15:55:09 +1000247 .pvr_mask = 0xffff0000,
248 .pvr_value = 0x003a0000,
249 .cpu_name = "POWER5 (gr)",
250 .cpu_features = CPU_FTRS_POWER5,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100251 .cpu_user_features = COMMON_USER_POWER5,
Stephen Rothwell49209602005-10-12 15:55:09 +1000252 .icache_bsize = 128,
253 .dcache_bsize = 128,
254 .num_pmcs = 6,
Stephen Rothwell49209602005-10-12 15:55:09 +1000255 .oprofile_cpu_type = "ppc64/power5",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000256 .oprofile_type = PPC_OPROFILE_POWER4,
Michael Neulinge78dbc82006-06-08 14:42:34 +1000257 /* SIHV / SIPR bits are implemented on POWER4+ (GQ)
258 * and above but only works on POWER5 and above
259 */
260 .oprofile_mmcra_sihv = MMCRA_SIHV,
261 .oprofile_mmcra_sipr = MMCRA_SIPR,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100262 .platform = "power5",
Stephen Rothwell49209602005-10-12 15:55:09 +1000263 },
Benjamin Herrenschmidt3c726f82005-11-07 11:06:55 +1100264 { /* Power5 GS */
Stephen Rothwell49209602005-10-12 15:55:09 +1000265 .pvr_mask = 0xffff0000,
266 .pvr_value = 0x003b0000,
Anton Blanchard834608f2006-01-09 15:42:30 +1100267 .cpu_name = "POWER5+ (gs)",
Stephen Rothwell49209602005-10-12 15:55:09 +1000268 .cpu_features = CPU_FTRS_POWER5,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100269 .cpu_user_features = COMMON_USER_POWER5_PLUS,
Stephen Rothwell49209602005-10-12 15:55:09 +1000270 .icache_bsize = 128,
271 .dcache_bsize = 128,
272 .num_pmcs = 6,
Anton Blanchard834608f2006-01-09 15:42:30 +1100273 .oprofile_cpu_type = "ppc64/power5+",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000274 .oprofile_type = PPC_OPROFILE_POWER4,
Michael Neulinge78dbc82006-06-08 14:42:34 +1000275 .oprofile_mmcra_sihv = MMCRA_SIHV,
276 .oprofile_mmcra_sipr = MMCRA_SIPR,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100277 .platform = "power5+",
Stephen Rothwell49209602005-10-12 15:55:09 +1000278 },
Anton Blanchard03054d52006-04-29 09:51:06 +1000279 { /* Power6 */
280 .pvr_mask = 0xffff0000,
281 .pvr_value = 0x003e0000,
282 .cpu_name = "POWER6",
283 .cpu_features = CPU_FTRS_POWER6,
284 .cpu_user_features = COMMON_USER_POWER6,
285 .icache_bsize = 128,
286 .dcache_bsize = 128,
Anton Blanchard99f48612006-10-13 12:13:12 +1000287 .num_pmcs = 6,
Anton Blanchard03054d52006-04-29 09:51:06 +1000288 .oprofile_cpu_type = "ppc64/power6",
289 .oprofile_type = PPC_OPROFILE_POWER4,
Michael Neulinge78dbc82006-06-08 14:42:34 +1000290 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
291 .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
292 .oprofile_mmcra_clear = POWER6_MMCRA_THRM |
293 POWER6_MMCRA_OTHER,
Anton Blanchard03054d52006-04-29 09:51:06 +1000294 .platform = "power6",
295 },
Arnd Bergmannc902be72006-01-04 19:55:53 +0000296 { /* Cell Broadband Engine */
Stephen Rothwell49209602005-10-12 15:55:09 +1000297 .pvr_mask = 0xffff0000,
298 .pvr_value = 0x00700000,
299 .cpu_name = "Cell Broadband Engine",
300 .cpu_features = CPU_FTRS_CELL,
301 .cpu_user_features = COMMON_USER_PPC64 |
Benjamin Herrenschmidtaa5cb022006-03-01 15:07:07 +1100302 PPC_FEATURE_CELL | PPC_FEATURE_HAS_ALTIVEC_COMP |
303 PPC_FEATURE_SMT,
Stephen Rothwell49209602005-10-12 15:55:09 +1000304 .icache_bsize = 128,
305 .dcache_bsize = 128,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100306 .platform = "ppc-cell-be",
Stephen Rothwell49209602005-10-12 15:55:09 +1000307 },
Olof Johanssonb3ebd1d2006-09-06 14:35:57 -0500308 { /* PA Semi PA6T */
309 .pvr_mask = 0x7fff0000,
310 .pvr_value = 0x00900000,
311 .cpu_name = "PA6T",
312 .cpu_features = CPU_FTRS_PA6T,
313 .cpu_user_features = COMMON_USER_PA6T,
314 .icache_bsize = 64,
315 .dcache_bsize = 64,
316 .num_pmcs = 6,
317 .platform = "pa6t",
318 },
Stephen Rothwell49209602005-10-12 15:55:09 +1000319 { /* default match */
320 .pvr_mask = 0x00000000,
321 .pvr_value = 0x00000000,
322 .cpu_name = "POWER4 (compatible)",
323 .cpu_features = CPU_FTRS_COMPATIBLE,
324 .cpu_user_features = COMMON_USER_PPC64,
325 .icache_bsize = 128,
326 .dcache_bsize = 128,
327 .num_pmcs = 6,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100328 .platform = "power4",
Stephen Rothwell49209602005-10-12 15:55:09 +1000329 }
330#endif /* CONFIG_PPC64 */
331#ifdef CONFIG_PPC32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700332#if CLASSIC_PPC
Stephen Rothwell49209602005-10-12 15:55:09 +1000333 { /* 601 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700334 .pvr_mask = 0xffff0000,
335 .pvr_value = 0x00010000,
336 .cpu_name = "601",
Kumar Gala10b35d92005-09-23 14:08:58 -0500337 .cpu_features = CPU_FTRS_PPC601,
Stephen Rothwell49209602005-10-12 15:55:09 +1000338 .cpu_user_features = COMMON_USER | PPC_FEATURE_601_INSTR |
Paul Mackerras98599012005-10-22 16:51:34 +1000339 PPC_FEATURE_UNIFIED_CACHE | PPC_FEATURE_NO_TB,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700340 .icache_bsize = 32,
341 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100342 .platform = "ppc601",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700343 },
344 { /* 603 */
345 .pvr_mask = 0xffff0000,
346 .pvr_value = 0x00030000,
347 .cpu_name = "603",
Kumar Gala10b35d92005-09-23 14:08:58 -0500348 .cpu_features = CPU_FTRS_603,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000349 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700350 .icache_bsize = 32,
351 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100352 .cpu_setup = __setup_cpu_603,
353 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700354 },
355 { /* 603e */
356 .pvr_mask = 0xffff0000,
357 .pvr_value = 0x00060000,
358 .cpu_name = "603e",
Kumar Gala10b35d92005-09-23 14:08:58 -0500359 .cpu_features = CPU_FTRS_603,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000360 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700361 .icache_bsize = 32,
362 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100363 .cpu_setup = __setup_cpu_603,
364 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700365 },
366 { /* 603ev */
367 .pvr_mask = 0xffff0000,
368 .pvr_value = 0x00070000,
369 .cpu_name = "603ev",
Kumar Gala10b35d92005-09-23 14:08:58 -0500370 .cpu_features = CPU_FTRS_603,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000371 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700372 .icache_bsize = 32,
373 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100374 .cpu_setup = __setup_cpu_603,
375 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700376 },
377 { /* 604 */
378 .pvr_mask = 0xffff0000,
379 .pvr_value = 0x00040000,
380 .cpu_name = "604",
Kumar Gala10b35d92005-09-23 14:08:58 -0500381 .cpu_features = CPU_FTRS_604,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000382 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700383 .icache_bsize = 32,
384 .dcache_bsize = 32,
385 .num_pmcs = 2,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100386 .cpu_setup = __setup_cpu_604,
387 .platform = "ppc604",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700388 },
389 { /* 604e */
390 .pvr_mask = 0xfffff000,
391 .pvr_value = 0x00090000,
392 .cpu_name = "604e",
Kumar Gala10b35d92005-09-23 14:08:58 -0500393 .cpu_features = CPU_FTRS_604,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000394 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700395 .icache_bsize = 32,
396 .dcache_bsize = 32,
397 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100398 .cpu_setup = __setup_cpu_604,
399 .platform = "ppc604",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700400 },
401 { /* 604r */
402 .pvr_mask = 0xffff0000,
403 .pvr_value = 0x00090000,
404 .cpu_name = "604r",
Kumar Gala10b35d92005-09-23 14:08:58 -0500405 .cpu_features = CPU_FTRS_604,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000406 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700407 .icache_bsize = 32,
408 .dcache_bsize = 32,
409 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100410 .cpu_setup = __setup_cpu_604,
411 .platform = "ppc604",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700412 },
413 { /* 604ev */
414 .pvr_mask = 0xffff0000,
415 .pvr_value = 0x000a0000,
416 .cpu_name = "604ev",
Kumar Gala10b35d92005-09-23 14:08:58 -0500417 .cpu_features = CPU_FTRS_604,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000418 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700419 .icache_bsize = 32,
420 .dcache_bsize = 32,
421 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100422 .cpu_setup = __setup_cpu_604,
423 .platform = "ppc604",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700424 },
425 { /* 740/750 (0x4202, don't support TAU ?) */
426 .pvr_mask = 0xffffffff,
427 .pvr_value = 0x00084202,
428 .cpu_name = "740/750",
Kumar Gala10b35d92005-09-23 14:08:58 -0500429 .cpu_features = CPU_FTRS_740_NOTAU,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000430 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700431 .icache_bsize = 32,
432 .dcache_bsize = 32,
433 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100434 .cpu_setup = __setup_cpu_750,
435 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700436 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700437 { /* 750CX (80100 and 8010x?) */
438 .pvr_mask = 0xfffffff0,
439 .pvr_value = 0x00080100,
440 .cpu_name = "750CX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500441 .cpu_features = CPU_FTRS_750,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000442 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700443 .icache_bsize = 32,
444 .dcache_bsize = 32,
445 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100446 .cpu_setup = __setup_cpu_750cx,
447 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700448 },
449 { /* 750CX (82201 and 82202) */
450 .pvr_mask = 0xfffffff0,
451 .pvr_value = 0x00082200,
452 .cpu_name = "750CX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500453 .cpu_features = CPU_FTRS_750,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000454 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700455 .icache_bsize = 32,
456 .dcache_bsize = 32,
457 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100458 .cpu_setup = __setup_cpu_750cx,
459 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700460 },
461 { /* 750CXe (82214) */
462 .pvr_mask = 0xfffffff0,
463 .pvr_value = 0x00082210,
464 .cpu_name = "750CXe",
Kumar Gala10b35d92005-09-23 14:08:58 -0500465 .cpu_features = CPU_FTRS_750,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000466 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700467 .icache_bsize = 32,
468 .dcache_bsize = 32,
469 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100470 .cpu_setup = __setup_cpu_750cx,
471 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700472 },
Arthur Othieno7c316252005-09-03 15:55:52 -0700473 { /* 750CXe "Gekko" (83214) */
474 .pvr_mask = 0xffffffff,
475 .pvr_value = 0x00083214,
476 .cpu_name = "750CXe",
Kumar Gala10b35d92005-09-23 14:08:58 -0500477 .cpu_features = CPU_FTRS_750,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000478 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Arthur Othieno7c316252005-09-03 15:55:52 -0700479 .icache_bsize = 32,
480 .dcache_bsize = 32,
481 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100482 .cpu_setup = __setup_cpu_750cx,
483 .platform = "ppc750",
Arthur Othieno7c316252005-09-03 15:55:52 -0700484 },
Arthur Othienoac1ff042005-09-03 15:55:51 -0700485 { /* 745/755 */
486 .pvr_mask = 0xfffff000,
487 .pvr_value = 0x00083000,
488 .cpu_name = "745/755",
Kumar Gala10b35d92005-09-23 14:08:58 -0500489 .cpu_features = CPU_FTRS_750,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000490 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Arthur Othienoac1ff042005-09-03 15:55:51 -0700491 .icache_bsize = 32,
492 .dcache_bsize = 32,
493 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100494 .cpu_setup = __setup_cpu_750,
495 .platform = "ppc750",
Arthur Othienoac1ff042005-09-03 15:55:51 -0700496 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700497 { /* 750FX rev 1.x */
498 .pvr_mask = 0xffffff00,
499 .pvr_value = 0x70000100,
500 .cpu_name = "750FX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500501 .cpu_features = CPU_FTRS_750FX1,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000502 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700503 .icache_bsize = 32,
504 .dcache_bsize = 32,
505 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100506 .cpu_setup = __setup_cpu_750,
507 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700508 },
509 { /* 750FX rev 2.0 must disable HID0[DPM] */
510 .pvr_mask = 0xffffffff,
511 .pvr_value = 0x70000200,
512 .cpu_name = "750FX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500513 .cpu_features = CPU_FTRS_750FX2,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000514 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700515 .icache_bsize = 32,
516 .dcache_bsize = 32,
517 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100518 .cpu_setup = __setup_cpu_750,
519 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700520 },
521 { /* 750FX (All revs except 2.0) */
522 .pvr_mask = 0xffff0000,
523 .pvr_value = 0x70000000,
524 .cpu_name = "750FX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500525 .cpu_features = CPU_FTRS_750FX,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000526 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700527 .icache_bsize = 32,
528 .dcache_bsize = 32,
529 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100530 .cpu_setup = __setup_cpu_750fx,
531 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700532 },
533 { /* 750GX */
534 .pvr_mask = 0xffff0000,
535 .pvr_value = 0x70020000,
536 .cpu_name = "750GX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500537 .cpu_features = CPU_FTRS_750GX,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000538 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700539 .icache_bsize = 32,
540 .dcache_bsize = 32,
541 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100542 .cpu_setup = __setup_cpu_750fx,
543 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700544 },
545 { /* 740/750 (L2CR bit need fixup for 740) */
546 .pvr_mask = 0xffff0000,
547 .pvr_value = 0x00080000,
548 .cpu_name = "740/750",
Kumar Gala10b35d92005-09-23 14:08:58 -0500549 .cpu_features = CPU_FTRS_740,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000550 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700551 .icache_bsize = 32,
552 .dcache_bsize = 32,
553 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100554 .cpu_setup = __setup_cpu_750,
555 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700556 },
557 { /* 7400 rev 1.1 ? (no TAU) */
558 .pvr_mask = 0xffffffff,
559 .pvr_value = 0x000c1101,
560 .cpu_name = "7400 (1.1)",
Kumar Gala10b35d92005-09-23 14:08:58 -0500561 .cpu_features = CPU_FTRS_7400_NOTAU,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000562 .cpu_user_features = COMMON_USER |
563 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700564 .icache_bsize = 32,
565 .dcache_bsize = 32,
566 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100567 .cpu_setup = __setup_cpu_7400,
568 .platform = "ppc7400",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700569 },
570 { /* 7400 */
571 .pvr_mask = 0xffff0000,
572 .pvr_value = 0x000c0000,
573 .cpu_name = "7400",
Kumar Gala10b35d92005-09-23 14:08:58 -0500574 .cpu_features = CPU_FTRS_7400,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000575 .cpu_user_features = COMMON_USER |
576 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700577 .icache_bsize = 32,
578 .dcache_bsize = 32,
579 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100580 .cpu_setup = __setup_cpu_7400,
581 .platform = "ppc7400",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700582 },
583 { /* 7410 */
584 .pvr_mask = 0xffff0000,
585 .pvr_value = 0x800c0000,
586 .cpu_name = "7410",
Kumar Gala10b35d92005-09-23 14:08:58 -0500587 .cpu_features = CPU_FTRS_7400,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000588 .cpu_user_features = COMMON_USER |
589 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700590 .icache_bsize = 32,
591 .dcache_bsize = 32,
592 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100593 .cpu_setup = __setup_cpu_7410,
594 .platform = "ppc7400",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700595 },
596 { /* 7450 2.0 - no doze/nap */
597 .pvr_mask = 0xffffffff,
598 .pvr_value = 0x80000200,
599 .cpu_name = "7450",
Kumar Gala10b35d92005-09-23 14:08:58 -0500600 .cpu_features = CPU_FTRS_7450_20,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000601 .cpu_user_features = COMMON_USER |
602 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700603 .icache_bsize = 32,
604 .dcache_bsize = 32,
605 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600606 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600607 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000608 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100609 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700610 },
611 { /* 7450 2.1 */
612 .pvr_mask = 0xffffffff,
613 .pvr_value = 0x80000201,
614 .cpu_name = "7450",
Kumar Gala10b35d92005-09-23 14:08:58 -0500615 .cpu_features = CPU_FTRS_7450_21,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000616 .cpu_user_features = COMMON_USER |
617 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700618 .icache_bsize = 32,
619 .dcache_bsize = 32,
620 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600621 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600622 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000623 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100624 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700625 },
626 { /* 7450 2.3 and newer */
627 .pvr_mask = 0xffff0000,
628 .pvr_value = 0x80000000,
629 .cpu_name = "7450",
Kumar Gala10b35d92005-09-23 14:08:58 -0500630 .cpu_features = CPU_FTRS_7450_23,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000631 .cpu_user_features = COMMON_USER |
632 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700633 .icache_bsize = 32,
634 .dcache_bsize = 32,
635 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600636 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600637 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000638 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100639 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700640 },
641 { /* 7455 rev 1.x */
642 .pvr_mask = 0xffffff00,
643 .pvr_value = 0x80010100,
644 .cpu_name = "7455",
Kumar Gala10b35d92005-09-23 14:08:58 -0500645 .cpu_features = CPU_FTRS_7455_1,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000646 .cpu_user_features = COMMON_USER |
647 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700648 .icache_bsize = 32,
649 .dcache_bsize = 32,
650 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600651 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600652 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000653 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100654 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700655 },
656 { /* 7455 rev 2.0 */
657 .pvr_mask = 0xffffffff,
658 .pvr_value = 0x80010200,
659 .cpu_name = "7455",
Kumar Gala10b35d92005-09-23 14:08:58 -0500660 .cpu_features = CPU_FTRS_7455_20,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000661 .cpu_user_features = COMMON_USER |
662 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700663 .icache_bsize = 32,
664 .dcache_bsize = 32,
665 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600666 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600667 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000668 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100669 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700670 },
671 { /* 7455 others */
672 .pvr_mask = 0xffff0000,
673 .pvr_value = 0x80010000,
674 .cpu_name = "7455",
Kumar Gala10b35d92005-09-23 14:08:58 -0500675 .cpu_features = CPU_FTRS_7455,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000676 .cpu_user_features = COMMON_USER |
677 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700678 .icache_bsize = 32,
679 .dcache_bsize = 32,
680 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600681 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600682 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000683 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100684 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700685 },
686 { /* 7447/7457 Rev 1.0 */
687 .pvr_mask = 0xffffffff,
688 .pvr_value = 0x80020100,
689 .cpu_name = "7447/7457",
Kumar Gala10b35d92005-09-23 14:08:58 -0500690 .cpu_features = CPU_FTRS_7447_10,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000691 .cpu_user_features = COMMON_USER |
692 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700693 .icache_bsize = 32,
694 .dcache_bsize = 32,
695 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600696 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600697 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000698 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100699 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700700 },
701 { /* 7447/7457 Rev 1.1 */
702 .pvr_mask = 0xffffffff,
703 .pvr_value = 0x80020101,
704 .cpu_name = "7447/7457",
Kumar Gala10b35d92005-09-23 14:08:58 -0500705 .cpu_features = CPU_FTRS_7447_10,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000706 .cpu_user_features = COMMON_USER |
707 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700708 .icache_bsize = 32,
709 .dcache_bsize = 32,
710 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600711 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600712 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000713 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100714 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700715 },
716 { /* 7447/7457 Rev 1.2 and later */
717 .pvr_mask = 0xffff0000,
718 .pvr_value = 0x80020000,
719 .cpu_name = "7447/7457",
Kumar Gala10b35d92005-09-23 14:08:58 -0500720 .cpu_features = CPU_FTRS_7447,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000721 .cpu_user_features = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700722 .icache_bsize = 32,
723 .dcache_bsize = 32,
724 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600725 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600726 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000727 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100728 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700729 },
730 { /* 7447A */
731 .pvr_mask = 0xffff0000,
732 .pvr_value = 0x80030000,
733 .cpu_name = "7447A",
Kumar Gala10b35d92005-09-23 14:08:58 -0500734 .cpu_features = CPU_FTRS_7447A,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000735 .cpu_user_features = COMMON_USER |
736 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700737 .icache_bsize = 32,
738 .dcache_bsize = 32,
739 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600740 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600741 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000742 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100743 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700744 },
Kumar Galabbde6302005-09-03 15:55:55 -0700745 { /* 7448 */
746 .pvr_mask = 0xffff0000,
747 .pvr_value = 0x80040000,
748 .cpu_name = "7448",
Kumar Gala10b35d92005-09-23 14:08:58 -0500749 .cpu_features = CPU_FTRS_7447A,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000750 .cpu_user_features = COMMON_USER |
751 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Kumar Galabbde6302005-09-03 15:55:55 -0700752 .icache_bsize = 32,
753 .dcache_bsize = 32,
754 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600755 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600756 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000757 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100758 .platform = "ppc7450",
Kumar Galabbde6302005-09-03 15:55:55 -0700759 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700760 { /* 82xx (8240, 8245, 8260 are all 603e cores) */
761 .pvr_mask = 0x7fff0000,
762 .pvr_value = 0x00810000,
763 .cpu_name = "82xx",
Kumar Gala10b35d92005-09-23 14:08:58 -0500764 .cpu_features = CPU_FTRS_82XX,
Stephen Rothwell49209602005-10-12 15:55:09 +1000765 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700766 .icache_bsize = 32,
767 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100768 .cpu_setup = __setup_cpu_603,
769 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700770 },
771 { /* All G2_LE (603e core, plus some) have the same pvr */
772 .pvr_mask = 0x7fff0000,
773 .pvr_value = 0x00820000,
774 .cpu_name = "G2_LE",
Kumar Gala10b35d92005-09-23 14:08:58 -0500775 .cpu_features = CPU_FTRS_G2_LE,
Stephen Rothwell49209602005-10-12 15:55:09 +1000776 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700777 .icache_bsize = 32,
778 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100779 .cpu_setup = __setup_cpu_603,
780 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700781 },
Kim Phillips6c4a2502006-10-02 20:10:24 -0500782 { /* e300c1 (a 603e core, plus some) on 83xx */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700783 .pvr_mask = 0x7fff0000,
784 .pvr_value = 0x00830000,
Kim Phillips6c4a2502006-10-02 20:10:24 -0500785 .cpu_name = "e300c1",
Kumar Gala10b35d92005-09-23 14:08:58 -0500786 .cpu_features = CPU_FTRS_E300,
Stephen Rothwell49209602005-10-12 15:55:09 +1000787 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700788 .icache_bsize = 32,
789 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100790 .cpu_setup = __setup_cpu_603,
791 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700792 },
Kim Phillips6c4a2502006-10-02 20:10:24 -0500793 { /* e300c2 (an e300c1 core, plus some, minus FPU) on 83xx */
794 .pvr_mask = 0x7fff0000,
795 .pvr_value = 0x00840000,
796 .cpu_name = "e300c2",
797 .cpu_features = CPU_FTRS_E300,
798 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
799 .icache_bsize = 32,
800 .dcache_bsize = 32,
801 .cpu_setup = __setup_cpu_603,
802 .platform = "ppc603",
803 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700804 { /* default match, we assume split I/D cache & TB (non-601)... */
805 .pvr_mask = 0x00000000,
806 .pvr_value = 0x00000000,
807 .cpu_name = "(generic PPC)",
Kumar Gala10b35d92005-09-23 14:08:58 -0500808 .cpu_features = CPU_FTRS_CLASSIC32,
Stephen Rothwell49209602005-10-12 15:55:09 +1000809 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700810 .icache_bsize = 32,
811 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100812 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700813 },
814#endif /* CLASSIC_PPC */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700815#ifdef CONFIG_8xx
816 { /* 8xx */
817 .pvr_mask = 0xffff0000,
818 .pvr_value = 0x00500000,
819 .cpu_name = "8xx",
820 /* CPU_FTR_MAYBE_CAN_DOZE is possible,
821 * if the 8xx code is there.... */
Kumar Gala10b35d92005-09-23 14:08:58 -0500822 .cpu_features = CPU_FTRS_8XX,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700823 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
824 .icache_bsize = 16,
825 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100826 .platform = "ppc823",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700827 },
828#endif /* CONFIG_8xx */
829#ifdef CONFIG_40x
830 { /* 403GC */
831 .pvr_mask = 0xffffff00,
832 .pvr_value = 0x00200200,
833 .cpu_name = "403GC",
Kumar Gala10b35d92005-09-23 14:08:58 -0500834 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700835 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
836 .icache_bsize = 16,
837 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100838 .platform = "ppc403",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700839 },
840 { /* 403GCX */
841 .pvr_mask = 0xffffff00,
842 .pvr_value = 0x00201400,
843 .cpu_name = "403GCX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500844 .cpu_features = CPU_FTRS_40X,
Paul Mackerras98599012005-10-22 16:51:34 +1000845 .cpu_user_features = PPC_FEATURE_32 |
846 PPC_FEATURE_HAS_MMU | PPC_FEATURE_NO_TB,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700847 .icache_bsize = 16,
848 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100849 .platform = "ppc403",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700850 },
851 { /* 403G ?? */
852 .pvr_mask = 0xffff0000,
853 .pvr_value = 0x00200000,
854 .cpu_name = "403G ??",
Kumar Gala10b35d92005-09-23 14:08:58 -0500855 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700856 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
857 .icache_bsize = 16,
858 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100859 .platform = "ppc403",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700860 },
861 { /* 405GP */
862 .pvr_mask = 0xffff0000,
863 .pvr_value = 0x40110000,
864 .cpu_name = "405GP",
Kumar Gala10b35d92005-09-23 14:08:58 -0500865 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700866 .cpu_user_features = PPC_FEATURE_32 |
867 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
868 .icache_bsize = 32,
869 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100870 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700871 },
872 { /* STB 03xxx */
873 .pvr_mask = 0xffff0000,
874 .pvr_value = 0x40130000,
875 .cpu_name = "STB03xxx",
Kumar Gala10b35d92005-09-23 14:08:58 -0500876 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700877 .cpu_user_features = PPC_FEATURE_32 |
878 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
879 .icache_bsize = 32,
880 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100881 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700882 },
883 { /* STB 04xxx */
884 .pvr_mask = 0xffff0000,
885 .pvr_value = 0x41810000,
886 .cpu_name = "STB04xxx",
Kumar Gala10b35d92005-09-23 14:08:58 -0500887 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700888 .cpu_user_features = PPC_FEATURE_32 |
889 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
890 .icache_bsize = 32,
891 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100892 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700893 },
894 { /* NP405L */
895 .pvr_mask = 0xffff0000,
896 .pvr_value = 0x41610000,
897 .cpu_name = "NP405L",
Kumar Gala10b35d92005-09-23 14:08:58 -0500898 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700899 .cpu_user_features = PPC_FEATURE_32 |
900 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
901 .icache_bsize = 32,
902 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100903 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700904 },
905 { /* NP4GS3 */
906 .pvr_mask = 0xffff0000,
907 .pvr_value = 0x40B10000,
908 .cpu_name = "NP4GS3",
Kumar Gala10b35d92005-09-23 14:08:58 -0500909 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700910 .cpu_user_features = PPC_FEATURE_32 |
911 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
912 .icache_bsize = 32,
913 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100914 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700915 },
916 { /* NP405H */
917 .pvr_mask = 0xffff0000,
918 .pvr_value = 0x41410000,
919 .cpu_name = "NP405H",
Kumar Gala10b35d92005-09-23 14:08:58 -0500920 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700921 .cpu_user_features = PPC_FEATURE_32 |
922 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
923 .icache_bsize = 32,
924 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100925 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700926 },
927 { /* 405GPr */
928 .pvr_mask = 0xffff0000,
929 .pvr_value = 0x50910000,
930 .cpu_name = "405GPr",
Kumar Gala10b35d92005-09-23 14:08:58 -0500931 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700932 .cpu_user_features = PPC_FEATURE_32 |
933 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
934 .icache_bsize = 32,
935 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100936 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700937 },
938 { /* STBx25xx */
939 .pvr_mask = 0xffff0000,
940 .pvr_value = 0x51510000,
941 .cpu_name = "STBx25xx",
Kumar Gala10b35d92005-09-23 14:08:58 -0500942 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700943 .cpu_user_features = PPC_FEATURE_32 |
944 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
945 .icache_bsize = 32,
946 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100947 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700948 },
949 { /* 405LP */
950 .pvr_mask = 0xffff0000,
951 .pvr_value = 0x41F10000,
952 .cpu_name = "405LP",
Kumar Gala10b35d92005-09-23 14:08:58 -0500953 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700954 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
955 .icache_bsize = 32,
956 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100957 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700958 },
959 { /* Xilinx Virtex-II Pro */
Grant C. Likely72646c72006-01-19 01:13:20 -0700960 .pvr_mask = 0xfffff000,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700961 .pvr_value = 0x20010000,
962 .cpu_name = "Virtex-II Pro",
Kumar Gala10b35d92005-09-23 14:08:58 -0500963 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700964 .cpu_user_features = PPC_FEATURE_32 |
965 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
966 .icache_bsize = 32,
967 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100968 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700969 },
Grant C. Likely72646c72006-01-19 01:13:20 -0700970 { /* Xilinx Virtex-4 FX */
971 .pvr_mask = 0xfffff000,
972 .pvr_value = 0x20011000,
973 .cpu_name = "Virtex-4 FX",
974 .cpu_features = CPU_FTRS_40X,
975 .cpu_user_features = PPC_FEATURE_32 |
976 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
977 .icache_bsize = 32,
978 .dcache_bsize = 32,
Peter Bergner838fdb42006-09-14 14:18:38 -0500979 .platform = "ppc405",
Grant C. Likely72646c72006-01-19 01:13:20 -0700980 },
Eugene Suroveginad95d602005-06-07 13:22:09 -0700981 { /* 405EP */
982 .pvr_mask = 0xffff0000,
983 .pvr_value = 0x51210000,
984 .cpu_name = "405EP",
Kumar Gala10b35d92005-09-23 14:08:58 -0500985 .cpu_features = CPU_FTRS_40X,
Eugene Suroveginad95d602005-06-07 13:22:09 -0700986 .cpu_user_features = PPC_FEATURE_32 |
987 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
988 .icache_bsize = 32,
989 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100990 .platform = "ppc405",
Eugene Suroveginad95d602005-06-07 13:22:09 -0700991 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700992
993#endif /* CONFIG_40x */
994#ifdef CONFIG_44x
Matt Porterc9cf73a2005-07-31 22:34:52 -0700995 {
996 .pvr_mask = 0xf0000fff,
997 .pvr_value = 0x40000850,
998 .cpu_name = "440EP Rev. A",
Kumar Gala10b35d92005-09-23 14:08:58 -0500999 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001000 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
Matt Porterc9cf73a2005-07-31 22:34:52 -07001001 .icache_bsize = 32,
1002 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001003 .platform = "ppc440",
Matt Porterc9cf73a2005-07-31 22:34:52 -07001004 },
1005 {
1006 .pvr_mask = 0xf0000fff,
1007 .pvr_value = 0x400008d3,
1008 .cpu_name = "440EP Rev. B",
Kumar Gala10b35d92005-09-23 14:08:58 -05001009 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001010 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
Matt Porterc9cf73a2005-07-31 22:34:52 -07001011 .icache_bsize = 32,
1012 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001013 .platform = "ppc440",
Matt Porterc9cf73a2005-07-31 22:34:52 -07001014 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001015 { /* 440GP Rev. B */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001016 .pvr_mask = 0xf0000fff,
1017 .pvr_value = 0x40000440,
1018 .cpu_name = "440GP Rev. B",
Kumar Gala10b35d92005-09-23 14:08:58 -05001019 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001020 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001021 .icache_bsize = 32,
1022 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001023 .platform = "ppc440gp",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001024 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001025 { /* 440GP Rev. C */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001026 .pvr_mask = 0xf0000fff,
1027 .pvr_value = 0x40000481,
1028 .cpu_name = "440GP Rev. C",
Kumar Gala10b35d92005-09-23 14:08:58 -05001029 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001030 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001031 .icache_bsize = 32,
1032 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001033 .platform = "ppc440gp",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001034 },
1035 { /* 440GX Rev. A */
1036 .pvr_mask = 0xf0000fff,
1037 .pvr_value = 0x50000850,
1038 .cpu_name = "440GX Rev. A",
Kumar Gala10b35d92005-09-23 14:08:58 -05001039 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001040 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001041 .icache_bsize = 32,
1042 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001043 .platform = "ppc440",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001044 },
1045 { /* 440GX Rev. B */
1046 .pvr_mask = 0xf0000fff,
1047 .pvr_value = 0x50000851,
1048 .cpu_name = "440GX Rev. B",
Kumar Gala10b35d92005-09-23 14:08:58 -05001049 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001050 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001051 .icache_bsize = 32,
1052 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001053 .platform = "ppc440",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001054 },
1055 { /* 440GX Rev. C */
1056 .pvr_mask = 0xf0000fff,
1057 .pvr_value = 0x50000892,
1058 .cpu_name = "440GX Rev. C",
Kumar Gala10b35d92005-09-23 14:08:58 -05001059 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001060 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001061 .icache_bsize = 32,
1062 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001063 .platform = "ppc440",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001064 },
Eugene Surovegin9149fb32005-09-03 15:55:40 -07001065 { /* 440GX Rev. F */
1066 .pvr_mask = 0xf0000fff,
1067 .pvr_value = 0x50000894,
1068 .cpu_name = "440GX Rev. F",
Kumar Gala10b35d92005-09-23 14:08:58 -05001069 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001070 .cpu_user_features = COMMON_USER_BOOKE,
Eugene Surovegin9149fb32005-09-03 15:55:40 -07001071 .icache_bsize = 32,
1072 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001073 .platform = "ppc440",
Eugene Surovegin9149fb32005-09-03 15:55:40 -07001074 },
Matt Porter656de7e2005-09-03 15:55:42 -07001075 { /* 440SP Rev. A */
1076 .pvr_mask = 0xff000fff,
1077 .pvr_value = 0x53000891,
1078 .cpu_name = "440SP Rev. A",
Kumar Gala10b35d92005-09-23 14:08:58 -05001079 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001080 .cpu_user_features = COMMON_USER_BOOKE,
Matt Porter656de7e2005-09-03 15:55:42 -07001081 .icache_bsize = 32,
1082 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001083 .platform = "ppc440",
Matt Porter656de7e2005-09-03 15:55:42 -07001084 },
Roland Dreierb0f7b8b2005-11-07 00:58:13 -08001085 { /* 440SPe Rev. A */
1086 .pvr_mask = 0xff000fff,
1087 .pvr_value = 0x53000890,
1088 .cpu_name = "440SPe Rev. A",
1089 .cpu_features = CPU_FTR_SPLIT_ID_CACHE |
1090 CPU_FTR_USE_TB,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001091 .cpu_user_features = COMMON_USER_BOOKE,
Roland Dreierb0f7b8b2005-11-07 00:58:13 -08001092 .icache_bsize = 32,
1093 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001094 .platform = "ppc440",
Roland Dreierb0f7b8b2005-11-07 00:58:13 -08001095 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001096#endif /* CONFIG_44x */
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001097#ifdef CONFIG_FSL_BOOKE
Stephen Rothwell49209602005-10-12 15:55:09 +10001098 { /* e200z5 */
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001099 .pvr_mask = 0xfff00000,
1100 .pvr_value = 0x81000000,
1101 .cpu_name = "e200z5",
1102 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001103 .cpu_features = CPU_FTRS_E200,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001104 .cpu_user_features = COMMON_USER_BOOKE |
1105 PPC_FEATURE_HAS_EFP_SINGLE |
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001106 PPC_FEATURE_UNIFIED_CACHE,
1107 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001108 .platform = "ppc5554",
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001109 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001110 { /* e200z6 */
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001111 .pvr_mask = 0xfff00000,
1112 .pvr_value = 0x81100000,
1113 .cpu_name = "e200z6",
1114 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001115 .cpu_features = CPU_FTRS_E200,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001116 .cpu_user_features = COMMON_USER_BOOKE |
1117 PPC_FEATURE_SPE_COMP |
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001118 PPC_FEATURE_HAS_EFP_SINGLE |
1119 PPC_FEATURE_UNIFIED_CACHE,
1120 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001121 .platform = "ppc5554",
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001122 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001123 { /* e500 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001124 .pvr_mask = 0xffff0000,
1125 .pvr_value = 0x80200000,
1126 .cpu_name = "e500",
1127 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001128 .cpu_features = CPU_FTRS_E500,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001129 .cpu_user_features = COMMON_USER_BOOKE |
1130 PPC_FEATURE_SPE_COMP |
Linus Torvalds1da177e2005-04-16 15:20:36 -07001131 PPC_FEATURE_HAS_EFP_SINGLE,
1132 .icache_bsize = 32,
1133 .dcache_bsize = 32,
1134 .num_pmcs = 4,
Andy Fleming555d97a2005-12-15 20:02:04 -06001135 .oprofile_cpu_type = "ppc/e500",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +00001136 .oprofile_type = PPC_OPROFILE_BOOKE,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001137 .platform = "ppc8540",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001138 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001139 { /* e500v2 */
Kumar Gala5b37b702005-06-21 17:15:18 -07001140 .pvr_mask = 0xffff0000,
1141 .pvr_value = 0x80210000,
1142 .cpu_name = "e500v2",
1143 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001144 .cpu_features = CPU_FTRS_E500_2,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001145 .cpu_user_features = COMMON_USER_BOOKE |
1146 PPC_FEATURE_SPE_COMP |
1147 PPC_FEATURE_HAS_EFP_SINGLE |
1148 PPC_FEATURE_HAS_EFP_DOUBLE,
Kumar Gala5b37b702005-06-21 17:15:18 -07001149 .icache_bsize = 32,
1150 .dcache_bsize = 32,
1151 .num_pmcs = 4,
Andy Fleming555d97a2005-12-15 20:02:04 -06001152 .oprofile_cpu_type = "ppc/e500",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +00001153 .oprofile_type = PPC_OPROFILE_BOOKE,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001154 .platform = "ppc8548",
Kumar Gala5b37b702005-06-21 17:15:18 -07001155 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001156#endif
1157#if !CLASSIC_PPC
1158 { /* default match */
1159 .pvr_mask = 0x00000000,
1160 .pvr_value = 0x00000000,
1161 .cpu_name = "(generic PPC)",
Kumar Gala10b35d92005-09-23 14:08:58 -05001162 .cpu_features = CPU_FTRS_GENERIC_32,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001163 .cpu_user_features = PPC_FEATURE_32,
1164 .icache_bsize = 32,
1165 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001166 .platform = "powerpc",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001167 }
1168#endif /* !CLASSIC_PPC */
Stephen Rothwell49209602005-10-12 15:55:09 +10001169#endif /* CONFIG_PPC32 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001170};
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001171
1172struct cpu_spec *identify_cpu(unsigned long offset)
1173{
1174 struct cpu_spec *s = cpu_specs;
1175 struct cpu_spec **cur = &cur_cpu_spec;
1176 unsigned int pvr = mfspr(SPRN_PVR);
1177 int i;
1178
1179 s = PTRRELOC(s);
1180 cur = PTRRELOC(cur);
1181
1182 if (*cur != NULL)
1183 return PTRRELOC(*cur);
1184
1185 for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++)
1186 if ((pvr & s->pvr_mask) == s->pvr_value) {
1187 *cur = cpu_specs + i;
1188#ifdef CONFIG_PPC64
1189 /* ppc64 expects identify_cpu to also call setup_cpu
1190 * for that processor. I will consolidate that at a
1191 * later time, for now, just use our friend #ifdef.
1192 * we also don't need to PTRRELOC the function pointer
1193 * on ppc64 as we are running at 0 in real mode.
1194 */
1195 if (s->cpu_setup) {
1196 s->cpu_setup(offset, s);
1197 }
1198#endif /* CONFIG_PPC64 */
1199 return s;
1200 }
1201 BUG();
1202 return NULL;
1203}
1204
Benjamin Herrenschmidt0909c8c2006-10-20 11:47:18 +10001205void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end)
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001206{
1207 struct fixup_entry {
1208 unsigned long mask;
1209 unsigned long value;
Benjamin Herrenschmidt0909c8c2006-10-20 11:47:18 +10001210 long start_off;
1211 long end_off;
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001212 } *fcur, *fend;
1213
1214 fcur = fixup_start;
1215 fend = fixup_end;
1216
1217 for (; fcur < fend; fcur++) {
1218 unsigned int *pstart, *pend, *p;
1219
1220 if ((value & fcur->mask) == fcur->value)
1221 continue;
1222
1223 /* These PTRRELOCs will disappear once the new scheme for
1224 * modules and vdso is implemented
1225 */
Benjamin Herrenschmidt0909c8c2006-10-20 11:47:18 +10001226 pstart = ((unsigned int *)fcur) + (fcur->start_off / 4);
1227 pend = ((unsigned int *)fcur) + (fcur->end_off / 4);
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001228
1229 for (p = pstart; p < pend; p++) {
1230 *p = 0x60000000u;
1231 asm volatile ("dcbst 0, %0" : : "r" (p));
1232 }
1233 asm volatile ("sync" : : : "memory");
1234 for (p = pstart; p < pend; p++)
1235 asm volatile ("icbi 0,%0" : : "r" (p));
1236 asm volatile ("sync; isync" : : : "memory");
1237 }
1238}