summaryrefslogtreecommitdiff
path: root/src/soc/amd/common/block
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/amd/common/block')
-rw-r--r--src/soc/amd/common/block/acpi/tables.c22
-rw-r--r--src/soc/amd/common/block/include/amdblocks/acpi.h2
-rw-r--r--src/soc/amd/common/block/include/amdblocks/chip.h11
3 files changed, 35 insertions, 0 deletions
diff --git a/src/soc/amd/common/block/acpi/tables.c b/src/soc/amd/common/block/acpi/tables.c
index f941bc94a0..88ff252b26 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 @@ unsigned long acpi_fill_mcfg(unsigned long current)
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;
+}
diff --git a/src/soc/amd/common/block/include/amdblocks/acpi.h b/src/soc/amd/common/block/include/amdblocks/acpi.h
index badc77bb9f..e6e2520412 100644
--- a/src/soc/amd/common/block/include/amdblocks/acpi.h
+++ b/src/soc/amd/common/block/include/amdblocks/acpi.h
@@ -51,4 +51,6 @@ struct chipset_power_state {
unsigned long southbridge_write_acpi_tables(const struct device *device, unsigned long current,
struct acpi_rsdp *rsdp);
+unsigned long acpi_fill_madt_irqoverride(unsigned long current);
+
#endif /* AMD_BLOCK_ACPI_H */
diff --git a/src/soc/amd/common/block/include/amdblocks/chip.h b/src/soc/amd/common/block/include/amdblocks/chip.h
index b365e4d5d0..e18ce64265 100644
--- a/src/soc/amd/common/block/include/amdblocks/chip.h
+++ b/src/soc/amd/common/block/include/amdblocks/chip.h
@@ -24,6 +24,17 @@ struct soc_amd_common_config {
/* Options for these are in src/include/acpi/acpi.h */
uint16_t fadt_boot_arch;
uint32_t fadt_flags;
+
+ /**
+ * IRQ 0 - 15 have a default trigger of edge and default polarity of high.
+ * If you have a device that requires a different configuration you can override the
+ * settings here.
+ */
+ struct {
+ uint8_t irq;
+ /* See MP_IRQ_* from mpspec.h */
+ uint8_t flags;
+ } irq_override[16];
};
/*