diff options
author | Angel Pons <th3fanbus@gmail.com> | 2021-04-17 12:49:08 +0200 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2021-04-21 09:17:01 +0000 |
commit | e4844ce7c93b97adad543dc868a302d34f9e0282 (patch) | |
tree | 1004219452ff99040e5a2e169d759cba18d55333 /src/soc/intel/skylake/acpi.c | |
parent | 0feb949565bace3dd9a7a33a059b6a32dd2faa29 (diff) |
soc/intel/skylake: Move acpi_sci_irq() to acpi.c
Change-Id: I8bc170bd715e13d46fcedc0f796e2a99786791c0
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/52462
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Reviewed-by: Michael Niewöhner <foss@mniewoehner.de>
Reviewed-by: Frans Hendriks <fhendriks@eltan.com>
Diffstat (limited to 'src/soc/intel/skylake/acpi.c')
-rw-r--r-- | src/soc/intel/skylake/acpi.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/soc/intel/skylake/acpi.c b/src/soc/intel/skylake/acpi.c index 3434aac9bb..51fea18bf9 100644 --- a/src/soc/intel/skylake/acpi.c +++ b/src/soc/intel/skylake/acpi.c @@ -475,6 +475,34 @@ unsigned long northbridge_write_acpi_tables(const struct device *const dev, return current; } +int acpi_sci_irq(void) +{ + int scis = pci_read_config32(PCH_DEV_PMC, ACTL) & SCI_IRQ_SEL; + int sci_irq = 9; + + /* Determine how SCI is routed. */ + switch (scis) { + case SCIS_IRQ9: + case SCIS_IRQ10: + case SCIS_IRQ11: + sci_irq = scis - SCIS_IRQ9 + 9; + break; + case SCIS_IRQ20: + case SCIS_IRQ21: + case SCIS_IRQ22: + case SCIS_IRQ23: + sci_irq = scis - SCIS_IRQ20 + 20; + break; + default: + printk(BIOS_DEBUG, "Invalid SCI route! Defaulting to IRQ9.\n"); + sci_irq = 9; + break; + } + + printk(BIOS_DEBUG, "SCI is IRQ%d\n", sci_irq); + return sci_irq; +} + unsigned long acpi_madt_irq_overrides(unsigned long current) { int sci = acpi_sci_irq(); |