Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/47301 )
Change subject: soc/intel/xeon_sp: Improve generating PCH IOAPIC MADT entry ......................................................................
soc/intel/xeon_sp: Improve generating PCH IOAPIC MADT entry
The PCH IOAPIC ID is 0x8 so it needs to be generated before the IIO IOAPICs. Since we will get rid of the ioapic_id array this makes it more readable.
Change-Id: I64a3b259e438ef666fb68a433cceda10aebdb1bf Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/soc/intel/xeon_sp/acpi.c 1 file changed, 17 insertions(+), 12 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/01/47301/1
diff --git a/src/soc/intel/xeon_sp/acpi.c b/src/soc/intel/xeon_sp/acpi.c index fcd5f00..c70945a 100644 --- a/src/soc/intel/xeon_sp/acpi.c +++ b/src/soc/intel/xeon_sp/acpi.c @@ -101,6 +101,16 @@ current = xeonsp_acpi_create_madt_lapics(current);
cur_index = 0; + { + assert(cur_index < ARRAY_SIZE(ioapic_ids)); + assert(cur_index < ARRAY_SIZE(gsi_bases)); + int ioapic_id = ioapic_ids[cur_index]; + int gsi_base = gsi_bases[cur_index]; + current += add_madt_ioapic(current, 0, 0, ioapic_id, + hob->PlatformData.IIO_resource[0].StackRes[0].IoApicBase, + gsi_base); + ++cur_index; + }
for (int socket = 0; socket < hob->PlatformData.numofIIO; ++socket) { for (int stack = 0; stack < MAX_IIO_STACK; ++stack) { @@ -111,22 +121,17 @@ assert(cur_index < ARRAY_SIZE(gsi_bases)); int ioapic_id = ioapic_ids[cur_index]; int gsi_base = gsi_bases[cur_index]; - current += add_madt_ioapic(current, socket, stack, ioapic_id, ri->IoApicBase, gsi_base); - ++cur_index; - + uint32_t ioapic_base = ri->IoApicBase; /* * Stack 0 has non-PCH IOAPIC and PCH IOAPIC. * Add entry for PCH IOAPIC. */ - if (stack == 0 && socket == 0) { /* PCH IOAPIC */ - assert(cur_index < ARRAY_SIZE(ioapic_ids)); - assert(cur_index < ARRAY_SIZE(gsi_bases)); - ioapic_id = ioapic_ids[cur_index]; - gsi_base = gsi_bases[cur_index]; - current += add_madt_ioapic(current, socket, stack, ioapic_id, - ri->IoApicBase + 0x1000, gsi_base); - ++cur_index; - } + if (stack == 0 && socket == 0) + ioapic_base += 0x1000; + + current += add_madt_ioapic(current, socket, stack, ioapic_id, ioapic_base, + gsi_base); + ++cur_index; } }