arch/x86/ioapic: Add Kconfig option to keep pre-allocated IOAPIC ID

Introduce IOAPIC_USE_PRESET_ID Kconfig option to instruct coreboot to
keep the IOAPIC ID programmed in the silicon initialization modules.
For example, OpenSIL already programs the IOAPIC IDs.

TEST=See IOAPIC IDs are starting with 240 on Gigabyte MZ33-AR1 as set
by OpenSIL.

Change-Id: Idb44c1aa663d7e351b011f4dd13f0b6b426566bb
Signed-off-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/89477
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Matt DeVillier <matt.devillier@gmail.com>
This commit is contained in:
Michał Żygowski 2025-10-06 10:52:32 +02:00 committed by Matt DeVillier
commit 026bac6de7
2 changed files with 12 additions and 2 deletions

View file

@ -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

View file

@ -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);
}