diff --git a/src/Kconfig b/src/Kconfig index 6c59e4fa5b..ec7dde2e53 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -919,6 +919,13 @@ config IOAPIC default y if SMP default n +config IOAPIC_8BIT_ID + bool + default n + depends on IOAPIC + help + Select this option if the hardware support 8bit long IOAPIC IDs. + config USE_WATCHDOG_ON_BOOT bool default n diff --git a/src/arch/x86/ioapic.c b/src/arch/x86/ioapic.c index 4cde7c7f51..792ba3e65e 100644 --- a/src/arch/x86/ioapic.c +++ b/src/arch/x86/ioapic.c @@ -129,13 +129,21 @@ static void route_i8259_irq0(uintptr_t ioapic_base) static void set_ioapic_id(uintptr_t ioapic_base, u8 ioapic_id) { int i; + u32 reg; printk(BIOS_DEBUG, "IOAPIC: Initializing IOAPIC at %" PRIxPTR "\n", ioapic_base); printk(BIOS_DEBUG, "IOAPIC: ID = 0x%02x\n", ioapic_id); - io_apic_write(ioapic_base, 0x00, - (io_apic_read(ioapic_base, 0x00) & 0xf0ffffff) | (ioapic_id << 24)); + reg = io_apic_read(ioapic_base, 0x00); + + if (CONFIG(IOAPIC_8BIT_ID)) + reg &= 0x00ffffff; + else + reg &= 0xf0ffffff; + + reg |= (ioapic_id << 24); + io_apic_write(ioapic_base, 0x00, reg); printk(BIOS_SPEW, "IOAPIC: Dumping registers\n"); for (i = 0; i < 3; i++)