diff options
-rw-r--r-- | arch/powerpc/kernel/cputable.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c index f7f3c215d06f..b936a1dd0a50 100644 --- a/arch/powerpc/kernel/cputable.c +++ b/arch/powerpc/kernel/cputable.c | |||
@@ -355,6 +355,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
355 | .icache_bsize = 128, | 355 | .icache_bsize = 128, |
356 | .dcache_bsize = 128, | 356 | .dcache_bsize = 128, |
357 | .machine_check = machine_check_generic, | 357 | .machine_check = machine_check_generic, |
358 | .oprofile_cpu_type = "ppc64/compat-power5+", | ||
358 | .platform = "power5+", | 359 | .platform = "power5+", |
359 | }, | 360 | }, |
360 | { /* Power6 */ | 361 | { /* Power6 */ |
@@ -386,6 +387,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
386 | .icache_bsize = 128, | 387 | .icache_bsize = 128, |
387 | .dcache_bsize = 128, | 388 | .dcache_bsize = 128, |
388 | .machine_check = machine_check_generic, | 389 | .machine_check = machine_check_generic, |
390 | .oprofile_cpu_type = "ppc64/compat-power6", | ||
389 | .platform = "power6", | 391 | .platform = "power6", |
390 | }, | 392 | }, |
391 | { /* 2.06-compliant processor, i.e. Power7 "architected" mode */ | 393 | { /* 2.06-compliant processor, i.e. Power7 "architected" mode */ |
@@ -397,6 +399,7 @@ static struct cpu_spec __initdata cpu_specs[] = { | |||
397 | .icache_bsize = 128, | 399 | .icache_bsize = 128, |
398 | .dcache_bsize = 128, | 400 | .dcache_bsize = 128, |
399 | .machine_check = machine_check_generic, | 401 | .machine_check = machine_check_generic, |
402 | .oprofile_cpu_type = "ppc64/compat-power7", | ||
400 | .platform = "power7", | 403 | .platform = "power7", |
401 | }, | 404 | }, |
402 | { /* Power7 */ | 405 | { /* Power7 */ |
@@ -1629,6 +1632,23 @@ struct cpu_spec * __init identify_cpu(unsigned long offset, unsigned int pvr) | |||
1629 | t->cpu_setup = s->cpu_setup; | 1632 | t->cpu_setup = s->cpu_setup; |
1630 | t->cpu_restore = s->cpu_restore; | 1633 | t->cpu_restore = s->cpu_restore; |
1631 | t->platform = s->platform; | 1634 | t->platform = s->platform; |
1635 | /* | ||
1636 | * If we have passed through this logic once | ||
1637 | * before and have pulled the default case | ||
1638 | * because the real PVR was not found inside | ||
1639 | * cpu_specs[], then we are possibly running in | ||
1640 | * compatibility mode. In that case, let the | ||
1641 | * oprofiler know which set of compatibility | ||
1642 | * counters to pull from by making sure the | ||
1643 | * oprofile_cpu_type string is set to that of | ||
1644 | * compatibility mode. If the oprofile_cpu_type | ||
1645 | * already has a value, then we are possibly | ||
1646 | * overriding a real PVR with a logical one, and, | ||
1647 | * in that case, keep the current value for | ||
1648 | * oprofile_cpu_type. | ||
1649 | */ | ||
1650 | if (t->oprofile_cpu_type == NULL) | ||
1651 | t->oprofile_cpu_type = s->oprofile_cpu_type; | ||
1632 | } else | 1652 | } else |
1633 | *t = *s; | 1653 | *t = *s; |
1634 | *PTRRELOC(&cur_cpu_spec) = &the_cpu_spec; | 1654 | *PTRRELOC(&cur_cpu_spec) = &the_cpu_spec; |