diff options
author | Raul E Rangel <rrangel@chromium.org> | 2021-02-11 11:07:11 -0700 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2021-02-12 20:45:59 +0000 |
commit | ffab5e64d185cebfbc35e3959382910ddd5ddce8 (patch) | |
tree | 4f2b1b71d82802268ceee248f6b13a7b2cbff511 /src/soc/amd/common | |
parent | 1c88b10be277bb65ebf3f4ff12361c53eb054e01 (diff) |
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>
Diffstat (limited to 'src/soc/amd/common')
-rw-r--r-- | src/soc/amd/common/block/acpi/tables.c | 22 | ||||
-rw-r--r-- | src/soc/amd/common/block/include/amdblocks/acpi.h | 2 | ||||
-rw-r--r-- | src/soc/amd/common/block/include/amdblocks/chip.h | 11 |
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]; }; /* |