diff --git a/src/arch/x86/Kconfig b/src/arch/x86/Kconfig index 7f10f9a20f..e7328b6375 100644 --- a/src/arch/x86/Kconfig +++ b/src/arch/x86/Kconfig @@ -478,4 +478,12 @@ config IOAPIC_8BIT_ID help Select this option if the hardware support 8bit long IOAPIC IDs. +config IOAPIC_USE_PRESET_ID + bool + default n + depends on IOAPIC + help + Select this option if coreboot should keep IOAPIC IDs programmed + by silicon vendor initialization code. + endif diff --git a/src/arch/x86/ioapic.c b/src/arch/x86/ioapic.c index 792ba3e65e..b90ba94fcb 100644 --- a/src/arch/x86/ioapic.c +++ b/src/arch/x86/ioapic.c @@ -230,13 +230,15 @@ void setup_ioapic(uintptr_t ioapic_base, u8 ioapic_id) void register_new_ioapic_gsi0(uintptr_t ioapic_base) { - setup_ioapic(ioapic_base, 0); + setup_ioapic(ioapic_base, CONFIG(IOAPIC_USE_PRESET_ID) ? + get_ioapic_id(ioapic_base) : 0); } void register_new_ioapic(uintptr_t ioapic_base) { static u8 ioapic_id; ioapic_id++; - set_ioapic_id(ioapic_base, ioapic_id); + set_ioapic_id(ioapic_base, CONFIG(IOAPIC_USE_PRESET_ID) ? + get_ioapic_id(ioapic_base) : ioapic_id); clear_vectors(ioapic_base, 0, ioapic_get_max_vectors(ioapic_base) - 1); }