summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2022-12-08 14:25:11 +0100
committerLean Sheng Tan <sheng.tan@9elements.com>2023-05-14 13:00:25 +0000
commitd1c61a8e70422d746c3096821bb479b2014248f0 (patch)
tree1e719c6adf7172bdf607aa35cdd35701e7703c15
parent0e1f08d1fbb09eb0a14b23f231f1a62697af9ccd (diff)
downloadcoreboot-d1c61a8e70422d746c3096821bb479b2014248f0.tar.gz
arch/x86/ioapic.c: Increase the number of bits for ioapic ID
In practice hardware can use larger numbers. Change-Id: I6e9ddd1ebd396c37e25eb3019f981d45d9c5e062 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/70499 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Naresh Solanki <naresh.solanki.2011@gmail.com> Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
-rw-r--r--src/arch/x86/ioapic.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/arch/x86/ioapic.c b/src/arch/x86/ioapic.c
index 84a4c7f7bc..04c852b4c2 100644
--- a/src/arch/x86/ioapic.c
+++ b/src/arch/x86/ioapic.c
@@ -147,7 +147,12 @@ static void set_ioapic_id(void *ioapic_base, u8 ioapic_id)
u8 get_ioapic_id(void *ioapic_base)
{
- return (io_apic_read(ioapic_base, 0x00) >> 24) & 0x0f;
+ /*
+ * According to 82093AA I/O ADVANCED PROGRAMMABLE INTERRUPT CONTROLLER (IOAPIC)
+ * only 4 bits (24:27) are used for the ID. In practice the upper bits are either
+ * always 0 or used for larger IDs.
+ */
+ return (io_apic_read(ioapic_base, 0x00) >> 24) & 0xff;
}
u8 get_ioapic_version(void *ioapic_base)