From 57ddd682cefb924d84016a1d494f3e1483a5cff0 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Tue, 28 Feb 2023 09:17:40 +0100 Subject: soc/intel/xeon_sp: Fix PCH IOAPIC ID FSP may program a different ID under certain circumstances. Read IOAPIC ID from hardware instead of using some define that might not reflect how hardware is configured. Change-Id: Ia91cb4aef9d15520b8b3402ec10e7b0a4355caeb Signed-off-by: Patrick Rudolph Reviewed-on: https://review.coreboot.org/c/coreboot/+/73390 Tested-by: build bot (Jenkins) Reviewed-by: Arthur Heymans Reviewed-by: Angel Pons --- src/soc/intel/xeon_sp/include/soc/pch_pci_devs.h | 3 --- src/soc/intel/xeon_sp/uncore_acpi.c | 9 +++++---- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'src/soc/intel') diff --git a/src/soc/intel/xeon_sp/include/soc/pch_pci_devs.h b/src/soc/intel/xeon_sp/include/soc/pch_pci_devs.h index de7a73a472..4f34fe0111 100644 --- a/src/soc/intel/xeon_sp/include/soc/pch_pci_devs.h +++ b/src/soc/intel/xeon_sp/include/soc/pch_pci_devs.h @@ -58,7 +58,4 @@ #define PCH_IOAPIC_DEV_NUM 0x1F #define PCH_IOAPIC_FUNC_NUM 0x00 -// ========== IOAPIC Definitions for DMAR/ACPI ======== -#define PCH_IOAPIC_ID 0x08 - #endif diff --git a/src/soc/intel/xeon_sp/uncore_acpi.c b/src/soc/intel/xeon_sp/uncore_acpi.c index 89deb88665..af53ebb590 100644 --- a/src/soc/intel/xeon_sp/uncore_acpi.c +++ b/src/soc/intel/xeon_sp/uncore_acpi.c @@ -2,6 +2,7 @@ #include #include +#include #include #include #include @@ -223,10 +224,10 @@ static unsigned long acpi_create_drhd(unsigned long current, int socket, if (socket == 0 && stack == CSTACK) { union p2sb_bdf ioapic_bdf = p2sb_get_ioapic_bdf(); printk(BIOS_DEBUG, " [IOAPIC Device] Enumeration ID: 0x%x, PCI Bus Number: 0x%x, " - "PCI Path: 0x%x, 0x%x\n", - PCH_IOAPIC_ID, ioapic_bdf.bus, ioapic_bdf.dev, ioapic_bdf.fn); - current += acpi_create_dmar_ds_ioapic(current, PCH_IOAPIC_ID, - ioapic_bdf.bus, ioapic_bdf.dev, ioapic_bdf.fn); + "PCI Path: 0x%x, 0x%x\n", get_ioapic_id(VIO_APIC_VADDR), ioapic_bdf.bus, + ioapic_bdf.dev, ioapic_bdf.fn); + current += acpi_create_dmar_ds_ioapic_from_hw(current, + IO_APIC_ADDR, ioapic_bdf.bus, ioapic_bdf.dev, ioapic_bdf.fn); } // Add IOAPIC entry -- cgit v1.2.3