cputable.c 38.3 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 36 37 38 39 40 41
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 已提交
42
#endif /* CONFIG_PPC32 */
O
Olof Johansson 已提交
43
#ifdef CONFIG_PPC64
44
extern void __setup_cpu_ppc970(unsigned long offset, struct cpu_spec* spec);
45
extern void __setup_cpu_ppc970MP(unsigned long offset, struct cpu_spec* spec);
O
Olof Johansson 已提交
46
extern void __setup_cpu_pa6t(unsigned long offset, struct cpu_spec* spec);
S
Stephen Rothwell 已提交
47
extern void __restore_cpu_pa6t(void);
O
Olof Johansson 已提交
48 49
extern void __restore_cpu_ppc970(void);
#endif /* CONFIG_PPC64 */
L
Linus Torvalds 已提交
50 51 52 53

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

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

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

1310
struct cpu_spec *identify_cpu(unsigned long offset, unsigned int pvr)
1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321
{
	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;
1322 1323 1324 1325
#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.
1326
			 * we also don't need to PTRRELOC the function pointer
1327 1328
			 * on ppc64 and booke as we are running at 0 in real
			 * mode on ppc64 and reloc_offset is always 0 on booke.
1329 1330 1331 1332
			 */
			if (s->cpu_setup) {
				s->cpu_setup(offset, s);
			}
1333
#endif /* CONFIG_PPC64 || CONFIG_BOOKE */
1334 1335 1336 1337 1338 1339
			return s;
		}
	BUG();
	return NULL;
}

1340
void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end)
1341 1342 1343 1344
{
	struct fixup_entry {
		unsigned long	mask;
		unsigned long	value;
1345 1346
		long		start_off;
		long		end_off;
1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360
	} *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
		 */
1361 1362
		pstart = ((unsigned int *)fcur) + (fcur->start_off / 4);
		pend = ((unsigned int *)fcur) + (fcur->end_off / 4);
1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373

		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");
	}
}