summaryrefslogtreecommitdiff
path: root/src/soc
diff options
context:
space:
mode:
authorAngel Pons <th3fanbus@gmail.com>2021-01-28 12:22:52 +0100
committerNico Huber <nico.h@gmx.de>2021-03-12 15:41:35 +0000
commit18edd0008c1cfd7d0c61dcceb02cbfea03d464bf (patch)
treed8cf8145d36a486340148e408e31971e5bc25167 /src/soc
parentd37cfb766942748782dd866ec986dc36538836a2 (diff)
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 <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/50028 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc')
-rw-r--r--src/soc/intel/braswell/acpi.c18
-rw-r--r--src/soc/intel/braswell/include/soc/acpi.h1
2 files changed, 16 insertions, 3 deletions
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 <acpi/acpi.h>
#include <acpi/acpi_gnvs.h>
#include <acpi/acpigen.h>
-#include <device/mmio.h>
+#include <arch/ioapic.h>
#include <arch/smp/mpspec.h>
+#include <device/mmio.h>
#include <console/console.h>
#include <cpu/intel/turbo.h>
#include <cpu/x86/msr.h>
@@ -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);