From 18edd0008c1cfd7d0c61dcceb02cbfea03d464bf Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Thu, 28 Jan 2021 12:22:52 +0100 Subject: soc/intel/braswell: Factor out common `acpi_fill_madt` Function is identical for all mainboards, so factor it out. Change-Id: Ibe08fa7ae19bfc238d09158309f0a9fdb31ad21c Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/50028 Reviewed-by: Tim Wawrzynczak Reviewed-by: Nico Huber Tested-by: build bot (Jenkins) --- src/soc/intel/braswell/acpi.c | 18 ++++++++++++++++-- src/soc/intel/braswell/include/soc/acpi.h | 1 - 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'src/soc/intel') diff --git a/src/soc/intel/braswell/acpi.c b/src/soc/intel/braswell/acpi.c index c55632c4e5..2d7ca3c9ca 100644 --- a/src/soc/intel/braswell/acpi.c +++ b/src/soc/intel/braswell/acpi.c @@ -3,8 +3,9 @@ #include #include #include -#include +#include #include +#include #include #include #include @@ -305,7 +306,7 @@ void generate_cpu_entries(const struct device *device) acpigen_write_processor_cnot(pattrs->num_cpus); } -unsigned long acpi_madt_irq_overrides(unsigned long current) +static unsigned long acpi_madt_irq_overrides(unsigned long current) { int sci_irq = acpi_sci_irq(); acpi_madt_irqoverride_t *irqovr; @@ -326,6 +327,19 @@ unsigned long acpi_madt_irq_overrides(unsigned long current) return current; } +unsigned long acpi_fill_madt(unsigned long current) +{ + /* Local APICs */ + current = acpi_create_madt_lapics(current); + + /* IOAPIC */ + current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, 2, IO_APIC_ADDR, 0); + + current = acpi_madt_irq_overrides(current); + + return current; +} + unsigned long southcluster_write_acpi_tables(const struct device *device, unsigned long current, struct acpi_rsdp *rsdp) { diff --git a/src/soc/intel/braswell/include/soc/acpi.h b/src/soc/intel/braswell/include/soc/acpi.h index 461913dda3..ccb48eb447 100644 --- a/src/soc/intel/braswell/include/soc/acpi.h +++ b/src/soc/intel/braswell/include/soc/acpi.h @@ -7,7 +7,6 @@ int acpi_sci_irq(void); void acpi_create_serialio_ssdt(acpi_header_t *ssdt); -unsigned long acpi_madt_irq_overrides(unsigned long current); unsigned long southcluster_write_acpi_tables(const struct device *device, unsigned long current, struct acpi_rsdp *rsdp); -- cgit v1.2.3