cputable.c 36.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
extern void __setup_cpu_pa6t(unsigned long offset, struct cpu_spec* spec);
S
Stephen Rothwell 已提交
47
extern void __restore_cpu_pa6t(void);
O
Olof Johansson 已提交
48 49
extern void __restore_cpu_ppc970(void);
#endif /* CONFIG_PPC64 */
L
Linus Torvalds 已提交
50 51 52 53

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

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

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

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

1270
struct cpu_spec *identify_cpu(unsigned long offset, unsigned int pvr)
1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298
{
	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;
}

1299
void do_feature_fixups(unsigned long value, void *fixup_start, void *fixup_end)
1300 1301 1302 1303
{
	struct fixup_entry {
		unsigned long	mask;
		unsigned long	value;
1304 1305
		long		start_off;
		long		end_off;
1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319
	} *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
		 */
1320 1321
		pstart = ((unsigned int *)fcur) + (fcur->start_off / 4);
		pend = ((unsigned int *)fcur) + (fcur->end_off / 4);
1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332

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