cputable.c 38.7 KB
Newer Older
L
Linus Torvalds 已提交
1 2 3
/*
 *  Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org)
 *
S
Stephen Rothwell 已提交
4 5 6
 *  Modifications for ppc64:
 *      Copyright (C) 2003 Dave Engebretsen <engebret@us.ibm.com>
 *
L
Linus Torvalds 已提交
7 8 9 10 11 12 13 14 15 16
 *  This program is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU General Public License
 *  as published by the Free Software Foundation; either version
 *  2 of the License, or (at your option) any later version.
 */

#include <linux/string.h>
#include <linux/sched.h>
#include <linux/threads.h>
#include <linux/init.h>
17 18 19
#include <linux/module.h>

#include <asm/oprofile_impl.h>
L
Linus Torvalds 已提交
20
#include <asm/cputable.h>
21
#include <asm/prom.h>		/* for PTRRELOC on ARCH=ppc */
L
Linus Torvalds 已提交
22

23
struct cpu_spec* cur_cpu_spec = NULL;
S
Stephen Rothwell 已提交
24
EXPORT_SYMBOL(cur_cpu_spec);
L
Linus Torvalds 已提交
25

S
Stephen Rothwell 已提交
26 27 28 29 30 31 32
/* NOTE:
 * Unlike ppc32, ppc64 will only call this once for the boot CPU, it's
 * the responsibility of the appropriate CPU save/restore functions to
 * eventually copy these settings over. Those save/restore aren't yet
 * part of the cputable though. That has to be fixed for both ppc32
 * and ppc64
 */
33
#ifdef CONFIG_PPC32
34 35
extern void __setup_cpu_440ep(unsigned long offset, struct cpu_spec* spec);
extern void __setup_cpu_440epx(unsigned long offset, struct cpu_spec* spec);
36
extern void __setup_cpu_440grx(unsigned long offset, struct cpu_spec* spec);
37 38 39 40 41 42 43 44
extern void __setup_cpu_603(unsigned long offset, struct cpu_spec* spec);
extern void __setup_cpu_604(unsigned long offset, struct cpu_spec* spec);
extern void __setup_cpu_750(unsigned long offset, struct cpu_spec* spec);
extern void __setup_cpu_750cx(unsigned long offset, struct cpu_spec* spec);
extern void __setup_cpu_750fx(unsigned long offset, struct cpu_spec* spec);
extern void __setup_cpu_7400(unsigned long offset, struct cpu_spec* spec);
extern void __setup_cpu_7410(unsigned long offset, struct cpu_spec* spec);
extern void __setup_cpu_745x(unsigned long offset, struct cpu_spec* spec);
S
Stephen Rothwell 已提交
45
#endif /* CONFIG_PPC32 */
O
Olof Johansson 已提交
46
#ifdef CONFIG_PPC64
47
extern void __setup_cpu_ppc970(unsigned long offset, struct cpu_spec* spec);
48
extern void __setup_cpu_ppc970MP(unsigned long offset, struct cpu_spec* spec);
O
Olof Johansson 已提交
49
extern void __setup_cpu_pa6t(unsigned long offset, struct cpu_spec* spec);
S
Stephen Rothwell 已提交
50
extern void __restore_cpu_pa6t(void);
O
Olof Johansson 已提交
51 52
extern void __restore_cpu_ppc970(void);
#endif /* CONFIG_PPC64 */
L
Linus Torvalds 已提交
53 54 55 56

/* This table only contains "desktop" CPUs, it need to be filled with embedded
 * ones as well...
 */
S
Stephen Rothwell 已提交
57 58 59
#define COMMON_USER		(PPC_FEATURE_32 | PPC_FEATURE_HAS_FPU | \
				 PPC_FEATURE_HAS_MMU)
#define COMMON_USER_PPC64	(COMMON_USER | PPC_FEATURE_64)
60
#define COMMON_USER_POWER4	(COMMON_USER_PPC64 | PPC_FEATURE_POWER4)
61 62 63 64
#define COMMON_USER_POWER5	(COMMON_USER_PPC64 | PPC_FEATURE_POWER5 |\
				 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
#define COMMON_USER_POWER5_PLUS	(COMMON_USER_PPC64 | PPC_FEATURE_POWER5_PLUS|\
				 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP)
65
#define COMMON_USER_POWER6	(COMMON_USER_PPC64 | PPC_FEATURE_ARCH_2_05 |\
66 67
				 PPC_FEATURE_SMT | PPC_FEATURE_ICACHE_SNOOP | \
				 PPC_FEATURE_TRUE_LE)
68 69 70
#define COMMON_USER_PA6T	(COMMON_USER_PPC64 | PPC_FEATURE_PA6T |\
				 PPC_FEATURE_TRUE_LE | \
				 PPC_FEATURE_HAS_ALTIVEC_COMP)
71 72
#define COMMON_USER_BOOKE	(PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \
				 PPC_FEATURE_BOOKE)
L
Linus Torvalds 已提交
73

