cputable.c 35.5 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 47
extern void __restore_cpu_ppc970(void);
#endif /* CONFIG_PPC64 */
L
Linus Torvalds 已提交
48 49 50 51

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

/* We only set the spe features if the kernel was compiled with
 * spe support
 */
#ifdef CONFIG_SPE
S
Stephen Rothwell 已提交
73
#define PPC_FEATURE_SPE_COMP	PPC_FEATURE_HAS_SPE
L
Linus Torvalds 已提交
74
#else
S
Stephen Rothwell 已提交
75
#define PPC_FEATURE_SPE_COMP	0
L
Linus Torvalds 已提交
76 77
#endif

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

#endif /* CONFIG_40x */
#ifdef CONFIG_44x
M
Matt Porter 已提交
1045 1046 1047 1048
	{
		.pvr_mask		= 0xf0000fff,
		.pvr_value		= 0x40000850,
		.cpu_name		= "440EP Rev. A",
1049
		.cpu_features		= CPU_FTRS_44X,
1050
		.cpu_user_features	= COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
M
Matt Porter 已提交
1051 1052
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1053
		.platform		= "ppc440",
M
Matt Porter 已提交
1054 1055 1056 1057 1058
	},
	{
		.pvr_mask		= 0xf0000fff,
		.pvr_value		= 0x400008d3,
		.cpu_name		= "440EP Rev. B",
1059
		.cpu_features		= CPU_FTRS_44X,
1060
		.cpu_user_features	= COMMON_USER_BOOKE | PPC_FEATURE_HAS_FPU,
M
Matt Porter 已提交
1061 1062
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1063
		.platform		= "ppc440",
M
Matt Porter 已提交
1064
	},
S
Stephen Rothwell 已提交
1065
	{	/* 440GP Rev. B */
L
Linus Torvalds 已提交
1066 1067 1068
		.pvr_mask		= 0xf0000fff,
		.pvr_value		= 0x40000440,
		.cpu_name		= "440GP Rev. B",
1069
		.cpu_features		= CPU_FTRS_44X,
1070
		.cpu_user_features	= COMMON_USER_BOOKE,
L
Linus Torvalds 已提交
1071 1072
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1073
		.platform		= "ppc440gp",
L
Linus Torvalds 已提交
1074
	},
S
Stephen Rothwell 已提交
1075
	{	/* 440GP Rev. C */
L
Linus Torvalds 已提交
1076 1077 1078
		.pvr_mask		= 0xf0000fff,
		.pvr_value		= 0x40000481,
		.cpu_name		= "440GP Rev. C",
1079
		.cpu_features		= CPU_FTRS_44X,
1080
		.cpu_user_features	= COMMON_USER_BOOKE,
L
Linus Torvalds 已提交
1081 1082
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1083
		.platform		= "ppc440gp",
L
Linus Torvalds 已提交
1084 1085 1086 1087 1088
	},
	{ /* 440GX Rev. A */
		.pvr_mask		= 0xf0000fff,
		.pvr_value		= 0x50000850,
		.cpu_name		= "440GX Rev. A",
1089
		.cpu_features		= CPU_FTRS_44X,
1090
		.cpu_user_features	= COMMON_USER_BOOKE,
L
Linus Torvalds 已提交
1091 1092
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1093
		.platform		= "ppc440",
L
Linus Torvalds 已提交
1094 1095 1096 1097 1098
	},
	{ /* 440GX Rev. B */
		.pvr_mask		= 0xf0000fff,
		.pvr_value		= 0x50000851,
		.cpu_name		= "440GX Rev. B",
1099
		.cpu_features		= CPU_FTRS_44X,
1100
		.cpu_user_features	= COMMON_USER_BOOKE,
L
Linus Torvalds 已提交
1101 1102
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1103
		.platform		= "ppc440",
L
Linus Torvalds 已提交
1104 1105 1106 1107 1108
	},
	{ /* 440GX Rev. C */
		.pvr_mask		= 0xf0000fff,
		.pvr_value		= 0x50000892,
		.cpu_name		= "440GX Rev. C",
1109
		.cpu_features		= CPU_FTRS_44X,
1110
		.cpu_user_features	= COMMON_USER_BOOKE,
L
Linus Torvalds 已提交
1111 1112
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1113
		.platform		= "ppc440",
L
Linus Torvalds 已提交
1114
	},
1115 1116 1117 1118
	{ /* 440GX Rev. F */
		.pvr_mask		= 0xf0000fff,
		.pvr_value		= 0x50000894,
		.cpu_name		= "440GX Rev. F",
1119
		.cpu_features		= CPU_FTRS_44X,
1120
		.cpu_user_features	= COMMON_USER_BOOKE,
1121 1122
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1123
		.platform		= "ppc440",
1124
	},
1125 1126 1127 1128
	{ /* 440SP Rev. A */
		.pvr_mask		= 0xff000fff,
		.pvr_value		= 0x53000891,
		.cpu_name		= "440SP Rev. A",
1129
		.cpu_features		= CPU_FTRS_44X,
1130
		.cpu_user_features	= COMMON_USER_BOOKE,
1131 1132
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1133
		.platform		= "ppc440",
1134
	},
