soc/amd: Use ioapic helper functions
Calling setup_ioapic() was only correct for the
IOAPIC routing GSI 0..15 that mimic legacy PIC IRQs.
Change-Id: Ifdacc61b72f461ec6bea334fa06651c09a9695d6
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55571
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
diff --git a/src/soc/amd/stoneyridge/acpi.c b/src/soc/amd/stoneyridge/acpi.c
index d6f7048..20221d2 100644
--- a/src/soc/amd/stoneyridge/acpi.c
+++ b/src/soc/amd/stoneyridge/acpi.c
@@ -29,11 +29,9 @@
current = acpi_create_madt_lapics(current);
/* Write Kern IOAPIC, only one */
- current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current,
- FCH_IOAPIC_ID, IO_APIC_ADDR, 0);
+ current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR);
- current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current,
- GNB_IOAPIC_ID, IO_APIC2_ADDR, 24);
+ current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC2_ADDR);
/* PIT is connected to legacy IRQ 0, but IOAPIC GSI 2 */
current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)current,
diff --git a/src/soc/amd/stoneyridge/northbridge.c b/src/soc/amd/stoneyridge/northbridge.c
index 7e93896..3960a39 100644
--- a/src/soc/amd/stoneyridge/northbridge.c
+++ b/src/soc/amd/stoneyridge/northbridge.c
@@ -164,7 +164,7 @@
static void northbridge_init(struct device *dev)
{
- setup_ioapic((u8 *)IO_APIC2_ADDR, GNB_IOAPIC_ID);
+ register_new_ioapic((u8 *)IO_APIC2_ADDR);
}
static unsigned long acpi_fill_hest(acpi_hest_t *hest)