Hi,
a laptop at hand (samsung q45) has two entries for HPET device, which
point to the same actual device:
HPET: Length=56, Revision=1, Checksum=10,
OEMID=INTEL, OEM Table ID=CRESTLNE, OEM Revision=0x6040000,
Creator ID=LOHR, Creator Revision=0x5a
and
HPET: Length=56, Revision=1, Checksum=214,
OEMID=PTLTD, OEM Table ID=HPETTBL, OEM Revision=0x6040000,
Creator ID= LTP, Creator Revision=0x1
When apcihpet1 attaches it obviously can't map already mapped memory
space and boils out.
To deal with that I did a hack to count acpihpet devices and attach
only once. kettenis pointed out that it's easier to just go for
acpihpet0 instead of acpihpet* in the kernel config file. That works
fine for me too.
Nevertheless, this is my hack:
Index: dev/acpi/acpihpet.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/acpihpet.c,v
retrieving revision 1.12
diff -N -u -p -u -p dev/acpi/acpihpet.c
--- dev/acpi/acpihpet.c 21 Jul 2010 19:35:15 -0000 1.12
+++ dev/acpi/acpihpet.c 11 Dec 2010 20:16:06 -0000
@@ -29,6 +29,8 @@
#include <dev/acpi/acpivar.h>
#include <dev/acpi/acpidev.h>
+int hpet_attached;
+
int acpihpet_match(struct device *, void *, void *);
void acpihpet_attach(struct device *, struct device *, void *);
int acpihpet_activate(struct device *, int);
@@ -87,9 +89,9 @@ acpihpet_match(struct device *parent, void *match, voi
struct acpi_table_header *hdr;
/*
- * If we do not have a table, it is not us
+ * If we do not have a table, it is not us; attach only once
*/
- if (aaa->aaa_table == NULL)
+ if (hpet_attached || aaa->aaa_table == NULL)
return (0);
/*
@@ -170,6 +172,7 @@ acpihpet_attach(struct device *parent, struct device *
hpet_timecounter.tc_name = sc->sc_dev.dv_xname;
tc_init(&hpet_timecounter);
#endif
+ hpet_attached++;
}
#ifdef __HAVE_TIMECOUNTER