summaryrefslogtreecommitdiff
path: root/src/soc/intel/common/block/acpi
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2023-04-10 16:45:39 +0300
committerKyösti Mälkki <kyosti.malkki@gmail.com>2023-04-26 10:52:21 +0000
commitae1b2d49cf0ad09ff8f1e3904a9e7b23d6fb423b (patch)
tree41a0e28f6df404725371c5d5c57162bd9f9653d8 /src/soc/intel/common/block/acpi
parentddc37d69cb29327217151bd15a906177bc7949de (diff)
soc/intel: Introduce ioapic_get_sci_pin()
According to ACPI Release 6.5 systems supporting PIC (i8259) interrupt mechanism need to report IRQ vector for the SCI_INT field. In PIC mode only IRQ0..15 are allowed hardware vectors. This change should cover section 5.2.9 to not pass SCI_INT larger than IRQ15. Section 5.2.15.5 needs follow-up work. Care should be taken that ioapic_get_sci_pin() is called after platform code has potentially changed the routing from the default. It appears touched all platforms except siemens/mc_aplX currently program SCI as IRQ9. Change-Id: I723c207f1dcbba5e6fc0452fe1dbd087fad290ee Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/74326 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <inforichland@gmail.com> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Diffstat (limited to 'src/soc/intel/common/block/acpi')
-rw-r--r--src/soc/intel/common/block/acpi/acpi.c40
1 files changed, 16 insertions, 24 deletions
diff --git a/src/soc/intel/common/block/acpi/acpi.c b/src/soc/intel/common/block/acpi/acpi.c
index cfc15a840d..50854fa374 100644
--- a/src/soc/intel/common/block/acpi/acpi.c
+++ b/src/soc/intel/common/block/acpi/acpi.c
@@ -24,9 +24,11 @@
#define CPUID_6_EAX_ISST (1 << 7)
-static int acpi_sci_irq(void)
+#define ACPI_SCI_IRQ 9
+
+void ioapic_get_sci_pin(u8 *gsi, u8 *irq, u8 *flags)
{
- int sci_irq = 9;
+ int sci_irq = ACPI_SCI_IRQ;
uint32_t scis;
scis = soc_read_sci_irq_select();
@@ -47,32 +49,18 @@ static int acpi_sci_irq(void)
sci_irq = scis - SCIS_IRQ20 + 20;
break;
default:
- printk(BIOS_DEBUG, "Invalid SCI route! Defaulting to IRQ9.\n");
- sci_irq = 9;
+ printk(BIOS_DEBUG, "Invalid SCI route! Defaulting to IRQ%d.\n", sci_irq);
break;
}
- printk(BIOS_DEBUG, "SCI is IRQ%d\n", sci_irq);
- return sci_irq;
-}
-
-static unsigned long acpi_madt_irq_overrides(unsigned long current)
-{
- int sci = acpi_sci_irq();
- uint16_t flags = MP_IRQ_TRIGGER_LEVEL;
-
- /* INT_SRC_OVR */
- current += acpi_create_madt_irqoverride((void *)current, 0, 0, 2, 0);
-
- flags |= soc_madt_sci_irq_polarity(sci);
+ *gsi = sci_irq;
+ *irq = (sci_irq < 16) ? sci_irq : ACPI_SCI_IRQ;
+ *flags = MP_IRQ_TRIGGER_LEVEL | soc_madt_sci_irq_polarity(sci_irq);
- /* SCI */
- current +=
- acpi_create_madt_irqoverride((void *)current, 0, sci, sci, flags);
-
- return current;
+ printk(BIOS_DEBUG, "SCI is IRQ %d, GSI %d\n", *irq, *gsi);
}
+
static const uintptr_t default_ioapic_bases[] = { IO_APIC_ADDR };
__weak size_t soc_get_ioapic_info(const uintptr_t *ioapic_bases[])
@@ -95,14 +83,18 @@ unsigned long acpi_fill_madt(unsigned long current)
for (int i = 0; i < ioapic_entries; i++)
current += acpi_create_madt_ioapic_from_hw((void *)current, ioapic_table[i]);
- return acpi_madt_irq_overrides(current);
+ /* INT_SRC_OVR */
+ current += acpi_create_madt_irqoverride((void *)current, 0, 0, 2, 0);
+ current += acpi_create_madt_sci_override((void *)current);
+
+ return current;
}
void acpi_fill_fadt(acpi_fadt_t *fadt)
{
const uint16_t pmbase = ACPI_BASE_ADDRESS;
- fadt->sci_int = acpi_sci_irq();
+ fadt->sci_int = acpi_sci_int();
if (permanent_smi_handler()) {
fadt->smi_cmd = APM_CNT;