Attention is currently required from: Jeff Daly, Vanessa Eusebio.
Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/69530 )
Change subject: [WIP] soc/intel/baytrail,braswell,common: Handle IOAPIC IRQ overrides ......................................................................
[WIP] soc/intel/baytrail,braswell,common: Handle IOAPIC IRQ overrides
There are differences with SCI pin and polarity, so the IRQ entries need to be created dynamically.
Change-Id: I919433dfef907dd9008b79eaec5f53e824dcd292 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/soc/intel/baytrail/acpi.c M src/soc/intel/baytrail/include/soc/acpi.h M src/soc/intel/braswell/acpi.c M src/soc/intel/common/block/acpi/acpi.c M src/soc/intel/denverton_ns/include/soc/acpi.h 5 files changed, 58 insertions(+), 61 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/30/69530/1
diff --git a/src/soc/intel/baytrail/acpi.c b/src/soc/intel/baytrail/acpi.c index 4406188..053e6e3 100644 --- a/src/soc/intel/baytrail/acpi.c +++ b/src/soc/intel/baytrail/acpi.c @@ -86,15 +86,31 @@ return sci_irq; }
+static void fill_sci_override(*override) +{ + int sci = acpi_sci_irq(); + override->bus = MP_BUS_ISA; + override->srcpin = sci; + override->dstirq = sci; + if (sci >= 20) + override->flags = MP_IRQ_TRIGGER_LEVEL | MP_IRQ_POLARITY_LOW; + else + override->flags = MP_IRQ_TRIGGER_LEVEL | MP_IRQ_POLARITY_HIGH; +} + unsigned long acpi_fill_madt(unsigned long current) { /* Local APICs */ current = acpi_create_madt_lapics_with_nmis(current);
/* IOAPIC */ - current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR);
- current = acpi_madt_irq_overrides(current); + _override[2]; + const irq_overrides_dyn = { &_override, ARRAY_SIZE(_override) }; + + fill_pit_override(&_override[0]); + fill_sci_override(&_override[1]); + current = acpi_create_madt_ioapic_gsi0(current, &irq_overrides_dyn);
return current; } @@ -289,24 +305,3 @@ /* Add a method to notify processor nodes */ acpigen_write_processor_cnot(pattrs->num_cpus); } - -unsigned long acpi_madt_irq_overrides(unsigned long current) -{ - int sci_irq = acpi_sci_irq(); - acpi_madt_irqoverride_t *irqovr; - uint16_t sci_flags = MP_IRQ_TRIGGER_LEVEL; - - /* INT_SRC_OVR */ - irqovr = (void *)current; - current += acpi_create_madt_irqoverride(irqovr, 0, 0, 2, 0); - - if (sci_irq >= 20) - sci_flags |= MP_IRQ_POLARITY_LOW; - else - sci_flags |= MP_IRQ_POLARITY_HIGH; - - irqovr = (void *)current; - current += acpi_create_madt_irqoverride(irqovr, 0, sci_irq, sci_irq, sci_flags); - - return current; -} diff --git a/src/soc/intel/baytrail/include/soc/acpi.h b/src/soc/intel/baytrail/include/soc/acpi.h index d629b24..57af044 100644 --- a/src/soc/intel/baytrail/include/soc/acpi.h +++ b/src/soc/intel/baytrail/include/soc/acpi.h @@ -6,6 +6,4 @@ #include <acpi/acpi.h>
int acpi_sci_irq(void); -unsigned long acpi_madt_irq_overrides(unsigned long current); - #endif /* _BAYTRAIL_ACPI_H_ */ diff --git a/src/soc/intel/braswell/acpi.c b/src/soc/intel/braswell/acpi.c index 46a8771..5b78539 100644 --- a/src/soc/intel/braswell/acpi.c +++ b/src/soc/intel/braswell/acpi.c @@ -305,25 +305,16 @@ acpigen_write_processor_cnot(pattrs->num_cpus); }
-static unsigned long acpi_madt_irq_overrides(unsigned long current) +static void fill_sci_override(*override) { - int sci_irq = acpi_sci_irq(); - acpi_madt_irqoverride_t *irqovr; - uint16_t sci_flags = MP_IRQ_TRIGGER_LEVEL; - - /* INT_SRC_OVR */ - irqovr = (void *)current; - current += acpi_create_madt_irqoverride(irqovr, 0, 0, 2, 0); - - if (sci_irq >= 20) - sci_flags |= MP_IRQ_POLARITY_LOW; + int sci = acpi_sci_irq(); + override->bus = MP_BUS_ISA; + override->srcpin = sci; + override->dstirq = sci; + if (sci >= 20) + override->flags = MP_IRQ_TRIGGER_LEVEL | MP_IRQ_POLARITY_LOW; else - sci_flags |= MP_IRQ_POLARITY_HIGH; - - irqovr = (void *)current; - current += acpi_create_madt_irqoverride(irqovr, 0, sci_irq, sci_irq, sci_flags); - - return current; + override->flags = MP_IRQ_TRIGGER_LEVEL | MP_IRQ_POLARITY_HIGH; }
unsigned long acpi_fill_madt(unsigned long current) @@ -332,9 +323,11 @@ current = acpi_create_madt_lapics_with_nmis(current);
/* IOAPIC */ - current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR); - - current = acpi_madt_irq_overrides(current); + _override[2]; + const irq_overrides_dyn = { &_override, ARRAY_SIZE(_override) }; + fill_pit_override(&_override[0]); + fill_sci_override(&_override[1]); + current = acpi_create_madt_ioapic_gsi0(current, &irq_overrides_dyn);
return current; } diff --git a/src/soc/intel/common/block/acpi/acpi.c b/src/soc/intel/common/block/acpi/acpi.c index 860c868..b120727 100644 --- a/src/soc/intel/common/block/acpi/acpi.c +++ b/src/soc/intel/common/block/acpi/acpi.c @@ -55,22 +55,15 @@ return sci_irq; }
-static unsigned long acpi_madt_irq_overrides(unsigned long current) +static void fill_sci_override(*override) { - int sci = acpi_sci_irq(); uint16_t flags = MP_IRQ_TRIGGER_LEVEL; + int sci = acpi_sci_irq();
- /* INT_SRC_OVR */ - current += acpi_create_madt_irqoverride((void *)current, 0, 0, 2, 0); - - flags |= soc_madt_sci_irq_polarity(sci); - - /* SCI */ - current += - acpi_create_madt_irqoverride((void *)current, 0, sci, sci, flags); - - - return current; + override->bus = MP_BUS_ISA; + override->srcpin = sci; + override->dstirq = sci; + override->flags |= soc_madt_sci_irq_polarity(sci); }
__weak const struct madt_ioapic_info *soc_get_ioapic_info(size_t *entries) @@ -97,12 +90,18 @@ ioapic_table[i].addr, ioapic_table[i].gsi_base); } + /* FIXME: Path is missing override entries. */ } else { + _override[2]; + const irq_overrides_dyn = { &_override, ARRAY_SIZE(_override) }; + /* Default SOC IOAPIC entry */ - current += acpi_create_madt_ioapic_from_hw((void *)current, IO_APIC_ADDR); + fill_pit_override(&_override[0]); + fill_sci_override(&_override[1]); + current = acpi_create_madt_ioapic_gsi0(current, &irq_overrides_dyn); }
- return acpi_madt_irq_overrides(current); + return current; }
void acpi_fill_fadt(acpi_fadt_t *fadt) diff --git a/src/soc/intel/denverton_ns/include/soc/acpi.h b/src/soc/intel/denverton_ns/include/soc/acpi.h index 41a60d0..a789db2 100644 --- a/src/soc/intel/denverton_ns/include/soc/acpi.h +++ b/src/soc/intel/denverton_ns/include/soc/acpi.h @@ -6,7 +6,6 @@ #include <acpi/acpi.h>
void acpi_create_serialio_ssdt(acpi_header_t *ssdt); -unsigned long acpi_madt_irq_overrides(unsigned long current); unsigned long southcluster_write_acpi_tables(const struct device *device, unsigned long current, struct acpi_rsdp *rsdp);