cputable.c 34.2 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,
S
Stephen Rothwell 已提交
228
		.oprofile_cpu_type	= "ppc64/970",
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
	{	/* Power6 */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x003e0000,
		.cpu_name		= "POWER6",
		.cpu_features		= CPU_FTRS_POWER6,
		.cpu_user_features	= COMMON_USER_POWER6,
		.icache_bsize		= 128,
		.dcache_bsize		= 128,
A
Anton Blanchard 已提交
288
		.num_pmcs		= 6,
289 290
		.oprofile_cpu_type	= "ppc64/power6",
		.oprofile_type		= PPC_OPROFILE_POWER4,
291 292 293 294
 		.oprofile_mmcra_sihv	= POWER6_MMCRA_SIHV,
 		.oprofile_mmcra_sipr	= POWER6_MMCRA_SIPR,
 		.oprofile_mmcra_clear	= POWER6_MMCRA_THRM |
 			POWER6_MMCRA_OTHER,
295 296
		.platform		= "power6",
	},
297
	{	/* Cell Broadband Engine */
S
Stephen Rothwell 已提交
298 299 300 301 302
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00700000,
		.cpu_name		= "Cell Broadband Engine",
		.cpu_features		= CPU_FTRS_CELL,
		.cpu_user_features	= COMMON_USER_PPC64 |
303 304
			PPC_FEATURE_CELL | PPC_FEATURE_HAS_ALTIVEC_COMP |
			PPC_FEATURE_SMT,
S
Stephen Rothwell 已提交
305 306
		.icache_bsize		= 128,
		.dcache_bsize		= 128,
307 308 309
		.num_pmcs		= 4,
		.oprofile_cpu_type	= "ppc64/cell-be",
		.oprofile_type		= PPC_OPROFILE_CELL,
310
		.platform		= "ppc-cell-be",
S
Stephen Rothwell 已提交
311
	},