R
Roland Dreier 已提交
1135 1136 1137 1138 1139 1140
	{ /* 440SPe Rev. A */
		.pvr_mask		= 0xff000fff,
		.pvr_value		= 0x53000890,
		.cpu_name		= "440SPe Rev. A",
		.cpu_features		= CPU_FTR_SPLIT_ID_CACHE |
			CPU_FTR_USE_TB,
1141
		.cpu_user_features	= COMMON_USER_BOOKE,
R
Roland Dreier 已提交
1142 1143
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1144
		.platform		= "ppc440",
R
Roland Dreier 已提交
1145
	},
L
Linus Torvalds 已提交
1146
#endif /* CONFIG_44x */
1147
#ifdef CONFIG_FSL_BOOKE
S
Stephen Rothwell 已提交
1148
	{	/* e200z5 */
1149 1150 1151 1152
		.pvr_mask		= 0xfff00000,
		.pvr_value		= 0x81000000,
		.cpu_name		= "e200z5",
		/* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1153
		.cpu_features		= CPU_FTRS_E200,
1154 1155
		.cpu_user_features	= COMMON_USER_BOOKE |
			PPC_FEATURE_HAS_EFP_SINGLE |
1156 1157
			PPC_FEATURE_UNIFIED_CACHE,
		.dcache_bsize		= 32,
1158
		.platform		= "ppc5554",
1159
	},
S
Stephen Rothwell 已提交
1160
	{	/* e200z6 */
1161 1162 1163 1164
		.pvr_mask		= 0xfff00000,
		.pvr_value		= 0x81100000,
		.cpu_name		= "e200z6",
		/* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1165
		.cpu_features		= CPU_FTRS_E200,
1166 1167
		.cpu_user_features	= COMMON_USER_BOOKE |
			PPC_FEATURE_SPE_COMP |
1168 1169 1170
			PPC_FEATURE_HAS_EFP_SINGLE |
			PPC_FEATURE_UNIFIED_CACHE,
		.dcache_bsize		= 32,
1171
		.platform		= "ppc5554",
1172
	},
S
Stephen Rothwell 已提交
1173
	{	/* e500 */
L
Linus Torvalds 已提交
1174 1175 1176 1177
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x80200000,
		.cpu_name		= "e500",
		/* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1178
		.cpu_features		= CPU_FTRS_E500,
1179 1180
		.cpu_user_features	= COMMON_USER_BOOKE |
			PPC_FEATURE_SPE_COMP |
L
Linus Torvalds 已提交
1181 1182 1183 1184
			PPC_FEATURE_HAS_EFP_SINGLE,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
1185
		.oprofile_cpu_type	= "ppc/e500",
1186
		.oprofile_type		= PPC_OPROFILE_BOOKE,
1187
		.platform		= "ppc8540",
L
Linus Torvalds 已提交
1188
	},
S
Stephen Rothwell 已提交
1189
	{	/* e500v2 */
1190 1191 1192 1193
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x80210000,
		.cpu_name		= "e500v2",
		/* xxx - galak: add CPU_FTR_MAYBE_CAN_DOZE */
1194
		.cpu_features		= CPU_FTRS_E500_2,
1195 1196 1197 1198
		.cpu_user_features	= COMMON_USER_BOOKE |
			PPC_FEATURE_SPE_COMP |
			PPC_FEATURE_HAS_EFP_SINGLE |
			PPC_FEATURE_HAS_EFP_DOUBLE,
1199 1200 1201
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
1202
		.oprofile_cpu_type	= "ppc/e500",
1203
		.oprofile_type		= PPC_OPROFILE_BOOKE,
1204
		.platform		= "ppc8548",
1205
	},
L
Linus Torvalds 已提交
1206 1207 1208 1209 1210 1211
#endif
#if !CLASSIC_PPC
	{	/* default match */
		.pvr_mask		= 0x00000000,
		.pvr_value		= 0x00000000,
		.cpu_name		= "(generic PPC)",
1212
		.cpu_features		= CPU_FTRS_GENERIC_32,
L
Linus Torvalds 已提交
1213 1214 1215
		.cpu_user_features	= PPC_FEATURE_32,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1216
		.platform		= "powerpc",
L
Linus Torvalds 已提交
1217 1218
	}
#endif /* !CLASSIC_PPC */
S
Stephen Rothwell 已提交
1219
#endif /* CONFIG_PPC32 */
L
Linus Torvalds 已提交
1220
};
1221

1222
struct cpu_spec *identify_cpu(unsigned long offset, unsigned int pvr)
1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250
{
	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;
#ifdef CONFIG_PPC64
			/* ppc64 expects identify_cpu to also call setup_cpu
			 * for that processor. I will consolidate that at a
			 * later time, for now, just use our friend #ifdef.
			 * we also don't need to PTRRELOC the function pointer
			 * on ppc64 as we are running at 0 in real mode.
			 */
			if (s->cpu_setup) {
				s->cpu_setup(offset, s);
			}
#endif /* CONFIG_PPC64 */
			return s;
		}
	BUG();
	return NULL;
}

1251
void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end)
1252 1253 1254 1255
{
	struct fixup_entry {
		unsigned long	mask;
		unsigned long	value;
1256 1257
		long		start_off;
		long		end_off;
1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271
	} *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
		 */
1272 1273
		pstart = ((unsigned int *)fcur) + (fcur->start_off / 4);
		pend = ((unsigned int *)fcur) + (fcur->end_off / 4);
1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284

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