blob: dd17dffbf05863fea22ab3c65133a0d1dd0a17ef [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 Johansson11999192007-02-04 16:36:51 -060046extern void __setup_cpu_pa6t(unsigned long offset, struct cpu_spec* spec);
47extern void __restore_cpu_pa6t(unsigned long offset, struct cpu_spec* spec);
Olof Johanssonf39b7a52006-08-11 00:07:08 -050048extern void __restore_cpu_ppc970(void);
49#endif /* CONFIG_PPC64 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070050
Linus Torvalds1da177e2005-04-16 15:20:36 -070051/* This table only contains "desktop" CPUs, it need to be filled with embedded
52 * ones as well...
53 */
Stephen Rothwell49209602005-10-12 15:55:09 +100054#define COMMON_USER (PPC_FEATURE_32 | PPC_FEATURE_HAS_FPU | \
55 PPC_FEATURE_HAS_MMU)
56#define COMMON_USER_PPC64 (COMMON_USER | PPC_FEATURE_64)
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +110057#define COMMON_USER_POWER4 (COMMON_USER_PPC64 | PPC_FEATURE_POWER4)
Benjamin Herrenschmidtaa5cb022006-03-01 15:07:07 +110058#define COMMON_USER_POWER5 (COMMON_USER_PPC64 | PPC_FEATURE_POWER5 |\
59 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
60#define COMMON_USER_POWER5_PLUS (COMMON_USER_PPC64 | PPC_FEATURE_POWER5_PLUS|\
61 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
Anton Blanchard03054d52006-04-29 09:51:06 +100062#define COMMON_USER_POWER6 (COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_05 |\
Paul Mackerrasfab5db92006-06-07 16:14:40 +100063 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \
64 PPC_FEATURE_TRUE_LE)
Olof Johanssonb3ebd1d2006-09-06 14:35:57 -050065#define COMMON_USER_PA6T (COMMON_USER_PPC64 | PPC_FEATURE_PA6T |\
66 PPC_FEATURE_TRUE_LE | \
67 PPC_FEATURE_HAS_ALTIVEC_COMP)
Paul Mackerras80f15dc2006-01-14 10:11:39 +110068#define COMMON_USER_BOOKE (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \
69 PPC_FEATURE_BOOKE)
Linus Torvalds1da177e2005-04-16 15:20:36 -070070
Linus Torvalds1da177e2005-04-16 15:20:36 -070071/* We only set the spe features if the kernel was compiled with
72 * spe support
73 */
74#ifdef CONFIG_SPE
Stephen Rothwell49209602005-10-12 15:55:09 +100075#define PPC_FEATURE_SPE_COMP PPC_FEATURE_HAS_SPE
Linus Torvalds1da177e2005-04-16 15:20:36 -070076#else
Stephen Rothwell49209602005-10-12 15:55:09 +100077#define PPC_FEATURE_SPE_COMP 0
Linus Torvalds1da177e2005-04-16 15:20:36 -070078#endif
79
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +100080static struct cpu_spec cpu_specs[] = {
Stephen Rothwell49209602005-10-12 15:55:09 +100081#ifdef CONFIG_PPC64
82 { /* Power3 */
83 .pvr_mask = 0xffff0000,
84 .pvr_value = 0x00400000,
85 .cpu_name = "POWER3 (630)",
86 .cpu_features = CPU_FTRS_POWER3,
Paul Mackerrasfab5db92006-06-07 16:14:40 +100087 .cpu_user_features = COMMON_USER_PPC64|PPC_FEATURE_PPC_LE,
Stephen Rothwell49209602005-10-12 15:55:09 +100088 .icache_bsize = 128,
89 .dcache_bsize = 128,
90 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -060091 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +100092 .oprofile_cpu_type = "ppc64/power3",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +000093 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +110094 .platform = "power3",
Stephen Rothwell49209602005-10-12 15:55:09 +100095 },
96 { /* Power3+ */
97 .pvr_mask = 0xffff0000,
98 .pvr_value = 0x00410000,
99 .cpu_name = "POWER3 (630+)",
100 .cpu_features = CPU_FTRS_POWER3,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000101 .cpu_user_features = COMMON_USER_PPC64|PPC_FEATURE_PPC_LE,
Stephen Rothwell49209602005-10-12 15:55:09 +1000102 .icache_bsize = 128,
103 .dcache_bsize = 128,
104 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600105 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000106 .oprofile_cpu_type = "ppc64/power3",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000107 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100108 .platform = "power3",
Stephen Rothwell49209602005-10-12 15:55:09 +1000109 },
110 { /* Northstar */
111 .pvr_mask = 0xffff0000,
112 .pvr_value = 0x00330000,
113 .cpu_name = "RS64-II (northstar)",
114 .cpu_features = CPU_FTRS_RS64,
115 .cpu_user_features = COMMON_USER_PPC64,
116 .icache_bsize = 128,
117 .dcache_bsize = 128,
118 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600119 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000120 .oprofile_cpu_type = "ppc64/rs64",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000121 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100122 .platform = "rs64",
Stephen Rothwell49209602005-10-12 15:55:09 +1000123 },
124 { /* Pulsar */
125 .pvr_mask = 0xffff0000,
126 .pvr_value = 0x00340000,
127 .cpu_name = "RS64-III (pulsar)",
128 .cpu_features = CPU_FTRS_RS64,
129 .cpu_user_features = COMMON_USER_PPC64,
130 .icache_bsize = 128,
131 .dcache_bsize = 128,
132 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600133 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000134 .oprofile_cpu_type = "ppc64/rs64",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000135 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100136 .platform = "rs64",
Stephen Rothwell49209602005-10-12 15:55:09 +1000137 },
138 { /* I-star */
139 .pvr_mask = 0xffff0000,
140 .pvr_value = 0x00360000,
141 .cpu_name = "RS64-III (icestar)",
142 .cpu_features = CPU_FTRS_RS64,
143 .cpu_user_features = COMMON_USER_PPC64,
144 .icache_bsize = 128,
145 .dcache_bsize = 128,
146 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600147 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000148 .oprofile_cpu_type = "ppc64/rs64",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000149 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100150 .platform = "rs64",
Stephen Rothwell49209602005-10-12 15:55:09 +1000151 },
152 { /* S-star */
153 .pvr_mask = 0xffff0000,
154 .pvr_value = 0x00370000,
155 .cpu_name = "RS64-IV (sstar)",
156 .cpu_features = CPU_FTRS_RS64,
157 .cpu_user_features = COMMON_USER_PPC64,
158 .icache_bsize = 128,
159 .dcache_bsize = 128,
160 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600161 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000162 .oprofile_cpu_type = "ppc64/rs64",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000163 .oprofile_type = PPC_OPROFILE_RS64,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100164 .platform = "rs64",
Stephen Rothwell49209602005-10-12 15:55:09 +1000165 },
166 { /* Power4 */
167 .pvr_mask = 0xffff0000,
168 .pvr_value = 0x00350000,
169 .cpu_name = "POWER4 (gp)",
170 .cpu_features = CPU_FTRS_POWER4,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100171 .cpu_user_features = COMMON_USER_POWER4,
Stephen Rothwell49209602005-10-12 15:55:09 +1000172 .icache_bsize = 128,
173 .dcache_bsize = 128,
174 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600175 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000176 .oprofile_cpu_type = "ppc64/power4",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000177 .oprofile_type = PPC_OPROFILE_POWER4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100178 .platform = "power4",
Stephen Rothwell49209602005-10-12 15:55:09 +1000179 },
180 { /* Power4+ */
181 .pvr_mask = 0xffff0000,
182 .pvr_value = 0x00380000,
183 .cpu_name = "POWER4+ (gq)",
184 .cpu_features = CPU_FTRS_POWER4,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100185 .cpu_user_features = COMMON_USER_POWER4,
Stephen Rothwell49209602005-10-12 15:55:09 +1000186 .icache_bsize = 128,
187 .dcache_bsize = 128,
188 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600189 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000190 .oprofile_cpu_type = "ppc64/power4",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000191 .oprofile_type = PPC_OPROFILE_POWER4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100192 .platform = "power4",
Stephen Rothwell49209602005-10-12 15:55:09 +1000193 },
194 { /* PPC970 */
195 .pvr_mask = 0xffff0000,
196 .pvr_value = 0x00390000,
197 .cpu_name = "PPC970",
198 .cpu_features = CPU_FTRS_PPC970,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100199 .cpu_user_features = COMMON_USER_POWER4 |
Stephen Rothwell49209602005-10-12 15:55:09 +1000200 PPC_FEATURE_HAS_ALTIVEC_COMP,
201 .icache_bsize = 128,
202 .dcache_bsize = 128,
203 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600204 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000205 .cpu_setup = __setup_cpu_ppc970,
Olof Johanssonf39b7a52006-08-11 00:07:08 -0500206 .cpu_restore = __restore_cpu_ppc970,
Stephen Rothwell49209602005-10-12 15:55:09 +1000207 .oprofile_cpu_type = "ppc64/970",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000208 .oprofile_type = PPC_OPROFILE_POWER4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100209 .platform = "ppc970",
Stephen Rothwell49209602005-10-12 15:55:09 +1000210 },
Stephen Rothwell49209602005-10-12 15:55:09 +1000211 { /* PPC970FX */
212 .pvr_mask = 0xffff0000,
213 .pvr_value = 0x003c0000,
214 .cpu_name = "PPC970FX",
Stephen Rothwell49209602005-10-12 15:55:09 +1000215 .cpu_features = CPU_FTRS_PPC970,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100216 .cpu_user_features = COMMON_USER_POWER4 |
Stephen Rothwell49209602005-10-12 15:55:09 +1000217 PPC_FEATURE_HAS_ALTIVEC_COMP,
218 .icache_bsize = 128,
219 .dcache_bsize = 128,
220 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600221 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000222 .cpu_setup = __setup_cpu_ppc970,
Olof Johanssonf39b7a52006-08-11 00:07:08 -0500223 .cpu_restore = __restore_cpu_ppc970,
Stephen Rothwell49209602005-10-12 15:55:09 +1000224 .oprofile_cpu_type = "ppc64/970",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000225 .oprofile_type = PPC_OPROFILE_POWER4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100226 .platform = "ppc970",
Stephen Rothwell49209602005-10-12 15:55:09 +1000227 },
Stephen Rothwell49209602005-10-12 15:55:09 +1000228 { /* PPC970MP */
229 .pvr_mask = 0xffff0000,
230 .pvr_value = 0x00440000,
231 .cpu_name = "PPC970MP",
232 .cpu_features = CPU_FTRS_PPC970,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100233 .cpu_user_features = COMMON_USER_POWER4 |
Stephen Rothwell49209602005-10-12 15:55:09 +1000234 PPC_FEATURE_HAS_ALTIVEC_COMP,
235 .icache_bsize = 128,
236 .dcache_bsize = 128,
Anton Blanchard87af41b2006-05-05 05:44:26 +1000237 .num_pmcs = 8,
Olof Johansson5b43d202006-10-04 23:41:41 -0500238 .cpu_setup = __setup_cpu_ppc970MP,
Olof Johanssonf39b7a52006-08-11 00:07:08 -0500239 .cpu_restore = __restore_cpu_ppc970,
Mike Wolffecb3522006-11-21 14:41:54 -0600240 .oprofile_cpu_type = "ppc64/970MP",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000241 .oprofile_type = PPC_OPROFILE_POWER4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100242 .platform = "ppc970",
Stephen Rothwell49209602005-10-12 15:55:09 +1000243 },
Jake Moilanen362ff7b2006-10-18 10:47:22 -0500244 { /* PPC970GX */
245 .pvr_mask = 0xffff0000,
246 .pvr_value = 0x00450000,
247 .cpu_name = "PPC970GX",
248 .cpu_features = CPU_FTRS_PPC970,
249 .cpu_user_features = COMMON_USER_POWER4 |
250 PPC_FEATURE_HAS_ALTIVEC_COMP,
251 .icache_bsize = 128,
252 .dcache_bsize = 128,
253 .num_pmcs = 8,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600254 .pmc_type = PPC_PMC_IBM,
Jake Moilanen362ff7b2006-10-18 10:47:22 -0500255 .cpu_setup = __setup_cpu_ppc970,
256 .oprofile_cpu_type = "ppc64/970",
257 .oprofile_type = PPC_OPROFILE_POWER4,
258 .platform = "ppc970",
259 },
Benjamin Herrenschmidt3c726f82005-11-07 11:06:55 +1100260 { /* Power5 GR */
Stephen Rothwell49209602005-10-12 15:55:09 +1000261 .pvr_mask = 0xffff0000,
262 .pvr_value = 0x003a0000,
263 .cpu_name = "POWER5 (gr)",
264 .cpu_features = CPU_FTRS_POWER5,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100265 .cpu_user_features = COMMON_USER_POWER5,
Stephen Rothwell49209602005-10-12 15:55:09 +1000266 .icache_bsize = 128,
267 .dcache_bsize = 128,
268 .num_pmcs = 6,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600269 .pmc_type = PPC_PMC_IBM,
Stephen Rothwell49209602005-10-12 15:55:09 +1000270 .oprofile_cpu_type = "ppc64/power5",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000271 .oprofile_type = PPC_OPROFILE_POWER4,
Michael Neulinge78dbc82006-06-08 14:42:34 +1000272 /* SIHV / SIPR bits are implemented on POWER4+ (GQ)
273 * and above but only works on POWER5 and above
274 */
275 .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 },
Benjamin Herrenschmidt3c726f82005-11-07 11:06:55 +1100279 { /* Power5 GS */
Stephen Rothwell49209602005-10-12 15:55:09 +1000280 .pvr_mask = 0xffff0000,
281 .pvr_value = 0x003b0000,
Anton Blanchard834608f2006-01-09 15:42:30 +1100282 .cpu_name = "POWER5+ (gs)",
Stephen Rothwell49209602005-10-12 15:55:09 +1000283 .cpu_features = CPU_FTRS_POWER5,
Paul Mackerrasa7ddc5e2005-11-10 14:29:18 +1100284 .cpu_user_features = COMMON_USER_POWER5_PLUS,
Stephen Rothwell49209602005-10-12 15:55:09 +1000285 .icache_bsize = 128,
286 .dcache_bsize = 128,
287 .num_pmcs = 6,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600288 .pmc_type = PPC_PMC_IBM,
Anton Blanchard834608f2006-01-09 15:42:30 +1100289 .oprofile_cpu_type = "ppc64/power5+",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000290 .oprofile_type = PPC_OPROFILE_POWER4,
Michael Neulinge78dbc82006-06-08 14:42:34 +1000291 .oprofile_mmcra_sihv = MMCRA_SIHV,
292 .oprofile_mmcra_sipr = MMCRA_SIPR,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100293 .platform = "power5+",
Stephen Rothwell49209602005-10-12 15:55:09 +1000294 },
Paul Mackerras974a76f2006-11-10 20:38:53 +1100295 { /* POWER6 in P5+ mode; 2.04-compliant processor */
296 .pvr_mask = 0xffffffff,
297 .pvr_value = 0x0f000001,
298 .cpu_name = "POWER5+",
299 .cpu_features = CPU_FTRS_POWER5,
300 .cpu_user_features = COMMON_USER_POWER5_PLUS,
301 .icache_bsize = 128,
302 .dcache_bsize = 128,
303 .num_pmcs = 6,
304 .oprofile_cpu_type = "ppc64/power6",
305 .oprofile_type = PPC_OPROFILE_POWER4,
306 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
307 .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
308 .oprofile_mmcra_clear = POWER6_MMCRA_THRM |
309 POWER6_MMCRA_OTHER,
310 .platform = "power5+",
311 },
Anton Blanchard03054d52006-04-29 09:51:06 +1000312 { /* Power6 */
313 .pvr_mask = 0xffff0000,
314 .pvr_value = 0x003e0000,
Paul Mackerras974a76f2006-11-10 20:38:53 +1100315 .cpu_name = "POWER6 (raw)",
316 .cpu_features = CPU_FTRS_POWER6,
317 .cpu_user_features = COMMON_USER_POWER6 |
318 PPC_FEATURE_POWER6_EXT,
319 .icache_bsize = 128,
320 .dcache_bsize = 128,
321 .num_pmcs = 6,
322 .oprofile_cpu_type = "ppc64/power6",
323 .oprofile_type = PPC_OPROFILE_POWER4,
324 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
325 .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
326 .oprofile_mmcra_clear = POWER6_MMCRA_THRM |
327 POWER6_MMCRA_OTHER,
328 .platform = "power6x",
329 },
330 { /* 2.05-compliant processor, i.e. Power6 "architected" mode */
331 .pvr_mask = 0xffffffff,
332 .pvr_value = 0x0f000002,
333 .cpu_name = "POWER6 (architected)",
Anton Blanchard03054d52006-04-29 09:51:06 +1000334 .cpu_features = CPU_FTRS_POWER6,
335 .cpu_user_features = COMMON_USER_POWER6,
336 .icache_bsize = 128,
337 .dcache_bsize = 128,
Anton Blanchard99f48612006-10-13 12:13:12 +1000338 .num_pmcs = 6,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600339 .pmc_type = PPC_PMC_IBM,
Anton Blanchard03054d52006-04-29 09:51:06 +1000340 .oprofile_cpu_type = "ppc64/power6",
341 .oprofile_type = PPC_OPROFILE_POWER4,
Michael Neulinge78dbc82006-06-08 14:42:34 +1000342 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
343 .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
344 .oprofile_mmcra_clear = POWER6_MMCRA_THRM |
345 POWER6_MMCRA_OTHER,
Anton Blanchard03054d52006-04-29 09:51:06 +1000346 .platform = "power6",
347 },
Arnd Bergmannc902be72006-01-04 19:55:53 +0000348 { /* Cell Broadband Engine */
Stephen Rothwell49209602005-10-12 15:55:09 +1000349 .pvr_mask = 0xffff0000,
350 .pvr_value = 0x00700000,
351 .cpu_name = "Cell Broadband Engine",
352 .cpu_features = CPU_FTRS_CELL,
353 .cpu_user_features = COMMON_USER_PPC64 |
Benjamin Herrenschmidtaa5cb022006-03-01 15:07:07 +1100354 PPC_FEATURE_CELL | PPC_FEATURE_HAS_ALTIVEC_COMP |
355 PPC_FEATURE_SMT,
Stephen Rothwell49209602005-10-12 15:55:09 +1000356 .icache_bsize = 128,
357 .dcache_bsize = 128,
Maynard Johnson18f21902006-11-20 18:45:16 +0100358 .num_pmcs = 4,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600359 .pmc_type = PPC_PMC_IBM,
Maynard Johnson18f21902006-11-20 18:45:16 +0100360 .oprofile_cpu_type = "ppc64/cell-be",
361 .oprofile_type = PPC_OPROFILE_CELL,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100362 .platform = "ppc-cell-be",
Stephen Rothwell49209602005-10-12 15:55:09 +1000363 },
Olof Johanssonb3ebd1d2006-09-06 14:35:57 -0500364 { /* PA Semi PA6T */
365 .pvr_mask = 0x7fff0000,
366 .pvr_value = 0x00900000,
367 .cpu_name = "PA6T",
368 .cpu_features = CPU_FTRS_PA6T,
369 .cpu_user_features = COMMON_USER_PA6T,
370 .icache_bsize = 64,
371 .dcache_bsize = 64,
372 .num_pmcs = 6,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600373 .pmc_type = PPC_PMC_PA6T,
Olof Johansson11999192007-02-04 16:36:51 -0600374 .cpu_setup = __setup_cpu_pa6t,
375 .cpu_restore = __restore_cpu_pa6t,
Olof Johanssonb3ebd1d2006-09-06 14:35:57 -0500376 .platform = "pa6t",
377 },
Stephen Rothwell49209602005-10-12 15:55:09 +1000378 { /* default match */
379 .pvr_mask = 0x00000000,
380 .pvr_value = 0x00000000,
381 .cpu_name = "POWER4 (compatible)",
382 .cpu_features = CPU_FTRS_COMPATIBLE,
383 .cpu_user_features = COMMON_USER_PPC64,
384 .icache_bsize = 128,
385 .dcache_bsize = 128,
386 .num_pmcs = 6,
Olof Johansson1bd2e5a2007-01-28 21:23:54 -0600387 .pmc_type = PPC_PMC_IBM,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100388 .platform = "power4",
Stephen Rothwell49209602005-10-12 15:55:09 +1000389 }
390#endif /* CONFIG_PPC64 */
391#ifdef CONFIG_PPC32
Linus Torvalds1da177e2005-04-16 15:20:36 -0700392#if CLASSIC_PPC
Stephen Rothwell49209602005-10-12 15:55:09 +1000393 { /* 601 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700394 .pvr_mask = 0xffff0000,
395 .pvr_value = 0x00010000,
396 .cpu_name = "601",
Kumar Gala10b35d92005-09-23 14:08:58 -0500397 .cpu_features = CPU_FTRS_PPC601,
Stephen Rothwell49209602005-10-12 15:55:09 +1000398 .cpu_user_features = COMMON_USER | PPC_FEATURE_601_INSTR |
Paul Mackerras98599012005-10-22 16:51:34 +1000399 PPC_FEATURE_UNIFIED_CACHE | PPC_FEATURE_NO_TB,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700400 .icache_bsize = 32,
401 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100402 .platform = "ppc601",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700403 },
404 { /* 603 */
405 .pvr_mask = 0xffff0000,
406 .pvr_value = 0x00030000,
407 .cpu_name = "603",
Kumar Gala10b35d92005-09-23 14:08:58 -0500408 .cpu_features = CPU_FTRS_603,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000409 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700410 .icache_bsize = 32,
411 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100412 .cpu_setup = __setup_cpu_603,
413 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700414 },
415 { /* 603e */
416 .pvr_mask = 0xffff0000,
417 .pvr_value = 0x00060000,
418 .cpu_name = "603e",
Kumar Gala10b35d92005-09-23 14:08:58 -0500419 .cpu_features = CPU_FTRS_603,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000420 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700421 .icache_bsize = 32,
422 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100423 .cpu_setup = __setup_cpu_603,
424 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700425 },
426 { /* 603ev */
427 .pvr_mask = 0xffff0000,
428 .pvr_value = 0x00070000,
429 .cpu_name = "603ev",
Kumar Gala10b35d92005-09-23 14:08:58 -0500430 .cpu_features = CPU_FTRS_603,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000431 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700432 .icache_bsize = 32,
433 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100434 .cpu_setup = __setup_cpu_603,
435 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700436 },
437 { /* 604 */
438 .pvr_mask = 0xffff0000,
439 .pvr_value = 0x00040000,
440 .cpu_name = "604",
Kumar Gala10b35d92005-09-23 14:08:58 -0500441 .cpu_features = CPU_FTRS_604,
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 = 2,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100446 .cpu_setup = __setup_cpu_604,
447 .platform = "ppc604",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700448 },
449 { /* 604e */
450 .pvr_mask = 0xfffff000,
451 .pvr_value = 0x00090000,
452 .cpu_name = "604e",
Kumar Gala10b35d92005-09-23 14:08:58 -0500453 .cpu_features = CPU_FTRS_604,
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_604,
459 .platform = "ppc604",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700460 },
461 { /* 604r */
462 .pvr_mask = 0xffff0000,
463 .pvr_value = 0x00090000,
464 .cpu_name = "604r",
Kumar Gala10b35d92005-09-23 14:08:58 -0500465 .cpu_features = CPU_FTRS_604,
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_604,
471 .platform = "ppc604",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700472 },
473 { /* 604ev */
474 .pvr_mask = 0xffff0000,
475 .pvr_value = 0x000a0000,
476 .cpu_name = "604ev",
Kumar Gala10b35d92005-09-23 14:08:58 -0500477 .cpu_features = CPU_FTRS_604,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000478 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700479 .icache_bsize = 32,
480 .dcache_bsize = 32,
481 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100482 .cpu_setup = __setup_cpu_604,
483 .platform = "ppc604",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700484 },
485 { /* 740/750 (0x4202, don't support TAU ?) */
486 .pvr_mask = 0xffffffff,
487 .pvr_value = 0x00084202,
488 .cpu_name = "740/750",
Kumar Gala10b35d92005-09-23 14:08:58 -0500489 .cpu_features = CPU_FTRS_740_NOTAU,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000490 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -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",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700496 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700497 { /* 750CX (80100 and 8010x?) */
498 .pvr_mask = 0xfffffff0,
499 .pvr_value = 0x00080100,
500 .cpu_name = "750CX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500501 .cpu_features = CPU_FTRS_750,
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_750cx,
507 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700508 },
509 { /* 750CX (82201 and 82202) */
510 .pvr_mask = 0xfffffff0,
511 .pvr_value = 0x00082200,
512 .cpu_name = "750CX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500513 .cpu_features = CPU_FTRS_750,
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_750cx,
519 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700520 },
521 { /* 750CXe (82214) */
522 .pvr_mask = 0xfffffff0,
523 .pvr_value = 0x00082210,
524 .cpu_name = "750CXe",
Kumar Gala10b35d92005-09-23 14:08:58 -0500525 .cpu_features = CPU_FTRS_750,
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_750cx,
531 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700532 },
Arthur Othieno7c316252005-09-03 15:55:52 -0700533 { /* 750CXe "Gekko" (83214) */
534 .pvr_mask = 0xffffffff,
535 .pvr_value = 0x00083214,
536 .cpu_name = "750CXe",
Kumar Gala10b35d92005-09-23 14:08:58 -0500537 .cpu_features = CPU_FTRS_750,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000538 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Arthur Othieno7c316252005-09-03 15:55:52 -0700539 .icache_bsize = 32,
540 .dcache_bsize = 32,
541 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100542 .cpu_setup = __setup_cpu_750cx,
543 .platform = "ppc750",
Arthur Othieno7c316252005-09-03 15:55:52 -0700544 },
Arthur Othienoac1ff042005-09-03 15:55:51 -0700545 { /* 745/755 */
546 .pvr_mask = 0xfffff000,
547 .pvr_value = 0x00083000,
548 .cpu_name = "745/755",
Kumar Gala10b35d92005-09-23 14:08:58 -0500549 .cpu_features = CPU_FTRS_750,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000550 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Arthur Othienoac1ff042005-09-03 15:55:51 -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",
Arthur Othienoac1ff042005-09-03 15:55:51 -0700556 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700557 { /* 750FX rev 1.x */
558 .pvr_mask = 0xffffff00,
559 .pvr_value = 0x70000100,
560 .cpu_name = "750FX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500561 .cpu_features = CPU_FTRS_750FX1,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000562 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700563 .icache_bsize = 32,
564 .dcache_bsize = 32,
565 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100566 .cpu_setup = __setup_cpu_750,
567 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700568 },
569 { /* 750FX rev 2.0 must disable HID0[DPM] */
570 .pvr_mask = 0xffffffff,
571 .pvr_value = 0x70000200,
572 .cpu_name = "750FX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500573 .cpu_features = CPU_FTRS_750FX2,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000574 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700575 .icache_bsize = 32,
576 .dcache_bsize = 32,
577 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100578 .cpu_setup = __setup_cpu_750,
579 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700580 },
581 { /* 750FX (All revs except 2.0) */
582 .pvr_mask = 0xffff0000,
583 .pvr_value = 0x70000000,
584 .cpu_name = "750FX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500585 .cpu_features = CPU_FTRS_750FX,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000586 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700587 .icache_bsize = 32,
588 .dcache_bsize = 32,
589 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100590 .cpu_setup = __setup_cpu_750fx,
591 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700592 },
593 { /* 750GX */
594 .pvr_mask = 0xffff0000,
595 .pvr_value = 0x70020000,
596 .cpu_name = "750GX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500597 .cpu_features = CPU_FTRS_750GX,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000598 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700599 .icache_bsize = 32,
600 .dcache_bsize = 32,
601 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100602 .cpu_setup = __setup_cpu_750fx,
603 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700604 },
605 { /* 740/750 (L2CR bit need fixup for 740) */
606 .pvr_mask = 0xffff0000,
607 .pvr_value = 0x00080000,
608 .cpu_name = "740/750",
Kumar Gala10b35d92005-09-23 14:08:58 -0500609 .cpu_features = CPU_FTRS_740,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000610 .cpu_user_features = COMMON_USER | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700611 .icache_bsize = 32,
612 .dcache_bsize = 32,
613 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100614 .cpu_setup = __setup_cpu_750,
615 .platform = "ppc750",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700616 },
617 { /* 7400 rev 1.1 ? (no TAU) */
618 .pvr_mask = 0xffffffff,
619 .pvr_value = 0x000c1101,
620 .cpu_name = "7400 (1.1)",
Kumar Gala10b35d92005-09-23 14:08:58 -0500621 .cpu_features = CPU_FTRS_7400_NOTAU,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000622 .cpu_user_features = COMMON_USER |
623 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700624 .icache_bsize = 32,
625 .dcache_bsize = 32,
626 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100627 .cpu_setup = __setup_cpu_7400,
628 .platform = "ppc7400",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700629 },
630 { /* 7400 */
631 .pvr_mask = 0xffff0000,
632 .pvr_value = 0x000c0000,
633 .cpu_name = "7400",
Kumar Gala10b35d92005-09-23 14:08:58 -0500634 .cpu_features = CPU_FTRS_7400,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000635 .cpu_user_features = COMMON_USER |
636 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700637 .icache_bsize = 32,
638 .dcache_bsize = 32,
639 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100640 .cpu_setup = __setup_cpu_7400,
641 .platform = "ppc7400",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700642 },
643 { /* 7410 */
644 .pvr_mask = 0xffff0000,
645 .pvr_value = 0x800c0000,
646 .cpu_name = "7410",
Kumar Gala10b35d92005-09-23 14:08:58 -0500647 .cpu_features = CPU_FTRS_7400,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000648 .cpu_user_features = COMMON_USER |
649 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700650 .icache_bsize = 32,
651 .dcache_bsize = 32,
652 .num_pmcs = 4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100653 .cpu_setup = __setup_cpu_7410,
654 .platform = "ppc7400",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700655 },
656 { /* 7450 2.0 - no doze/nap */
657 .pvr_mask = 0xffffffff,
658 .pvr_value = 0x80000200,
659 .cpu_name = "7450",
Kumar Gala10b35d92005-09-23 14:08:58 -0500660 .cpu_features = CPU_FTRS_7450_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 { /* 7450 2.1 */
672 .pvr_mask = 0xffffffff,
673 .pvr_value = 0x80000201,
674 .cpu_name = "7450",
Kumar Gala10b35d92005-09-23 14:08:58 -0500675 .cpu_features = CPU_FTRS_7450_21,
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 { /* 7450 2.3 and newer */
687 .pvr_mask = 0xffff0000,
688 .pvr_value = 0x80000000,
689 .cpu_name = "7450",
Kumar Gala10b35d92005-09-23 14:08:58 -0500690 .cpu_features = CPU_FTRS_7450_23,
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 { /* 7455 rev 1.x */
702 .pvr_mask = 0xffffff00,
703 .pvr_value = 0x80010100,
704 .cpu_name = "7455",
Kumar Gala10b35d92005-09-23 14:08:58 -0500705 .cpu_features = CPU_FTRS_7455_1,
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 { /* 7455 rev 2.0 */
717 .pvr_mask = 0xffffffff,
718 .pvr_value = 0x80010200,
719 .cpu_name = "7455",
Kumar Gala10b35d92005-09-23 14:08:58 -0500720 .cpu_features = CPU_FTRS_7455_20,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000721 .cpu_user_features = COMMON_USER |
722 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700723 .icache_bsize = 32,
724 .dcache_bsize = 32,
725 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600726 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600727 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000728 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100729 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700730 },
731 { /* 7455 others */
732 .pvr_mask = 0xffff0000,
733 .pvr_value = 0x80010000,
734 .cpu_name = "7455",
Kumar Gala10b35d92005-09-23 14:08:58 -0500735 .cpu_features = CPU_FTRS_7455,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000736 .cpu_user_features = COMMON_USER |
737 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700738 .icache_bsize = 32,
739 .dcache_bsize = 32,
740 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600741 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600742 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000743 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100744 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700745 },
746 { /* 7447/7457 Rev 1.0 */
747 .pvr_mask = 0xffffffff,
748 .pvr_value = 0x80020100,
749 .cpu_name = "7447/7457",
Kumar Gala10b35d92005-09-23 14:08:58 -0500750 .cpu_features = CPU_FTRS_7447_10,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000751 .cpu_user_features = COMMON_USER |
752 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700753 .icache_bsize = 32,
754 .dcache_bsize = 32,
755 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600756 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600757 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000758 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100759 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700760 },
761 { /* 7447/7457 Rev 1.1 */
762 .pvr_mask = 0xffffffff,
763 .pvr_value = 0x80020101,
764 .cpu_name = "7447/7457",
Kumar Gala10b35d92005-09-23 14:08:58 -0500765 .cpu_features = CPU_FTRS_7447_10,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000766 .cpu_user_features = COMMON_USER |
767 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700768 .icache_bsize = 32,
769 .dcache_bsize = 32,
770 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600771 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600772 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000773 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100774 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700775 },
776 { /* 7447/7457 Rev 1.2 and later */
777 .pvr_mask = 0xffff0000,
778 .pvr_value = 0x80020000,
779 .cpu_name = "7447/7457",
Kumar Gala10b35d92005-09-23 14:08:58 -0500780 .cpu_features = CPU_FTRS_7447,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000781 .cpu_user_features = COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700782 .icache_bsize = 32,
783 .dcache_bsize = 32,
784 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600785 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600786 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000787 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100788 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700789 },
790 { /* 7447A */
791 .pvr_mask = 0xffff0000,
792 .pvr_value = 0x80030000,
793 .cpu_name = "7447A",
Kumar Gala10b35d92005-09-23 14:08:58 -0500794 .cpu_features = CPU_FTRS_7447A,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000795 .cpu_user_features = COMMON_USER |
796 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700797 .icache_bsize = 32,
798 .dcache_bsize = 32,
799 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600800 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600801 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000802 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100803 .platform = "ppc7450",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700804 },
Kumar Galabbde6302005-09-03 15:55:55 -0700805 { /* 7448 */
806 .pvr_mask = 0xffff0000,
807 .pvr_value = 0x80040000,
808 .cpu_name = "7448",
Kumar Gala10b35d92005-09-23 14:08:58 -0500809 .cpu_features = CPU_FTRS_7447A,
Paul Mackerrasfab5db92006-06-07 16:14:40 +1000810 .cpu_user_features = COMMON_USER |
811 PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
Kumar Galabbde6302005-09-03 15:55:55 -0700812 .icache_bsize = 32,
813 .dcache_bsize = 32,
814 .num_pmcs = 6,
Andy Fleming555d97a2005-12-15 20:02:04 -0600815 .cpu_setup = __setup_cpu_745x,
Andy Fleming555d97a2005-12-15 20:02:04 -0600816 .oprofile_cpu_type = "ppc/7450",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +0000817 .oprofile_type = PPC_OPROFILE_G4,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100818 .platform = "ppc7450",
Kumar Galabbde6302005-09-03 15:55:55 -0700819 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700820 { /* 82xx (8240, 8245, 8260 are all 603e cores) */
821 .pvr_mask = 0x7fff0000,
822 .pvr_value = 0x00810000,
823 .cpu_name = "82xx",
Kumar Gala10b35d92005-09-23 14:08:58 -0500824 .cpu_features = CPU_FTRS_82XX,
Stephen Rothwell49209602005-10-12 15:55:09 +1000825 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700826 .icache_bsize = 32,
827 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100828 .cpu_setup = __setup_cpu_603,
829 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700830 },
831 { /* All G2_LE (603e core, plus some) have the same pvr */
832 .pvr_mask = 0x7fff0000,
833 .pvr_value = 0x00820000,
834 .cpu_name = "G2_LE",
Kumar Gala10b35d92005-09-23 14:08:58 -0500835 .cpu_features = CPU_FTRS_G2_LE,
Stephen Rothwell49209602005-10-12 15:55:09 +1000836 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700837 .icache_bsize = 32,
838 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100839 .cpu_setup = __setup_cpu_603,
840 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700841 },
Kim Phillips6c4a2502006-10-02 20:10:24 -0500842 { /* e300c1 (a 603e core, plus some) on 83xx */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700843 .pvr_mask = 0x7fff0000,
844 .pvr_value = 0x00830000,
Kim Phillips6c4a2502006-10-02 20:10:24 -0500845 .cpu_name = "e300c1",
Kumar Gala10b35d92005-09-23 14:08:58 -0500846 .cpu_features = CPU_FTRS_E300,
Stephen Rothwell49209602005-10-12 15:55:09 +1000847 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700848 .icache_bsize = 32,
849 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100850 .cpu_setup = __setup_cpu_603,
851 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700852 },
Kim Phillips6c4a2502006-10-02 20:10:24 -0500853 { /* e300c2 (an e300c1 core, plus some, minus FPU) on 83xx */
854 .pvr_mask = 0x7fff0000,
855 .pvr_value = 0x00840000,
856 .cpu_name = "e300c2",
Kim Phillipsaa42c692006-12-08 02:43:30 -0600857 .cpu_features = CPU_FTRS_E300C2,
Kim Phillips6c4a2502006-10-02 20:10:24 -0500858 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
859 .icache_bsize = 32,
860 .dcache_bsize = 32,
861 .cpu_setup = __setup_cpu_603,
862 .platform = "ppc603",
863 },
Scott Wood57933f82006-12-01 12:57:05 -0600864 { /* e300c3 on 83xx */
865 .pvr_mask = 0x7fff0000,
866 .pvr_value = 0x00850000,
867 .cpu_name = "e300c3",
868 .cpu_features = CPU_FTRS_E300,
869 .cpu_user_features = COMMON_USER,
870 .icache_bsize = 32,
871 .dcache_bsize = 32,
872 .cpu_setup = __setup_cpu_603,
873 .platform = "ppc603",
874 },
Linus Torvalds1da177e2005-04-16 15:20:36 -0700875 { /* default match, we assume split I/D cache & TB (non-601)... */
876 .pvr_mask = 0x00000000,
877 .pvr_value = 0x00000000,
878 .cpu_name = "(generic PPC)",
Kumar Gala10b35d92005-09-23 14:08:58 -0500879 .cpu_features = CPU_FTRS_CLASSIC32,
Stephen Rothwell49209602005-10-12 15:55:09 +1000880 .cpu_user_features = COMMON_USER,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700881 .icache_bsize = 32,
882 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100883 .platform = "ppc603",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700884 },
885#endif /* CLASSIC_PPC */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700886#ifdef CONFIG_8xx
887 { /* 8xx */
888 .pvr_mask = 0xffff0000,
889 .pvr_value = 0x00500000,
890 .cpu_name = "8xx",
891 /* CPU_FTR_MAYBE_CAN_DOZE is possible,
892 * if the 8xx code is there.... */
Kumar Gala10b35d92005-09-23 14:08:58 -0500893 .cpu_features = CPU_FTRS_8XX,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700894 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
895 .icache_bsize = 16,
896 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100897 .platform = "ppc823",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700898 },
899#endif /* CONFIG_8xx */
900#ifdef CONFIG_40x
901 { /* 403GC */
902 .pvr_mask = 0xffffff00,
903 .pvr_value = 0x00200200,
904 .cpu_name = "403GC",
Kumar Gala10b35d92005-09-23 14:08:58 -0500905 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700906 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
907 .icache_bsize = 16,
908 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100909 .platform = "ppc403",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700910 },
911 { /* 403GCX */
912 .pvr_mask = 0xffffff00,
913 .pvr_value = 0x00201400,
914 .cpu_name = "403GCX",
Kumar Gala10b35d92005-09-23 14:08:58 -0500915 .cpu_features = CPU_FTRS_40X,
Paul Mackerras98599012005-10-22 16:51:34 +1000916 .cpu_user_features = PPC_FEATURE_32 |
917 PPC_FEATURE_HAS_MMU | PPC_FEATURE_NO_TB,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700918 .icache_bsize = 16,
919 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100920 .platform = "ppc403",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700921 },
922 { /* 403G ?? */
923 .pvr_mask = 0xffff0000,
924 .pvr_value = 0x00200000,
925 .cpu_name = "403G ??",
Kumar Gala10b35d92005-09-23 14:08:58 -0500926 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700927 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
928 .icache_bsize = 16,
929 .dcache_bsize = 16,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100930 .platform = "ppc403",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700931 },
932 { /* 405GP */
933 .pvr_mask = 0xffff0000,
934 .pvr_value = 0x40110000,
935 .cpu_name = "405GP",
Kumar Gala10b35d92005-09-23 14:08:58 -0500936 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700937 .cpu_user_features = PPC_FEATURE_32 |
938 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
939 .icache_bsize = 32,
940 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100941 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700942 },
943 { /* STB 03xxx */
944 .pvr_mask = 0xffff0000,
945 .pvr_value = 0x40130000,
946 .cpu_name = "STB03xxx",
Kumar Gala10b35d92005-09-23 14:08:58 -0500947 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700948 .cpu_user_features = PPC_FEATURE_32 |
949 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
950 .icache_bsize = 32,
951 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100952 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700953 },
954 { /* STB 04xxx */
955 .pvr_mask = 0xffff0000,
956 .pvr_value = 0x41810000,
957 .cpu_name = "STB04xxx",
Kumar Gala10b35d92005-09-23 14:08:58 -0500958 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700959 .cpu_user_features = PPC_FEATURE_32 |
960 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
961 .icache_bsize = 32,
962 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100963 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700964 },
965 { /* NP405L */
966 .pvr_mask = 0xffff0000,
967 .pvr_value = 0x41610000,
968 .cpu_name = "NP405L",
Kumar Gala10b35d92005-09-23 14:08:58 -0500969 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700970 .cpu_user_features = PPC_FEATURE_32 |
971 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
972 .icache_bsize = 32,
973 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100974 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700975 },
976 { /* NP4GS3 */
977 .pvr_mask = 0xffff0000,
978 .pvr_value = 0x40B10000,
979 .cpu_name = "NP4GS3",
Kumar Gala10b35d92005-09-23 14:08:58 -0500980 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700981 .cpu_user_features = PPC_FEATURE_32 |
982 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
983 .icache_bsize = 32,
984 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100985 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700986 },
987 { /* NP405H */
988 .pvr_mask = 0xffff0000,
989 .pvr_value = 0x41410000,
990 .cpu_name = "NP405H",
Kumar Gala10b35d92005-09-23 14:08:58 -0500991 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700992 .cpu_user_features = PPC_FEATURE_32 |
993 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
994 .icache_bsize = 32,
995 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +1100996 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -0700997 },
998 { /* 405GPr */
999 .pvr_mask = 0xffff0000,
1000 .pvr_value = 0x50910000,
1001 .cpu_name = "405GPr",
Kumar Gala10b35d92005-09-23 14:08:58 -05001002 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001003 .cpu_user_features = PPC_FEATURE_32 |
1004 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1005 .icache_bsize = 32,
1006 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001007 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001008 },
1009 { /* STBx25xx */
1010 .pvr_mask = 0xffff0000,
1011 .pvr_value = 0x51510000,
1012 .cpu_name = "STBx25xx",
Kumar Gala10b35d92005-09-23 14:08:58 -05001013 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001014 .cpu_user_features = PPC_FEATURE_32 |
1015 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1016 .icache_bsize = 32,
1017 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001018 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001019 },
1020 { /* 405LP */
1021 .pvr_mask = 0xffff0000,
1022 .pvr_value = 0x41F10000,
1023 .cpu_name = "405LP",
Kumar Gala10b35d92005-09-23 14:08:58 -05001024 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001025 .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
1026 .icache_bsize = 32,
1027 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001028 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001029 },
1030 { /* Xilinx Virtex-II Pro */
Grant C. Likely72646c72006-01-19 01:13:20 -07001031 .pvr_mask = 0xfffff000,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001032 .pvr_value = 0x20010000,
1033 .cpu_name = "Virtex-II Pro",
Kumar Gala10b35d92005-09-23 14:08:58 -05001034 .cpu_features = CPU_FTRS_40X,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001035 .cpu_user_features = PPC_FEATURE_32 |
1036 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1037 .icache_bsize = 32,
1038 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001039 .platform = "ppc405",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001040 },
Grant C. Likely72646c72006-01-19 01:13:20 -07001041 { /* Xilinx Virtex-4 FX */
1042 .pvr_mask = 0xfffff000,
1043 .pvr_value = 0x20011000,
1044 .cpu_name = "Virtex-4 FX",
1045 .cpu_features = CPU_FTRS_40X,
1046 .cpu_user_features = PPC_FEATURE_32 |
1047 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1048 .icache_bsize = 32,
1049 .dcache_bsize = 32,
Peter Bergner838fdb42006-09-14 14:18:38 -05001050 .platform = "ppc405",
Grant C. Likely72646c72006-01-19 01:13:20 -07001051 },
Eugene Suroveginad95d602005-06-07 13:22:09 -07001052 { /* 405EP */
1053 .pvr_mask = 0xffff0000,
1054 .pvr_value = 0x51210000,
1055 .cpu_name = "405EP",
Kumar Gala10b35d92005-09-23 14:08:58 -05001056 .cpu_features = CPU_FTRS_40X,
Eugene Suroveginad95d602005-06-07 13:22:09 -07001057 .cpu_user_features = PPC_FEATURE_32 |
1058 PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
1059 .icache_bsize = 32,
1060 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001061 .platform = "ppc405",
Eugene Suroveginad95d602005-06-07 13:22:09 -07001062 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001063
1064#endif /* CONFIG_40x */
1065#ifdef CONFIG_44x
Matt Porterc9cf73a2005-07-31 22:34:52 -07001066 {
1067 .pvr_mask = 0xf0000fff,
1068 .pvr_value = 0x40000850,
1069 .cpu_name = "440EP Rev. A",
Kumar Gala10b35d92005-09-23 14:08:58 -05001070 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001071 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
Matt Porterc9cf73a2005-07-31 22:34:52 -07001072 .icache_bsize = 32,
1073 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001074 .platform = "ppc440",
Matt Porterc9cf73a2005-07-31 22:34:52 -07001075 },
1076 {
1077 .pvr_mask = 0xf0000fff,
1078 .pvr_value = 0x400008d3,
1079 .cpu_name = "440EP Rev. B",
Kumar Gala10b35d92005-09-23 14:08:58 -05001080 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001081 .cpu_user_features = COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
Matt Porterc9cf73a2005-07-31 22:34:52 -07001082 .icache_bsize = 32,
1083 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001084 .platform = "ppc440",
Matt Porterc9cf73a2005-07-31 22:34:52 -07001085 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001086 { /* 440GP Rev. B */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001087 .pvr_mask = 0xf0000fff,
1088 .pvr_value = 0x40000440,
1089 .cpu_name = "440GP Rev. B",
Kumar Gala10b35d92005-09-23 14:08:58 -05001090 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001091 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001092 .icache_bsize = 32,
1093 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001094 .platform = "ppc440gp",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001095 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001096 { /* 440GP Rev. C */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001097 .pvr_mask = 0xf0000fff,
1098 .pvr_value = 0x40000481,
1099 .cpu_name = "440GP Rev. C",
Kumar Gala10b35d92005-09-23 14:08:58 -05001100 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001101 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001102 .icache_bsize = 32,
1103 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001104 .platform = "ppc440gp",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001105 },
1106 { /* 440GX Rev. A */
1107 .pvr_mask = 0xf0000fff,
1108 .pvr_value = 0x50000850,
1109 .cpu_name = "440GX Rev. A",
Kumar Gala10b35d92005-09-23 14:08:58 -05001110 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001111 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001112 .icache_bsize = 32,
1113 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001114 .platform = "ppc440",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001115 },
1116 { /* 440GX Rev. B */
1117 .pvr_mask = 0xf0000fff,
1118 .pvr_value = 0x50000851,
1119 .cpu_name = "440GX Rev. B",
Kumar Gala10b35d92005-09-23 14:08:58 -05001120 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001121 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001122 .icache_bsize = 32,
1123 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001124 .platform = "ppc440",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001125 },
1126 { /* 440GX Rev. C */
1127 .pvr_mask = 0xf0000fff,
1128 .pvr_value = 0x50000892,
1129 .cpu_name = "440GX Rev. C",
Kumar Gala10b35d92005-09-23 14:08:58 -05001130 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001131 .cpu_user_features = COMMON_USER_BOOKE,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001132 .icache_bsize = 32,
1133 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001134 .platform = "ppc440",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001135 },
Eugene Surovegin9149fb32005-09-03 15:55:40 -07001136 { /* 440GX Rev. F */
1137 .pvr_mask = 0xf0000fff,
1138 .pvr_value = 0x50000894,
1139 .cpu_name = "440GX Rev. F",
Kumar Gala10b35d92005-09-23 14:08:58 -05001140 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001141 .cpu_user_features = COMMON_USER_BOOKE,
Eugene Surovegin9149fb32005-09-03 15:55:40 -07001142 .icache_bsize = 32,
1143 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001144 .platform = "ppc440",
Eugene Surovegin9149fb32005-09-03 15:55:40 -07001145 },
Matt Porter656de7e2005-09-03 15:55:42 -07001146 { /* 440SP Rev. A */
1147 .pvr_mask = 0xff000fff,
1148 .pvr_value = 0x53000891,
1149 .cpu_name = "440SP Rev. A",
Kumar Gala10b35d92005-09-23 14:08:58 -05001150 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001151 .cpu_user_features = COMMON_USER_BOOKE,
Matt Porter656de7e2005-09-03 15:55:42 -07001152 .icache_bsize = 32,
1153 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001154 .platform = "ppc440",
Matt Porter656de7e2005-09-03 15:55:42 -07001155 },
Roland Dreierb0f7b8b2005-11-07 00:58:13 -08001156 { /* 440SPe Rev. A */
1157 .pvr_mask = 0xff000fff,
1158 .pvr_value = 0x53000890,
1159 .cpu_name = "440SPe Rev. A",
Kumar Galaa147c582006-12-08 02:34:38 -06001160 .cpu_features = CPU_FTRS_44X,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001161 .cpu_user_features = COMMON_USER_BOOKE,
Roland Dreierb0f7b8b2005-11-07 00:58:13 -08001162 .icache_bsize = 32,
1163 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001164 .platform = "ppc440",
Roland Dreierb0f7b8b2005-11-07 00:58:13 -08001165 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001166#endif /* CONFIG_44x */
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001167#ifdef CONFIG_FSL_BOOKE
Stephen Rothwell49209602005-10-12 15:55:09 +10001168 { /* e200z5 */
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001169 .pvr_mask = 0xfff00000,
1170 .pvr_value = 0x81000000,
1171 .cpu_name = "e200z5",
1172 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001173 .cpu_features = CPU_FTRS_E200,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001174 .cpu_user_features = COMMON_USER_BOOKE |
1175 PPC_FEATURE_HAS_EFP_SINGLE |
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001176 PPC_FEATURE_UNIFIED_CACHE,
1177 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001178 .platform = "ppc5554",
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001179 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001180 { /* e200z6 */
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001181 .pvr_mask = 0xfff00000,
1182 .pvr_value = 0x81100000,
1183 .cpu_name = "e200z6",
1184 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001185 .cpu_features = CPU_FTRS_E200,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001186 .cpu_user_features = COMMON_USER_BOOKE |
1187 PPC_FEATURE_SPE_COMP |
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001188 PPC_FEATURE_HAS_EFP_SINGLE |
1189 PPC_FEATURE_UNIFIED_CACHE,
1190 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001191 .platform = "ppc5554",
Kumar Gala33d9e9b2005-06-25 14:54:37 -07001192 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001193 { /* e500 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001194 .pvr_mask = 0xffff0000,
1195 .pvr_value = 0x80200000,
1196 .cpu_name = "e500",
1197 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001198 .cpu_features = CPU_FTRS_E500,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001199 .cpu_user_features = COMMON_USER_BOOKE |
1200 PPC_FEATURE_SPE_COMP |
Linus Torvalds1da177e2005-04-16 15:20:36 -07001201 PPC_FEATURE_HAS_EFP_SINGLE,
1202 .icache_bsize = 32,
1203 .dcache_bsize = 32,
1204 .num_pmcs = 4,
Andy Fleming555d97a2005-12-15 20:02:04 -06001205 .oprofile_cpu_type = "ppc/e500",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +00001206 .oprofile_type = PPC_OPROFILE_BOOKE,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001207 .platform = "ppc8540",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001208 },
Stephen Rothwell49209602005-10-12 15:55:09 +10001209 { /* e500v2 */
Kumar Gala5b37b702005-06-21 17:15:18 -07001210 .pvr_mask = 0xffff0000,
1211 .pvr_value = 0x80210000,
1212 .cpu_name = "e500v2",
1213 /* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
Kumar Gala10b35d92005-09-23 14:08:58 -05001214 .cpu_features = CPU_FTRS_E500_2,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001215 .cpu_user_features = COMMON_USER_BOOKE |
1216 PPC_FEATURE_SPE_COMP |
1217 PPC_FEATURE_HAS_EFP_SINGLE |
1218 PPC_FEATURE_HAS_EFP_DOUBLE,
Kumar Gala5b37b702005-06-21 17:15:18 -07001219 .icache_bsize = 32,
1220 .dcache_bsize = 32,
1221 .num_pmcs = 4,
Andy Fleming555d97a2005-12-15 20:02:04 -06001222 .oprofile_cpu_type = "ppc/e500",
Andy Whitcroft7a45fb12006-01-13 12:35:49 +00001223 .oprofile_type = PPC_OPROFILE_BOOKE,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001224 .platform = "ppc8548",
Kumar Gala5b37b702005-06-21 17:15:18 -07001225 },
Linus Torvalds1da177e2005-04-16 15:20:36 -07001226#endif
1227#if !CLASSIC_PPC
1228 { /* default match */
1229 .pvr_mask = 0x00000000,
1230 .pvr_value = 0x00000000,
1231 .cpu_name = "(generic PPC)",
Kumar Gala10b35d92005-09-23 14:08:58 -05001232 .cpu_features = CPU_FTRS_GENERIC_32,
Linus Torvalds1da177e2005-04-16 15:20:36 -07001233 .cpu_user_features = PPC_FEATURE_32,
1234 .icache_bsize = 32,
1235 .dcache_bsize = 32,
Paul Mackerras80f15dc2006-01-14 10:11:39 +11001236 .platform = "powerpc",
Linus Torvalds1da177e2005-04-16 15:20:36 -07001237 }
1238#endif /* !CLASSIC_PPC */
Stephen Rothwell49209602005-10-12 15:55:09 +10001239#endif /* CONFIG_PPC32 */
Linus Torvalds1da177e2005-04-16 15:20:36 -07001240};
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001241
Paul Mackerras974a76f2006-11-10 20:38:53 +11001242struct cpu_spec *identify_cpu(unsigned long offset, unsigned int pvr)
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001243{
1244 struct cpu_spec *s = cpu_specs;
1245 struct cpu_spec **cur = &cur_cpu_spec;
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001246 int i;
1247
1248 s = PTRRELOC(s);
1249 cur = PTRRELOC(cur);
1250
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001251 for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++)
1252 if ((pvr & s->pvr_mask) == s->pvr_value) {
1253 *cur = cpu_specs + i;
1254#ifdef CONFIG_PPC64
1255 /* ppc64 expects identify_cpu to also call setup_cpu
1256 * for that processor. I will consolidate that at a
1257 * later time, for now, just use our friend #ifdef.
1258 * we also don't need to PTRRELOC the function pointer
1259 * on ppc64 as we are running at 0 in real mode.
1260 */
1261 if (s->cpu_setup) {
1262 s->cpu_setup(offset, s);
1263 }
1264#endif /* CONFIG_PPC64 */
1265 return s;
1266 }
1267 BUG();
1268 return NULL;
1269}
1270
Benjamin Herrenschmidt0909c8c2006-10-20 11:47:18 +10001271void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end)
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001272{
1273 struct fixup_entry {
1274 unsigned long mask;
1275 unsigned long value;
Benjamin Herrenschmidt0909c8c2006-10-20 11:47:18 +10001276 long start_off;
1277 long end_off;
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001278 } *fcur, *fend;
1279
1280 fcur = fixup_start;
1281 fend = fixup_end;
1282
1283 for (; fcur < fend; fcur++) {
1284 unsigned int *pstart, *pend, *p;
1285
1286 if ((value & fcur->mask) == fcur->value)
1287 continue;
1288
1289 /* These PTRRELOCs will disappear once the new scheme for
1290 * modules and vdso is implemented
1291 */
Benjamin Herrenschmidt0909c8c2006-10-20 11:47:18 +10001292 pstart = ((unsigned int *)fcur) + (fcur->start_off / 4);
1293 pend = ((unsigned int *)fcur) + (fcur->end_off / 4);
Benjamin Herrenschmidt42c4aaa2006-10-24 16:42:40 +10001294
1295 for (p = pstart; p < pend; p++) {
1296 *p = 0x60000000u;
1297 asm volatile ("dcbst 0, %0" : : "r" (p));
1298 }
1299 asm volatile ("sync" : : : "memory");
1300 for (p = pstart; p < pend; p++)
1301 asm volatile ("icbi 0,%0" : : "r" (p));
1302 asm volatile ("sync; isync" : : : "memory");
1303 }
1304}