312 313 314 315 316 317 318 319 320 321 322
	{	/* 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 已提交
323 324 325 326 327 328 329 330 331
	{	/* 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,
332
		.platform		= "power4",
S
Stephen Rothwell 已提交
333 334 335
	}
#endif	/* CONFIG_PPC64 */
#ifdef CONFIG_PPC32
L
Linus Torvalds 已提交
336
#if CLASSIC_PPC
S
Stephen Rothwell 已提交
337
	{	/* 601 */
L
Linus Torvalds 已提交
338 339 340
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00010000,
		.cpu_name		= "601",
341
		.cpu_features		= CPU_FTRS_PPC601,
S
Stephen Rothwell 已提交
342
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_601_INSTR |
343
			PPC_FEATURE_UNIFIED_CACHE | PPC_FEATURE_NO_TB,
L
Linus Torvalds 已提交
344 345
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
346
		.platform		= "ppc601",
L
Linus Torvalds 已提交
347 348 349 350 351
	},
	{	/* 603 */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00030000,
		.cpu_name		= "603",
352
		.cpu_features		= CPU_FTRS_603,
353
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
354 355
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
356 357
		.cpu_setup		= __setup_cpu_603,
		.platform		= "ppc603",
L
Linus Torvalds 已提交
358 359 360 361 362
	},
	{	/* 603e */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00060000,
		.cpu_name		= "603e",
363
		.cpu_features		= CPU_FTRS_603,
364
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
365 366
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
367 368
		.cpu_setup		= __setup_cpu_603,
		.platform		= "ppc603",
L
Linus Torvalds 已提交
369 370 371 372 373
	},
	{	/* 603ev */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00070000,
		.cpu_name		= "603ev",
374
		.cpu_features		= CPU_FTRS_603,
375
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
376 377
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
378 379
		.cpu_setup		= __setup_cpu_603,
		.platform		= "ppc603",
L
Linus Torvalds 已提交
380 381 382 383 384
	},
	{	/* 604 */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00040000,
		.cpu_name		= "604",
385
		.cpu_features		= CPU_FTRS_604,
386
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
387 388 389
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 2,
390 391
		.cpu_setup		= __setup_cpu_604,
		.platform		= "ppc604",
L
Linus Torvalds 已提交
392 393 394 395 396
	},
	{	/* 604e */
		.pvr_mask		= 0xfffff000,
		.pvr_value		= 0x00090000,
		.cpu_name		= "604e",
397
		.cpu_features		= CPU_FTRS_604,
398
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
399 400 401
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
402 403
		.cpu_setup		= __setup_cpu_604,
		.platform		= "ppc604",
L
Linus Torvalds 已提交
404 405 406 407 408
	},
	{	/* 604r */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00090000,
		.cpu_name		= "604r",
409
		.cpu_features		= CPU_FTRS_604,
410
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
411 412 413
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
414 415
		.cpu_setup		= __setup_cpu_604,
		.platform		= "ppc604",
L
Linus Torvalds 已提交
416 417 418 419 420
	},
	{	/* 604ev */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x000a0000,
		.cpu_name		= "604ev",
421
		.cpu_features		= CPU_FTRS_604,
422
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
423 424 425
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
426 427
		.cpu_setup		= __setup_cpu_604,
		.platform		= "ppc604",
L
Linus Torvalds 已提交
428 429 430 431 432
	},
	{	/* 740/750 (0x4202, don't support TAU ?) */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x00084202,
		.cpu_name		= "740/750",
433
		.cpu_features		= CPU_FTRS_740_NOTAU,
434
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
435 436 437
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
438 439
		.cpu_setup		= __setup_cpu_750,
		.platform		= "ppc750",
L
Linus Torvalds 已提交
440 441 442 443 444
	},
	{	/* 750CX (80100 and 8010x?) */
		.pvr_mask		= 0xfffffff0,
		.pvr_value		= 0x00080100,
		.cpu_name		= "750CX",
445
		.cpu_features		= CPU_FTRS_750,
446
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
447 448 449
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
450 451
		.cpu_setup		= __setup_cpu_750cx,
		.platform		= "ppc750",
L
Linus Torvalds 已提交
452 453 454 455 456
	},
	{	/* 750CX (82201 and 82202) */
		.pvr_mask		= 0xfffffff0,
		.pvr_value		= 0x00082200,
		.cpu_name		= "750CX",
457
		.cpu_features		= CPU_FTRS_750,
458
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
459 460 461
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
462 463
		.cpu_setup		= __setup_cpu_750cx,
		.platform		= "ppc750",
L
Linus Torvalds 已提交
464 465 466 467 468
	},
	{	/* 750CXe (82214) */
		.pvr_mask		= 0xfffffff0,
		.pvr_value		= 0x00082210,
		.cpu_name		= "750CXe",
469
		.cpu_features		= CPU_FTRS_750,
470
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
471 472 473
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
474 475
		.cpu_setup		= __setup_cpu_750cx,
		.platform		= "ppc750",
L
Linus Torvalds 已提交
476
	},
477 478 479 480
	{	/* 750CXe "Gekko" (83214) */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x00083214,
		.cpu_name		= "750CXe",
481
		.cpu_features		= CPU_FTRS_750,
482
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
483 484 485
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
486 487
		.cpu_setup		= __setup_cpu_750cx,
		.platform		= "ppc750",
488
	},
489 490 491 492
	{	/* 745/755 */
		.pvr_mask		= 0xfffff000,
		.pvr_value		= 0x00083000,
		.cpu_name		= "745/755",
493
		.cpu_features		= CPU_FTRS_750,
494
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
495 496 497
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
498 499
		.cpu_setup		= __setup_cpu_750,
		.platform		= "ppc750",
500
	},
L
Linus Torvalds 已提交
501 502 503 504
	{	/* 750FX rev 1.x */
		.pvr_mask		= 0xffffff00,
		.pvr_value		= 0x70000100,
		.cpu_name		= "750FX",
505
		.cpu_features		= CPU_FTRS_750FX1,
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_750,
		.platform		= "ppc750",
L
Linus Torvalds 已提交
512 513 514 515 516
	},
	{	/* 750FX rev 2.0 must disable HID0[DPM] */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x70000200,
		.cpu_name		= "750FX",
517
		.cpu_features		= CPU_FTRS_750FX2,
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
	},
	{	/* 750FX (All revs except 2.0) */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x70000000,
		.cpu_name		= "750FX",
529
		.cpu_features		= CPU_FTRS_750FX,
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_750fx,
		.platform		= "ppc750",
L
Linus Torvalds 已提交
536 537 538 539 540
	},
	{	/* 750GX */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x70020000,
		.cpu_name		= "750GX",
541
		.cpu_features		= CPU_FTRS_750GX,
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_750fx,
		.platform		= "ppc750",
L
Linus Torvalds 已提交
548 549 550 551 552
	},
	{	/* 740/750 (L2CR bit need fixup for 740) */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00080000,
		.cpu_name		= "740/750",
553
		.cpu_features		= CPU_FTRS_740,
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_750,
		.platform		= "ppc750",
L
Linus Torvalds 已提交
560 561 562 563 564
	},
	{	/* 7400 rev 1.1 ? (no TAU) */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x000c1101,
		.cpu_name		= "7400 (1.1)",
565
		.cpu_features		= CPU_FTRS_7400_NOTAU,
566 567
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
568 569 570
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
571 572
		.cpu_setup		= __setup_cpu_7400,
		.platform		= "ppc7400",
L
Linus Torvalds 已提交
573 574 575 576 577
	},
	{	/* 7400 */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x000c0000,
		.cpu_name		= "7400",
578
		.cpu_features		= CPU_FTRS_7400,
579 580
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
581 582 583
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
584 585
		.cpu_setup		= __setup_cpu_7400,
		.platform		= "ppc7400",
L
Linus Torvalds 已提交
586 587 588 589 590
	},
	{	/* 7410 */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x800c0000,
		.cpu_name		= "7410",
591
		.cpu_features		= CPU_FTRS_7400,
592 593
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
594 595 596
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
597 598
		.cpu_setup		= __setup_cpu_7410,
		.platform		= "ppc7400",
L
Linus Torvalds 已提交
599 600 601 602 603
	},
	{	/* 7450 2.0 - no doze/nap */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x80000200,
		.cpu_name		= "7450",
604
		.cpu_features		= CPU_FTRS_7450_20,
605 606
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
607 608 609
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
610 611
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
612
		.oprofile_type		= PPC_OPROFILE_G4,
613
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
614 615 616 617 618
	},
	{	/* 7450 2.1 */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x80000201,
		.cpu_name		= "7450",
619
		.cpu_features		= CPU_FTRS_7450_21,
620 621
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
622 623 624
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
625 626
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
627
		.oprofile_type		= PPC_OPROFILE_G4,
628
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
629 630 631 632 633
	},
	{	/* 7450 2.3 and newer */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x80000000,
		.cpu_name		= "7450",
634
		.cpu_features		= CPU_FTRS_7450_23,
635 636
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
637 638 639
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
640 641
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
642
		.oprofile_type		= PPC_OPROFILE_G4,
643
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
644 645 646 647 648
	},
	{	/* 7455 rev 1.x */
		.pvr_mask		= 0xffffff00,
		.pvr_value		= 0x80010100,
		.cpu_name		= "7455",
649
		.cpu_features		= CPU_FTRS_7455_1,
650 651
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
652 653 654
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
655 656
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
657
		.oprofile_type		= PPC_OPROFILE_G4,
658
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
659 660 661 662 663
	},
	{	/* 7455 rev 2.0 */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x80010200,
		.cpu_name		= "7455",
664
		.cpu_features		= CPU_FTRS_7455_20,
665 666
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
667 668 669
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
670 671
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
672
		.oprofile_type		= PPC_OPROFILE_G4,
673
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
674 675 676 677 678
	},
	{	/* 7455 others */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x80010000,
		.cpu_name		= "7455",
679
		.cpu_features		= CPU_FTRS_7455,
680 681
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
682 683 684
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
685 686
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
687
		.oprofile_type		= PPC_OPROFILE_G4,
688
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
689 690 691 692 693
	},
	{	/* 7447/7457 Rev 1.0 */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x80020100,
		.cpu_name		= "7447/7457",
694
		.cpu_features		= CPU_FTRS_7447_10,
695 696
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
697 698 699
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
700 701
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
702
		.oprofile_type		= PPC_OPROFILE_G4,
703
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
704 705 706 707 708
	},
	{	/* 7447/7457 Rev 1.1 */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x80020101,
		.cpu_name		= "7447/7457",
709
		.cpu_features		= CPU_FTRS_7447_10,
710 711
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
712 713 714
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
715 716
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
717
		.oprofile_type		= PPC_OPROFILE_G4,
718
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
719 720 721 722 723
	},
	{	/* 7447/7457 Rev 1.2 and later */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x80020000,
		.cpu_name		= "7447/7457",
724
		.cpu_features		= CPU_FTRS_7447,
725
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
726 727 728
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
729 730
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
731
		.oprofile_type		= PPC_OPROFILE_G4,
732
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
733 734 735 736 737
	},
	{	/* 7447A */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x80030000,
		.cpu_name		= "7447A",
738
		.cpu_features		= CPU_FTRS_7447A,
739 740
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
741 742 743
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
744 745
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
746
		.oprofile_type		= PPC_OPROFILE_G4,
747
		.platform		= "ppc7450",
748 749 750 751 752
	},
	{	/* 7448 */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x80040000,
		.cpu_name		= "7448",
753
		.cpu_features		= CPU_FTRS_7447A,
754 755
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
756 757 758
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
759 760
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
761
		.oprofile_type		= PPC_OPROFILE_G4,
762
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
763 764 765 766 767
	},
	{	/* 82xx (8240, 8245, 8260 are all 603e cores) */
		.pvr_mask		= 0x7fff0000,
		.pvr_value		= 0x00810000,
		.cpu_name		= "82xx",
768
		.cpu_features		= CPU_FTRS_82XX,
S
Stephen Rothwell 已提交
769
		.cpu_user_features	= COMMON_USER,
L
Linus Torvalds 已提交
770 771
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
772 773
		.cpu_setup		= __setup_cpu_603,
		.platform		= "ppc603",
L
Linus Torvalds 已提交
774 775 776 777 778
	},
	{	/* All G2_LE (603e core, plus some) have the same pvr */
		.pvr_mask		= 0x7fff0000,
		.pvr_value		= 0x00820000,
		.cpu_name		= "G2_LE",
779
		.cpu_features		= CPU_FTRS_G2_LE,
S
Stephen Rothwell 已提交
780
		.cpu_user_features	= COMMON_USER,
L
Linus Torvalds 已提交
781 782
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
783 784
		.cpu_setup		= __setup_cpu_603,
		.platform		= "ppc603",
L
Linus Torvalds 已提交
785
	},
786
	{	/* e300c1 (a 603e core, plus some) on 83xx */
L
Linus Torvalds 已提交
787 788
		.pvr_mask		= 0x7fff0000,
		.pvr_value		= 0x00830000,
789
		.cpu_name		= "e300c1",
790
		.cpu_features		= CPU_FTRS_E300,
S
Stephen Rothwell 已提交
791
		.cpu_user_features	= COMMON_USER,
L
Linus Torvalds 已提交
792 793
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
794 795
		.cpu_setup		= __setup_cpu_603,
		.platform		= "ppc603",
L
Linus Torvalds 已提交
796
	},
797 798 799 800 801 802 803 804 805 806 807
	{	/* 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",
	},
L
Linus Torvalds 已提交
808 809 810 811
	{	/* default match, we assume split I/D cache & TB (non-601)... */
		.pvr_mask		= 0x00000000,
		.pvr_value		= 0x00000000,
		.cpu_name		= "(generic PPC)",
812
		.cpu_features		= CPU_FTRS_CLASSIC32,
S
Stephen Rothwell 已提交
813
		.cpu_user_features	= COMMON_USER,
L
Linus Torvalds 已提交
814 815
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
816
		.platform		= "ppc603",
L
Linus Torvalds 已提交
817 818 819 820 821 822 823 824 825
	},
#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.... */
826
		.cpu_features		= CPU_FTRS_8XX,
L
Linus Torvalds 已提交
827 828 829
		.cpu_user_features	= PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
		.icache_bsize		= 16,
		.dcache_bsize		= 16,
830
		.platform		= "ppc823",
L
Linus Torvalds 已提交
831 832 833 834 835 836 837
	},
