cputable.c 37.0 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
		.oprofile_cpu_type	= "ppc64/pa6t",
		.oprofile_type		= PPC_OPROFILE_PA6T,
394 395
		.platform		= "pa6t",
	},
S
Stephen Rothwell 已提交
396 397 398 399 400 401 402 403 404
	{	/* 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,
405
		.pmc_type		= PPC_PMC_IBM,
406
		.platform		= "power4",
S
Stephen Rothwell 已提交
407 408 409
	}
#endif	/* CONFIG_PPC64 */
#ifdef CONFIG_PPC32
L
Linus Torvalds 已提交
410
#if CLASSIC_PPC
S
Stephen Rothwell 已提交
411
	{	/* 601 */
L
Linus Torvalds 已提交
412 413 414
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00010000,
		.cpu_name		= "601",
415
		.cpu_features		= CPU_FTRS_PPC601,
S
Stephen Rothwell 已提交
416
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_601_INSTR |
417
			PPC_FEATURE_UNIFIED_CACHE | PPC_FEATURE_NO_TB,
L
Linus Torvalds 已提交
418 419
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
420
		.platform		= "ppc601",
L
Linus Torvalds 已提交
421 422 423 424 425
	},
	{	/* 603 */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00030000,
		.cpu_name		= "603",
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
	},
	{	/* 603e */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00060000,
		.cpu_name		= "603e",
437
		.cpu_features		= CPU_FTRS_603,
438
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
439 440
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
441 442
		.cpu_setup		= __setup_cpu_603,
		.platform		= "ppc603",
L
Linus Torvalds 已提交
443 444 445 446 447
	},
	{	/* 603ev */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00070000,
		.cpu_name		= "603ev",
448
		.cpu_features		= CPU_FTRS_603,
449
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
450 451
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
452 453
		.cpu_setup		= __setup_cpu_603,
		.platform		= "ppc603",
L
Linus Torvalds 已提交
454 455 456 457 458
	},
	{	/* 604 */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00040000,
		.cpu_name		= "604",
459
		.cpu_features		= CPU_FTRS_604,
460
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
461 462 463
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 2,
464 465
		.cpu_setup		= __setup_cpu_604,
		.platform		= "ppc604",
L
Linus Torvalds 已提交
466 467 468 469 470
	},
	{	/* 604e */
		.pvr_mask		= 0xfffff000,
		.pvr_value		= 0x00090000,
		.cpu_name		= "604e",
471
		.cpu_features		= CPU_FTRS_604,
472
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
473 474 475
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
476 477
		.cpu_setup		= __setup_cpu_604,
		.platform		= "ppc604",
L
Linus Torvalds 已提交
478 479 480 481 482
	},
	{	/* 604r */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00090000,
		.cpu_name		= "604r",
483
		.cpu_features		= CPU_FTRS_604,
484
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
485 486 487
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
488 489
		.cpu_setup		= __setup_cpu_604,
		.platform		= "ppc604",
L
Linus Torvalds 已提交
490 491 492 493 494
	},
	{	/* 604ev */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x000a0000,
		.cpu_name		= "604ev",
495
		.cpu_features		= CPU_FTRS_604,
496
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
497 498 499
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
500 501
		.cpu_setup		= __setup_cpu_604,
		.platform		= "ppc604",
L
Linus Torvalds 已提交
502 503 504 505 506
	},
	{	/* 740/750 (0x4202, don't support TAU ?) */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x00084202,
		.cpu_name		= "740/750",
507
		.cpu_features		= CPU_FTRS_740_NOTAU,
508
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
509 510 511
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
512 513
		.cpu_setup		= __setup_cpu_750,
		.platform		= "ppc750",
L
Linus Torvalds 已提交
514 515 516 517 518
	},
	{	/* 750CX (80100 and 8010x?) */
		.pvr_mask		= 0xfffffff0,
		.pvr_value		= 0x00080100,
		.cpu_name		= "750CX",
519
		.cpu_features		= CPU_FTRS_750,
520
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
521 522 523
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
524 525
		.cpu_setup		= __setup_cpu_750cx,
		.platform		= "ppc750",
L
Linus Torvalds 已提交
526 527 528 529 530
	},
	{	/* 750CX (82201 and 82202) */
		.pvr_mask		= 0xfffffff0,
		.pvr_value		= 0x00082200,
		.cpu_name		= "750CX",
531
		.cpu_features		= CPU_FTRS_750,
532
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
533 534 535
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
536 537
		.cpu_setup		= __setup_cpu_750cx,
		.platform		= "ppc750",
L
Linus Torvalds 已提交
538 539 540 541 542
	},
	{	/* 750CXe (82214) */
		.pvr_mask		= 0xfffffff0,
		.pvr_value		= 0x00082210,
		.cpu_name		= "750CXe",
543
		.cpu_features		= CPU_FTRS_750,
544
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
545 546 547
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
548 549
		.cpu_setup		= __setup_cpu_750cx,
		.platform		= "ppc750",
L
Linus Torvalds 已提交
550
	},
551 552 553 554
	{	/* 750CXe "Gekko" (83214) */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x00083214,
		.cpu_name		= "750CXe",
555
		.cpu_features		= CPU_FTRS_750,
556
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
557 558 559
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
560 561
		.cpu_setup		= __setup_cpu_750cx,
		.platform		= "ppc750",
562
	},
J
Jake Moilanen 已提交
563 564 565 566
	{	/* 750CL */
		.pvr_mask		= 0xfffff0f0,
		.pvr_value		= 0x00087010,
		.cpu_name		= "750CL",
567
		.cpu_features		= CPU_FTRS_750CL,
J
Jake Moilanen 已提交
568 569 570 571
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
572
		.cpu_setup		= __setup_cpu_750,
J
Jake Moilanen 已提交
573 574
		.platform		= "ppc750",
	},
575 576 577 578
	{	/* 745/755 */
		.pvr_mask		= 0xfffff000,
		.pvr_value		= 0x00083000,
		.cpu_name		= "745/755",
579
		.cpu_features		= CPU_FTRS_750,
580
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
581 582 583
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
584 585
		.cpu_setup		= __setup_cpu_750,
		.platform		= "ppc750",
586
	},
L
Linus Torvalds 已提交
587 588 589 590
	{	/* 750FX rev 1.x */
		.pvr_mask		= 0xffffff00,
		.pvr_value		= 0x70000100,
		.cpu_name		= "750FX",
591
		.cpu_features		= CPU_FTRS_750FX1,
592
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
593 594 595
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
596 597
		.cpu_setup		= __setup_cpu_750,
		.platform		= "ppc750",
L
Linus Torvalds 已提交
598 599 600 601 602
	},
	{	/* 750FX rev 2.0 must disable HID0[DPM] */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x70000200,
		.cpu_name		= "750FX",
603
		.cpu_features		= CPU_FTRS_750FX2,
604
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
605 606 607
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
608 609
		.cpu_setup		= __setup_cpu_750,
		.platform		= "ppc750",
L
Linus Torvalds 已提交
610 611 612 613 614
	},
	{	/* 750FX (All revs except 2.0) */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x70000000,
		.cpu_name		= "750FX",
615
		.cpu_features		= CPU_FTRS_750FX,
616
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
617 618 619
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
620 621
		.cpu_setup		= __setup_cpu_750fx,
		.platform		= "ppc750",
L
Linus Torvalds 已提交
622 623 624 625 626
	},
	{	/* 750GX */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x70020000,
		.cpu_name		= "750GX",
627
		.cpu_features		= CPU_FTRS_750GX,
628
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
629 630 631
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
632 633
		.cpu_setup		= __setup_cpu_750fx,
		.platform		= "ppc750",
L
Linus Torvalds 已提交
634 635 636 637 638
	},
	{	/* 740/750 (L2CR bit need fixup for 740) */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00080000,
		.cpu_name		= "740/750",
639
		.cpu_features		= CPU_FTRS_740,
640
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
641 642 643
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
644 645
		.cpu_setup		= __setup_cpu_750,
		.platform		= "ppc750",
L
Linus Torvalds 已提交
646 647 648 649 650
	},
	{	/* 7400 rev 1.1 ? (no TAU) */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x000c1101,
		.cpu_name		= "7400 (1.1)",
651
		.cpu_features		= CPU_FTRS_7400_NOTAU,
652 653
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
654 655 656
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
657 658
		.cpu_setup		= __setup_cpu_7400,
		.platform		= "ppc7400",
L
Linus Torvalds 已提交
659 660 661 662 663
	},
	{	/* 7400 */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x000c0000,
		.cpu_name		= "7400",
664
		.cpu_features		= CPU_FTRS_7400,
665 666
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
667 668 669
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
670 671
		.cpu_setup		= __setup_cpu_7400,
		.platform		= "ppc7400",
L
Linus Torvalds 已提交
672 673 674 675 676
	},
	{	/* 7410 */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x800c0000,
		.cpu_name		= "7410",
677
		.cpu_features		= CPU_FTRS_7400,
678 679
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
680 681 682
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 4,
683 684
		.cpu_setup		= __setup_cpu_7410,
		.platform		= "ppc7400",
L
Linus Torvalds 已提交
685 686 687 688 689
	},
	{	/* 7450 2.0 - no doze/nap */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x80000200,
		.cpu_name		= "7450",
690
		.cpu_features		= CPU_FTRS_7450_20,
691 692
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
693 694 695
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
696 697
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
698
		.oprofile_type		= PPC_OPROFILE_G4,
699
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
700 701 702 703 704
	},
	{	/* 7450 2.1 */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x80000201,
		.cpu_name		= "7450",
705
		.cpu_features		= CPU_FTRS_7450_21,
706 707
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
708 709 710
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
711 712
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
713
		.oprofile_type		= PPC_OPROFILE_G4,
714
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
715 716 717 718 719
	},
	{	/* 7450 2.3 and newer */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x80000000,
		.cpu_name		= "7450",
720
		.cpu_features		= CPU_FTRS_7450_23,
721 722
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
723 724 725
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
726 727
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
728
		.oprofile_type		= PPC_OPROFILE_G4,
729
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
730 731 732 733 734
	},
	{	/* 7455 rev 1.x */
		.pvr_mask		= 0xffffff00,
		.pvr_value		= 0x80010100,
		.cpu_name		= "7455",
735
		.cpu_features		= CPU_FTRS_7455_1,
736 737
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
738 739 740
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
741 742
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
743
		.oprofile_type		= PPC_OPROFILE_G4,
744
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
745 746 747 748 749
	},
	{	/* 7455 rev 2.0 */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x80010200,
		.cpu_name		= "7455",
750
		.cpu_features		= CPU_FTRS_7455_20,
751 752
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
753 754 755
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
756 757
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
758
		.oprofile_type		= PPC_OPROFILE_G4,
759
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
760 761 762 763 764
	},
	{	/* 7455 others */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x80010000,
		.cpu_name		= "7455",
765
		.cpu_features		= CPU_FTRS_7455,
766 767
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
768 769 770
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
771 772
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
773
		.oprofile_type		= PPC_OPROFILE_G4,
774
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
775 776 777 778 779
	},
	{	/* 7447/7457 Rev 1.0 */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x80020100,
		.cpu_name		= "7447/7457",
780
		.cpu_features		= CPU_FTRS_7447_10,
781 782
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
783 784 785
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
786 787
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
788
		.oprofile_type		= PPC_OPROFILE_G4,
789
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
790 791 792 793 794
	},
	{	/* 7447/7457 Rev 1.1 */
		.pvr_mask		= 0xffffffff,
		.pvr_value		= 0x80020101,
		.cpu_name		= "7447/7457",
795
		.cpu_features		= CPU_FTRS_7447_10,
796 797
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
798 799 800
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
801 802
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
803
		.oprofile_type		= PPC_OPROFILE_G4,
804
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
805 806 807 808 809
	},
	{	/* 7447/7457 Rev 1.2 and later */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x80020000,
		.cpu_name		= "7447/7457",
810
		.cpu_features		= CPU_FTRS_7447,
811
		.cpu_user_features	= COMMON_USER | PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
812 813 814
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
815 816
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
817
		.oprofile_type		= PPC_OPROFILE_G4,
818
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
819 820 821 822 823
	},
	{	/* 7447A */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x80030000,
		.cpu_name		= "7447A",
824
		.cpu_features		= CPU_FTRS_7447A,
825 826
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
827 828 829
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
830 831
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
832
		.oprofile_type		= PPC_OPROFILE_G4,
833
		.platform		= "ppc7450",
834 835 836 837 838
	},
	{	/* 7448 */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x80040000,
		.cpu_name		= "7448",
839
		.cpu_features		= CPU_FTRS_7447A,
840 841
		.cpu_user_features	= COMMON_USER |
			PPC_FEATURE_HAS_ALTIVEC_COMP | PPC_FEATURE_PPC_LE,
L
Linus Torvalds 已提交
842 843 844
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.num_pmcs		= 6,
845 846
		.cpu_setup		= __setup_cpu_745x,
		.oprofile_cpu_type      = "ppc/7450",
847
		.oprofile_type		= PPC_OPROFILE_G4,
848
		.platform		= "ppc7450",
L
Linus Torvalds 已提交
849 850 851 852 853
	},
	{	/* 82xx (8240, 8245, 8260 are all 603e cores) */
		.pvr_mask		= 0x7fff0000,
		.pvr_value		= 0x00810000,
		.cpu_name		= "82xx",
854
		.cpu_features		= CPU_FTRS_82XX,
S
Stephen Rothwell 已提交
855
		.cpu_user_features	= COMMON_USER,
L
Linus Torvalds 已提交
856 857
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
858 859
		.cpu_setup		= __setup_cpu_603,
		.platform		= "ppc603",
L
Linus Torvalds 已提交
860 861 862 863 864
	},
	{	/* All G2_LE (603e core, plus some) have the same pvr */
		.pvr_mask		= 0x7fff0000,
		.pvr_value		= 0x00820000,
		.cpu_name		= "G2_LE",
865
		.cpu_features		= CPU_FTRS_G2_LE,
S
Stephen Rothwell 已提交
866
		.cpu_user_features	= COMMON_USER,
L
Linus Torvalds 已提交
867 868
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
869 870
		.cpu_setup		= __setup_cpu_603,
		.platform		= "ppc603",
L
Linus Torvalds 已提交
871
	},
872
	{	/* e300c1 (a 603e core, plus some) on 83xx */
L
Linus Torvalds 已提交
873 874
		.pvr_mask		= 0x7fff0000,
		.pvr_value		= 0x00830000,
875
		.cpu_name		= "e300c1",
876
		.cpu_features		= CPU_FTRS_E300,
S
Stephen Rothwell 已提交
877
		.cpu_user_features	= COMMON_USER,
L
Linus Torvalds 已提交
878 879
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
880 881
		.cpu_setup		= __setup_cpu_603,
		.platform		= "ppc603",
L
Linus Torvalds 已提交
882
	},
883 884 885 886
	{	/* e300c2 (an e300c1 core, plus some, minus FPU) on 83xx */
		.pvr_mask		= 0x7fff0000,
		.pvr_value		= 0x00840000,
		.cpu_name		= "e300c2",
887
		.cpu_features		= CPU_FTRS_E300C2,
888 889 890 891 892 893
		.cpu_user_features	= PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
		.cpu_setup		= __setup_cpu_603,
		.platform		= "ppc603",
	},
894 895 896 897 898 899 900 901 902 903 904
	{	/* 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 已提交
905 906 907 908
	{	/* default match, we assume split I/D cache & TB (non-601)... */
		.pvr_mask		= 0x00000000,
		.pvr_value		= 0x00000000,
		.cpu_name		= "(generic PPC)",
909
		.cpu_features		= CPU_FTRS_CLASSIC32,
S
Stephen Rothwell 已提交
910
		.cpu_user_features	= COMMON_USER,
L
Linus Torvalds 已提交
911 912
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
913
		.platform		= "ppc603",
L
Linus Torvalds 已提交
914 915 916 917 918 919 920 921 922
	},
#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.... */
923
		.cpu_features		= CPU_FTRS_8XX,
L
Linus Torvalds 已提交
924 925 926
		.cpu_user_features	= PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
		.icache_bsize		= 16,
		.dcache_bsize		= 16,
927
		.platform		= "ppc823",
L
Linus Torvalds 已提交
928 929 930 931 932 933 934
	},
