summaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel/cpu.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2007-08-08 17:11:39 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2007-08-08 17:33:45 -0700
commit6c70b6fc7b6fc321636a014082d9e32333da1f80 (patch)
treeff0e52bb7ba43b058b7cbb88b952fd268fbe3ad2 /arch/sparc64/kernel/cpu.c
parent68c9f9fd336dc7e793cecad25f8ac40ccaa7a256 (diff)
[SPARC64]: Do not assume sun4v chips have load-twin/store-init support.
Check the cpu type in the OBP device tree before committing to using the optimized Niagara memcpy and memset implementation. If we don't recognize the cpu type, use a completely generic version. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64/kernel/cpu.c')
-rw-r--r--arch/sparc64/kernel/cpu.c42
1 files changed, 15 insertions, 27 deletions
diff --git a/arch/sparc64/kernel/cpu.c b/arch/sparc64/kernel/cpu.c
index e4eff878123..e43db73f2b9 100644
--- a/arch/sparc64/kernel/cpu.c
+++ b/arch/sparc64/kernel/cpu.c
@@ -13,7 +13,7 @@
#include <asm/fpumacro.h>
#include <asm/cpudata.h>
#include <asm/spitfire.h>
-#include <asm/prom.h>
+#include <asm/oplib.h>
DEFINE_PER_CPU(cpuinfo_sparc, __cpu_data) = { 0 };
@@ -69,36 +69,24 @@ unsigned int fsr_storage;
static void __init sun4v_cpu_probe(void)
{
- struct device_node *dp;
- const char *compat;
- int len;
-
- dp = of_find_node_by_name(NULL, "cpu");
- if (!dp)
- goto no_compat;
-
- compat = of_get_property(dp, "compatible", &len);
- if (!compat)
- goto no_compat;
-
- if (of_find_in_proplist(compat, "SUNW,UltraSPARC-T1", len)) {
+ switch (sun4v_chip_type) {
+ case SUN4V_CHIP_NIAGARA1:
sparc_cpu_type = "UltraSparc T1 (Niagara)";
sparc_fpu_type = "UltraSparc T1 integrated FPU";
- } else if (of_find_in_proplist(compat, "SUNW,UltraSPARC-T2", len)) {
+ break;
+
+ case SUN4V_CHIP_NIAGARA2:
sparc_cpu_type = "UltraSparc T2 (Niagara2)";
sparc_fpu_type = "UltraSparc T2 integrated FPU";
- } else
- goto unknown;
-
- return;
-
-no_compat:
- compat = "no property";
-
-unknown:
- printk(KERN_WARNING "CPU: Unknown sun4v cpu type [%s]\n", compat);
- sparc_cpu_type = "Unknown SUN4V CPU";
- sparc_fpu_type = "Unknown SUN4V FPU";
+ break;
+
+ default:
+ printk(KERN_WARNING "CPU: Unknown sun4v cpu type [%s]\n",
+ prom_cpu_compatible);
+ sparc_cpu_type = "Unknown SUN4V CPU";
+ sparc_fpu_type = "Unknown SUN4V FPU";
+ break;
+ }
}
void __init cpu_probe(void)