]>
Commit | Line | Data |
---|---|---|
6a930a95 BS |
1 | From: Russ Anderson <rja@sgi.com> |
2 | Subject: x86: Add UV partition call | |
3 | References: bnc#442455 | |
4 | ||
5 | Add a bios call to return partitioning related info. | |
6 | ||
7 | Signed-off-by: Russ Anderson <rja@sgi.com> | |
8 | Acked-by: Bernhard Walle <bwalle@suse.de> | |
9 | ||
10 | --- | |
11 | arch/x86/kernel/bios_uv.c | 44 ++++++++++++++++++++++++++++++++++----- | |
12 | arch/x86/kernel/genx2apic_uv_x.c | 14 +++++++----- | |
13 | include/asm-x86/uv/bios.h | 22 ++++++++++++++++--- | |
14 | 3 files changed, 66 insertions(+), 14 deletions(-) | |
15 | ||
16 | --- a/arch/x86/kernel/bios_uv.c | |
17 | +++ b/arch/x86/kernel/bios_uv.c | |
18 | @@ -23,6 +23,7 @@ | |
19 | #include <asm/efi.h> | |
20 | #include <linux/io.h> | |
21 | #include <asm/uv/bios.h> | |
22 | +#include <asm/uv/uv_hub.h> | |
23 | ||
24 | struct uv_systab uv_systab; | |
25 | ||
26 | @@ -65,14 +66,47 @@ s64 uv_bios_call_reentrant(enum uv_bios_ | |
27 | return ret; | |
28 | } | |
29 | ||
30 | -long | |
31 | -x86_bios_freq_base(unsigned long clock_type, unsigned long *ticks_per_second, | |
32 | - unsigned long *drift_info) | |
33 | + | |
34 | +long sn_partition_id; | |
35 | +EXPORT_SYMBOL_GPL(sn_partition_id); | |
36 | +long uv_coherency_id; | |
37 | +EXPORT_SYMBOL_GPL(uv_coherency_id); | |
38 | +long uv_region_size; | |
39 | +EXPORT_SYMBOL_GPL(uv_region_size); | |
40 | +int uv_type; | |
41 | + | |
42 | + | |
43 | +s64 uv_bios_get_sn_info(int fc, int *uvtype, long *partid, long *coher, | |
44 | + long *region) | |
45 | +{ | |
46 | + s64 ret; | |
47 | + u64 v0, v1; | |
48 | + union partition_info_u part; | |
49 | + | |
50 | + ret = uv_bios_call_irqsave(UV_BIOS_GET_SN_INFO, fc, | |
51 | + (u64)(&v0), (u64)(&v1), 0, 0); | |
52 | + if (ret != BIOS_STATUS_SUCCESS) | |
53 | + return ret; | |
54 | + | |
55 | + part.val = v0; | |
56 | + if (uvtype) | |
57 | + *uvtype = part.hub_version; | |
58 | + if (partid) | |
59 | + *partid = part.partition_id; | |
60 | + if (coher) | |
61 | + *coher = part.coherence_id; | |
62 | + if (region) | |
63 | + *region = part.region_size; | |
64 | + return ret; | |
65 | +} | |
66 | + | |
67 | + | |
68 | +s64 uv_bios_freq_base(u64 clock_type, u64 *ticks_per_second) | |
69 | { | |
70 | return uv_bios_call(UV_BIOS_FREQ_BASE, clock_type, | |
71 | - (u64)ticks_per_second, 0, 0, 0); | |
72 | + (u64)ticks_per_second, 0, 0, 0); | |
73 | } | |
74 | -EXPORT_SYMBOL_GPL(x86_bios_freq_base); | |
75 | +EXPORT_SYMBOL_GPL(uv_bios_freq_base); | |
76 | ||
77 | ||
78 | #ifdef CONFIG_EFI | |
79 | --- a/arch/x86/kernel/genx2apic_uv_x.c | |
80 | +++ b/arch/x86/kernel/genx2apic_uv_x.c | |
81 | @@ -353,12 +353,12 @@ static __init void map_mmioh_high(int ma | |
82 | ||
83 | static __init void uv_rtc_init(void) | |
84 | { | |
85 | - long status, ticks_per_sec, drift; | |
86 | + long status; | |
87 | + u64 ticks_per_sec; | |
88 | ||
89 | - status = | |
90 | - x86_bios_freq_base(BIOS_FREQ_BASE_REALTIME_CLOCK, &ticks_per_sec, | |
91 | - &drift); | |
92 | - if (status != 0 || ticks_per_sec < 100000) { | |
93 | + status = uv_bios_freq_base(BIOS_FREQ_BASE_REALTIME_CLOCK, | |
94 | + &ticks_per_sec); | |
95 | + if (status != BIOS_STATUS_SUCCESS || ticks_per_sec < 100000) { | |
96 | printk(KERN_WARNING | |
97 | "unable to determine platform RTC clock frequency, " | |
98 | "guessing.\n"); | |
99 | @@ -523,6 +523,8 @@ void __init uv_system_init(void) | |
100 | ~((1 << n_val) - 1)) << m_val; | |
101 | ||
102 | uv_bios_init(); | |
103 | + uv_bios_get_sn_info(0, &uv_type, &sn_partition_id, | |
104 | + &uv_coherency_id, &uv_region_size); | |
105 | uv_rtc_init(); | |
106 | ||
107 | for_each_present_cpu(cpu) { | |
108 | @@ -544,7 +546,7 @@ void __init uv_system_init(void) | |
109 | uv_cpu_hub_info(cpu)->gpa_mask = (1 << (m_val + n_val)) - 1; | |
110 | uv_cpu_hub_info(cpu)->gnode_upper = gnode_upper; | |
111 | uv_cpu_hub_info(cpu)->global_mmr_base = mmr_base; | |
112 | - uv_cpu_hub_info(cpu)->coherency_domain_number = 0;/* ZZZ */ | |
113 | + uv_cpu_hub_info(cpu)->coherency_domain_number = uv_coherency_id; | |
114 | uv_cpu_hub_info(cpu)->scir.offset = SCIR_LOCAL_MMR_BASE + lcpu; | |
115 | uv_node_to_blade[nid] = blade; | |
116 | uv_cpu_to_blade[cpu] = blade; | |
117 | --- a/include/asm-x86/uv/bios.h | |
118 | +++ b/include/asm-x86/uv/bios.h | |
119 | @@ -61,6 +61,16 @@ enum { | |
120 | BIOS_FREQ_BASE_REALTIME_CLOCK = 2 | |
121 | }; | |
122 | ||
123 | +union partition_info_u { | |
124 | + u64 val; | |
125 | + struct { | |
126 | + u64 hub_version : 8, | |
127 | + partition_id : 16, | |
128 | + coherence_id : 16, | |
129 | + region_size : 24; | |
130 | + }; | |
131 | +}; | |
132 | + | |
133 | /* | |
134 | * bios calls have 6 parameters | |
135 | */ | |
136 | @@ -68,10 +78,16 @@ extern s64 uv_bios_call(enum uv_bios_cmd | |
137 | extern s64 uv_bios_call_irqsave(enum uv_bios_cmd, u64, u64, u64, u64, u64); | |
138 | extern s64 uv_bios_call_reentrant(enum uv_bios_cmd, u64, u64, u64, u64, u64); | |
139 | ||
140 | +extern s64 uv_bios_get_sn_info(int, int *, long *, long *, long *); | |
141 | +extern s64 uv_bios_freq_base(u64, u64 *); | |
142 | + | |
143 | extern void uv_bios_init(void); | |
144 | ||
145 | -extern long | |
146 | -x86_bios_freq_base(unsigned long which, unsigned long *ticks_per_second, | |
147 | - unsigned long *drift_info); | |
148 | +extern int uv_type; | |
149 | +extern long sn_partition_id; | |
150 | +extern long uv_coherency_id; | |
151 | +extern long uv_region_size; | |
152 | +#define partition_coherence_id() (uv_coherency_id) | |
153 | + | |
154 | ||
155 | #endif /* _ASM_X86_BIOS_H */ |