74
static struct cpu_spec cpu_specs[] = {
S
Stephen Rothwell 已提交
75 76 77 78 79 80
#ifdef CONFIG_PPC64
	{	/* Power3 */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00400000,
		.cpu_name		= "POWER3 (630)",
		.cpu_features		= CPU_FTRS_POWER3,
81
		.cpu_user_features	= COMMON_USER_PPC64|PPC_FEATURE_PPC_LE,
S
Stephen Rothwell 已提交
82 83 84
		.icache_bsize		= 128,
		.dcache_bsize		= 128,
		.num_pmcs		= 8,
85
		.pmc_type		= PPC_PMC_IBM,
S
Stephen Rothwell 已提交
86
		.oprofile_cpu_type	= "ppc64/power3",
87
		.oprofile_type		= PPC_OPROFILE_RS64,
88
		.platform		= "power3",
S
Stephen Rothwell 已提交
89 90 91 92 93 94
	},
	{	/* Power3+ */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00410000,
		.cpu_name		= "POWER3 (630+)",
		.cpu_features		= CPU_FTRS_POWER3,
95
		.cpu_user_features	= COMMON_USER_PPC64|PPC_FEATURE_PPC_LE,
S
Stephen Rothwell 已提交
96 97 98
		.icache_bsize		= 128,
		.dcache_bsize		= 128,
		.num_pmcs		= 8,
99
		.pmc_type		= PPC_PMC_IBM,
S
Stephen Rothwell 已提交
100
		.oprofile_cpu_type	= "ppc64/power3",
101
		.oprofile_type		= PPC_OPROFILE_RS64,
102
		.platform		= "power3",
S
Stephen Rothwell 已提交
103 104 105 106 107 108 109 110 111 112
	},
	{	/* Northstar */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00330000,
		.cpu_name		= "RS64-II (northstar)",
		.cpu_features		= CPU_FTRS_RS64,
		.cpu_user_features	= COMMON_USER_PPC64,
		.icache_bsize		= 128,
		.dcache_bsize		= 128,
		.num_pmcs		= 8,
113
		.pmc_type		= PPC_PMC_IBM,
S
Stephen Rothwell 已提交
114
		.oprofile_cpu_type	= "ppc64/rs64",
115
		.oprofile_type		= PPC_OPROFILE_RS64,
116
		.platform		= "rs64",
S
Stephen Rothwell 已提交
117 118 119 120 121 122 123 124 125 126
	},
	{	/* Pulsar */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00340000,
		.cpu_name		= "RS64-III (pulsar)",
		.cpu_features		= CPU_FTRS_RS64,
		.cpu_user_features	= COMMON_USER_PPC64,
		.icache_bsize		= 128,
		.dcache_bsize		= 128,
		.num_pmcs		= 8,
127
		.pmc_type		= PPC_PMC_IBM,
S
Stephen Rothwell 已提交
128
		.oprofile_cpu_type	= "ppc64/rs64",
129
		.oprofile_type		= PPC_OPROFILE_RS64,
130
		.platform		= "rs64",
S
Stephen Rothwell 已提交
131 132 133 134 135 136 137 138 139 140
	},
	{	/* I-star */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00360000,
		.cpu_name		= "RS64-III (icestar)",
		.cpu_features		= CPU_FTRS_RS64,
		.cpu_user_features	= COMMON_USER_PPC64,
		.icache_bsize		= 128,
		.dcache_bsize		= 128,
		.num_pmcs		= 8,
141
		.pmc_type		= PPC_PMC_IBM,
S
Stephen Rothwell 已提交
142
		.oprofile_cpu_type	= "ppc64/rs64",
143
		.oprofile_type		= PPC_OPROFILE_RS64,
144
		.platform		= "rs64",
S
Stephen Rothwell 已提交
145 146 147 148 149 150 151 152 153 154
	},
	{	/* S-star */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00370000,
		.cpu_name		= "RS64-IV (sstar)",
		.cpu_features		= CPU_FTRS_RS64,
		.cpu_user_features	= COMMON_USER_PPC64,
		.icache_bsize		= 128,
		.dcache_bsize		= 128,
		.num_pmcs		= 8,
155
		.pmc_type		= PPC_PMC_IBM,
S
Stephen Rothwell 已提交
156
		.oprofile_cpu_type	= "ppc64/rs64",
157
		.oprofile_type		= PPC_OPROFILE_RS64,
158
		.platform		= "rs64",
S
Stephen Rothwell 已提交
159 160 161 162 163 164
	},
	{	/* Power4 */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00350000,
		.cpu_name		= "POWER4 (gp)",
		.cpu_features		= CPU_FTRS_POWER4,
165
		.cpu_user_features	= COMMON_USER_POWER4,
S
Stephen Rothwell 已提交
166 167 168
		.icache_bsize		= 128,
		.dcache_bsize		= 128,
		.num_pmcs		= 8,
169
		.pmc_type		= PPC_PMC_IBM,
S
Stephen Rothwell 已提交
170
		.oprofile_cpu_type	= "ppc64/power4",
171
		.oprofile_type		= PPC_OPROFILE_POWER4,
172
		.platform		= "power4",
S
Stephen Rothwell 已提交
173 174 175 176 177 178
	},
	{	/* Power4+ */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00380000,
		.cpu_name		= "POWER4+ (gq)",
		.cpu_features		= CPU_FTRS_POWER4,
179
		.cpu_user_features	= COMMON_USER_POWER4,
S
Stephen Rothwell 已提交
180 181 182
		.icache_bsize		= 128,
		.dcache_bsize		= 128,
		.num_pmcs		= 8,
183
		.pmc_type		= PPC_PMC_IBM,
S
Stephen Rothwell 已提交
184
		.oprofile_cpu_type	= "ppc64/power4",
185
		.oprofile_type		= PPC_OPROFILE_POWER4,
186
		.platform		= "power4",
S
Stephen Rothwell 已提交
187 188 189 190 191 192
	},
	{	/* PPC970 */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00390000,
		.cpu_name		= "PPC970",
		.cpu_features		= CPU_FTRS_PPC970,
193
		.cpu_user_features	= COMMON_USER_POWER4 |
S
Stephen Rothwell 已提交
194 195 196 197
			PPC_FEATURE_HAS_ALTIVEC_COMP,
		.icache_bsize		= 128,
		.dcache_bsize		= 128,
		.num_pmcs		= 8,
198
		.pmc_type		= PPC_PMC_IBM,
S
Stephen Rothwell 已提交
199
		.cpu_setup		= __setup_cpu_ppc970,
O
Olof Johansson 已提交
200
		.cpu_restore		= __restore_cpu_ppc970,
S
Stephen Rothwell 已提交
201
		.oprofile_cpu_type	= "ppc64/970",
202
		.oprofile_type		= PPC_OPROFILE_POWER4,
203
		.platform		= "ppc970",
S
Stephen Rothwell 已提交
204 205 206 207 208 209
	},
	{	/* PPC970FX */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x003c0000,
		.cpu_name		= "PPC970FX",
		.cpu_features		= CPU_FTRS_PPC970,
210
		.cpu_user_features	= COMMON_USER_POWER4 |
S
Stephen Rothwell 已提交
211 212 213 214
			PPC_FEATURE_HAS_ALTIVEC_COMP,
		.icache_bsize		= 128,
		.dcache_bsize		= 128,
		.num_pmcs		= 8,
215
		.pmc_type		= PPC_PMC_IBM,
S
Stephen Rothwell 已提交
216
		.cpu_setup		= __setup_cpu_ppc970,
O
Olof Johansson 已提交
217
		.cpu_restore		= __restore_cpu_ppc970,
S
Stephen Rothwell 已提交
218
		.oprofile_cpu_type	= "ppc64/970",
219
		.oprofile_type		= PPC_OPROFILE_POWER4,
220
		.platform		= "ppc970",
221 222 223 224 225 226 227 228 229 230 231
	},
	{	/* PPC970MP DD1.0 - no DEEPNAP, use regular 970 init */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x00440100,
		.cpu_name		= "PPC970MP",
		.cpu_features		= CPU_FTRS_PPC970,
		.cpu_user_features	= COMMON_USER_POWER4 |
			PPC_FEATURE_HAS_ALTIVEC_COMP,
		.icache_bsize		= 128,
		.dcache_bsize		= 128,
		.num_pmcs		= 8,
232
		.pmc_type		= PPC_PMC_IBM,
233 234 235 236 237
		.cpu_setup		= __setup_cpu_ppc970,
		.cpu_restore		= __restore_cpu_ppc970,
		.oprofile_cpu_type	= "ppc64/970MP",
		.oprofile_type		= PPC_OPROFILE_POWER4,
		.platform		= "ppc970",
S
Stephen Rothwell 已提交
238 239 240 241 242 243
	},
	{	/* PPC970MP */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00440000,
		.cpu_name		= "PPC970MP",
		.cpu_features		= CPU_FTRS_PPC970,
244
		.cpu_user_features	= COMMON_USER_POWER4 |
S
Stephen Rothwell 已提交
245 246 247
			PPC_FEATURE_HAS_ALTIVEC_COMP,
		.icache_bsize		= 128,
		.dcache_bsize		= 128,
248
		.num_pmcs		= 8,
249
		.pmc_type		= PPC_PMC_IBM,
250
		.cpu_setup		= __setup_cpu_ppc970MP,
O
Olof Johansson 已提交
251
		.cpu_restore		= __restore_cpu_ppc970,
252
		.oprofile_cpu_type	= "ppc64/970MP",
253
		.oprofile_type		= PPC_OPROFILE_POWER4,
254
		.platform		= "ppc970",
S
Stephen Rothwell 已提交
255
	},
J
Jake Moilanen 已提交
256 257 258 259 260 261 262 263 264 265
	{	/* PPC970GX */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00450000,
		.cpu_name		= "PPC970GX",
		.cpu_features		= CPU_FTRS_PPC970,
		.cpu_user_features	= COMMON_USER_POWER4 |
			PPC_FEATURE_HAS_ALTIVEC_COMP,
		.icache_bsize		= 128,
		.dcache_bsize		= 128,
		.num_pmcs		= 8,
266
		.pmc_type		= PPC_PMC_IBM,
J
Jake Moilanen 已提交
267 268 269 270 271
		.cpu_setup		= __setup_cpu_ppc970,
		.oprofile_cpu_type	= "ppc64/970",
		.oprofile_type		= PPC_OPROFILE_POWER4,
		.platform		= "ppc970",
	},
272
	{	/* Power5 GR */
S
Stephen Rothwell 已提交
273 274 275 276
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x003a0000,
		.cpu_name		= "POWER5 (gr)",
		.cpu_features		= CPU_FTRS_POWER5,
277
		.cpu_user_features	= COMMON_USER_POWER5,
S
Stephen Rothwell 已提交
278 279 280
		.icache_bsize		= 128,
		.dcache_bsize		= 128,
		.num_pmcs		= 6,
281
		.pmc_type		= PPC_PMC_IBM,
S
Stephen Rothwell 已提交
282
		.oprofile_cpu_type	= "ppc64/power5",
283
		.oprofile_type		= PPC_OPROFILE_POWER4,
284 285 286 287 288
		/* SIHV / SIPR bits are implemented on POWER4+ (GQ)
		 * and above but only works on POWER5 and above
		 */
		.oprofile_mmcra_sihv	= MMCRA_SIHV,
		.oprofile_mmcra_sipr	= MMCRA_SIPR,
289
		.platform		= "power5",
S
Stephen Rothwell 已提交
290
	},
291 292 293 294 295 296 297 298 299 300 301 302 303 304 305
	{	/* Power5++ */
		.pvr_mask		= 0xffffff00,
		.pvr_value		= 0x003b0300,
		.cpu_name		= "POWER5+ (gs)",
		.cpu_features		= CPU_FTRS_POWER5,
		.cpu_user_features	= COMMON_USER_POWER5_PLUS,
		.icache_bsize		= 128,
		.dcache_bsize		= 128,
		.num_pmcs		= 6,
		.oprofile_cpu_type	= "ppc64/power5++",
		.oprofile_type		= PPC_OPROFILE_POWER4,
		.oprofile_mmcra_sihv	= MMCRA_SIHV,
		.oprofile_mmcra_sipr	= MMCRA_SIPR,
		.platform		= "power5+",
	},
306
	{	/* Power5 GS */
S
Stephen Rothwell 已提交
307 308
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x003b0000,
309
		.cpu_name		= "POWER5+ (gs)",
S
Stephen Rothwell 已提交
310
		.cpu_features		= CPU_FTRS_POWER5,
311
		.cpu_user_features	= COMMON_USER_POWER5_PLUS,
S
Stephen Rothwell 已提交
312 313 314
		.icache_bsize		= 128,
		.dcache_bsize		= 128,
		.num_pmcs		= 6,
315
		.pmc_type		= PPC_PMC_IBM,
316
		.oprofile_cpu_type	= "ppc64/power5+",
317
		.oprofile_type		= PPC_OPROFILE_POWER4,
318 319
		.oprofile_mmcra_sihv	= MMCRA_SIHV,
		.oprofile_mmcra_sipr	= MMCRA_SIPR,
320
		.platform		= "power5+",
S
Stephen Rothwell 已提交
321
	},
322 323 324 325 326 327 328 329 330
	{	/* POWER6 in P5+ mode; 2.04-compliant processor */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x0f000001,
		.cpu_name		= "POWER5+",
		.cpu_features		= CPU_FTRS_POWER5,
		.cpu_user_features	= COMMON_USER_POWER5_PLUS,
		.icache_bsize		= 128,
		.dcache_bsize		= 128,
		.num_pmcs		= 6,
331
		.pmc_type		= PPC_PMC_IBM,
332 333 334 335 336 337 338 339
		.oprofile_cpu_type	= "ppc64/power6",
		.oprofile_type		= PPC_OPROFILE_POWER4,
		.oprofile_mmcra_sihv	= POWER6_MMCRA_SIHV,
		.oprofile_mmcra_sipr	= POWER6_MMCRA_SIPR,
		.oprofile_mmcra_clear	= POWER6_MMCRA_THRM |
			POWER6_MMCRA_OTHER,
		.platform		= "power5+",
	},
340 341 342
	{	/* Power6 */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x003e0000,
343 344 345 346 347 348 349
		.cpu_name		= "POWER6 (raw)",
		.cpu_features		= CPU_FTRS_POWER6,
		.cpu_user_features	= COMMON_USER_POWER6 |
			PPC_FEATURE_POWER6_EXT,
		.icache_bsize		= 128,
		.dcache_bsize		= 128,
		.num_pmcs		= 6,
350
		.pmc_type		= PPC_PMC_IBM,
351 352 353 354 355 356 357 358 359 360 361 362
		.oprofile_cpu_type	= "ppc64/power6",
		.oprofile_type		= PPC_OPROFILE_POWER4,
		.oprofile_mmcra_sihv	= POWER6_MMCRA_SIHV,
		.oprofile_mmcra_sipr	= POWER6_MMCRA_SIPR,
		.oprofile_mmcra_clear	= POWER6_MMCRA_THRM |
			POWER6_MMCRA_OTHER,
		.platform		= "power6x",
	},
	{	/* 2.05-compliant processor, i.e. Power6 "architected" mode */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x0f000002,
		.cpu_name		= "POWER6 (architected)",
363 364 365 366
		.cpu_features		= CPU_FTRS_POWER6,
		.cpu_user_features	= COMMON_USER_POWER6,
		.icache_bsize		= 128,
		.dcache_bsize		= 128,
A
Anton Blanchard 已提交
367
		.num_pmcs		= 6,
368
		.pmc_type		= PPC_PMC_IBM,
369 370
		.oprofile_cpu_type	= "ppc64/power6",
		.oprofile_type		= PPC_OPROFILE_POWER4,
371 372 373 374
 		.oprofile_mmcra_sihv	= POWER6_MMCRA_SIHV,
 		.oprofile_mmcra_sipr	= POWER6_MMCRA_SIPR,
 		.oprofile_mmcra_clear	= POWER6_MMCRA_THRM |
 			POWER6_MMCRA_OTHER,
375 376
		.platform		= "power6",
	},
377
	{	/* Cell Broadband Engine */
S
Stephen Rothwell 已提交
378 379 380 381 382
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00700000,
		.cpu_name		= "Cell Broadband Engine",
		.cpu_features		= CPU_FTRS_CELL,
		.cpu_user_features	= COMMON_USER_PPC64 |
383 384
			PPC_FEATURE_CELL | PPC_FEATURE_HAS_ALTIVEC_COMP |
			PPC_FEATURE_SMT,
S
Stephen Rothwell 已提交
385 386
		.icache_bsize		= 128,
		.dcache_bsize		= 128,
387
		.num_pmcs		= 4,
388
		.pmc_type		= PPC_PMC_IBM,
389 390
		.oprofile_cpu_type	= "ppc64/cell-be",
		.oprofile_type		= PPC_OPROFILE_CELL,
391
		.platform		= "ppc-cell-be",
S
Stephen Rothwell 已提交
392
	},
393 394 395 396 397 398 399 400 401
	{	/* PA Semi PA6T */
		.pvr_mask		= 0x7fff0000,
		.pvr_value		= 0x00900000,
		.cpu_name		= "PA6T",
		.cpu_features		= CPU_FTRS_PA6T,
		.cpu_user_features	= COMMON_USER_PA6T,
		.icache_bsize		= 64,
		.dcache_bsize		= 64,
		.num_pmcs		= 6,
402
		.pmc_type		= PPC_PMC_PA6T,
O
Olof Johansson 已提交
403 404
		.cpu_setup		= __setup_cpu_pa6t,
		.cpu_restore		= __restore_cpu_pa6t,
405 406
		.oprofile_cpu_type	= "ppc64/pa6t",
		.oprofile_type		= PPC_OPROFILE_PA6T,
407 408
		.platform		= "pa6t",
	},
S
Stephen Rothwell 已提交
409 410 411 412 413 414 415 416 417
	{	/* default match */
		.pvr_mask		= 0x00000000,
		.pvr_value		= 0x00000000,
		.cpu_name		= "POWER4 (compatible)",
		.cpu_features		= CPU_FTRS_COMPATIBLE,
		.cpu_user_features	= COMMON_USER_PPC64,
		.icache_bsize		= 128,
		.dcache_bsize		= 128,
		.num_pmcs		= 6,
418
		.pmc_type		= PPC_PMC_IBM,
419
		.platform		= "power4",
S
Stephen Rothwell 已提交
420 421 422
	}
#endif	/* CONFIG_PPC64 */
#ifdef CONFIG_PPC32
L
Linus Torvalds 已提交
423
#if CLASSIC_PPC
S
Stephen Rothwell 已提交
424
	{	/* 601 */
L
Linus Torvalds 已提交
425 426 427
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00010000,
		.cpu_name		= "601",
428
		.cpu_features		= CPU_FTRS_PPC601,
S
Stephen Rothwell 已提交
429
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_601_INSTR |
430
			PPC_FEATURE_UNIFIED_CACHE | PPC_FEATURE_NO_TB,
L
Linus Torvalds 已提交
431 432
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
433
		.platform		= "ppc601",
L
Linus Torvalds 已提交
434 435 436 437 438
	},
	{	/* 603 */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00030000,
		.cpu_name		= "603",
439
		.cpu_features		= CPU_FTRS_603,
440
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
441 442
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
443 444
		.cpu_setup		= __setup_cpu_603,
		.platform		= "ppc603",
L
Linus Torvalds 已提交
445 446 447 448 449
	},
	{	/* 603e */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00060000,
		.cpu_name		= "603e",
450
		.cpu_features		= CPU_FTRS_603,
451
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
452 453
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
454 455
		.cpu_setup		= __setup_cpu_603,
		.platform		= "ppc603",
L
Linus Torvalds 已提交
456 457 458 459 460
	},
	{	/* 603ev */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00070000,
		.cpu_name		= "603ev",
461
		.cpu_features		= CPU_FTRS_603,
462
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
463 464
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
465 466
		.cpu_setup		= __setup_cpu_603,
		.platform		= "ppc603",
L
Linus Torvalds 已提交
467 468 469 470 471
	},
	{	/* 604 */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00040000,
		.cpu_name		= "604",
472
		.cpu_features		= CPU_FTRS_604,
473
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
474 475 476
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 2,
477 478
		.cpu_setup		= __setup_cpu_604,
		.platform		= "ppc604",
L
Linus Torvalds 已提交
479 480 481 482 483
	},
	{	/* 604e */
		.pvr_mask		= 0xfffff000,
		.pvr_value		= 0x00090000,
		.cpu_name		= "604e",
484
		.cpu_features		= CPU_FTRS_604,
485
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
486 487 488
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
489 490
		.cpu_setup		= __setup_cpu_604,
		.platform		= "ppc604",
L
Linus Torvalds 已提交
491 492 493 494 495
	},
	{	/* 604r */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00090000,
		.cpu_name		= "604r",
496
		.cpu_features		= CPU_FTRS_604,
497
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
498 499 500
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
501 502
		.cpu_setup		= __setup_cpu_604,
		.platform		= "ppc604",
L
Linus Torvalds 已提交
503 504 505 506 507
	},
	{	/* 604ev */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x000a0000,
		.cpu_name		= "604ev",
508
		.cpu_features		= CPU_FTRS_604,
509
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
510 511 512
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
513 514
		.cpu_setup		= __setup_cpu_604,
		.platform		= "ppc604",
L
Linus Torvalds 已提交
515 516 517 518 519
	},
	{	/* 740/750 (0x4202, don't support TAU ?) */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x00084202,
		.cpu_name		= "740/750",
520
		.cpu_features		= CPU_FTRS_740_NOTAU,
521
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
522 523 524
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
525 526
		.cpu_setup		= __setup_cpu_750,
		.platform		= "ppc750",
L
Linus Torvalds 已提交
527 528 529 530 531
	},
	{	/* 750CX (80100 and 8010x?) */
		.pvr_mask		= 0xfffffff0,
		.pvr_value		= 0x00080100,
		.cpu_name		= "750CX",
532
		.cpu_features		= CPU_FTRS_750,
533
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
534 535 536
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
537 538
		.cpu_setup		= __setup_cpu_750cx,
		.platform		= "ppc750",
L
Linus Torvalds 已提交
539 540 541 542 543
	},
	{	/* 750CX (82201 and 82202) */
		.pvr_mask		= 0xfffffff0,
		.pvr_value		= 0x00082200,
		.cpu_name		= "750CX",
544
		.cpu_features		= CPU_FTRS_750,
545
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
546 547 548
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
549 550
		.cpu_setup		= __setup_cpu_750cx,
		.platform		= "ppc750",
L
Linus Torvalds 已提交
551 552 553 554 555
	},
	{	/* 750CXe (82214) */
		.pvr_mask		= 0xfffffff0,
		.pvr_value		= 0x00082210,
		.cpu_name		= "750CXe",
556
		.cpu_features		= CPU_FTRS_750,
557
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
558 559 560
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
561 562
		.cpu_setup		= __setup_cpu_750cx,
		.platform		= "ppc750",
L
Linus Torvalds 已提交
563
	},
564 565 566 567
	{	/* 750CXe "Gekko" (83214) */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x00083214,
		.cpu_name		= "750CXe",
568
		.cpu_features		= CPU_FTRS_750,
569
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
570 571 572
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
573 574
		.cpu_setup		= __setup_cpu_750cx,
		.platform		= "ppc750",
575
	},
J
Jake Moilanen 已提交
576 577 578 579
	{	/* 750CL */
		.pvr_mask		= 0xfffff0f0,
		.pvr_value		= 0x00087010,
		.cpu_name		= "750CL",
580
		.cpu_features		= CPU_FTRS_750CL,
J
Jake Moilanen 已提交
581 582 583 584
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
585
		.cpu_setup		= __setup_cpu_750,
J
Jake Moilanen 已提交
586 587
		.platform		= "ppc750",
	},
588 589 590 591
	{	/* 745/755 */
		.pvr_mask		= 0xfffff000,
		.pvr_value		= 0x00083000,
		.cpu_name		= "745/755",
592
		.cpu_features		= CPU_FTRS_750,
593
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
594 595 596
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
597 598
		.cpu_setup		= __setup_cpu_750,
		.platform		= "ppc750",
599
	},
L
Linus Torvalds 已提交
600 601 602 603
	{	/* 750FX rev 1.x */
		.pvr_mask		= 0xffffff00,
		.pvr_value		= 0x70000100,
		.cpu_name		= "750FX",
604
		.cpu_features		= CPU_FTRS_750FX1,
605
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
606 607 608
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
609 610
		.cpu_setup		= __setup_cpu_750,
		.platform		= "ppc750",
L
Linus Torvalds 已提交
611 612 613 614 615
	},
	{	/* 750FX rev 2.0 must disable HID0[DPM] */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x70000200,
		.cpu_name		= "750FX",
616
		.cpu_features		= CPU_FTRS_750FX2,
617
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
618 619 620
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
621 622
		.cpu_setup		= __setup_cpu_750,
		.platform		= "ppc750",
L
Linus Torvalds 已提交
623 624 625 626 627
	},
	{	/* 750FX (All revs except 2.0) */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x70000000,
		.cpu_name		= "750FX",
628
		.cpu_features		= CPU_FTRS_750FX,
629
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
630 631 632
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
633 634
		.cpu_setup		= __setup_cpu_750fx,
		.platform		= "ppc750",
L
Linus Torvalds 已提交
635 636 637 638 639
	},
	{	/* 750GX */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x70020000,
		.cpu_name		= "750GX",
640
		.cpu_features		= CPU_FTRS_750GX,
641
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
642 643 644
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
645 646
		.cpu_setup		= __setup_cpu_750fx,
		.platform		= "ppc750",
L
Linus Torvalds 已提交
647 648 649 650 651
	},
	{	/* 740/750 (L2CR bit need fixup for 740) */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00080000,
		.cpu_name		= "740/750",
652
		.cpu_features		= CPU_FTRS_740,
653
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
654 655 656
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
657 658
		.cpu_setup		= __setup_cpu_750,
		.platform		= "ppc750",
L
Linus Torvalds 已提交
659 660 661 662 663
	},
	{	/* 7400 rev 1.1 ? (no TAU) */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x000c1101,
		.cpu_name		= "7400 (1.1)",
664
		.cpu_features		= CPU_FTRS_7400_NOTAU,
665 666
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
667 668 669
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
670 671
		.cpu_setup		= __setup_cpu_7400,
		.platform		= "ppc7400",
L
Linus Torvalds 已提交
672 673 674 675 676
	},
	{	/* 7400 */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x000c0000,
		.cpu_name		= "7400",
677
		.cpu_features		= CPU_FTRS_7400,
678 679
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
680 681 682
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
683 684
		.cpu_setup		= __setup_cpu_7400,
		.platform		= "ppc7400",
L
Linus Torvalds 已提交
685 686 687 688 689
	},
	{	/* 7410 */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x800c0000,
		.cpu_name		= "7410",
690
		.cpu_features		= CPU_FTRS_7400,
691 692
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
693 694 695
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
696 697
		.cpu_setup		= __setup_cpu_7410,
		.platform		= "ppc7400",
L
Linus Torvalds 已提交
698 699 700 701 702
	},
	{	/* 7450 2.0 - no doze/nap */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x80000200,
		.cpu_name		= "7450",
703
		.cpu_features		= CPU_FTRS_7450_20,
704 705
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
706 707 708
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
709 710
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
711
		.oprofile_type		= PPC_OPROFILE_G4,
712
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
713 714 715 716 717
	},
	{	/* 7450 2.1 */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x80000201,
		.cpu_name		= "7450",
718
		.cpu_features		= CPU_FTRS_7450_21,
719 720
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
721 722 723
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
724 725
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
726
		.oprofile_type		= PPC_OPROFILE_G4,
727
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
728 729 730 731 732
	},
	{	/* 7450 2.3 and newer */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x80000000,
		.cpu_name		= "7450",
733
		.cpu_features		= CPU_FTRS_7450_23,
734 735
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
736 737 738
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
739 740
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
741
		.oprofile_type		= PPC_OPROFILE_G4,
742
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
743 744 745 746 747
	},
	{	/* 7455 rev 1.x */
		.pvr_mask		= 0xffffff00,
		.pvr_value		= 0x80010100,
		.cpu_name		= "7455",
748
		.cpu_features		= CPU_FTRS_7455_1,
749 750
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
751 752 753
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
754 755
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
756
		.oprofile_type		= PPC_OPROFILE_G4,
757
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
758 759 760 761 762
	},
	{	/* 7455 rev 2.0 */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x80010200,
		.cpu_name		= "7455",
763
		.cpu_features		= CPU_FTRS_7455_20,
764 765
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
766 767 768
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
769 770
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
771
		.oprofile_type		= PPC_OPROFILE_G4,
772
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
773 774 775 776 777
	},
	{	/* 7455 others */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x80010000,
		.cpu_name		= "7455",
778
		.cpu_features		= CPU_FTRS_7455,
779 780
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
781 782 783
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
784 785
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
786
		.oprofile_type		= PPC_OPROFILE_G4,
787
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
788 789 790 791 792
	},
	{	/* 7447/7457 Rev 1.0 */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x80020100,
		.cpu_name		= "7447/7457",
793
		.cpu_features		= CPU_FTRS_7447_10,
794 795
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
796 797 798
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
799 800
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
801
		.oprofile_type		= PPC_OPROFILE_G4,
802
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
803 804 805 806 807
	},
	{	/* 7447/7457 Rev 1.1 */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x80020101,
		.cpu_name		= "7447/7457",
808
		.cpu_features		= CPU_FTRS_7447_10,
809 810
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
811 812 813
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
814 815
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
816
		.oprofile_type		= PPC_OPROFILE_G4,
817
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
818 819 820 821 822
	},
	{	/* 7447/7457 Rev 1.2 and later */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x80020000,
		.cpu_name		= "7447/7457",
823
		.cpu_features		= CPU_FTRS_7447,
824
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
825 826 827
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
828 829
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
830
		.oprofile_type		= PPC_OPROFILE_G4,
831
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
832 833 834 835 836
	},
	{	/* 7447A */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x80030000,
		.cpu_name		= "7447A",
837
		.cpu_features		= CPU_FTRS_7447A,
838 839
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
840 841 842
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
843 844
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
845
		.oprofile_type		= PPC_OPROFILE_G4,
846
		.platform		= "ppc7450",
847 848 849 850 851
	},
	{	/* 7448 */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x80040000,
		.cpu_name		= "7448",
852
		.cpu_features		= CPU_FTRS_7448,
853 854
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
855 856 857
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
858 859
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
860
		.oprofile_type		= PPC_OPROFILE_G4,
861
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
862 863 864 865 866
	},
	{	/* 82xx (8240, 8245, 8260 are all 603e cores) */
		.pvr_mask		= 0x7fff0000,
		.pvr_value		= 0x00810000,
		.cpu_name		= "82xx",
867
		.cpu_features		= CPU_FTRS_82XX,
S
Stephen Rothwell 已提交
868
		.cpu_user_features	= COMMON_USER,
L
Linus Torvalds 已提交
869 870
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
871 872
		.cpu_setup		= __setup_cpu_603,
		.platform		= "ppc603",
L
Linus Torvalds 已提交
873 874 875 876 877
	},
	{	/* All G2_LE (603e core, plus some) have the same pvr */
		.pvr_mask		= 0x7fff0000,
		.pvr_value		= 0x00820000,
		.cpu_name		= "G2_LE",
878
		.cpu_features		= CPU_FTRS_G2_LE,
S
Stephen Rothwell 已提交
879
		.cpu_user_features	= COMMON_USER,
L
Linus Torvalds 已提交
880 881
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
882 883
		.cpu_setup		= __setup_cpu_603,
		.platform		= "ppc603",
L
Linus Torvalds 已提交
884
	},
885
	{	/* e300c1 (a 603e core, plus some) on 83xx */
L
Linus Torvalds 已提交
886 887
		.pvr_mask		= 0x7fff0000,
		.pvr_value		= 0x00830000,
888
		.cpu_name		= "e300c1",
889
		.cpu_features		= CPU_FTRS_E300,
S
Stephen Rothwell 已提交
890
		.cpu_user_features	= COMMON_USER,
L
Linus Torvalds 已提交
891 892
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
893 894
		.cpu_setup		= __setup_cpu_603,
		.platform		= "ppc603",
L
Linus Torvalds 已提交
895
	},
896 897 898 899
	{	/* e300c2 (an e300c1 core, plus some, minus FPU) on 83xx */
		.pvr_mask		= 0x7fff0000,
		.pvr_value		= 0x00840000,
		.cpu_name		= "e300c2",
900
		.cpu_features		= CPU_FTRS_E300C2,
901 902 903 904 905 906
		.cpu_user_features	= PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.cpu_setup		= __setup_cpu_603,
		.platform		= "ppc603",
	},
907 908 909 910 911 912 913 914 915 916 917
	{	/* e300c3 on 83xx  */
		.pvr_mask		= 0x7fff0000,
		.pvr_value		= 0x00850000,
		.cpu_name		= "e300c3",
		.cpu_features		= CPU_FTRS_E300,
		.cpu_user_features	= COMMON_USER,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.cpu_setup		= __setup_cpu_603,
		.platform		= "ppc603",
	},
L
Linus Torvalds 已提交
918 919 920 921
	{	/* default match, we assume split I/D cache & TB (non-601)... */
		.pvr_mask		= 0x00000000,
		.pvr_value		= 0x00000000,
		.cpu_name		= "(generic PPC)",
922
		.cpu_features		= CPU_FTRS_CLASSIC32,
S
Stephen Rothwell 已提交
923
		.cpu_user_features	= COMMON_USER,
L
Linus Torvalds 已提交
924 925
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
926
		.platform		= "ppc603",
L
Linus Torvalds 已提交
927 928 929 930 931 932 933 934 935
	},
#endif /* CLASSIC_PPC */
#ifdef CONFIG_8xx
	{	/* 8xx */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00500000,
		.cpu_name		= "8xx",
		/* CPU_FTR_MAYBE_CAN_DOZE is possible,
		 * if the 8xx code is there.... */
936
		.cpu_features		= CPU_FTRS_8XX,
L
Linus Torvalds 已提交
937 938 939
		.cpu_user_features	= PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
		.icache_bsize		= 16,
		.dcache_bsize		= 16,
940
		.platform		= "ppc823",
L
Linus Torvalds 已提交
941 942 943 944 945 946 947
	},
#endif /* CONFIG_8xx */
#ifdef CONFIG_40x
	{	/* 403GC */
		.pvr_mask		= 0xffffff00,
		.pvr_value		= 0x00200200,
		.cpu_name		= "403GC",
948
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
949 950 951
		.cpu_user_features	= PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
		.icache_bsize		= 16,
		.dcache_bsize		= 16,
952
		.platform		= "ppc403",
L
Linus Torvalds 已提交
953 954 955 956 957
	},
	{	/* 403GCX */
		.pvr_mask		= 0xffffff00,
		.pvr_value		= 0x00201400,
		.cpu_name		= "403GCX",
958
		.cpu_features		= CPU_FTRS_40X,
959 960
		.cpu_user_features	= PPC_FEATURE_32 |
		 	PPC_FEATURE_HAS_MMU | PPC_FEATURE_NO_TB,
L
Linus Torvalds 已提交
961 962
		.icache_bsize		= 16,
		.dcache_bsize		= 16,
963
		.platform		= "ppc403",
L
Linus Torvalds 已提交
964 965 966 967 968
	},
	{	/* 403G ?? */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00200000,
		.cpu_name		= "403G ??",
969
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
970 971 972
		.cpu_user_features	= PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
		.icache_bsize		= 16,
		.dcache_bsize		= 16,
973
		.platform		= "ppc403",
L
Linus Torvalds 已提交
974 975 976 977 978
	},
	{	/* 405GP */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x40110000,
		.cpu_name		= "405GP",
979
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
980 981 982 983
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
984
		.platform		= "ppc405",
L
Linus Torvalds 已提交
985 986 987 988 989
	},
	{	/* STB 03xxx */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x40130000,
		.cpu_name		= "STB03xxx",
990
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
991 992 993 994
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
995
		.platform		= "ppc405",
L
Linus Torvalds 已提交
996 997 998 999 1000
	},
	{	/* STB 04xxx */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x41810000,
		.cpu_name		= "STB04xxx",
1001
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
1002 1003 1004 1005
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1006
		.platform		= "ppc405",
L
Linus Torvalds 已提交
1007 1008 1009 1010 1011
	},
	{	/* NP405L */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x41610000,
		.cpu_name		= "NP405L",
1012
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
1013 1014 1015 1016
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1017
		.platform		= "ppc405",
L
Linus Torvalds 已提交
1018 1019 1020 1021 1022
	},
	{	/* NP4GS3 */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x40B10000,
		.cpu_name		= "NP4GS3",
1023
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
1024 1025 1026 1027
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1028
		.platform		= "ppc405",
L
Linus Torvalds 已提交
1029 1030 1031 1032 1033
	},
	{   /* NP405H */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x41410000,
		.cpu_name		= "NP405H",
1034
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
1035 1036 1037 1038
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1039
		.platform		= "ppc405",
L
Linus Torvalds 已提交
1040 1041 1042 1043 1044
	},
	{	/* 405GPr */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x50910000,
		.cpu_name		= "405GPr",
1045
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
1046 1047 1048 1049
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1050
		.platform		= "ppc405",
L
Linus Torvalds 已提交
1051 1052 1053 1054 1055
	},
	{   /* STBx25xx */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x51510000,
		.cpu_name		= "STBx25xx",
1056
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
1057 1058 1059 1060
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1061
		.platform		= "ppc405",
L
Linus Torvalds 已提交
1062 1063 1064 1065 1066
	},
	{	/* 405LP */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x41F10000,
		.cpu_name		= "405LP",
1067
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
1068 1069 1070
		.cpu_user_features	= PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1071
		.platform		= "ppc405",
L
Linus Torvalds 已提交
1072 1073
	},
	{	/* Xilinx Virtex-II Pro  */
1074
		.pvr_mask		= 0xfffff000,
L
Linus Torvalds 已提交
1075 1076
		.pvr_value		= 0x20010000,
		.cpu_name		= "Virtex-II Pro",
1077
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
1078 1079 1080 1081
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1082
		.platform		= "ppc405",
L
Linus Torvalds 已提交
1083
	},
1084 1085 1086 1087 1088 1089 1090 1091 1092
	{	/* Xilinx Virtex-4 FX */
		.pvr_mask		= 0xfffff000,
		.pvr_value		= 0x20011000,
		.cpu_name		= "Virtex-4 FX",
		.cpu_features		= CPU_FTRS_40X,
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1093
		.platform		= "ppc405",
1094
	},
1095 1096 1097 1098
	{	/* 405EP */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x51210000,
		.cpu_name		= "405EP",
1099
		.cpu_features		= CPU_FTRS_40X,
1100 1101 1102 1103
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1104
		.platform		= "ppc405",
1105
	},
L
Linus Torvalds 已提交
1106 1107 1108

#endif /* CONFIG_40x */
#ifdef CONFIG_44x
M
Matt Porter 已提交
1109 1110 1111 1112
	{
		.pvr_mask		= 0xf0000fff,
		.pvr_value		= 0x40000850,
		.cpu_name		= "440EP Rev. A",
1113
		.cpu_features		= CPU_FTRS_44X,
1114
		.cpu_user_features	= COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
M
Matt Porter 已提交
1115 1116
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1117
		.cpu_setup		= __setup_cpu_440ep,
1118
		.platform		= "ppc440",
M
Matt Porter 已提交
1119 1120 1121 1122 1123
	},
	{
		.pvr_mask		= 0xf0000fff,
		.pvr_value		= 0x400008d3,
		.cpu_name		= "440EP Rev. B",
1124
		.cpu_features		= CPU_FTRS_44X,
1125
		.cpu_user_features	= COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
M
Matt Porter 已提交
1126 1127
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1128
		.cpu_setup		= __setup_cpu_440ep,
1129
		.platform		= "ppc440",
M
Matt Porter 已提交
1130
	},
1131 1132 1133 1134 1135 1136 1137 1138
	{ /* 440EPX */
		.pvr_mask		= 0xf0000ffb,
		.pvr_value		= 0x200008D0,
		.cpu_name		= "440EPX",
		.cpu_features		= CPU_FTRS_44X,
		.cpu_user_features	= COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1139 1140
		.cpu_setup		= __setup_cpu_440epx,
		.platform		= "ppc440",
1141 1142 1143 1144 1145 1146 1147 1148 1149
	},
	{ /* 440GRX */
		.pvr_mask		= 0xf0000ffb,
		.pvr_value		= 0x200008D8,
		.cpu_name		= "440GRX",
		.cpu_features		= CPU_FTRS_44X,
		.cpu_user_features	= COMMON_USER_BOOKE,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1150 1151
		.cpu_setup		= __setup_cpu_440grx,
		.platform		= "ppc440",
1152
	},
S
Stephen Rothwell 已提交
1153
	{	/* 440GP Rev. B */
L
Linus Torvalds 已提交
1154 1155 1156
		.pvr_mask		= 0xf0000fff,
		.pvr_value		= 0x40000440,
		.cpu_name		= "440GP Rev. B",
1157
		.cpu_features		= CPU_FTRS_44X,
1158
		.cpu_user_features	= COMMON_USER_BOOKE,
L
Linus Torvalds 已提交
1159 1160
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1161
		.platform		= "ppc440gp",
L
Linus Torvalds 已提交
1162
	},
S
Stephen Rothwell 已提交
1163
	{	/* 440GP Rev. C */
L
Linus Torvalds 已提交
1164 1165 1166
		.pvr_mask		= 0xf0000fff,
		.pvr_value		= 0x40000481,
		.cpu_name		= "440GP Rev. C",
1167
		.cpu_features		= CPU_FTRS_44X,
1168
		.cpu_user_features	= COMMON_USER_BOOKE,
L
Linus Torvalds 已提交
1169 1170
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1171
		.platform		= "ppc440gp",
L
Linus Torvalds 已提交
1172 1173 1174 1175 1176
	},
	{ /* 440GX Rev. A */
		.pvr_mask		= 0xf0000fff,
		.pvr_value		= 0x50000850,
		.cpu_name		= "440GX Rev. A",
1177
		.cpu_features		= CPU_FTRS_44X,
1178
		.cpu_user_features	= COMMON_USER_BOOKE,
L
Linus Torvalds 已提交
1179 1180
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1181
		.platform		= "ppc440",
L
Linus Torvalds 已提交
1182 1183 1184 1185 1186
	},
	{ /* 440GX Rev. B */
		.pvr_mask		= 0xf0000fff,
		.pvr_value		= 0x50000851,
		.cpu_name		= "440GX Rev. B",
1187
		.cpu_features		= CPU_FTRS_44X,
1188
		.cpu_user_features	= COMMON_USER_BOOKE,
L
Linus Torvalds 已提交
1189 1190
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1191
		.platform		= "ppc440",
L
Linus Torvalds 已提交
1192 1193 1194 1195 1196
	},
	{ /* 440GX Rev. C */
		.pvr_mask		= 0xf0000fff,
		.pvr_value		= 0x50000892,
		.cpu_name		= "440GX Rev. C",
1197
		.cpu_features		= CPU_FTRS_44X,
1198
		.cpu_user_features	= COMMON_USER_BOOKE,
L
Linus Torvalds 已提交
1199 1200
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1201
		.platform		= "ppc440",
L
Linus Torvalds 已提交
1202
	},
1203 1204 1205 1206
	{ /* 440GX Rev. F */
		.pvr_mask		= 0xf0000fff,
		.pvr_value		= 0x50000894,
		.cpu_name		= "440GX Rev. F",
1207
		.cpu_features		= CPU_FTRS_44X,
1208
		.cpu_user_features	= COMMON_USER_BOOKE,
1209 1210
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1211
		.platform		= "ppc440",
1212
	},
1213
	{ /* 440SP Rev. A */
1214 1215
		.pvr_mask		= 0xfff00fff,
		.pvr_value		= 0x53200891,
1216
		.cpu_name		= "440SP Rev. A",
1217
		.cpu_features		= CPU_FTRS_44X,
1218
		.cpu_user_features	= COMMON_USER_BOOKE,
1219 1220
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1221
		.platform		= "ppc440",
1222
	},
R
Roland Dreier 已提交
1223
	{ /* 440SPe Rev. A */
1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236
		.pvr_mask               = 0xfff00fff,
		.pvr_value              = 0x53400890,
		.cpu_name               = "440SPe Rev. A",
		.cpu_features		= CPU_FTRS_44X,
		.cpu_user_features      = COMMON_USER_BOOKE,
		.icache_bsize           = 32,
		.dcache_bsize           = 32,
		.platform               = "ppc440",
	},
	{ /* 440SPe Rev. B */
		.pvr_mask		= 0xfff00fff,
		.pvr_value		= 0x53400891,
		.cpu_name		= "440SPe Rev. B",
K
Kumar Gala 已提交
1237
		.cpu_features		= CPU_FTRS_44X,
1238
		.cpu_user_features	= COMMON_USER_BOOKE,
R
Roland Dreier 已提交
1239 1240
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1241
		.platform		= "ppc440",
R
Roland Dreier 已提交
1242
	},
L
Linus Torvalds 已提交
1243
#endif /* CONFIG_44x */
1244
#ifdef CONFIG_FSL_BOOKE
S
Stephen Rothwell 已提交
1245
	{	/* e200z5 */
1246 1247 1248 1249
		.pvr_mask		= 0xfff00000,
		.pvr_value		= 0x81000000,
		.cpu_name		= "e200z5",
		/* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1250
		.cpu_features		= CPU_FTRS_E200,
1251 1252
		.cpu_user_features	= COMMON_USER_BOOKE |
			PPC_FEATURE_HAS_EFP_SINGLE |
1253 1254
			PPC_FEATURE_UNIFIED_CACHE,
		.dcache_bsize		= 32,
1255
		.platform		= "ppc5554",
1256
	},
S
Stephen Rothwell 已提交
1257
	{	/* e200z6 */
1258 1259 1260 1261
		.pvr_mask		= 0xfff00000,
		.pvr_value		= 0x81100000,
		.cpu_name		= "e200z6",
		/* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1262
		.cpu_features		= CPU_FTRS_E200,
1263
		.cpu_user_features	= COMMON_USER_BOOKE |
1264 1265
			PPC_FEATURE_HAS_SPE_COMP |
			PPC_FEATURE_HAS_EFP_SINGLE_COMP |
1266 1267
			PPC_FEATURE_UNIFIED_CACHE,
		.dcache_bsize		= 32,
1268
		.platform		= "ppc5554",
1269
	},
S
Stephen Rothwell 已提交
1270
	{	/* e500 */
L
Linus Torvalds 已提交
1271 1272 1273 1274
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x80200000,
		.cpu_name		= "e500",
		/* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1275
		.cpu_features		= CPU_FTRS_E500,
1276
		.cpu_user_features	= COMMON_USER_BOOKE |
1277 1278
			PPC_FEATURE_HAS_SPE_COMP |
			PPC_FEATURE_HAS_EFP_SINGLE_COMP,
L
Linus Torvalds 已提交
1279 1280 1281
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
1282
		.oprofile_cpu_type	= "ppc/e500",
1283
		.oprofile_type		= PPC_OPROFILE_BOOKE,
1284
		.platform		= "ppc8540",
L
Linus Torvalds 已提交
1285
	},
S
Stephen Rothwell 已提交
1286
	{	/* e500v2 */
1287 1288 1289 1290
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x80210000,
		.cpu_name		= "e500v2",
		/* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1291
		.cpu_features		= CPU_FTRS_E500_2,
1292
		.cpu_user_features	= COMMON_USER_BOOKE |
1293 1294 1295
			PPC_FEATURE_HAS_SPE_COMP |
			PPC_FEATURE_HAS_EFP_SINGLE_COMP |
			PPC_FEATURE_HAS_EFP_DOUBLE_COMP,
1296 1297 1298
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
1299
		.oprofile_cpu_type	= "ppc/e500",
1300
		.oprofile_type		= PPC_OPROFILE_BOOKE,
1301
		.platform		= "ppc8548",
1302
	},
L
Linus Torvalds 已提交
1303 1304 1305 1306 1307 1308
#endif
#if !CLASSIC_PPC
	{	/* default match */
		.pvr_mask		= 0x00000000,
		.pvr_value		= 0x00000000,
		.cpu_name		= "(generic PPC)",
1309
		.cpu_features		= CPU_FTRS_GENERIC_32,
L
Linus Torvalds 已提交
1310 1311 1312
		.cpu_user_features	= PPC_FEATURE_32,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1313
		.platform		= "powerpc",
L
Linus Torvalds 已提交
1314 1315
	}
#endif /* !CLASSIC_PPC */
S
Stephen Rothwell 已提交
1316
#endif /* CONFIG_PPC32 */
L
Linus Torvalds 已提交
1317
};
1318

