Furquan Shaikh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/48248 )
Change subject: soc/intel/xeon_sp: Use common block ACPI ......................................................................
Patch Set 8:
(1 comment)
https://review.coreboot.org/c/coreboot/+/48248/8/src/soc/intel/xeon_sp/acpi.... File src/soc/intel/xeon_sp/acpi.c:
https://review.coreboot.org/c/coreboot/+/48248/8/src/soc/intel/xeon_sp/acpi.... PS8, Line 99: add_madt_ioapic 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.