diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/soc/intel/common/block/acpi/acpi.c | 23 | ||||
-rw-r--r-- | src/soc/intel/common/block/include/intelblocks/acpi.h | 12 |
2 files changed, 34 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); } diff --git a/src/soc/intel/common/block/include/intelblocks/acpi.h b/src/soc/intel/common/block/include/intelblocks/acpi.h index cd3a309c21..d76d95ab11 100644 --- a/src/soc/intel/common/block/include/intelblocks/acpi.h +++ b/src/soc/intel/common/block/include/intelblocks/acpi.h @@ -68,4 +68,16 @@ void soc_power_states_generation(int core_id, int cores_per_package); */ int common_calculate_power_ratio(int tdp, int p1_ratio, int ratio); +struct madt_ioapic_info { + u8 id; + u32 addr; + u32 gsi_base; +}; + +/* + * Returns a table of MADT ioapic_info entries and the number of entries + * If the SOC doesn't implement this hook a default ioapic setting is used. + */ +const struct madt_ioapic_info *soc_get_ioapic_info(size_t *entries); + #endif /* _SOC_INTEL_COMMON_BLOCK_ACPI_H_ */ |