blob: 4939b3d56dfbd2ea2c3601a9c299b933cee97f99 [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,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -060089 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +100090 .oprofile_cpu_type = "ppc64/power3",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +000091 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +110092 .platform = "power3",
Stephen Rothwell49209602005-10-12 15:55:09 +100093 },
94 { /* Power3+ */
95 .pvr_mask = 0xffff0000,
96 .pvr_value = 0x00410000,
97 .cpu_name = "POWER3 (630+)",
98 .cpu_features = CPU_FTRS_POWER3,
Paul Mackerrasfab5db92006-06-07 16:14:40 +100099 .cpu_user_features = COMMON_USER_PPC64|PPC_FEATURE_PPC_LE,
Stephen Rothwell49209602005-10-12 15:55:09 +1000100 .icache_bsize = 128,
101 .dcache_bsize = 128,
102 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600103 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000104 .oprofile_cpu_type = "ppc64/power3",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000105 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100106 .platform = "power3",
Stephen Rothwell49209602005-10-12 15:55:09 +1000107 },
108 { /* Northstar */
109 .pvr_mask = 0xffff0000,
110 .pvr_value = 0x00330000,
111 .cpu_name = "RS64-II (northstar)",
112 .cpu_features = CPU_FTRS_RS64,
113 .cpu_user_features = COMMON_USER_PPC64,
114 .icache_bsize = 128,
115 .dcache_bsize = 128,
116 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600117 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000118 .oprofile_cpu_type = "ppc64/rs64",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000119 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100120 .platform = "rs64",
Stephen Rothwell49209602005-10-12 15:55:09 +1000121 },
122 { /* Pulsar */
123 .pvr_mask = 0xffff0000,
124 .pvr_value = 0x00340000,
125 .cpu_name = "RS64-III (pulsar)",
126 .cpu_features = CPU_FTRS_RS64,
127 .cpu_user_features = COMMON_USER_PPC64,
128 .icache_bsize = 128,
129 .dcache_bsize = 128,
130 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600131 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000132 .oprofile_cpu_type = "ppc64/rs64",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000133 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100134 .platform = "rs64",
Stephen Rothwell49209602005-10-12 15:55:09 +1000135 },
136 { /* I-star */
137 .pvr_mask = 0xffff0000,
138 .pvr_value = 0x00360000,
139 .cpu_name = "RS64-III (icestar)",
140 .cpu_features = CPU_FTRS_RS64,
141 .cpu_user_features = COMMON_USER_PPC64,
142 .icache_bsize = 128,
143 .dcache_bsize = 128,
144 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600145 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000146 .oprofile_cpu_type = "ppc64/rs64",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000147 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100148 .platform = "rs64",
Stephen Rothwell49209602005-10-12 15:55:09 +1000149 },
150 { /* S-star */
151 .pvr_mask = 0xffff0000,
152 .pvr_value = 0x00370000,
153 .cpu_name = "RS64-IV (sstar)",
154 .cpu_features = CPU_FTRS_RS64,
155 .cpu_user_features = COMMON_USER_PPC64,
156 .icache_bsize = 128,
157 .dcache_bsize = 128,
158 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600159 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000160 .oprofile_cpu_type = "ppc64/rs64",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000161 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100162 .platform = "rs64",
Stephen Rothwell49209602005-10-12 15:55:09 +1000163 },
164 { /* Power4 */
165 .pvr_mask = 0xffff0000,
166 .pvr_value = 0x00350000,
167 .cpu_name = "POWER4 (gp)",
168 .cpu_features = CPU_FTRS_POWER4,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100169 .cpu_user_features = COMMON_USER_POWER4,
Stephen Rothwell49209602005-10-12 15:55:09 +1000170 .icache_bsize = 128,
171 .dcache_bsize = 128,
172 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600173 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000174 .oprofile_cpu_type = "ppc64/power4",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000175 .oprofile_type = PPC_OPROFILE_POWER4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100176 .platform = "power4",
Stephen Rothwell49209602005-10-12 15:55:09 +1000177 },
178 { /* Power4+ */
179 .pvr_mask = 0xffff0000,
180 .pvr_value = 0x00380000,
181 .cpu_name = "POWER4+ (gq)",
182 .cpu_features = CPU_FTRS_POWER4,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100183 .cpu_user_features = COMMON_USER_POWER4,
Stephen Rothwell49209602005-10-12 15:55:09 +1000184 .icache_bsize = 128,
185 .dcache_bsize = 128,
186 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600187 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000188 .oprofile_cpu_type = "ppc64/power4",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000189 .oprofile_type = PPC_OPROFILE_POWER4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100190 .platform = "power4",
Stephen Rothwell49209602005-10-12 15:55:09 +1000191 },
192 { /* PPC970 */
193 .pvr_mask = 0xffff0000,
194 .pvr_value = 0x00390000,
195 .cpu_name = "PPC970",
196 .cpu_features = CPU_FTRS_PPC970,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100197 .cpu_user_features = COMMON_USER_POWER4 |
Stephen Rothwell49209602005-10-12 15:55:09 +1000198 PPC_FEATURE_HAS_ALTIVEC_COMP,
199 .icache_bsize = 128,
200 .dcache_bsize = 128,
201 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600202 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000203 .cpu_setup = __setup_cpu_ppc970,
Olof Johanssonf39b7a52006-08-11 00:07:08 -0500204 .cpu_restore = __restore_cpu_ppc970,
Stephen Rothwell49209602005-10-12 15:55:09 +1000205 .oprofile_cpu_type = "ppc64/970",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000206 .oprofile_type = PPC_OPROFILE_POWER4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100207 .platform = "ppc970",
Stephen Rothwell49209602005-10-12 15:55:09 +1000208 },
Stephen Rothwell49209602005-10-12 15:55:09 +1000209 { /* PPC970FX */
210 .pvr_mask = 0xffff0000,
211 .pvr_value = 0x003c0000,
212 .cpu_name = "PPC970FX",
Stephen Rothwell49209602005-10-12 15:55:09 +1000213 .cpu_features = CPU_FTRS_PPC970,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100214 .cpu_user_features = COMMON_USER_POWER4 |
Stephen Rothwell49209602005-10-12 15:55:09 +1000215 PPC_FEATURE_HAS_ALTIVEC_COMP,
216 .icache_bsize = 128,
217 .dcache_bsize = 128,
218 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600219 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000220 .cpu_setup = __setup_cpu_ppc970,
Olof Johanssonf39b7a52006-08-11 00:07:08 -0500221 .cpu_restore = __restore_cpu_ppc970,
Stephen Rothwell49209602005-10-12 15:55:09 +1000222 .oprofile_cpu_type = "ppc64/970",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000223 .oprofile_type = PPC_OPROFILE_POWER4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100224 .platform = "ppc970",
Stephen Rothwell49209602005-10-12 15:55:09 +1000225 },
Stephen Rothwell49209602005-10-12 15:55:09 +1000226 { /* PPC970MP */
227 .pvr_mask = 0xffff0000,
228 .pvr_value = 0x00440000,
229 .cpu_name = "PPC970MP",
230 .cpu_features = CPU_FTRS_PPC970,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100231 .cpu_user_features = COMMON_USER_POWER4 |
Stephen Rothwell49209602005-10-12 15:55:09 +1000232 PPC_FEATURE_HAS_ALTIVEC_COMP,
233 .icache_bsize = 128,
234 .dcache_bsize = 128,
Anton Blanchard87af41b2006-05-05 05:44:26 +1000235 .num_pmcs = 8,
Olof Johansson5b43d202006-10-04 23:41:41 -0500236 .cpu_setup = __setup_cpu_ppc970MP,
Olof Johanssonf39b7a52006-08-11 00:07:08 -0500237 .cpu_restore = __restore_cpu_ppc970,
Mike Wolffecb3522006-11-21 14:41:54 -0600238 .oprofile_cpu_type = "ppc64/970MP",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000239 .oprofile_type = PPC_OPROFILE_POWER4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100240 .platform = "ppc970",
Stephen Rothwell49209602005-10-12 15:55:09 +1000241 },
Jake Moilanen362ff7b2006-10-18 10:47:22 -0500242 { /* PPC970GX */
243 .pvr_mask = 0xffff0000,
244 .pvr_value = 0x00450000,
245 .cpu_name = "PPC970GX",
246 .cpu_features = CPU_FTRS_PPC970,
247 .cpu_user_features = COMMON_USER_POWER4 |
248 PPC_FEATURE_HAS_ALTIVEC_COMP,
249 .icache_bsize = 128,
250 .dcache_bsize = 128,
251 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600252 .pmc_type = PPC_PMC_IBM,
Jake Moilanen362ff7b2006-10-18 10:47:22 -0500253 .cpu_setup = __setup_cpu_ppc970,
254 .oprofile_cpu_type = "ppc64/970",
255 .oprofile_type = PPC_OPROFILE_POWER4,
256 .platform = "ppc970",
257 },
Benjamin Herrenschmidt3c726f82005-11-07 11:06:55 +1100258 { /* Power5 GR */
Stephen Rothwell49209602005-10-12 15:55:09 +1000259 .pvr_mask = 0xffff0000,
260 .pvr_value = 0x003a0000,
261 .cpu_name = "POWER5 (gr)",
262 .cpu_features = CPU_FTRS_POWER5,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100263 .cpu_user_features = COMMON_USER_POWER5,
Stephen Rothwell49209602005-10-12 15:55:09 +1000264 .icache_bsize = 128,
265 .dcache_bsize = 128,
266 .num_pmcs = 6,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600267 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000268 .oprofile_cpu_type = "ppc64/power5",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000269 .oprofile_type = PPC_OPROFILE_POWER4,
Michael Neulinge78dbc82006-06-08 14:42:34 +1000270 /* SIHV / SIPR bits are implemented on POWER4+ (GQ)
271 * and above but only works on POWER5 and above
272 */
273 .oprofile_mmcra_sihv = MMCRA_SIHV,
274 .oprofile_mmcra_sipr = MMCRA_SIPR,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100275 .platform = "power5",
Stephen Rothwell49209602005-10-12 15:55:09 +1000276 },
Benjamin Herrenschmidt3c726f82005-11-07 11:06:55 +1100277 { /* Power5 GS */
Stephen Rothwell49209602005-10-12 15:55:09 +1000278 .pvr_mask = 0xffff0000,
279 .pvr_value = 0x003b0000,
Anton Blanchard834608f2006-01-09 15:42:30 +1100280 .cpu_name = "POWER5+ (gs)",
Stephen Rothwell49209602005-10-12 15:55:09 +1000281 .cpu_features = CPU_FTRS_POWER5,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100282 .cpu_user_features = COMMON_USER_POWER5_PLUS,
Stephen Rothwell49209602005-10-12 15:55:09 +1000283 .icache_bsize = 128,
284 .dcache_bsize = 128,
285 .num_pmcs = 6,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600286 .pmc_type = PPC_PMC_IBM,
Anton Blanchard834608f2006-01-09 15:42:30 +1100287 .oprofile_cpu_type = "ppc64/power5+",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000288 .oprofile_type = PPC_OPROFILE_POWER4,
Michael Neulinge78dbc82006-06-08 14:42:34 +1000289 .oprofile_mmcra_sihv = MMCRA_SIHV,
290 .oprofile_mmcra_sipr = MMCRA_SIPR,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100291 .platform = "power5+",
Stephen Rothwell49209602005-10-12 15:55:09 +1000292 },
Paul Mackerras974a76f2006-11-10 20:38:53 +1100293 { /* POWER6 in P5+ mode; 2.04-compliant processor */
294 .pvr_mask = 0xffffffff,
295 .pvr_value = 0x0f000001,
296 .cpu_name = "POWER5+",
297 .cpu_features = CPU_FTRS_POWER5,
298 .cpu_user_features = COMMON_USER_POWER5_PLUS,
299 .icache_bsize = 128,
300 .dcache_bsize = 128,
301 .num_pmcs = 6,
302 .oprofile_cpu_type = "ppc64/power6",
303 .oprofile_type = PPC_OPROFILE_POWER4,
304 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
305 .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
306 .oprofile_mmcra_clear = POWER6_MMCRA_THRM |
307 POWER6_MMCRA_OTHER,
308 .platform = "power5+",
309 },
Anton Blanchard03054d52006-04-29 09:51:06 +1000310 { /* Power6 */
311 .pvr_mask = 0xffff0000,
312 .pvr_value = 0x003e0000,
Paul Mackerras974a76f2006-11-10 20:38:53 +1100313 .cpu_name = "POWER6 (raw)",
314 .cpu_features = CPU_FTRS_POWER6,
315 .cpu_user_features = COMMON_USER_POWER6 |
316 PPC_FEATURE_POWER6_EXT,
317 .icache_bsize = 128,
318 .dcache_bsize = 128,
319 .num_pmcs = 6,
320 .oprofile_cpu_type = "ppc64/power6",
321 .oprofile_type = PPC_OPROFILE_POWER4,
322 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
323 .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
324 .oprofile_mmcra_clear = POWER6_MMCRA_THRM |
325 POWER6_MMCRA_OTHER,
326 .platform = "power6x",
327 },
328 { /* 2.05-compliant processor, i.e. Power6 "architected" mode */
329 .pvr_mask = 0xffffffff,
330 .pvr_value = 0x0f000002,
331 .cpu_name = "POWER6 (architected)",
Anton Blanchard03054d52006-04-29 09:51:06 +1000332 .cpu_features = CPU_FTRS_POWER6,
333 .cpu_user_features = COMMON_USER_POWER6,
334 .icache_bsize = 128,
335 .dcache_bsize = 128,
Anton Blanchard99f48612006-10-13 12:13:12 +1000336 .num_pmcs = 6,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600337 .pmc_type = PPC_PMC_IBM,
Anton Blanchard03054d52006-04-29 09:51:06 +1000338 .oprofile_cpu_type = "ppc64/power6",
339 .oprofile_type = PPC_OPROFILE_POWER4,
Michael Neulinge78dbc82006-06-08 14:42:34 +1000340 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
341 .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
342 .oprofile_mmcra_clear = POWER6_MMCRA_THRM |
343 POWER6_MMCRA_OTHER,
Anton Blanchard03054d52006-04-29 09:51:06 +1000344 .platform = "power6",
345 },
Arnd Bergmannc902be72006-01-04 19:55:53 +0000346 { /* Cell Broadband Engine */
Stephen Rothwell49209602005-10-12 15:55:09 +1000347 .pvr_mask = 0xffff0000,
348 .pvr_value = 0x00700000,
349 .cpu_name = "Cell Broadband Engine",
350 .cpu_features = CPU_FTRS_CELL,
351 .cpu_user_features = COMMON_USER_PPC64 |
Benjamin Herrenschmidtaa5cb022006-03-01 15:07:07 +1100352 PPC_FEATURE_CELL | PPC_FEATURE_HAS_ALTIVEC_COMP |
353 PPC_FEATURE_SMT,
Stephen Rothwell49209602005-10-12 15:55:09 +1000354 .icache_bsize = 128,
355 .dcache_bsize = 128,
Maynard Johnson18f21902006-11-20 18:45:16 +0100356 .num_pmcs = 4,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600357 .pmc_type = PPC_PMC_IBM,
Maynard Johnson18f21902006-11-20 18:45:16 +0100358 .oprofile_cpu_type = "ppc64/cell-be",
359 .oprofile_type = PPC_OPROFILE_CELL,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100360 .platform = "ppc-cell-be",
Stephen Rothwell49209602005-10-12 15:55:09 +1000361 },
Olof Johanssonb3ebd1d2006-09-06 14:35:57 -0500362 { /* PA Semi PA6T */
363 .pvr_mask = 0x7fff0000,
364 .pvr_value = 0x00900000,
365 .cpu_name = "PA6T",
366 .cpu_features = CPU_FTRS_PA6T,
367 .cpu_user_features = COMMON_USER_PA6T,
368 .icache_bsize = 64,
369 .dcache_bsize = 64,
370 .num_pmcs = 6,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600371 .pmc_type = PPC_PMC_PA6T,
Olof Johanssonb3ebd1d2006-09-06 14:35:57 -0500372 .platform = "pa6t",
373 },
Stephen Rothwell49209602005-10-12 15:55:09 +1000374 { /* default match */
375 .pvr_mask = 0x00000000,
376 .pvr_value = 0x00000000,
377 .cpu_name = "POWER4 (compatible)",
378 .cpu_features = CPU_FTRS_COMPATIBLE,
379 .cpu_user_features = COMMON_USER_PPC64,
380 .icache_bsize = 128,
381 .dcache_bsize = 128,
382 .num_pmcs = 6,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600383 .pmc_type = PPC_PMC_IBM,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100384 .platform = "power4",
Stephen Rothwell49209602005-10-12 15:55:09 +1000385 }
386#endif /* CONFIG_PPC64 */
387#ifdef CONFIG_PPC32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700388#if CLASSIC_PPC
Stephen Rothwell49209602005-10-12 15:55:09 +1000389 { /* 601 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700390 .pvr_mask = 0xffff0000,
391 .pvr_value = 0x00010000,
392 .cpu_name = "601",
Kumar Gala10b35d92005-09-23 14:08:58 -0500393 .cpu_features = CPU_FTRS_PPC601,
Stephen Rothwell49209602005-10-12 15:55:09 +1000394 .cpu_user_features = COMMON_USER | PPC_FEATURE_601_INSTR |
Paul Mackerras98599012005-10-22 16:51:34 +1000395 PPC_FEATURE_UNIFIED_CACHE | PPC_FEATURE_NO_TB,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700396 .icache_bsize = 32,
397 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100398 .platform = "ppc601",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700399 },
400 { /* 603 */
401 .pvr_mask = 0xffff0000,
402 .pvr_value = 0x00030000,
403 .cpu_name = "603",
Kumar Gala10b35d92005-09-23 14:08:58 -0500404 .cpu_features = CPU_FTRS_603,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000405 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700406 .icache_bsize = 32,
407 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100408 .cpu_setup = __setup_cpu_603,
409 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700410 },
411 { /* 603e */
412 .pvr_mask = 0xffff0000,
413 .pvr_value = 0x00060000,
414 .cpu_name = "603e",
Kumar Gala10b35d92005-09-23 14:08:58 -0500415 .cpu_features = CPU_FTRS_603,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000416 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700417 .icache_bsize = 32,
418 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100419 .cpu_setup = __setup_cpu_603,
420 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700421 },
422 { /* 603ev */
423 .pvr_mask = 0xffff0000,
424 .pvr_value = 0x00070000,
425 .cpu_name = "603ev",
Kumar Gala10b35d92005-09-23 14:08:58 -0500426 .cpu_features = CPU_FTRS_603,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000427 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700428 .icache_bsize = 32,
429 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100430 .cpu_setup = __setup_cpu_603,
431 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700432 },
433 { /* 604 */
434 .pvr_mask = 0xffff0000,
435 .pvr_value = 0x00040000,
436 .cpu_name = "604",
Kumar Gala10b35d92005-09-23 14:08:58 -0500437 .cpu_features = CPU_FTRS_604,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000438 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700439 .icache_bsize = 32,
440 .dcache_bsize = 32,
441 .num_pmcs = 2,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100442 .cpu_setup = __setup_cpu_604,
443 .platform = "ppc604",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700444 },
445 { /* 604e */
446 .pvr_mask = 0xfffff000,
447 .pvr_value = 0x00090000,
448 .cpu_name = "604e",
Kumar Gala10b35d92005-09-23 14:08:58 -0500449 .cpu_features = CPU_FTRS_604,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000450 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700451 .icache_bsize = 32,
452 .dcache_bsize = 32,
453 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100454 .cpu_setup = __setup_cpu_604,
455 .platform = "ppc604",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700456 },
457 { /* 604r */
458 .pvr_mask = 0xffff0000,
459 .pvr_value = 0x00090000,
460 .cpu_name = "604r",
Kumar Gala10b35d92005-09-23 14:08:58 -0500461 .cpu_features = CPU_FTRS_604,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000462 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700463 .icache_bsize = 32,
464 .dcache_bsize = 32,
465 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100466 .cpu_setup = __setup_cpu_604,
467 .platform = "ppc604",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700468 },
469 { /* 604ev */
470 .pvr_mask = 0xffff0000,
471 .pvr_value = 0x000a0000,
472 .cpu_name = "604ev",
Kumar Gala10b35d92005-09-23 14:08:58 -0500473 .cpu_features = CPU_FTRS_604,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000474 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700475 .icache_bsize = 32,
476 .dcache_bsize = 32,
477 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100478 .cpu_setup = __setup_cpu_604,
479 .platform = "ppc604",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700480 },
481 { /* 740/750 (0x4202, don't support TAU ?) */
482 .pvr_mask = 0xffffffff,
483 .pvr_value = 0x00084202,
484 .cpu_name = "740/750",
Kumar Gala10b35d92005-09-23 14:08:58 -0500485 .cpu_features = CPU_FTRS_740_NOTAU,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000486 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700487 .icache_bsize = 32,
488 .dcache_bsize = 32,
489 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100490 .cpu_setup = __setup_cpu_750,
491 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700492 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700493 { /* 750CX (80100 and 8010x?) */
494 .pvr_mask = 0xfffffff0,
495 .pvr_value = 0x00080100,
496 .cpu_name = "750CX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500497 .cpu_features = CPU_FTRS_750,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000498 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700499 .icache_bsize = 32,
500 .dcache_bsize = 32,
501 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100502 .cpu_setup = __setup_cpu_750cx,
503 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700504 },
505 { /* 750CX (82201 and 82202) */
506 .pvr_mask = 0xfffffff0,
507 .pvr_value = 0x00082200,
508 .cpu_name = "750CX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500509 .cpu_features = CPU_FTRS_750,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000510 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700511 .icache_bsize = 32,
512 .dcache_bsize = 32,
513 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100514 .cpu_setup = __setup_cpu_750cx,
515 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700516 },
517 { /* 750CXe (82214) */
518 .pvr_mask = 0xfffffff0,
519 .pvr_value = 0x00082210,
520 .cpu_name = "750CXe",
Kumar Gala10b35d92005-09-23 14:08:58 -0500521 .cpu_features = CPU_FTRS_750,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000522 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700523 .icache_bsize = 32,
524 .dcache_bsize = 32,
525 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100526 .cpu_setup = __setup_cpu_750cx,
527 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700528 },
Arthur Othieno7c316252005-09-03 15:55:52 -0700529 { /* 750CXe "Gekko" (83214) */
530 .pvr_mask = 0xffffffff,
531 .pvr_value = 0x00083214,
532 .cpu_name = "750CXe",
Kumar Gala10b35d92005-09-23 14:08:58 -0500533 .cpu_features = CPU_FTRS_750,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000534 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Arthur Othieno7c316252005-09-03 15:55:52 -0700535 .icache_bsize = 32,
536 .dcache_bsize = 32,
537 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100538 .cpu_setup = __setup_cpu_750cx,
539 .platform = "ppc750",
Arthur Othieno7c316252005-09-03 15:55:52 -0700540 },
Arthur Othienoac1ff042005-09-03 15:55:51 -0700541 { /* 745/755 */
542 .pvr_mask = 0xfffff000,
543 .pvr_value = 0x00083000,
544 .cpu_name = "745/755",
Kumar Gala10b35d92005-09-23 14:08:58 -0500545 .cpu_features = CPU_FTRS_750,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000546 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Arthur Othienoac1ff042005-09-03 15:55:51 -0700547 .icache_bsize = 32,
548 .dcache_bsize = 32,
549 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100550 .cpu_setup = __setup_cpu_750,
551 .platform = "ppc750",
Arthur Othienoac1ff042005-09-03 15:55:51 -0700552 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700553 { /* 750FX rev 1.x */
554 .pvr_mask = 0xffffff00,
555 .pvr_value = 0x70000100,
556 .cpu_name = "750FX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500557 .cpu_features = CPU_FTRS_750FX1,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000558 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700559 .icache_bsize = 32,
560 .dcache_bsize = 32,
561 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100562 .cpu_setup = __setup_cpu_750,
563 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700564 },
565 { /* 750FX rev 2.0 must disable HID0[DPM] */
566 .pvr_mask = 0xffffffff,
567 .pvr_value = 0x70000200,
568 .cpu_name = "750FX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500569 .cpu_features = CPU_FTRS_750FX2,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000570 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700571 .icache_bsize = 32,
572 .dcache_bsize = 32,
573 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100574 .cpu_setup = __setup_cpu_750,
575 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700576 },
577 { /* 750FX (All revs except 2.0) */
578 .pvr_mask = 0xffff0000,
579 .pvr_value = 0x70000000,
580 .cpu_name = "750FX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500581 .cpu_features = CPU_FTRS_750FX,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000582 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700583 .icache_bsize = 32,
584 .dcache_bsize = 32,
585 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100586 .cpu_setup = __setup_cpu_750fx,
587 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700588 },
589 { /* 750GX */
590 .pvr_mask = 0xffff0000,
591 .pvr_value = 0x70020000,
592 .cpu_name = "750GX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500593 .cpu_features = CPU_FTRS_750GX,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000594 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700595 .icache_bsize = 32,
596 .dcache_bsize = 32,
597 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100598 .cpu_setup = __setup_cpu_750fx,
599 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700600 },
601 { /* 740/750 (L2CR bit need fixup for 740) */
602 .pvr_mask = 0xffff0000,
603 .pvr_value = 0x00080000,
604 .cpu_name = "740/750",
Kumar Gala10b35d92005-09-23 14:08:58 -0500605 .cpu_features = CPU_FTRS_740,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000606 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700607 .icache_bsize = 32,
608 .dcache_bsize = 32,
609 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100610 .cpu_setup = __setup_cpu_750,
611 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700612 },
613 { /* 7400 rev 1.1 ? (no TAU) */
614 .pvr_mask = 0xffffffff,
615 .pvr_value = 0x000c1101,
616 .cpu_name = "7400 (1.1)",
Kumar Gala10b35d92005-09-23 14:08:58 -0500617 .cpu_features = CPU_FTRS_7400_NOTAU,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000618 .cpu_user_features = COMMON_USER |
619 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700620 .icache_bsize = 32,
621 .dcache_bsize = 32,
622 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100623 .cpu_setup = __setup_cpu_7400,
624 .platform = "ppc7400",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700625 },
626 { /* 7400 */
627 .pvr_mask = 0xffff0000,
628 .pvr_value = 0x000c0000,
629 .cpu_name = "7400",
Kumar Gala10b35d92005-09-23 14:08:58 -0500630 .cpu_features = CPU_FTRS_7400,
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 = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100636 .cpu_setup = __setup_cpu_7400,
637 .platform = "ppc7400",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700638 },
639 { /* 7410 */
640 .pvr_mask = 0xffff0000,
641 .pvr_value = 0x800c0000,
642 .cpu_name = "7410",
Kumar Gala10b35d92005-09-23 14:08:58 -0500643 .cpu_features = CPU_FTRS_7400,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000644 .cpu_user_features = COMMON_USER |
645 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700646 .icache_bsize = 32,
647 .dcache_bsize = 32,
648 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100649 .cpu_setup = __setup_cpu_7410,
650 .platform = "ppc7400",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700651 },
652 { /* 7450 2.0 - no doze/nap */
653 .pvr_mask = 0xffffffff,
654 .pvr_value = 0x80000200,
655 .cpu_name = "7450",
Kumar Gala10b35d92005-09-23 14:08:58 -0500656 .cpu_features = CPU_FTRS_7450_20,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000657 .cpu_user_features = COMMON_USER |
658 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700659 .icache_bsize = 32,
660 .dcache_bsize = 32,
661 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600662 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600663 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000664 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100665 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700666 },
667 { /* 7450 2.1 */
668 .pvr_mask = 0xffffffff,
669 .pvr_value = 0x80000201,
670 .cpu_name = "7450",
Kumar Gala10b35d92005-09-23 14:08:58 -0500671 .cpu_features = CPU_FTRS_7450_21,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000672 .cpu_user_features = COMMON_USER |
673 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700674 .icache_bsize = 32,
675 .dcache_bsize = 32,
676 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600677 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600678 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000679 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100680 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700681 },
682 { /* 7450 2.3 and newer */
683 .pvr_mask = 0xffff0000,
684 .pvr_value = 0x80000000,
685 .cpu_name = "7450",
Kumar Gala10b35d92005-09-23 14:08:58 -0500686 .cpu_features = CPU_FTRS_7450_23,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000687 .cpu_user_features = COMMON_USER |
688 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700689 .icache_bsize = 32,
690 .dcache_bsize = 32,
691 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600692 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600693 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000694 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100695 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700696 },
697 { /* 7455 rev 1.x */
698 .pvr_mask = 0xffffff00,
699 .pvr_value = 0x80010100,
700 .cpu_name = "7455",
Kumar Gala10b35d92005-09-23 14:08:58 -0500701 .cpu_features = CPU_FTRS_7455_1,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000702 .cpu_user_features = COMMON_USER |
703 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700704 .icache_bsize = 32,
705 .dcache_bsize = 32,
706 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600707 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600708 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000709 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100710 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700711 },
712 { /* 7455 rev 2.0 */
713 .pvr_mask = 0xffffffff,
714 .pvr_value = 0x80010200,
715 .cpu_name = "7455",
Kumar Gala10b35d92005-09-23 14:08:58 -0500716 .cpu_features = CPU_FTRS_7455_20,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000717 .cpu_user_features = COMMON_USER |
718 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700719 .icache_bsize = 32,
720 .dcache_bsize = 32,
721 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600722 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600723 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000724 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100725 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700726 },
727 { /* 7455 others */
728 .pvr_mask = 0xffff0000,
729 .pvr_value = 0x80010000,
730 .cpu_name = "7455",
Kumar Gala10b35d92005-09-23 14:08:58 -0500731 .cpu_features = CPU_FTRS_7455,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000732 .cpu_user_features = COMMON_USER |
733 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700734 .icache_bsize = 32,
735 .dcache_bsize = 32,
736 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600737 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600738 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000739 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100740 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700741 },
742 { /* 7447/7457 Rev 1.0 */
743 .pvr_mask = 0xffffffff,
744 .pvr_value = 0x80020100,
745 .cpu_name = "7447/7457",
Kumar Gala10b35d92005-09-23 14:08:58 -0500746 .cpu_features = CPU_FTRS_7447_10,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000747 .cpu_user_features = COMMON_USER |
748 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700749 .icache_bsize = 32,
750 .dcache_bsize = 32,
751 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600752 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600753 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000754 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100755 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700756 },
757 { /* 7447/7457 Rev 1.1 */
758 .pvr_mask = 0xffffffff,
759 .pvr_value = 0x80020101,
760 .cpu_name = "7447/7457",
Kumar Gala10b35d92005-09-23 14:08:58 -0500761 .cpu_features = CPU_FTRS_7447_10,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000762 .cpu_user_features = COMMON_USER |
763 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700764 .icache_bsize = 32,
765 .dcache_bsize = 32,
766 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600767 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600768 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000769 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100770 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700771 },
772 { /* 7447/7457 Rev 1.2 and later */
773 .pvr_mask = 0xffff0000,
774 .pvr_value = 0x80020000,
775 .cpu_name = "7447/7457",
Kumar Gala10b35d92005-09-23 14:08:58 -0500776 .cpu_features = CPU_FTRS_7447,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000777 .cpu_user_features = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700778 .icache_bsize = 32,
779 .dcache_bsize = 32,
780 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600781 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600782 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000783 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100784 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700785 },
786 { /* 7447A */
787 .pvr_mask = 0xffff0000,
788 .pvr_value = 0x80030000,
789 .cpu_name = "7447A",
Kumar Gala10b35d92005-09-23 14:08:58 -0500790 .cpu_features = CPU_FTRS_7447A,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000791 .cpu_user_features = COMMON_USER |
792 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700793 .icache_bsize = 32,
794 .dcache_bsize = 32,
795 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600796 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600797 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000798 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100799 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700800 },
Kumar Galabbde6302005-09-03 15:55:55 -0700801 { /* 7448 */
802 .pvr_mask = 0xffff0000,
803 .pvr_value = 0x80040000,
804 .cpu_name = "7448",
Kumar Gala10b35d92005-09-23 14:08:58 -0500805 .cpu_features = CPU_FTRS_7447A,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000806 .cpu_user_features = COMMON_USER |
807 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Kumar Galabbde6302005-09-03 15:55:55 -0700808 .icache_bsize = 32,
809 .dcache_bsize = 32,
810 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600811 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600812 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000813 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100814 .platform = "ppc7450",
Kumar Galabbde6302005-09-03 15:55:55 -0700815 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700816 { /* 82xx (8240, 8245, 8260 are all 603e cores) */
817 .pvr_mask = 0x7fff0000,
818 .pvr_value = 0x00810000,
819 .cpu_name = "82xx",
Kumar Gala10b35d92005-09-23 14:08:58 -0500820 .cpu_features = CPU_FTRS_82XX,
Stephen Rothwell49209602005-10-12 15:55:09 +1000821 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700822 .icache_bsize = 32,
823 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100824 .cpu_setup = __setup_cpu_603,
825 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700826 },
827 { /* All G2_LE (603e core, plus some) have the same pvr */
828 .pvr_mask = 0x7fff0000,
829 .pvr_value = 0x00820000,
830 .cpu_name = "G2_LE",
Kumar Gala10b35d92005-09-23 14:08:58 -0500831 .cpu_features = CPU_FTRS_G2_LE,
Stephen Rothwell49209602005-10-12 15:55:09 +1000832 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700833 .icache_bsize = 32,
834 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100835 .cpu_setup = __setup_cpu_603,
836 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700837 },
Kim Phillips6c4a2502006-10-02 20:10:24 -0500838 { /* e300c1 (a 603e core, plus some) on 83xx */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700839 .pvr_mask = 0x7fff0000,
840 .pvr_value = 0x00830000,
Kim Phillips6c4a2502006-10-02 20:10:24 -0500841 .cpu_name = "e300c1",
Kumar Gala10b35d92005-09-23 14:08:58 -0500842 .cpu_features = CPU_FTRS_E300,
Stephen Rothwell49209602005-10-12 15:55:09 +1000843 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700844 .icache_bsize = 32,
845 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100846 .cpu_setup = __setup_cpu_603,
847 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700848 },
Kim Phillips6c4a2502006-10-02 20:10:24 -0500849 { /* e300c2 (an e300c1 core, plus some, minus FPU) on 83xx */
850 .pvr_mask = 0x7fff0000,
851 .pvr_value = 0x00840000,
852 .cpu_name = "e300c2",
Kim Phillipsaa42c692006-12-08 02:43:30 -0600853 .cpu_features = CPU_FTRS_E300C2,
Kim Phillips6c4a2502006-10-02 20:10:24 -0500854 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
855 .icache_bsize = 32,
856 .dcache_bsize = 32,
857 .cpu_setup = __setup_cpu_603,
858 .platform = "ppc603",
859 },
Scott Wood57933f82006-12-01 12:57:05 -0600860 { /* e300c3 on 83xx */
861 .pvr_mask = 0x7fff0000,
862 .pvr_value = 0x00850000,
863 .cpu_name = "e300c3",
864 .cpu_features = CPU_FTRS_E300,
865 .cpu_user_features = COMMON_USER,
866 .icache_bsize = 32,
867 .dcache_bsize = 32,
868 .cpu_setup = __setup_cpu_603,
869 .platform = "ppc603",
870 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700871 { /* default match, we assume split I/D cache & TB (non-601)... */
872 .pvr_mask = 0x00000000,
873 .pvr_value = 0x00000000,
874 .cpu_name = "(generic PPC)",
Kumar Gala10b35d92005-09-23 14:08:58 -0500875 .cpu_features = CPU_FTRS_CLASSIC32,
Stephen Rothwell49209602005-10-12 15:55:09 +1000876 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700877 .icache_bsize = 32,
878 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100879 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700880 },
881#endif /* CLASSIC_PPC */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700882#ifdef CONFIG_8xx
883 { /* 8xx */
884 .pvr_mask = 0xffff0000,
885 .pvr_value = 0x00500000,
886 .cpu_name = "8xx",
887 /* CPU_FTR_MAYBE_CAN_DOZE is possible,
888 * if the 8xx code is there.... */
Kumar Gala10b35d92005-09-23 14:08:58 -0500889 .cpu_features = CPU_FTRS_8XX,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700890 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
891 .icache_bsize = 16,
892 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100893 .platform = "ppc823",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700894 },
895#endif /* CONFIG_8xx */
896#ifdef CONFIG_40x
897 { /* 403GC */
898 .pvr_mask = 0xffffff00,
899 .pvr_value = 0x00200200,
900 .cpu_name = "403GC",
Kumar Gala10b35d92005-09-23 14:08:58 -0500901 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700902 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
903 .icache_bsize = 16,
904 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100905 .platform = "ppc403",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700906 },
907 { /* 403GCX */
908 .pvr_mask = 0xffffff00,
909 .pvr_value = 0x00201400,
910 .cpu_name = "403GCX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500911 .cpu_features = CPU_FTRS_40X,
Paul Mackerras98599012005-10-22 16:51:34 +1000912 .cpu_user_features = PPC_FEATURE_32 |
913 PPC_FEATURE_HAS_MMU | PPC_FEATURE_NO_TB,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700914 .icache_bsize = 16,
915 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100916 .platform = "ppc403",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700917 },
918 { /* 403G ?? */
919 .pvr_mask = 0xffff0000,
920 .pvr_value = 0x00200000,
921 .cpu_name = "403G ??",
Kumar Gala10b35d92005-09-23 14:08:58 -0500922 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700923 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
924 .icache_bsize = 16,
925 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100926 .platform = "ppc403",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700927 },
928 { /* 405GP */
929 .pvr_mask = 0xffff0000,
930 .pvr_value = 0x40110000,
931 .cpu_name = "405GP",
Kumar Gala10b35d92005-09-23 14:08:58 -0500932 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700933 .cpu_user_features = PPC_FEATURE_32 |
934 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
935 .icache_bsize = 32,
936 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100937 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700938 },
939 { /* STB 03xxx */
940 .pvr_mask = 0xffff0000,
941 .pvr_value = 0x40130000,
942 .cpu_name = "STB03xxx",
Kumar Gala10b35d92005-09-23 14:08:58 -0500943 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700944 .cpu_user_features = PPC_FEATURE_32 |
945 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
946 .icache_bsize = 32,
947 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100948 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700949 },
950 { /* STB 04xxx */
951 .pvr_mask = 0xffff0000,
952 .pvr_value = 0x41810000,
953 .cpu_name = "STB04xxx",
Kumar Gala10b35d92005-09-23 14:08:58 -0500954 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700955 .cpu_user_features = PPC_FEATURE_32 |
956 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
957 .icache_bsize = 32,
958 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100959 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700960 },
961 { /* NP405L */
962 .pvr_mask = 0xffff0000,
963 .pvr_value = 0x41610000,
964 .cpu_name = "NP405L",
Kumar Gala10b35d92005-09-23 14:08:58 -0500965 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700966 .cpu_user_features = PPC_FEATURE_32 |
967 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
968 .icache_bsize = 32,
969 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100970 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700971 },
972 { /* NP4GS3 */
973 .pvr_mask = 0xffff0000,
974 .pvr_value = 0x40B10000,
975 .cpu_name = "NP4GS3",
Kumar Gala10b35d92005-09-23 14:08:58 -0500976 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700977 .cpu_user_features = PPC_FEATURE_32 |
978 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
979 .icache_bsize = 32,
980 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100981 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700982 },
983 { /* NP405H */
984 .pvr_mask = 0xffff0000,
985 .pvr_value = 0x41410000,
986 .cpu_name = "NP405H",
Kumar Gala10b35d92005-09-23 14:08:58 -0500987 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700988 .cpu_user_features = PPC_FEATURE_32 |
989 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
990 .icache_bsize = 32,
991 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100992 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700993 },
994 { /* 405GPr */
995 .pvr_mask = 0xffff0000,
996 .pvr_value = 0x50910000,
997 .cpu_name = "405GPr",
Kumar Gala10b35d92005-09-23 14:08:58 -0500998 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700999 .cpu_user_features = PPC_FEATURE_32 |
1000 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1001 .icache_bsize = 32,
1002 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001003 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001004 },
1005 { /* STBx25xx */
1006 .pvr_mask = 0xffff0000,
1007 .pvr_value = 0x51510000,
1008 .cpu_name = "STBx25xx",
Kumar Gala10b35d92005-09-23 14:08:58 -05001009 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001010 .cpu_user_features = PPC_FEATURE_32 |
1011 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1012 .icache_bsize = 32,
1013 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001014 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001015 },
1016 { /* 405LP */
1017 .pvr_mask = 0xffff0000,
1018 .pvr_value = 0x41F10000,
1019 .cpu_name = "405LP",
Kumar Gala10b35d92005-09-23 14:08:58 -05001020 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001021 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
1022 .icache_bsize = 32,
1023 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001024 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001025 },
1026 { /* Xilinx Virtex-II Pro */
Grant C. Likely72646c72006-01-19 01:13:20 -07001027 .pvr_mask = 0xfffff000,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001028 .pvr_value = 0x20010000,
1029 .cpu_name = "Virtex-II Pro",
Kumar Gala10b35d92005-09-23 14:08:58 -05001030 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001031 .cpu_user_features = PPC_FEATURE_32 |
1032 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1033 .icache_bsize = 32,
1034 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001035 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001036 },
Grant C. Likely72646c72006-01-19 01:13:20 -07001037 { /* Xilinx Virtex-4 FX */
1038 .pvr_mask = 0xfffff000,
1039 .pvr_value = 0x20011000,
1040 .cpu_name = "Virtex-4 FX",
1041 .cpu_features = CPU_FTRS_40X,
1042 .cpu_user_features = PPC_FEATURE_32 |
1043 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1044 .icache_bsize = 32,
1045 .dcache_bsize = 32,
Peter Bergner838fdb42006-09-14 14:18:38 -05001046 .platform = "ppc405",
Grant C. Likely72646c72006-01-19 01:13:20 -07001047 },
Eugene Suroveginad95d602005-06-07 13:22:09 -07001048 { /* 405EP */
1049 .pvr_mask = 0xffff0000,
1050 .pvr_value = 0x51210000,
1051 .cpu_name = "405EP",
Kumar Gala10b35d92005-09-23 14:08:58 -05001052 .cpu_features = CPU_FTRS_40X,
Eugene Suroveginad95d602005-06-07 13:22:09 -07001053 .cpu_user_features = PPC_FEATURE_32 |
1054 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1055 .icache_bsize = 32,
1056 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001057 .platform = "ppc405",
Eugene Suroveginad95d602005-06-07 13:22:09 -07001058 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001059
1060#endif /* CONFIG_40x */
1061#ifdef CONFIG_44x
Matt Porterc9cf73a2005-07-31 22:34:52 -07001062 {
1063 .pvr_mask = 0xf0000fff,
1064 .pvr_value = 0x40000850,
1065 .cpu_name = "440EP Rev. A",
Kumar Gala10b35d92005-09-23 14:08:58 -05001066 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001067 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
Matt Porterc9cf73a2005-07-31 22:34:52 -07001068 .icache_bsize = 32,
1069 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001070 .platform = "ppc440",
Matt Porterc9cf73a2005-07-31 22:34:52 -07001071 },
1072 {
1073 .pvr_mask = 0xf0000fff,
1074 .pvr_value = 0x400008d3,
1075 .cpu_name = "440EP Rev. B",
Kumar Gala10b35d92005-09-23 14:08:58 -05001076 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001077 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
Matt Porterc9cf73a2005-07-31 22:34:52 -07001078 .icache_bsize = 32,
1079 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001080 .platform = "ppc440",
Matt Porterc9cf73a2005-07-31 22:34:52 -07001081 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001082 { /* 440GP Rev. B */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001083 .pvr_mask = 0xf0000fff,
1084 .pvr_value = 0x40000440,
1085 .cpu_name = "440GP Rev. B",
Kumar Gala10b35d92005-09-23 14:08:58 -05001086 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001087 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001088 .icache_bsize = 32,
1089 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001090 .platform = "ppc440gp",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001091 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001092 { /* 440GP Rev. C */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001093 .pvr_mask = 0xf0000fff,
1094 .pvr_value = 0x40000481,
1095 .cpu_name = "440GP Rev. C",
Kumar Gala10b35d92005-09-23 14:08:58 -05001096 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001097 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001098 .icache_bsize = 32,
1099 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001100 .platform = "ppc440gp",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001101 },
1102 { /* 440GX Rev. A */
1103 .pvr_mask = 0xf0000fff,
1104 .pvr_value = 0x50000850,
1105 .cpu_name = "440GX Rev. A",
Kumar Gala10b35d92005-09-23 14:08:58 -05001106 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001107 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001108 .icache_bsize = 32,
1109 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001110 .platform = "ppc440",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001111 },
1112 { /* 440GX Rev. B */
1113 .pvr_mask = 0xf0000fff,
1114 .pvr_value = 0x50000851,
1115 .cpu_name = "440GX Rev. B",
Kumar Gala10b35d92005-09-23 14:08:58 -05001116 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001117 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001118 .icache_bsize = 32,
1119 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001120 .platform = "ppc440",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001121 },
1122 { /* 440GX Rev. C */
1123 .pvr_mask = 0xf0000fff,
1124 .pvr_value = 0x50000892,
1125 .cpu_name = "440GX Rev. C",
Kumar Gala10b35d92005-09-23 14:08:58 -05001126 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001127 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001128 .icache_bsize = 32,
1129 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001130 .platform = "ppc440",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001131 },
Eugene Surovegin9149fb32005-09-03 15:55:40 -07001132 { /* 440GX Rev. F */
1133 .pvr_mask = 0xf0000fff,
1134 .pvr_value = 0x50000894,
1135 .cpu_name = "440GX Rev. F",
Kumar Gala10b35d92005-09-23 14:08:58 -05001136 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001137 .cpu_user_features = COMMON_USER_BOOKE,
Eugene Surovegin9149fb32005-09-03 15:55:40 -07001138 .icache_bsize = 32,
1139 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001140 .platform = "ppc440",
Eugene Surovegin9149fb32005-09-03 15:55:40 -07001141 },
Matt Porter656de7e2005-09-03 15:55:42 -07001142 { /* 440SP Rev. A */
1143 .pvr_mask = 0xff000fff,
1144 .pvr_value = 0x53000891,
1145 .cpu_name = "440SP Rev. A",
Kumar Gala10b35d92005-09-23 14:08:58 -05001146 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001147 .cpu_user_features = COMMON_USER_BOOKE,
Matt Porter656de7e2005-09-03 15:55:42 -07001148 .icache_bsize = 32,
1149 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001150 .platform = "ppc440",
Matt Porter656de7e2005-09-03 15:55:42 -07001151 },
Roland Dreierb0f7b8b2005-11-07 00:58:13 -08001152 { /* 440SPe Rev. A */
1153 .pvr_mask = 0xff000fff,
1154 .pvr_value = 0x53000890,
1155 .cpu_name = "440SPe Rev. A",
Kumar Galaa147c582006-12-08 02:34:38 -06001156 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001157 .cpu_user_features = COMMON_USER_BOOKE,
Roland Dreierb0f7b8b2005-11-07 00:58:13 -08001158 .icache_bsize = 32,
1159 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001160 .platform = "ppc440",
Roland Dreierb0f7b8b2005-11-07 00:58:13 -08001161 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001162#endif /* CONFIG_44x */
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001163#ifdef CONFIG_FSL_BOOKE
Stephen Rothwell49209602005-10-12 15:55:09 +10001164 { /* e200z5 */
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001165 .pvr_mask = 0xfff00000,
1166 .pvr_value = 0x81000000,
1167 .cpu_name = "e200z5",
1168 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001169 .cpu_features = CPU_FTRS_E200,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001170 .cpu_user_features = COMMON_USER_BOOKE |
1171 PPC_FEATURE_HAS_EFP_SINGLE |
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001172 PPC_FEATURE_UNIFIED_CACHE,
1173 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001174 .platform = "ppc5554",
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001175 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001176 { /* e200z6 */
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001177 .pvr_mask = 0xfff00000,
1178 .pvr_value = 0x81100000,
1179 .cpu_name = "e200z6",
1180 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001181 .cpu_features = CPU_FTRS_E200,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001182 .cpu_user_features = COMMON_USER_BOOKE |
1183 PPC_FEATURE_SPE_COMP |
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001184 PPC_FEATURE_HAS_EFP_SINGLE |
1185 PPC_FEATURE_UNIFIED_CACHE,
1186 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001187 .platform = "ppc5554",
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001188 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001189 { /* e500 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001190 .pvr_mask = 0xffff0000,
1191 .pvr_value = 0x80200000,
1192 .cpu_name = "e500",
1193 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001194 .cpu_features = CPU_FTRS_E500,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001195 .cpu_user_features = COMMON_USER_BOOKE |
1196 PPC_FEATURE_SPE_COMP |
Linus Torvalds1da177e2005-04-16 15:20:36 -07001197 PPC_FEATURE_HAS_EFP_SINGLE,
1198 .icache_bsize = 32,
1199 .dcache_bsize = 32,
1200 .num_pmcs = 4,
Andy Fleming555d97a2005-12-15 20:02:04 -06001201 .oprofile_cpu_type = "ppc/e500",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +00001202 .oprofile_type = PPC_OPROFILE_BOOKE,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001203 .platform = "ppc8540",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001204 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001205 { /* e500v2 */
Kumar Gala5b37b702005-06-21 17:15:18 -07001206 .pvr_mask = 0xffff0000,
1207 .pvr_value = 0x80210000,
1208 .cpu_name = "e500v2",
1209 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001210 .cpu_features = CPU_FTRS_E500_2,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001211 .cpu_user_features = COMMON_USER_BOOKE |
1212 PPC_FEATURE_SPE_COMP |
1213 PPC_FEATURE_HAS_EFP_SINGLE |
1214 PPC_FEATURE_HAS_EFP_DOUBLE,
Kumar Gala5b37b702005-06-21 17:15:18 -07001215 .icache_bsize = 32,
1216 .dcache_bsize = 32,
1217 .num_pmcs = 4,
Andy Fleming555d97a2005-12-15 20:02:04 -06001218 .oprofile_cpu_type = "ppc/e500",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +00001219 .oprofile_type = PPC_OPROFILE_BOOKE,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001220 .platform = "ppc8548",
Kumar Gala5b37b702005-06-21 17:15:18 -07001221 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001222#endif
1223#if !CLASSIC_PPC
1224 { /* default match */
1225 .pvr_mask = 0x00000000,
1226 .pvr_value = 0x00000000,
1227 .cpu_name = "(generic PPC)",
Kumar Gala10b35d92005-09-23 14:08:58 -05001228 .cpu_features = CPU_FTRS_GENERIC_32,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001229 .cpu_user_features = PPC_FEATURE_32,
1230 .icache_bsize = 32,
1231 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001232 .platform = "powerpc",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001233 }
1234#endif /* !CLASSIC_PPC */
Stephen Rothwell49209602005-10-12 15:55:09 +10001235#endif /* CONFIG_PPC32 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001236};
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001237
Paul Mackerras974a76f2006-11-10 20:38:53 +11001238struct cpu_spec *identify_cpu(unsigned long offset, unsigned int pvr)
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001239{
1240 struct cpu_spec *s = cpu_specs;
1241 struct cpu_spec **cur = &cur_cpu_spec;
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001242 int i;
1243
1244 s = PTRRELOC(s);
1245 cur = PTRRELOC(cur);
1246
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001247 for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++)
1248 if ((pvr & s->pvr_mask) == s->pvr_value) {
1249 *cur = cpu_specs + i;
1250#ifdef CONFIG_PPC64
1251 /* ppc64 expects identify_cpu to also call setup_cpu
1252 * for that processor. I will consolidate that at a
1253 * later time, for now, just use our friend #ifdef.
1254 * we also don't need to PTRRELOC the function pointer
1255 * on ppc64 as we are running at 0 in real mode.
1256 */
1257 if (s->cpu_setup) {
1258 s->cpu_setup(offset, s);
1259 }
1260#endif /* CONFIG_PPC64 */
1261 return s;
1262 }
1263 BUG();
1264 return NULL;
1265}
1266
Benjamin Herrenschmidt0909c8c2006-10-20 11:47:18 +10001267void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end)
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001268{
1269 struct fixup_entry {
1270 unsigned long mask;
1271 unsigned long value;
Benjamin Herrenschmidt0909c8c2006-10-20 11:47:18 +10001272 long start_off;
1273 long end_off;
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001274 } *fcur, *fend;
1275
1276 fcur = fixup_start;
1277 fend = fixup_end;
1278
1279 for (; fcur < fend; fcur++) {
1280 unsigned int *pstart, *pend, *p;
1281
1282 if ((value & fcur->mask) == fcur->value)
1283 continue;
1284
1285 /* These PTRRELOCs will disappear once the new scheme for
1286 * modules and vdso is implemented
1287 */
Benjamin Herrenschmidt0909c8c2006-10-20 11:47:18 +10001288 pstart = ((unsigned int *)fcur) + (fcur->start_off / 4);
1289 pend = ((unsigned int *)fcur) + (fcur->end_off / 4);
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001290
1291 for (p = pstart; p < pend; p++) {
1292 *p = 0x60000000u;
1293 asm volatile ("dcbst 0, %0" : : "r" (p));
1294 }
1295 asm volatile ("sync" : : : "memory");
1296 for (p = pstart; p < pend; p++)
1297 asm volatile ("icbi 0,%0" : : "r" (p));
1298 asm volatile ("sync; isync" : : : "memory");
1299 }
1300}