Attention is currently required from: Jason Glenesk, Raul Rangel, Matt DeVillier, Fred Reitberger, Felix Held.
Kyösti Mälkki has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/69531 )
Change subject: [WIP] ACPI MADT: Iterate IOAPIC entries ......................................................................
[WIP] ACPI MADT: Iterate IOAPIC entries
Change-Id: Ia3cf1841ae17c1fe91937eb85a98865892b992b7 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com --- M src/arch/x86/ioapic.c M src/mainboard/aopen/dxplplusu/acpi_tables.c M src/mainboard/emulation/qemu-i440fx/acpi_tables.c M src/northbridge/amd/pi/00730F01/acpi_tables.c M src/soc/amd/cezanne/acpi.c M src/soc/amd/glinda/acpi.c M src/soc/amd/mendocino/acpi.c M src/soc/amd/morgana/acpi.c M src/soc/amd/picasso/acpi.c M src/soc/amd/stoneyridge/acpi.c M src/southbridge/intel/i82801gx/lpc.c M src/southbridge/intel/i82801ix/madt.c M src/southbridge/intel/i82801jx/lpc.c M src/southbridge/intel/ibexpeak/madt.c 14 files changed, 27 insertions(+), 56 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/31/69531/1
diff --git a/src/arch/x86/ioapic.c b/src/arch/x86/ioapic.c index 28bbcb1..e01f28a 100644 --- a/src/arch/x86/ioapic.c +++ b/src/arch/x86/ioapic.c @@ -164,6 +164,9 @@ route_i8259_irq0(ioapic_base); }
+/* FIXME: Need to add the IOAPIC bases and overrides as a linked list. + * Consider adding them runtime into devicetree. */ + void register_new_ioapic_gsi0(void *ioapic_base) { setup_ioapic(ioapic_base, 0); diff --git a/src/mainboard/aopen/dxplplusu/acpi_tables.c b/src/mainboard/aopen/dxplplusu/acpi_tables.c index ab3e35d..d7827aa 100644 --- a/src/mainboard/aopen/dxplplusu/acpi_tables.c +++ b/src/mainboard/aopen/dxplplusu/acpi_tables.c @@ -1,34 +1,13 @@ /* SPDX-License-Identifier: GPL-2.0-only */
#include <acpi/acpi.h> -#include <device/pci_def.h>
unsigned long acpi_fill_madt(unsigned long current) { - struct device *bdev, *dev = NULL; - struct resource *res = NULL; - current = acpi_create_madt_lapics_with_nmis(current);
/* Southbridge IOAPIC */ - current = acpi_create_madt_ioapic_gsi0(current, &irq_overrides_01); - - bdev = pcidev_on_root(2, 0); - /* P64H2 Bus B IOAPIC */ - if (bdev) - dev = pcidev_path_behind(bdev->link_list, PCI_DEVFN(28, 0)); - if (dev) { - res = find_resource(dev, PCI_BASE_ADDRESS_0); - current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, res->base); - } - - /* P64H2 Bus A IOAPIC */ - if (bdev) - dev = pcidev_path_behind(bdev->link_list, PCI_DEVFN(30, 0)); - if (dev) { - res = find_resource(dev, PCI_BASE_ADDRESS_0); - current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, res->base); - } + current = acpi_create_madt_ioapics_from_list(current);
return current; } diff --git a/src/mainboard/emulation/qemu-i440fx/acpi_tables.c b/src/mainboard/emulation/qemu-i440fx/acpi_tables.c index f279703..e2b5439 100644 --- a/src/mainboard/emulation/qemu-i440fx/acpi_tables.c +++ b/src/mainboard/emulation/qemu-i440fx/acpi_tables.c @@ -14,7 +14,7 @@ current = acpi_create_madt_lapics_with_nmis(current);
/* IOAPIC */ - current = acpi_create_madt_ioapic_gsi0(current, &irq_overrides_02); + current = acpi_create_madt_ioapics_from_list(current);
return current; } diff --git a/src/northbridge/amd/pi/00730F01/acpi_tables.c b/src/northbridge/amd/pi/00730F01/acpi_tables.c index f8677a6..612d3f0 100644 --- a/src/northbridge/amd/pi/00730F01/acpi_tables.c +++ b/src/northbridge/amd/pi/00730F01/acpi_tables.c @@ -8,11 +8,8 @@ /* create all subtables for processors */ current = acpi_create_madt_lapics_with_nmis(current);
- /* Write IOAPIC, only one */ - current = acpi_create_madt_ioapic_gsi0(current, &irq_overrides_03); - - /* TODO: Remove the hardcode */ - current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, 0xFEC20000); + /* all IOAPICs */ + current = acpi_create_madt_ioapics_from_list(current);
return current; } diff --git a/src/soc/amd/cezanne/acpi.c b/src/soc/amd/cezanne/acpi.c index 2341943..b6c55ff 100644 --- a/src/soc/amd/cezanne/acpi.c +++ b/src/soc/amd/cezanne/acpi.c @@ -26,10 +26,7 @@ /* create all subtables for processors */ current = acpi_create_madt_lapics_with_nmis(current);
- current = acpi_create_madt_ioapic_gsi0(current, &irq_overrides_03); - - current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, - GNB_IO_APIC_ADDR); + current = acpi_create_madt_ioapics_from_list(current);
return current; } diff --git a/src/soc/amd/glinda/acpi.c b/src/soc/amd/glinda/acpi.c index 121b42f..edb1136 100644 --- a/src/soc/amd/glinda/acpi.c +++ b/src/soc/amd/glinda/acpi.c @@ -29,10 +29,7 @@ /* create all subtables for processors */ current = acpi_create_madt_lapics_with_nmis(current);
- current = acpi_create_madt_ioapic_gsi0(current, &irq_overrides_03); - - current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, - GNB_IO_APIC_ADDR); + current = acpi_create_madt_ioapics_from_list(current);
return current; } diff --git a/src/soc/amd/mendocino/acpi.c b/src/soc/amd/mendocino/acpi.c index 2432d9d..03d9e05 100644 --- a/src/soc/amd/mendocino/acpi.c +++ b/src/soc/amd/mendocino/acpi.c @@ -28,10 +28,7 @@ /* create all subtables for processors */ current = acpi_create_madt_lapics_with_nmis(current);
- current = acpi_create_madt_ioapic_gsi0(current, &irq_overrides_03); - - current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, - GNB_IO_APIC_ADDR); + current = acpi_create_madt_ioapics_from_list(current);
return current; } diff --git a/src/soc/amd/morgana/acpi.c b/src/soc/amd/morgana/acpi.c index 662146a..246676f 100644 --- a/src/soc/amd/morgana/acpi.c +++ b/src/soc/amd/morgana/acpi.c @@ -29,10 +29,7 @@ /* create all subtables for processors */ current = acpi_create_madt_lapics_with_nmis(current);
- current = acpi_create_madt_ioapic_gsi0(current, &irq_overrides_03); - - current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, - GNB_IO_APIC_ADDR); + current = acpi_create_madt_ioapics_from_list(current);
return current; } diff --git a/src/soc/amd/picasso/acpi.c b/src/soc/amd/picasso/acpi.c index ec3475f..da2ed74 100644 --- a/src/soc/amd/picasso/acpi.c +++ b/src/soc/amd/picasso/acpi.c @@ -33,10 +33,7 @@ /* create all subtables for processors */ current = acpi_create_madt_lapics_with_nmis(current);
- current = acpi_create_madt_ioapic_gsi0(current, &irq_overrides_03); - - current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, - GNB_IO_APIC_ADDR); + current = acpi_create_madt_ioapics_from_list(current);
return current; } diff --git a/src/soc/amd/stoneyridge/acpi.c b/src/soc/amd/stoneyridge/acpi.c index f56ab0a..641c9c4 100644 --- a/src/soc/amd/stoneyridge/acpi.c +++ b/src/soc/amd/stoneyridge/acpi.c @@ -28,10 +28,7 @@ /* create all subtables for processors */ current = acpi_create_madt_lapics_with_nmis(current);
- /* Write Kern IOAPIC, only one */ - current = acpi_create_madt_ioapic_gsi0(current, &irq_overrides_03); - - current += acpi_create_madt_ioapic_from_hw((acpi_madt_ioapic_t *)current, IO_APIC2_ADDR); + current = acpi_create_madt_ioapics_from_list(current);
return current; } diff --git a/src/southbridge/intel/i82801gx/lpc.c b/src/southbridge/intel/i82801gx/lpc.c index 0dfaec8..1d79d2f 100644 --- a/src/southbridge/intel/i82801gx/lpc.c +++ b/src/southbridge/intel/i82801gx/lpc.c @@ -355,7 +355,7 @@ current = acpi_create_madt_lapics_with_nmis(current);
/* IOAPIC */ - current = acpi_create_madt_ioapic_gsi0(current, &irq_overrides_00); + current = acpi_create_madt_ioapics_from_list(current);
return current; } diff --git a/src/southbridge/intel/i82801ix/madt.c b/src/southbridge/intel/i82801ix/madt.c index d1f7640..b7f3581 100644 --- a/src/southbridge/intel/i82801ix/madt.c +++ b/src/southbridge/intel/i82801ix/madt.c @@ -10,7 +10,7 @@ current = acpi_create_madt_lapics_with_nmis(current);
/* IOAPIC */ - current = acpi_create_madt_ioapic_gsi0(current, &irq_overrides_00); + current = acpi_create_madt_ioapics_from_list(current);
return current; } diff --git a/src/southbridge/intel/i82801jx/lpc.c b/src/southbridge/intel/i82801jx/lpc.c index a1eb0a0..77cb139 100644 --- a/src/southbridge/intel/i82801jx/lpc.c +++ b/src/southbridge/intel/i82801jx/lpc.c @@ -370,7 +370,7 @@ current = acpi_create_madt_lapics_with_nmis(current);
/* IOAPIC */ - current = acpi_create_madt_ioapic_gsi0(current, &irq_overrides_00); + current = acpi_create_madt_ioapics_from_list(current);
return current; } diff --git a/src/southbridge/intel/ibexpeak/madt.c b/src/southbridge/intel/ibexpeak/madt.c index 1cb40dd..8e2211a 100644 --- a/src/southbridge/intel/ibexpeak/madt.c +++ b/src/southbridge/intel/ibexpeak/madt.c @@ -12,7 +12,7 @@ current = acpi_create_madt_lapics_with_nmis(current);
/* IOAPIC */ - current = acpi_create_madt_ioapic_gsi0(current, &irq_overrides_02); + current = acpi_create_madt_ioapics_from_list(current);
return current; }