Marc Jones has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48246 )
Change subject: soc/intel/common/block/acpi: Add soc MADT override ......................................................................
Patch Set 7:
Furquan added a comment in a dependency madt patch. Moving the discussion to here: https://review.coreboot.org/c/coreboot/+/48248/8/src/soc/intel/xeon_sp/acpi....
src/soc/intel/xeon_sp/acpi.c Line 99 IIUC, the major difference between the common ACPI implementation of this function and the SoC-specific implementation here is that this implementation adds multiple IOAPIC structures whereas the common implementation adds just one.
Would this work: Use the common ACPI implementation of acpi_fill_madt(), but make a callback into SoC to get IOAPIC info. Probably a structure like this:
struct ioapic_info {
u8 id; u32 addr; u32 gsi_base; }; /* Returns a table of ioapic_info entries and the count of entries in the table */ size_t soc_get_ioapic_info(struct ioapic_info **ioapic_arr);
xeon_sp can implement this function (using exactly the same logic here) to create this table instead of making calls to add_madt_ioapic() directly and that table can be used by the common acpi_fill_madt() to make calls into add_madt_ioapic() as required. Default implementation would be using id = 2, addr = IO_APIC_ADDR, gsi_base = 0 which works for all other SoCs.