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

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

1238
struct cpu_spec *identify_cpu(unsigned long offset, unsigned int pvr)
1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266
{
	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;
}

1267
void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end)
1268 1269 1270 1271
{
	struct fixup_entry {
		unsigned long	mask;
		unsigned long	value;
1272 1273
		long		start_off;
		long		end_off;
1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287
	} *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
		 */
1288 1289
		pstart = ((unsigned int *)fcur) + (fcur->start_off / 4);
		pend = ((unsigned int *)fcur) + (fcur->end_off / 4);
1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300

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