#endif /* CONFIG_8xx */
#ifdef CONFIG_40x
	{	/* 403GC */
		.pvr_mask		= 0xffffff00,
		.pvr_value		= 0x00200200,
		.cpu_name		= "403GC",
838
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
839 840 841
		.cpu_user_features	= PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
		.icache_bsize		= 16,
		.dcache_bsize		= 16,
842
		.platform		= "ppc403",
L
Linus Torvalds 已提交
843 844 845 846 847
	},
	{	/* 403GCX */
		.pvr_mask		= 0xffffff00,
		.pvr_value		= 0x00201400,
		.cpu_name		= "403GCX",
848
		.cpu_features		= CPU_FTRS_40X,
849 850
		.cpu_user_features	= PPC_FEATURE_32 |
		 	PPC_FEATURE_HAS_MMU | PPC_FEATURE_NO_TB,
L
Linus Torvalds 已提交
851 852
		.icache_bsize		= 16,
		.dcache_bsize		= 16,
853
		.platform		= "ppc403",
L
Linus Torvalds 已提交
854 855 856 857 858
	},
	{	/* 403G ?? */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00200000,
		.cpu_name		= "403G ??",
859
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
860 861 862
		.cpu_user_features	= PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
		.icache_bsize		= 16,
		.dcache_bsize		= 16,
863
		.platform		= "ppc403",
L
Linus Torvalds 已提交
864 865 866 867 868
	},
	{	/* 405GP */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x40110000,
		.cpu_name		= "405GP",
869
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
870 871 872 873
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
874
		.platform		= "ppc405",
L
Linus Torvalds 已提交
875 876 877 878 879
	},
	{	/* STB 03xxx */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x40130000,
		.cpu_name		= "STB03xxx",
880
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
881 882 883 884
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
885
		.platform		= "ppc405",
L
Linus Torvalds 已提交
886 887 888 889 890
	},
	{	/* STB 04xxx */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x41810000,
		.cpu_name		= "STB04xxx",
891
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
892 893 894 895
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
896
		.platform		= "ppc405",
L
Linus Torvalds 已提交
897 898 899 900 901
	},
	{	/* NP405L */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x41610000,
		.cpu_name		= "NP405L",
902
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
903 904 905 906
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
907
		.platform		= "ppc405",
L
Linus Torvalds 已提交
908 909 910 911 912
	},
	{	/* NP4GS3 */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x40B10000,
		.cpu_name		= "NP4GS3",
913
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
914 915 916 917
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
918
		.platform		= "ppc405",
L
Linus Torvalds 已提交
919 920 921 922 923
	},
	{   /* NP405H */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x41410000,
		.cpu_name		= "NP405H",
924
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
925 926 927 928
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
929
		.platform		= "ppc405",
L
Linus Torvalds 已提交
930 931 932 933 934
	},
	{	/* 405GPr */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x50910000,
		.cpu_name		= "405GPr",
935
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
936 937 938 939
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
940
		.platform		= "ppc405",
L
Linus Torvalds 已提交
941 942 943 944 945
	},
	{   /* STBx25xx */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x51510000,
		.cpu_name		= "STBx25xx",
946
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
947 948 949 950
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
951
		.platform		= "ppc405",
L
Linus Torvalds 已提交
952 953 954 955 956
	},
	{	/* 405LP */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x41F10000,
		.cpu_name		= "405LP",
957
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
958 959 960
		.cpu_user_features	= PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
961
		.platform		= "ppc405",
L
Linus Torvalds 已提交
962 963
	},
	{	/* Xilinx Virtex-II Pro  */
964
		.pvr_mask		= 0xfffff000,
L
Linus Torvalds 已提交
965 966
		.pvr_value		= 0x20010000,
		.cpu_name		= "Virtex-II Pro",
967
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
968 969 970 971
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
972
		.platform		= "ppc405",
L
Linus Torvalds 已提交
973
	},
974 975 976 977 978 979 980 981 982
	{	/* 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,
983
		.platform		= "ppc405",
984
	},
985 986 987 988
	{	/* 405EP */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x51210000,
		.cpu_name		= "405EP",
989
		.cpu_features		= CPU_FTRS_40X,
990 991 992 993
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
994
		.platform		= "ppc405",
995
	},
L
Linus Torvalds 已提交
996 997 998

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

struct cpu_spec *identify_cpu(unsigned long offset)
{
	struct cpu_spec *s = cpu_specs;
	struct cpu_spec **cur = &cur_cpu_spec;
	unsigned int pvr = mfspr(SPRN_PVR);
	int i;

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

	if (*cur != NULL)
		return 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;
}

1209
void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end)
1210 1211 1212 1213
{
	struct fixup_entry {
		unsigned long	mask;
		unsigned long	value;
1214 1215
		long		start_off;
		long		end_off;
1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229
	} *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
		 */
1230 1231
		pstart = ((unsigned int *)fcur) + (fcur->start_off / 4);
		pend = ((unsigned int *)fcur) + (fcur->end_off / 4);
1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242

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