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>
diff --git a/src/arch/x86/ioapic.c b/src/arch/x86/ioapic.c
index 84a4c7f..04c852b 100644
--- a/src/arch/x86/ioapic.c
+++ b/src/arch/x86/ioapic.c
@@ -147,7 +147,12 @@
 
 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)