diff options
author | Marc Jones <marcjones@sysproconsulting.com> | 2020-12-02 11:24:00 -0700 |
---|---|---|
committer | Hung-Te Lin <hungte@chromium.org> | 2020-12-21 02:35:21 +0000 |
commit | 847043c2074e855e48f820fbc193a2c860827e1b (patch) | |
tree | 353c530299f491dd16dbb661c5b13480e34f87e7 /src/soc/intel/common/block/acpi | |
parent | cbe12440713f66d1f05ecc34a0dcc6b6c8c73b4e (diff) |
soc/intel/common/block/acpi: Add soc MADT IOAPIC hook
Add a hook for SOCs to provide an IOAPIC MADT table. If the
SOC doesn't provide a table then a standard setting is used.
Change-Id: Ic818a634e4912d88ef93971deb4da5ab708c9020
Signed-off-by: Marc Jones <marcjones@sysproconsulting.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/48246
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Jay Talbott <JayTalbott@sysproconsulting.com>
Reviewed-by: Furquan Shaikh <furquan@google.com>
Diffstat (limited to 'src/soc/intel/common/block/acpi')
-rw-r--r-- | src/soc/intel/common/block/acpi/acpi.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/soc/intel/common/block/acpi/acpi.c b/src/soc/intel/common/block/acpi/acpi.c index a6c626f682..934a92f7c5 100644 --- a/src/soc/intel/common/block/acpi/acpi.c +++ b/src/soc/intel/common/block/acpi/acpi.c @@ -86,13 +86,34 @@ static unsigned long acpi_madt_irq_overrides(unsigned long current) return current; } +__weak const struct madt_ioapic_info *soc_get_ioapic_info(size_t *entries) +{ + *entries = 0; + return NULL; +} + unsigned long acpi_fill_madt(unsigned long current) { + const struct madt_ioapic_info *ioapic_table; + size_t ioapic_entries; + /* Local APICs */ current = acpi_create_madt_lapics(current); /* IOAPIC */ - current += acpi_create_madt_ioapic((void *)current, 2, IO_APIC_ADDR, 0); + ioapic_table = soc_get_ioapic_info(&ioapic_entries); + if (ioapic_entries) { + for (int i = 0; i < ioapic_entries; i++) { + current += acpi_create_madt_ioapic( + (void *)current, + ioapic_table[i].id, + ioapic_table[i].addr, + ioapic_table[i].gsi_base); + } + } else { + /* Default SOC IOAPIC entry */ + current += acpi_create_madt_ioapic((void *)current, 2, IO_APIC_ADDR, 0); + } return acpi_madt_irq_overrides(current); } |