]> git.hungrycats.org Git - linux/commitdiff
[PATCH] HPET 2/6: boot parsing
authorAndrew Morton <akpm@osdl.org>
Sun, 31 Aug 2003 11:36:11 +0000 (04:36 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Sun, 31 Aug 2003 11:36:11 +0000 (04:36 -0700)
From: "Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>

acpi boot time parsing changes to look for HPET

arch/i386/kernel/acpi/boot.c

index 7883fd57bd814a61f08107b24d06bb12b4ab79d6..528dfb381b1ccd456254cc35756d8a6043209862 100644 (file)
@@ -270,6 +270,27 @@ acpi_scan_rsdp (
        return 0;
 }
 
+#ifdef CONFIG_HPET_TIMER
+extern unsigned long hpet_address;
+
+static int __init acpi_parse_hpet(unsigned long phys, unsigned long size)
+{
+       struct acpi_table_hpet *hpet_tbl;
+
+       hpet_tbl = __va(phys);
+
+       if (hpet_tbl->addr.space_id != ACPI_SPACE_MEM) {
+               printk(KERN_WARNING PREFIX "HPET timers must be located in "
+                      "memory.\n");
+               return -1;
+       }
+
+       hpet_address = hpet_tbl->addr.addrl;
+       printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n", hpet_tbl->id,
+              hpet_address);
+       return 0;
+}
+#endif
 
 unsigned long __init
 acpi_find_rsdp (void)
@@ -459,6 +480,9 @@ acpi_boot_init (void)
                clustered_apic_check();
        }
 #endif
+#ifdef CONFIG_HPET_TIMER
+       acpi_table_parse(ACPI_HPET, acpi_parse_hpet);
+#endif
 
        return 0;
 }