diff options
author | Venki Pallipadi <venkatesh.pallipadi@intel.com> | 2007-10-12 17:04:23 -0400 |
---|---|---|
committer | Thomas Gleixner <tglx@inhelltoy.tec.linutronix.de> | 2007-10-12 17:04:23 -0400 |
commit | 59c69f2a51b41e9886b85f61c04e8d0d2a35f37b (patch) | |
tree | 3512523870b3a34a976777c2cb332bd29d7aab59 | |
parent | d54bd57d6580250e6551261f3b15c45a9d90c77b (diff) |
x86: HPET try to activate force detected hpet
Enable HPET later during boot, after the force detect in PCI quirks. Also add
a call to repeat the force enabling at resume time.
Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Cc: Andi Kleen <ak@suse.de>
Cc: john stultz <johnstul@us.ibm.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r-- | arch/x86/kernel/hpet.c | 27 | ||||
-rw-r--r-- | include/asm-x86/hpet.h | 1 |
2 files changed, 26 insertions, 2 deletions
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index ce3bcc4334d5..a6c68915d2a9 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c | |||
@@ -164,6 +164,7 @@ static struct clock_event_device hpet_clockevent = { | |||
164 | .set_next_event = hpet_legacy_next_event, | 164 | .set_next_event = hpet_legacy_next_event, |
165 | .shift = 32, | 165 | .shift = 32, |
166 | .irq = 0, | 166 | .irq = 0, |
167 | .rating = 50, | ||
167 | }; | 168 | }; |
168 | 169 | ||
169 | static void hpet_start_counter(void) | 170 | static void hpet_start_counter(void) |
@@ -178,6 +179,17 @@ static void hpet_start_counter(void) | |||
178 | hpet_writel(cfg, HPET_CFG); | 179 | hpet_writel(cfg, HPET_CFG); |
179 | } | 180 | } |
180 | 181 | ||
182 | static void hpet_resume_device(void) | ||
183 | { | ||
184 | ich_force_hpet_resume(); | ||
185 | } | ||
186 | |||
187 | static void hpet_restart_counter(void) | ||
188 | { | ||
189 | hpet_resume_device(); | ||
190 | hpet_start_counter(); | ||
191 | } | ||
192 | |||
181 | static void hpet_enable_legacy_int(void) | 193 | static void hpet_enable_legacy_int(void) |
182 | { | 194 | { |
183 | unsigned long cfg = hpet_readl(HPET_CFG); | 195 | unsigned long cfg = hpet_readl(HPET_CFG); |
@@ -299,7 +311,7 @@ static struct clocksource clocksource_hpet = { | |||
299 | .mask = HPET_MASK, | 311 | .mask = HPET_MASK, |
300 | .shift = HPET_SHIFT, | 312 | .shift = HPET_SHIFT, |
301 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, | 313 | .flags = CLOCK_SOURCE_IS_CONTINUOUS, |
302 | .resume = hpet_start_counter, | 314 | .resume = hpet_restart_counter, |
303 | #ifdef CONFIG_X86_64 | 315 | #ifdef CONFIG_X86_64 |
304 | .vread = vread_hpet, | 316 | .vread = vread_hpet, |
305 | #endif | 317 | #endif |
@@ -412,10 +424,21 @@ out_nohpet: | |||
412 | */ | 424 | */ |
413 | static __init int hpet_late_init(void) | 425 | static __init int hpet_late_init(void) |
414 | { | 426 | { |
415 | if (!is_hpet_capable()) | 427 | if (boot_hpet_disable) |
416 | return -ENODEV; | 428 | return -ENODEV; |
417 | 429 | ||
430 | if (!hpet_address) { | ||
431 | if (!force_hpet_address) | ||
432 | return -ENODEV; | ||
433 | |||
434 | hpet_address = force_hpet_address; | ||
435 | hpet_enable(); | ||
436 | if (!hpet_virt_address) | ||
437 | return -ENODEV; | ||
438 | } | ||
439 | |||
418 | hpet_reserve_platform_timers(hpet_readl(HPET_ID)); | 440 | hpet_reserve_platform_timers(hpet_readl(HPET_ID)); |
441 | |||
419 | return 0; | 442 | return 0; |
420 | } | 443 | } |
421 | fs_initcall(hpet_late_init); | 444 | fs_initcall(hpet_late_init); |
diff --git a/include/asm-x86/hpet.h b/include/asm-x86/hpet.h index 7c933242365f..47de4b8cdda9 100644 --- a/include/asm-x86/hpet.h +++ b/include/asm-x86/hpet.h | |||
@@ -63,6 +63,7 @@ | |||
63 | 63 | ||
64 | /* hpet memory map physical address */ | 64 | /* hpet memory map physical address */ |
65 | extern unsigned long hpet_address; | 65 | extern unsigned long hpet_address; |
66 | extern unsigned long force_hpet_address; | ||
66 | extern int is_hpet_enabled(void); | 67 | extern int is_hpet_enabled(void); |
67 | extern int hpet_enable(void); | 68 | extern int hpet_enable(void); |
68 | extern unsigned long hpet_readl(unsigned long a); | 69 | extern unsigned long hpet_readl(unsigned long a); |