aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/genx2apic_uv_x.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-07-18 17:01:04 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-18 17:01:04 -0400
commit9553e11325e3d44a8c8a1428c7e5f146f1cc7238 (patch)
tree98a95631f6b810436eca57c242ade769906200fa /arch/x86/kernel/genx2apic_uv_x.c
parent453c1404c5273a30d715e5a83372a78cff70b6d9 (diff)
parent7019cc2dd6fafcdc6b104005482dc910dcdbb797 (diff)
Merge branch 'x86/uv' into x86/x2apic
Conflicts: arch/x86/kernel/Makefile Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/genx2apic_uv_x.c')
-rw-r--r--arch/x86/kernel/genx2apic_uv_x.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c
index 3ca29cd8c23c..a8e5cb4c4d43 100644
--- a/arch/x86/kernel/genx2apic_uv_x.c
+++ b/arch/x86/kernel/genx2apic_uv_x.c
@@ -25,6 +25,7 @@
25#include <asm/pgtable.h> 25#include <asm/pgtable.h>
26#include <asm/uv/uv_mmrs.h> 26#include <asm/uv/uv_mmrs.h>
27#include <asm/uv/uv_hub.h> 27#include <asm/uv/uv_hub.h>
28#include <asm/uv/bios.h>
28 29
29DEFINE_PER_CPU(struct uv_hub_info_s, __uv_hub_info); 30DEFINE_PER_CPU(struct uv_hub_info_s, __uv_hub_info);
30EXPORT_PER_CPU_SYMBOL_GPL(__uv_hub_info); 31EXPORT_PER_CPU_SYMBOL_GPL(__uv_hub_info);
@@ -41,6 +42,9 @@ EXPORT_SYMBOL_GPL(uv_cpu_to_blade);
41short uv_possible_blades; 42short uv_possible_blades;
42EXPORT_SYMBOL_GPL(uv_possible_blades); 43EXPORT_SYMBOL_GPL(uv_possible_blades);
43 44
45unsigned long sn_rtc_cycles_per_second;
46EXPORT_SYMBOL(sn_rtc_cycles_per_second);
47
44/* Start with all IRQs pointing to boot CPU. IRQ balancing will shift them. */ 48/* Start with all IRQs pointing to boot CPU. IRQ balancing will shift them. */
45 49
46static cpumask_t uv_target_cpus(void) 50static cpumask_t uv_target_cpus(void)
@@ -306,6 +310,23 @@ static __init void map_mmioh_high(int max_pnode)
306 map_high("MMIOH", mmioh.s.base, shift, map_uc); 310 map_high("MMIOH", mmioh.s.base, shift, map_uc);
307} 311}
308 312
313static __init void uv_rtc_init(void)
314{
315 long status, ticks_per_sec, drift;
316
317 status =
318 x86_bios_freq_base(BIOS_FREQ_BASE_REALTIME_CLOCK, &ticks_per_sec,
319 &drift);
320 if (status != 0 || ticks_per_sec < 100000) {
321 printk(KERN_WARNING
322 "unable to determine platform RTC clock frequency, "
323 "guessing.\n");
324 /* BIOS gives wrong value for clock freq. so guess */
325 sn_rtc_cycles_per_second = 1000000000000UL / 30000UL;
326 } else
327 sn_rtc_cycles_per_second = ticks_per_sec;
328}
329
309static __init void uv_system_init(void) 330static __init void uv_system_init(void)
310{ 331{
311 union uvh_si_addr_map_config_u m_n_config; 332 union uvh_si_addr_map_config_u m_n_config;
@@ -360,6 +381,8 @@ static __init void uv_system_init(void)
360 gnode_upper = (((unsigned long)node_id.s.node_id) & 381 gnode_upper = (((unsigned long)node_id.s.node_id) &
361 ~((1 << n_val) - 1)) << m_val; 382 ~((1 << n_val) - 1)) << m_val;
362 383
384 uv_rtc_init();
385
363 for_each_present_cpu(cpu) { 386 for_each_present_cpu(cpu) {
364 nid = cpu_to_node(cpu); 387 nid = cpu_to_node(cpu);
365 pnode = uv_apicid_to_pnode(per_cpu(x86_cpu_to_apicid, cpu)); 388 pnode = uv_apicid_to_pnode(per_cpu(x86_cpu_to_apicid, cpu));