* [PATCH 1/3 -mm] hpet: allow HPET FIXED_MEM32 resource type
@ 2005-10-18 20:54 Randy Dunlap
0 siblings, 0 replies; only message in thread
From: Randy Dunlap @ 2005-10-18 20:54 UTC (permalink / raw)
To: lkml; +Cc: akpm, bob.picco, venki
From: Randy Dunlap <randy_d_dunlap@linux.intel.com>
Allow the ACPI HPET description table to use a resource type
of FIXED_MEM32 for the HPET reource. Use the fixed resoure
size of 1 KB for the HPET resource as per the HPET spec.
Signed-off-by: Randy Dunlap <randy_d_dunlap@linux.intel.com>
Acked-by: Bob Picco <bob.picco@hp.com>
---
Index: linux-2614-rc4-mm1/drivers/char/hpet.c
===================================================================
--- linux-2614-rc4-mm1.orig/drivers/char/hpet.c
+++ linux-2614-rc4-mm1/drivers/char/hpet.c
@@ -49,6 +49,8 @@
#define HPET_USER_FREQ (64)
#define HPET_DRIFT (500)
+#define HPET_RANGE_SIZE 1024 /* from HPET spec */
+
static u32 hpet_nhpet, hpet_max_freq = HPET_USER_FREQ;
/* A lock for concurrent access by app and isr hpet activity. */
@@ -922,6 +924,21 @@ static acpi_status hpet_resources(struct
for (hpetp = hpets; hpetp; hpetp = hpetp->hp_next)
if (hpetp->hp_hpet == hdp->hd_address)
return -EBUSY;
+ } else if (res->type == ACPI_RSTYPE_FIXED_MEM32) {
+ struct acpi_resource_fixed_mem32 *fixmem32;
+
+ fixmem32 = &res->data.fixed_memory32;
+ if (!fixmem32)
+ return -EINVAL;
+
+ hdp->hd_phys_address = fixmem32->range_base_address;
+ hdp->hd_address = ioremap(fixmem32->range_base_address,
+ HPET_RANGE_SIZE);
+
+ for (hpetp = hpets; hpetp; hpetp = hpetp->hp_next)
+ if (hpetp->hp_hpet == hdp->hd_address) {
+ return -EBUSY;
+ }
} else if (res->type == ACPI_RSTYPE_EXT_IRQ) {
struct acpi_resource_ext_irq *irqp;
int i;
---
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-10-18 20:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-18 20:54 [PATCH 1/3 -mm] hpet: allow HPET FIXED_MEM32 resource type Randy Dunlap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome