summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorPatrick Georgi <patrick@georgi-clan.de>2012-10-05 21:54:38 +0200
committerPatrick Georgi <patrick@georgi-clan.de>2012-10-08 21:23:08 +0200
commit9aeb69447d3839675b2cac51c3e95a4724fd9b0d (patch)
treed9b1cc7483a51ab340d6d9fae78a30e562f99767 /src/arch
parentec2c18ee6068ef6adf6f5be437d7047c91773654 (diff)
hpet: common ACPI generation
HPET's min ticks (minimum time between events to avoid losing interrupts) is chipset specific, so move it to Kconfig. Via also has a special base address, so move it as well. Apart from these (and the base address was already #defined), the table is very uniform. Change-Id: I848a2e2b0b16021c7ee5ba99097fa6a5886c3286 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/1562 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: Dave Frodin <dave.frodin@se-eng.com>
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/x86/Kconfig4
-rw-r--r--src/arch/x86/boot/acpi.c14
2 files changed, 13 insertions, 5 deletions
diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig
index 6d56ec6bfc..7e0d195548 100644
--- a/src/arch/x86/Kconfig
+++ b/src/arch/x86/Kconfig
@@ -111,4 +111,8 @@ config PCI_CONF2
bool
default n
+config HPET_ADDRESS
+ hex
+ default 0xfed00000 if !HPET_ADDRESS_OVERRIDE
+
endmenu
diff --git a/src/arch/x86/boot/acpi.c b/src/arch/x86/boot/acpi.c
index 69322088e2..9881ffe4ed 100644
--- a/src/arch/x86/boot/acpi.c
+++ b/src/arch/x86/boot/acpi.c
@@ -36,6 +36,11 @@
#include <timestamp.h>
#endif
+/* FIXME: Kconfig doesn't support overridable defaults :-( */
+#ifndef CONFIG_HPET_MIN_TICKS
+#define CONFIG_HPET_MIN_TICKS 0x1000
+#endif
+
u8 acpi_checksum(u8 *table, u32 length)
{
u8 ret = 0;
@@ -356,7 +361,6 @@ void acpi_create_slit(acpi_slit_t *slit)
/* http://www.intel.com/hardwaredesign/hpetspec_1.pdf */
void acpi_create_hpet(acpi_hpet_t *hpet)
{
-#define HPET_ADDR 0xfed00000ULL
acpi_header_t *header = &(hpet->header);
acpi_addr_t *addr = &(hpet->addr);
@@ -375,12 +379,12 @@ void acpi_create_hpet(acpi_hpet_t *hpet)
addr->space_id = 0; /* Memory */
addr->bit_width = 64;
addr->bit_offset = 0;
- addr->addrl = HPET_ADDR & 0xffffffff;
- addr->addrh = HPET_ADDR >> 32;
+ addr->addrl = CONFIG_HPET_ADDRESS & 0xffffffff;
+ addr->addrh = ((unsigned long long)CONFIG_HPET_ADDRESS) >> 32;
- hpet->id = 0x102282a0; /* AMD! FIXME */
+ hpet->id = *(unsigned int*)CONFIG_HPET_ADDRESS;
hpet->number = 0;
- hpet->min_tick = 4096;
+ hpet->min_tick = CONFIG_HPET_MIN_TICKS;
header->checksum = acpi_checksum((void *)hpet, sizeof(acpi_hpet_t));
}