diff options
Diffstat (limited to 'arch/sparc64/kernel/cpu.c')
-rw-r--r-- | arch/sparc64/kernel/cpu.c | 48 |
1 files changed, 40 insertions, 8 deletions
diff --git a/arch/sparc64/kernel/cpu.c b/arch/sparc64/kernel/cpu.c index 7eb81d3954d9..e4eff878123d 100644 --- a/arch/sparc64/kernel/cpu.c +++ b/arch/sparc64/kernel/cpu.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* cpu.c: Dinky routines to look for the kind of Sparc cpu | 1 | /* cpu.c: Dinky routines to look for the kind of Sparc cpu |
2 | * we are on. | 2 | * we are on. |
3 | * | 3 | * |
4 | * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu) | 4 | * Copyright (C) 1996, 2007 David S. Miller (davem@davemloft.net) |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #include <linux/kernel.h> | 7 | #include <linux/kernel.h> |
@@ -13,6 +13,7 @@ | |||
13 | #include <asm/fpumacro.h> | 13 | #include <asm/fpumacro.h> |
14 | #include <asm/cpudata.h> | 14 | #include <asm/cpudata.h> |
15 | #include <asm/spitfire.h> | 15 | #include <asm/spitfire.h> |
16 | #include <asm/prom.h> | ||
16 | 17 | ||
17 | DEFINE_PER_CPU(cpuinfo_sparc, __cpu_data) = { 0 }; | 18 | DEFINE_PER_CPU(cpuinfo_sparc, __cpu_data) = { 0 }; |
18 | 19 | ||
@@ -61,21 +62,52 @@ struct cpu_iu_info linux_sparc_chips[] = { | |||
61 | 62 | ||
62 | #define NSPARCCHIPS ARRAY_SIZE(linux_sparc_chips) | 63 | #define NSPARCCHIPS ARRAY_SIZE(linux_sparc_chips) |
63 | 64 | ||
64 | char *sparc_cpu_type = "cpu-oops"; | 65 | char *sparc_cpu_type; |
65 | char *sparc_fpu_type = "fpu-oops"; | 66 | char *sparc_fpu_type; |
66 | 67 | ||
67 | unsigned int fsr_storage; | 68 | unsigned int fsr_storage; |
68 | 69 | ||
70 | static void __init sun4v_cpu_probe(void) | ||
71 | { | ||
72 | struct device_node *dp; | ||
73 | const char *compat; | ||
74 | int len; | ||
75 | |||
76 | dp = of_find_node_by_name(NULL, "cpu"); | ||
77 | if (!dp) | ||
78 | goto no_compat; | ||
79 | |||
80 | compat = of_get_property(dp, "compatible", &len); | ||
81 | if (!compat) | ||
82 | goto no_compat; | ||
83 | |||
84 | if (of_find_in_proplist(compat, "SUNW,UltraSPARC-T1", len)) { | ||
85 | sparc_cpu_type = "UltraSparc T1 (Niagara)"; | ||
86 | sparc_fpu_type = "UltraSparc T1 integrated FPU"; | ||
87 | } else if (of_find_in_proplist(compat, "SUNW,UltraSPARC-T2", len)) { | ||
88 | sparc_cpu_type = "UltraSparc T2 (Niagara2)"; | ||
89 | sparc_fpu_type = "UltraSparc T2 integrated FPU"; | ||
90 | } else | ||
91 | goto unknown; | ||
92 | |||
93 | return; | ||
94 | |||
95 | no_compat: | ||
96 | compat = "no property"; | ||
97 | |||
98 | unknown: | ||
99 | printk(KERN_WARNING "CPU: Unknown sun4v cpu type [%s]\n", compat); | ||
100 | sparc_cpu_type = "Unknown SUN4V CPU"; | ||
101 | sparc_fpu_type = "Unknown SUN4V FPU"; | ||
102 | } | ||
103 | |||
69 | void __init cpu_probe(void) | 104 | void __init cpu_probe(void) |
70 | { | 105 | { |
71 | unsigned long ver, fpu_vers, manuf, impl, fprs; | 106 | unsigned long ver, fpu_vers, manuf, impl, fprs; |
72 | int i; | 107 | int i; |
73 | 108 | ||
74 | if (tlb_type == hypervisor) { | 109 | if (tlb_type == hypervisor) |
75 | sparc_cpu_type = "UltraSparc T1 (Niagara)"; | 110 | return sun4v_cpu_probe(); |
76 | sparc_fpu_type = "UltraSparc T1 integrated FPU"; | ||
77 | return; | ||
78 | } | ||
79 | 111 | ||
80 | fprs = fprs_read(); | 112 | fprs = fprs_read(); |
81 | fprs_write(FPRS_FEF); | 113 | fprs_write(FPRS_FEF); |