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.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index f7f3c215d06f..25c273c761d1 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -23,6 +23,9 @@
23struct cpu_spec* cur_cpu_spec = NULL; 23struct cpu_spec* cur_cpu_spec = NULL;
24EXPORT_SYMBOL(cur_cpu_spec); 24EXPORT_SYMBOL(cur_cpu_spec);
25 25
26/* The platform string corresponding to the real PVR */
27const char *powerpc_base_platform;
28
26/* NOTE: 29/* NOTE:
27 * Unlike ppc32, ppc64 will only call this once for the boot CPU, it's 30 * Unlike ppc32, ppc64 will only call this once for the boot CPU, it's
28 * the responsibility of the appropriate CPU save/restore functions to 31 * the responsibility of the appropriate CPU save/restore functions to
@@ -355,6 +358,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
355 .icache_bsize = 128, 358 .icache_bsize = 128,
356 .dcache_bsize = 128, 359 .dcache_bsize = 128,
357 .machine_check = machine_check_generic, 360 .machine_check = machine_check_generic,
361 .oprofile_cpu_type = "ppc64/compat-power5+",
358 .platform = "power5+", 362 .platform = "power5+",
359 }, 363 },
360 { /* Power6 */ 364 { /* Power6 */
@@ -386,6 +390,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
386 .icache_bsize = 128, 390 .icache_bsize = 128,
387 .dcache_bsize = 128, 391 .dcache_bsize = 128,
388 .machine_check = machine_check_generic, 392 .machine_check = machine_check_generic,
393 .oprofile_cpu_type = "ppc64/compat-power6",
389 .platform = "power6", 394 .platform = "power6",
390 }, 395 },
391 { /* 2.06-compliant processor, i.e. Power7 "architected" mode */ 396 { /* 2.06-compliant processor, i.e. Power7 "architected" mode */
@@ -397,6 +402,7 @@ static struct cpu_spec __initdata cpu_specs[] = {
397 .icache_bsize = 128, 402 .icache_bsize = 128,
398 .dcache_bsize = 128, 403 .dcache_bsize = 128,
399 .machine_check = machine_check_generic, 404 .machine_check = machine_check_generic,
405 .oprofile_cpu_type = "ppc64/compat-power7",
400 .platform = "power7", 406 .platform = "power7",
401 }, 407 },
402 { /* Power7 */ 408 { /* Power7 */
@@ -1629,9 +1635,34 @@ struct cpu_spec * __init identify_cpu(unsigned long offset, unsigned int pvr)
1629 t->cpu_setup = s->cpu_setup; 1635 t->cpu_setup = s->cpu_setup;
1630 t->cpu_restore = s->cpu_restore; 1636 t->cpu_restore = s->cpu_restore;
1631 t->platform = s->platform; 1637 t->platform = s->platform;
1638 /*
1639 * If we have passed through this logic once
1640 * before and have pulled the default case
1641 * because the real PVR was not found inside
1642 * cpu_specs[], then we are possibly running in
1643 * compatibility mode. In that case, let the
1644 * oprofiler know which set of compatibility
1645 * counters to pull from by making sure the
1646 * oprofile_cpu_type string is set to that of
1647 * compatibility mode. If the oprofile_cpu_type
1648 * already has a value, then we are possibly
1649 * overriding a real PVR with a logical one, and,
1650 * in that case, keep the current value for
1651 * oprofile_cpu_type.
1652 */
1653 if (t->oprofile_cpu_type == NULL)
1654 t->oprofile_cpu_type = s->oprofile_cpu_type;
1632 } else 1655 } else
1633 *t = *s; 1656 *t = *s;
1634 *PTRRELOC(&cur_cpu_spec) = &the_cpu_spec; 1657 *PTRRELOC(&cur_cpu_spec) = &the_cpu_spec;
1658
1659 /*
1660 * Set the base platform string once; assumes
1661 * we're called with real pvr first.
1662 */
1663 if (*PTRRELOC(&powerpc_base_platform) == NULL)
1664 *PTRRELOC(&powerpc_base_platform) = t->platform;
1665
1635#if defined(CONFIG_PPC64) || defined(CONFIG_BOOKE) 1666#if defined(CONFIG_PPC64) || defined(CONFIG_BOOKE)
1636 /* ppc64 and booke expect identify_cpu to also call 1667 /* ppc64 and booke expect identify_cpu to also call
1637 * setup_cpu for that processor. I will consolidate 1668 * setup_cpu for that processor. I will consolidate