From ef9c2922d24b3a031d2fcfc3b596faaec8ad7389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Sun, 9 Apr 2023 13:47:28 +0300 Subject: soc/amd: Clarify ACPI _PRT entry generation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The reference to a constant FCH IOAPIC interrupt count used with GNB IOAPIC was a bit obscure. Change-Id: I2d862e37424f9fea7f269cd09e9e90056531b643 Signed-off-by: Kyösti Mälkki Reviewed-on: https://review.coreboot.org/c/coreboot/+/74314 Tested-by: build bot (Jenkins) Reviewed-by: Arthur Heymans Reviewed-by: Felix Held --- src/arch/x86/include/arch/ioapic.h | 1 - src/soc/amd/common/block/pci/acpi_prt.c | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/arch/x86/include/arch/ioapic.h b/src/arch/x86/include/arch/ioapic.h index a91ac14220..6c5282b90d 100644 --- a/src/arch/x86/include/arch/ioapic.h +++ b/src/arch/x86/include/arch/ioapic.h @@ -5,7 +5,6 @@ #define IO_APIC_ADDR 0xfec00000 #define VIO_APIC_VADDR ((u8 *)IO_APIC_ADDR) -#define IO_APIC_INTERRUPTS 24 #ifndef __ACPI__ diff --git a/src/soc/amd/common/block/pci/acpi_prt.c b/src/soc/amd/common/block/pci/acpi_prt.c index c142f57567..f748024de9 100644 --- a/src/soc/amd/common/block/pci/acpi_prt.c +++ b/src/soc/amd/common/block/pci/acpi_prt.c @@ -7,20 +7,22 @@ #include #include +/* GNB IO-APIC is located after the FCH IO-APIC */ +#define FCH_IOAPIC_INTERRUPTS 24 +#define GNB_GSI_BASE FCH_IOAPIC_INTERRUPTS + static void acpigen_write_PRT_GSI(const struct pci_routing_info *routing_info) { unsigned int irq; acpigen_write_package(4); /* Package - APIC Routing */ for (unsigned int i = 0; i < 4; ++i) { - /* GNB IO-APIC is located after the FCH IO-APIC */ - irq = IO_APIC_INTERRUPTS; - irq += pci_calculate_irq(routing_info, i); + irq = pci_calculate_irq(routing_info, i); acpigen_write_PRT_GSI_entry( 0, /* There is only one device attached to the bridge */ i, /* pin */ - irq); + GNB_GSI_BASE + irq); } acpigen_pop_len(); /* Package - APIC Routing */ } -- cgit v1.2.3