soc/amd: Move MADT IRQ override settings into common_config
This is another common ACPI setting.
Signed-off-by: Raul E Rangel <rrangel@chromium.org>
Change-Id: Iefecabae1d83996a9a4aaadd2a53c2432441e1b2
Reviewed-on: https://review.coreboot.org/c/coreboot/+/50558
Reviewed-by: Mathew King <mathewk@chromium.org>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/soc/amd/common/block/acpi/tables.c b/src/soc/amd/common/block/acpi/tables.c
index f941bc9..88ff252 100644
--- a/src/soc/amd/common/block/acpi/tables.c
+++ b/src/soc/amd/common/block/acpi/tables.c
@@ -2,6 +2,7 @@
#include <acpi/acpi.h>
#include <amdblocks/acpi.h>
+#include <amdblocks/chip.h>
#include <device/device.h>
#include <types.h>
@@ -23,3 +24,24 @@
return current;
}
+
+unsigned long acpi_fill_madt_irqoverride(unsigned long current)
+{
+ const struct soc_amd_common_config *cfg = soc_get_common_config();
+ unsigned int i;
+ uint8_t irq;
+ uint8_t flags;
+
+ for (i = 0; i < ARRAY_SIZE(cfg->irq_override); ++i) {
+ irq = cfg->irq_override[i].irq;
+ flags = cfg->irq_override[i].flags;
+
+ if (!flags)
+ continue;
+
+ current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)current, 0,
+ irq, irq, flags);
+ }
+
+ return current;
+}