sb,soc/intel: Use acpi_create_madt_ioapic_from_hw()

Change-Id: I9fd9cf230ce21674d1c24b40f310e5558e65be25
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55311
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
Kyösti Mälkki 2021-06-08 06:12:25 +03:00
parent 0ea8f89e40
commit c0457358f6
9 changed files with 11 additions and 28 deletions

View File

@ -8,15 +8,8 @@
#include <acpi/acpi.h> #include <acpi/acpi.h>
#include <device/pci_def.h> #include <device/pci_def.h>
#define IOAPIC_ICH4 2
#define IOAPIC_P64H2_BUS_B 3 /* IOAPIC 3 at 02:1c.0 */
#define IOAPIC_P64H2_BUS_A 4 /* IOAPIC 4 at 02:1e.0 */
#define INTEL_IOAPIC_NUM_INTERRUPTS 24 /* Both ICH-4 and P64-H2 */
unsigned long acpi_fill_madt(unsigned long current) unsigned long acpi_fill_madt(unsigned long current)
{ {
unsigned int irq_start = 0;
struct device *bdev, *dev = NULL; struct device *bdev, *dev = NULL;
struct resource *res = NULL; struct resource *res = NULL;
@ -27,9 +20,7 @@ unsigned long acpi_fill_madt(unsigned long current)
current += acpi_create_madt_lapic((acpi_madt_lapic_t *)current, 3, 7); current += acpi_create_madt_lapic((acpi_madt_lapic_t *)current, 3, 7);
/* Southbridge IOAPIC */ /* Southbridge IOAPIC */
current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, IOAPIC_ICH4, current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, 0xfec00000);
0xfec00000, irq_start);
irq_start += INTEL_IOAPIC_NUM_INTERRUPTS;
bdev = pcidev_on_root(2, 0); bdev = pcidev_on_root(2, 0);
/* P64H2 Bus B IOAPIC */ /* P64H2 Bus B IOAPIC */
@ -37,9 +28,7 @@ unsigned long acpi_fill_madt(unsigned long current)
dev = pcidev_path_behind(bdev->link_list, PCI_DEVFN(28, 0)); dev = pcidev_path_behind(bdev->link_list, PCI_DEVFN(28, 0));
if (dev) { if (dev) {
res = find_resource(dev, PCI_BASE_ADDRESS_0); res = find_resource(dev, PCI_BASE_ADDRESS_0);
current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, res->base);
IOAPIC_P64H2_BUS_B, res->base, irq_start);
irq_start += INTEL_IOAPIC_NUM_INTERRUPTS;
} }
/* P64H2 Bus A IOAPIC */ /* P64H2 Bus A IOAPIC */
@ -47,9 +36,7 @@ unsigned long acpi_fill_madt(unsigned long current)
dev = pcidev_path_behind(bdev->link_list, PCI_DEVFN(30, 0)); dev = pcidev_path_behind(bdev->link_list, PCI_DEVFN(30, 0));
if (dev) { if (dev) {
res = find_resource(dev, PCI_BASE_ADDRESS_0); res = find_resource(dev, PCI_BASE_ADDRESS_0);
current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, res->base);
IOAPIC_P64H2_BUS_A, res->base, irq_start);
irq_start += INTEL_IOAPIC_NUM_INTERRUPTS;
} }
/* Map ISA IRQ 0 to IRQ 2 */ /* Map ISA IRQ 0 to IRQ 2 */

View File

@ -92,8 +92,7 @@ unsigned long acpi_fill_madt(unsigned long current)
current = acpi_create_madt_lapics(current); current = acpi_create_madt_lapics(current);
/* IOAPIC */ /* IOAPIC */
current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR);
2, IO_APIC_ADDR, 0);
current = acpi_madt_irq_overrides(current); current = acpi_madt_irq_overrides(current);

View File

@ -332,7 +332,7 @@ unsigned long acpi_fill_madt(unsigned long current)
current = acpi_create_madt_lapics(current); current = acpi_create_madt_lapics(current);
/* IOAPIC */ /* IOAPIC */
current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, 2, IO_APIC_ADDR, 0); current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR);
current = acpi_madt_irq_overrides(current); current = acpi_madt_irq_overrides(current);

View File

@ -105,7 +105,7 @@ unsigned long acpi_fill_madt(unsigned long current)
} }
} else { } else {
/* Default SOC IOAPIC entry */ /* Default SOC IOAPIC entry */
current += acpi_create_madt_ioapic((void *)current, 2, IO_APIC_ADDR, 0); current += acpi_create_madt_ioapic_from_hw((void *)current, IO_APIC_ADDR);
} }
return acpi_madt_irq_overrides(current); return acpi_madt_irq_overrides(current);

View File

@ -10,7 +10,7 @@ unsigned long acpi_fill_madt(unsigned long current)
current = acpi_create_madt_lapics(current); current = acpi_create_madt_lapics(current);
/* IOAPIC */ /* IOAPIC */
current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, 2, IO_APIC_ADDR, 0); current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR);
/* INT_SRC_OVR */ /* INT_SRC_OVR */
current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *) current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)

View File

@ -355,7 +355,7 @@ unsigned long acpi_fill_madt(unsigned long current)
current = acpi_create_madt_lapics(current); current = acpi_create_madt_lapics(current);
/* IOAPIC */ /* IOAPIC */
current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, 2, IO_APIC_ADDR, 0); current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR);
/* LAPIC_NMI */ /* LAPIC_NMI */
current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *) current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *)

View File

@ -10,8 +10,7 @@ unsigned long acpi_fill_madt(unsigned long current)
current = acpi_create_madt_lapics(current); current = acpi_create_madt_lapics(current);
/* IOAPIC */ /* IOAPIC */
current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR);
2, IO_APIC_ADDR, 0);
/* LAPIC_NMI */ /* LAPIC_NMI */
current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *) current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *)

View File

@ -370,8 +370,7 @@ unsigned long acpi_fill_madt(unsigned long current)
current = acpi_create_madt_lapics(current); current = acpi_create_madt_lapics(current);
/* IOAPIC */ /* IOAPIC */
current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *) current, current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR);
2, IO_APIC_ADDR, 0);
/* LAPIC_NMI */ /* LAPIC_NMI */
current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *) current += acpi_create_madt_lapic_nmi((acpi_madt_lapic_nmi_t *)

View File

@ -12,8 +12,7 @@ unsigned long acpi_fill_madt(unsigned long current)
current = acpi_create_madt_lapics(current); current = acpi_create_madt_lapics(current);
/* IOAPIC */ /* IOAPIC */
current += acpi_create_madt_ioapic((acpi_madt_ioapic_t *)current, current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC_ADDR);
1, IO_APIC_ADDR, 0);
/* INT_SRC_OVR */ /* INT_SRC_OVR */
current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *) current += acpi_create_madt_irqoverride((acpi_madt_irqoverride_t *)