Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 67748
b: refs/heads/master
c: 06a24de
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Gleixner authored and Thomas Gleixner committed Oct 12, 2007
1 parent a376f01 commit 0d9de44
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 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: d371698efd45c3664fd1726780c360f02e1f9580
refs/heads/master: 06a24dec10bc4014fc0974670627efed68f5da27
24 changes: 16 additions & 8 deletions trunk/arch/x86/kernel/hpet_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
#include <linux/delay.h>

#include <asm/hpet.h>
#include <asm/i8253.h>
#include <asm/io.h>

extern struct clock_event_device *global_clock_event;

#define HPET_MASK CLOCKSOURCE_MASK(32)
#define HPET_SHIFT 22

Expand All @@ -22,7 +21,7 @@ extern struct clock_event_device *global_clock_event;
* HPET address is set in acpi/boot.c, when an ACPI entry exists
*/
unsigned long hpet_address;
static void __iomem * hpet_virt_address;
static void __iomem *hpet_virt_address;

static inline unsigned long hpet_readl(unsigned long a)
{
Expand All @@ -34,6 +33,17 @@ static inline void hpet_writel(unsigned long d, unsigned long a)
writel(d, hpet_virt_address + a);
}

static inline void hpet_set_mapping(void)
{
hpet_virt_address = ioremap_nocache(hpet_address, HPET_MMAP_SIZE);
}

static inline void hpet_clear_mapping(void)
{
iounmap(hpet_virt_address);
hpet_virt_address = NULL;
}

/*
* HPET command line enable / disable
*/
Expand Down Expand Up @@ -83,7 +93,7 @@ static void hpet_reserve_platform_timers(unsigned long id)

memset(&hd, 0, sizeof (hd));
hd.hd_phys_address = hpet_address;
hd.hd_address = hpet_virt_address;
hd.hd_address = hpet;
hd.hd_nirqs = nrtimers;
hd.hd_flags = HPET_DATA_PLATFORM;
hpet_reserve_timer(&hd, 0);
Expand Down Expand Up @@ -238,7 +248,7 @@ int __init hpet_enable(void)
if (!is_hpet_capable())
return 0;

hpet_virt_address = ioremap_nocache(hpet_address, HPET_MMAP_SIZE);
hpet_set_mapping();

/*
* Read the period and check for a sane value:
Expand Down Expand Up @@ -334,13 +344,11 @@ int __init hpet_enable(void)
return 0;

out_nohpet:
iounmap(hpet_virt_address);
hpet_virt_address = NULL;
hpet_clear_mapping();
boot_hpet_disable = 1;
return 0;
}


#ifdef CONFIG_HPET_EMULATE_RTC

/* HPET in LegacyReplacement Mode eats up RTC interrupt line. When, HPET
Expand Down

0 comments on commit 0d9de44

Please sign in to comment.