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 | |
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')
-rw-r--r-- | src/soc/intel/skylake/acpi.c | 28 | ||||
-rw-r--r-- | src/soc/intel/skylake/fadt.c | 1 | ||||
-rw-r--r-- | src/soc/intel/skylake/include/soc/acpi.h | 2 | ||||
-rw-r--r-- | src/soc/intel/skylake/include/soc/pm.h | 3 | ||||
-rw-r--r-- | src/soc/intel/skylake/pmutil.c | 28 |
5 files changed, 31 insertions, 31 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(); diff --git a/src/soc/intel/skylake/fadt.c b/src/soc/intel/skylake/fadt.c index c8e4ec4fb6..3e60216fba 100644 --- a/src/soc/intel/skylake/fadt.c +++ b/src/soc/intel/skylake/fadt.c @@ -2,6 +2,7 @@ #include <acpi/acpi.h> #include <cpu/x86/smm.h> +#include <soc/acpi.h> #include <soc/iomap.h> #include <soc/pm.h> #include "chip.h" diff --git a/src/soc/intel/skylake/include/soc/acpi.h b/src/soc/intel/skylake/include/soc/acpi.h index e12a748291..683a50490a 100644 --- a/src/soc/intel/skylake/include/soc/acpi.h +++ b/src/soc/intel/skylake/include/soc/acpi.h @@ -11,6 +11,8 @@ #define PSS_LATENCY_TRANSITION 10 #define PSS_LATENCY_BUSMASTER 10 +/* Return the selected ACPI SCI IRQ */ +int acpi_sci_irq(void); unsigned long acpi_madt_irq_overrides(unsigned long current); unsigned long northbridge_write_acpi_tables(const struct device *, unsigned long current, struct acpi_rsdp *); diff --git a/src/soc/intel/skylake/include/soc/pm.h b/src/soc/intel/skylake/include/soc/pm.h index cd5c43e9b7..a57772446e 100644 --- a/src/soc/intel/skylake/include/soc/pm.h +++ b/src/soc/intel/skylake/include/soc/pm.h @@ -155,9 +155,6 @@ struct chipset_power_state { uint32_t prev_sleep_state; } __packed; -/* Return the selected ACPI SCI IRQ */ -int acpi_sci_irq(void); - /* Get base address PMC memory mapped registers. */ uint8_t *pmc_mmio_regs(void); diff --git a/src/soc/intel/skylake/pmutil.c b/src/soc/intel/skylake/pmutil.c index 906a1cf56f..115a9e58ec 100644 --- a/src/soc/intel/skylake/pmutil.c +++ b/src/soc/intel/skylake/pmutil.c @@ -113,34 +113,6 @@ const char *const *soc_std_gpe_sts_array(size_t *gpe_arr) return gpe_sts_bits; } -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; -} - uint8_t *pmc_mmio_regs(void) { uint32_t reg32; |