1319
struct cpu_spec *identify_cpu(unsigned long offset, unsigned int pvr)
1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330
{
	struct cpu_spec *s = cpu_specs;
	struct cpu_spec **cur = &cur_cpu_spec;
	int i;

	s = PTRRELOC(s);
	cur = PTRRELOC(cur);

	for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++)
		if ((pvr & s->pvr_mask) == s->pvr_value) {
			*cur = cpu_specs + i;
1331 1332 1333 1334
#if defined(CONFIG_PPC64) || defined(CONFIG_BOOKE)
			/* ppc64 and booke expect identify_cpu to also call 
			 * setup_cpu for that processor. I will consolidate
			 * that at a later time, for now, just use #ifdef.
1335
			 * we also don't need to PTRRELOC the function pointer
1336 1337
			 * on ppc64 and booke as we are running at 0 in real
			 * mode on ppc64 and reloc_offset is always 0 on booke.
1338 1339 1340 1341
			 */
			if (s->cpu_setup) {
				s->cpu_setup(offset, s);
			}
1342
#endif /* CONFIG_PPC64 || CONFIG_BOOKE */
1343 1344 1345 1346 1347 1348
			return s;
		}
	BUG();
	return NULL;
}

1349
void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end)
1350 1351 1352 1353
{
	struct fixup_entry {
		unsigned long	mask;
		unsigned long	value;
1354 1355
		long		start_off;
		long		end_off;
1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369
	} *fcur, *fend;

	fcur = fixup_start;
	fend = fixup_end;

	for (; fcur < fend; fcur++) {
		unsigned int *pstart, *pend, *p;

		if ((value & fcur->mask) == fcur->value)
			continue;

		/* These PTRRELOCs will disappear once the new scheme for
		 * modules and vdso is implemented
		 */
1370 1371
		pstart = ((unsigned int *)fcur) + (fcur->start_off / 4);
		pend = ((unsigned int *)fcur) + (fcur->end_off / 4);
1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382

		for (p = pstart; p < pend; p++) {
			*p = 0x60000000u;
			asm volatile ("dcbst 0, %0" : : "r" (p));
		}
		asm volatile ("sync" : : : "memory");
		for (p = pstart; p < pend; p++)
			asm volatile ("icbi 0,%0" : : "r" (p));
		asm volatile ("sync; isync" : : : "memory");
	}
}