aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/cputable.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/cputable.c')
-rw-r--r--arch/powerpc/kernel/cputable.c45
1 files changed, 24 insertions, 21 deletions
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index b03a442b7888..8662cf053fa0 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -71,7 +71,7 @@ extern void __restore_cpu_ppc970(void);
71#define COMMON_USER_BOOKE (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \ 71#define COMMON_USER_BOOKE (PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | \
72 PPC_FEATURE_BOOKE) 72 PPC_FEATURE_BOOKE)
73 73
74static struct cpu_spec cpu_specs[] = { 74static struct cpu_spec __initdata cpu_specs[] = {
75#ifdef CONFIG_PPC64 75#ifdef CONFIG_PPC64
76 { /* Power3 */ 76 { /* Power3 */
77 .pvr_mask = 0xffff0000, 77 .pvr_mask = 0xffff0000,
@@ -327,14 +327,6 @@ static struct cpu_spec cpu_specs[] = {
327 .cpu_user_features = COMMON_USER_POWER5_PLUS, 327 .cpu_user_features = COMMON_USER_POWER5_PLUS,
328 .icache_bsize = 128, 328 .icache_bsize = 128,
329 .dcache_bsize = 128, 329 .dcache_bsize = 128,
330 .num_pmcs = 6,
331 .pmc_type = PPC_PMC_IBM,
332 .oprofile_cpu_type = "ppc64/power6",
333 .oprofile_type = PPC_OPROFILE_POWER4,
334 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
335 .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
336 .oprofile_mmcra_clear = POWER6_MMCRA_THRM |
337 POWER6_MMCRA_OTHER,
338 .platform = "power5+", 330 .platform = "power5+",
339 }, 331 },
340 { /* Power6 */ 332 { /* Power6 */
@@ -364,14 +356,6 @@ static struct cpu_spec cpu_specs[] = {
364 .cpu_user_features = COMMON_USER_POWER6, 356 .cpu_user_features = COMMON_USER_POWER6,
365 .icache_bsize = 128, 357 .icache_bsize = 128,
366 .dcache_bsize = 128, 358 .dcache_bsize = 128,
367 .num_pmcs = 6,
368 .pmc_type = PPC_PMC_IBM,
369 .oprofile_cpu_type = "ppc64/power6",
370 .oprofile_type = PPC_OPROFILE_POWER4,
371 .oprofile_mmcra_sihv = POWER6_MMCRA_SIHV,
372 .oprofile_mmcra_sipr = POWER6_MMCRA_SIPR,
373 .oprofile_mmcra_clear = POWER6_MMCRA_THRM |
374 POWER6_MMCRA_OTHER,
375 .platform = "power6", 359 .platform = "power6",
376 }, 360 },
377 { /* Cell Broadband Engine */ 361 { /* Cell Broadband Engine */
@@ -1316,18 +1300,37 @@ static struct cpu_spec cpu_specs[] = {
1316#endif /* CONFIG_PPC32 */ 1300#endif /* CONFIG_PPC32 */
1317}; 1301};
1318 1302
1319struct cpu_spec *identify_cpu(unsigned long offset, unsigned int pvr) 1303static struct cpu_spec the_cpu_spec;
1304
1305struct cpu_spec * __init identify_cpu(unsigned long offset, unsigned int pvr)
1320{ 1306{
1321 struct cpu_spec *s = cpu_specs; 1307 struct cpu_spec *s = cpu_specs;
1322 struct cpu_spec **cur = &cur_cpu_spec; 1308 struct cpu_spec *t = &the_cpu_spec;
1323 int i; 1309 int i;
1324 1310
1325 s = PTRRELOC(s); 1311 s = PTRRELOC(s);
1326 cur = PTRRELOC(cur); 1312 t = PTRRELOC(t);
1327 1313
1328 for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++) 1314 for (i = 0; i < ARRAY_SIZE(cpu_specs); i++,s++)
1329 if ((pvr & s->pvr_mask) == s->pvr_value) { 1315 if ((pvr & s->pvr_mask) == s->pvr_value) {
1330 *cur = cpu_specs + i; 1316 /*
1317 * If we are overriding a previous value derived
1318 * from the real PVR with a new value obtained
1319 * using a logical PVR value, don't modify the
1320 * performance monitor fields.
1321 */
1322 if (t->num_pmcs && !s->num_pmcs) {
1323 t->cpu_name = s->cpu_name;
1324 t->cpu_features = s->cpu_features;
1325 t->cpu_user_features = s->cpu_user_features;
1326 t->icache_bsize = s->icache_bsize;
1327 t->dcache_bsize = s->dcache_bsize;
1328 t->cpu_setup = s->cpu_setup;
1329 t->cpu_restore = s->cpu_restore;
1330 t->platform = s->platform;
1331 } else
1332 *t = *s;
1333 *PTRRELOC(&cur_cpu_spec) = &the_cpu_spec;
1331#if defined(CONFIG_PPC64) || defined(CONFIG_BOOKE) 1334#if defined(CONFIG_PPC64) || defined(CONFIG_BOOKE)
1332 /* ppc64 and booke expect identify_cpu to also call 1335 /* ppc64 and booke expect identify_cpu to also call
1333 * setup_cpu for that processor. I will consolidate 1336 * setup_cpu for that processor. I will consolidate