#endif /* CONFIG_8xx */
#ifdef CONFIG_40x
	{	/* 403GC */
		.pvr_mask		= 0xffffff00,
		.pvr_value		= 0x00200200,
		.cpu_name		= "403GC",
935
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
936 937 938
		.cpu_user_features	= PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
		.icache_bsize		= 16,
		.dcache_bsize		= 16,
939
		.platform		= "ppc403",
L
Linus Torvalds 已提交
940 941 942 943 944
	},
	{	/* 403GCX */
		.pvr_mask		= 0xffffff00,
		.pvr_value		= 0x00201400,
		.cpu_name		= "403GCX",
945
		.cpu_features		= CPU_FTRS_40X,
946 947
		.cpu_user_features	= PPC_FEATURE_32 |
		 	PPC_FEATURE_HAS_MMU | PPC_FEATURE_NO_TB,
L
Linus Torvalds 已提交
948 949
		.icache_bsize		= 16,
		.dcache_bsize		= 16,
950
		.platform		= "ppc403",
L
Linus Torvalds 已提交
951 952 953 954 955
	},
	{	/* 403G ?? */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x00200000,
		.cpu_name		= "403G ??",
956
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
957 958 959
		.cpu_user_features	= PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
		.icache_bsize		= 16,
		.dcache_bsize		= 16,
960
		.platform		= "ppc403",
L
Linus Torvalds 已提交
961 962 963 964 965
	},
	{	/* 405GP */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x40110000,
		.cpu_name		= "405GP",
966
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
967 968 969 970
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
971
		.platform		= "ppc405",
L
Linus Torvalds 已提交
972 973 974 975 976
	},
	{	/* STB 03xxx */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x40130000,
		.cpu_name		= "STB03xxx",
977
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
978 979 980 981
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
982
		.platform		= "ppc405",
L
Linus Torvalds 已提交
983 984 985 986 987
	},
	{	/* STB 04xxx */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x41810000,
		.cpu_name		= "STB04xxx",
988
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
989 990 991 992
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
993
		.platform		= "ppc405",
L
Linus Torvalds 已提交
994 995 996 997 998
	},
	{	/* NP405L */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x41610000,
		.cpu_name		= "NP405L",
999
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
1000 1001 1002 1003
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1004
		.platform		= "ppc405",
L
Linus Torvalds 已提交
1005 1006 1007 1008 1009
	},
	{	/* NP4GS3 */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x40B10000,
		.cpu_name		= "NP4GS3",
1010
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
1011 1012 1013 1014
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1015
		.platform		= "ppc405",
L
Linus Torvalds 已提交
1016 1017 1018 1019 1020
	},
	{   /* NP405H */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x41410000,
		.cpu_name		= "NP405H",
1021
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
1022 1023 1024 1025
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1026
		.platform		= "ppc405",
L
Linus Torvalds 已提交
1027 1028 1029 1030 1031
	},
	{	/* 405GPr */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x50910000,
		.cpu_name		= "405GPr",
1032
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
1033 1034 1035 1036
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1037
		.platform		= "ppc405",
L
Linus Torvalds 已提交
1038 1039 1040 1041 1042
	},
	{   /* STBx25xx */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x51510000,
		.cpu_name		= "STBx25xx",
1043
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
1044 1045 1046 1047
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1048
		.platform		= "ppc405",
L
Linus Torvalds 已提交
1049 1050 1051 1052 1053
	},
	{	/* 405LP */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x41F10000,
		.cpu_name		= "405LP",
1054
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
1055 1056 1057
		.cpu_user_features	= PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1058
		.platform		= "ppc405",
L
Linus Torvalds 已提交
1059 1060
	},
	{	/* Xilinx Virtex-II Pro  */
1061
		.pvr_mask		= 0xfffff000,
L
Linus Torvalds 已提交
1062 1063
		.pvr_value		= 0x20010000,
		.cpu_name		= "Virtex-II Pro",
1064
		.cpu_features		= CPU_FTRS_40X,
L
Linus Torvalds 已提交
1065 1066 1067 1068
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1069
		.platform		= "ppc405",
L
Linus Torvalds 已提交
1070
	},
1071 1072 1073 1074 1075 1076 1077 1078 1079
	{	/* 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,
1080
		.platform		= "ppc405",
1081
	},
1082 1083 1084 1085
	{	/* 405EP */
		.pvr_mask		= 0xffff0000,
		.pvr_value		= 0x51210000,
		.cpu_name		= "405EP",
1086
		.cpu_features		= CPU_FTRS_40X,
1087 1088 1089 1090
		.cpu_user_features	= PPC_FEATURE_32 |
			PPC_FEATURE_HAS_MMU | PPC_FEATURE_HAS_4xxMAC,
		.icache_bsize		= 32,
		.dcache_bsize		= 32,
1091
		.platform		= "ppc405",
1092
	},
L
Linus Torvalds 已提交
1093 1094 1095

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

1272
struct cpu_spec *identify_cpu(unsigned long offset, unsigned int pvr)
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 1299 1300
{
	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;
}

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

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