Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67775
b: refs/heads/master
c: 59c69f2
h: refs/heads/master
i:
  67773: 84d4566
  67771: a2c14b8
  67767: 4c52bb0
  67759: 140f51c
  67743: 9e377e2
  67711: 82b1251
v: v3
  • Loading branch information
Venki Pallipadi authored and Thomas Gleixner committed Oct 12, 2007
1 parent bdacc8b commit f3ac1c9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d54bd57d6580250e6551261f3b15c45a9d90c77b
refs/heads/master: 59c69f2a51b41e9886b85f61c04e8d0d2a35f37b
27 changes: 25 additions & 2 deletions trunk/arch/x86/kernel/hpet.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ static struct clock_event_device hpet_clockevent = {
.set_next_event = hpet_legacy_next_event,
.shift = 32,
.irq = 0,
.rating = 50,
};

static void hpet_start_counter(void)
Expand All @@ -178,6 +179,17 @@ static void hpet_start_counter(void)
hpet_writel(cfg, HPET_CFG);
}

static void hpet_resume_device(void)
{
ich_force_hpet_resume();
}

static void hpet_restart_counter(void)
{
hpet_resume_device();
hpet_start_counter();
}

static void hpet_enable_legacy_int(void)
{
unsigned long cfg = hpet_readl(HPET_CFG);
Expand Down Expand Up @@ -299,7 +311,7 @@ static struct clocksource clocksource_hpet = {
.mask = HPET_MASK,
.shift = HPET_SHIFT,
.flags = CLOCK_SOURCE_IS_CONTINUOUS,
.resume = hpet_start_counter,
.resume = hpet_restart_counter,
#ifdef CONFIG_X86_64
.vread = vread_hpet,
#endif
Expand Down Expand Up @@ -412,10 +424,21 @@ int __init hpet_enable(void)
*/
static __init int hpet_late_init(void)
{
if (!is_hpet_capable())
if (boot_hpet_disable)
return -ENODEV;

if (!hpet_address) {
if (!force_hpet_address)
return -ENODEV;

hpet_address = force_hpet_address;
hpet_enable();
if (!hpet_virt_address)
return -ENODEV;
}

hpet_reserve_platform_timers(hpet_readl(HPET_ID));

return 0;
}
fs_initcall(hpet_late_init);
Expand Down
1 change: 1 addition & 0 deletions trunk/include/asm-x86/hpet.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@

/* hpet memory map physical address */
extern unsigned long hpet_address;
extern unsigned long force_hpet_address;
extern int is_hpet_enabled(void);
extern int hpet_enable(void);
extern unsigned long hpet_readl(unsigned long a);
Expand Down

0 comments on commit f3ac1c9

Please sign in to comment.