Attention is currently required from: Jonathan Zhang, Johnny Lin, Christian Walter, Tim Chu.
Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/70270 )
Change subject: soc/intel/xeon_sp: Add DMAR IOAPIC entries based on HW ......................................................................
soc/intel/xeon_sp: Add DMAR IOAPIC entries based on HW
Instead of guessing how FSP has set up IOAPIC IDs read it back from hardware. This is more robust.
Change-Id: If90873ac94261e424d1713bdab137eaceb256bba Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/soc/intel/xeon_sp/cpx/soc_util.c M src/soc/intel/xeon_sp/include/soc/util.h M src/soc/intel/xeon_sp/nb_acpi.c M src/soc/intel/xeon_sp/skx/soc_util.c 4 files changed, 22 insertions(+), 50 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/70/70270/1
diff --git a/src/soc/intel/xeon_sp/cpx/soc_util.c b/src/soc/intel/xeon_sp/cpx/soc_util.c index cd1e06d..0853292 100644 --- a/src/soc/intel/xeon_sp/cpx/soc_util.c +++ b/src/soc/intel/xeon_sp/cpx/soc_util.c @@ -61,24 +61,3 @@ else return -1; } - -uint8_t soc_get_iio_ioapicid(int socket, int stack) -{ - uint8_t ioapic_id = socket ? 0xf : 0x9; - switch (stack) { - case CSTACK: - break; - case PSTACK0: - ioapic_id += 1; - break; - case PSTACK1: - ioapic_id += 2; - break; - case PSTACK2: - ioapic_id += 3; - break; - default: - return 0xff; - } - return ioapic_id; -} diff --git a/src/soc/intel/xeon_sp/include/soc/util.h b/src/soc/intel/xeon_sp/include/soc/util.h index 213735a..7435d01 100644 --- a/src/soc/intel/xeon_sp/include/soc/util.h +++ b/src/soc/intel/xeon_sp/include/soc/util.h @@ -14,7 +14,6 @@ unsigned int soc_get_num_cpus(void); void xeonsp_init_cpu_config(void); void set_bios_init_completion(void); -uint8_t soc_get_iio_ioapicid(int socket, int stack);
struct iiostack_resource { uint8_t no_of_stacks; diff --git a/src/soc/intel/xeon_sp/nb_acpi.c b/src/soc/intel/xeon_sp/nb_acpi.c index 42b52f3..6b8396d 100644 --- a/src/soc/intel/xeon_sp/nb_acpi.c +++ b/src/soc/intel/xeon_sp/nb_acpi.c @@ -14,6 +14,7 @@ #include <soc/soc_util.h> #include <soc/util.h> #include <intelblocks/p2sb.h> +#include <stdint.h>
#include "chip.h"
@@ -182,13 +183,13 @@ static unsigned long acpi_create_drhd(unsigned long current, int socket, int stack, const IIO_UDS *hob) { - uint32_t enum_id; unsigned long tmp = current;
uint32_t bus = hob->PlatformData.IIO_resource[socket].StackRes[stack].BusBase; uint32_t pcie_seg = hob->PlatformData.CpuQpiInfo[socket].PcieSegment; uint32_t reg_base = hob->PlatformData.IIO_resource[socket].StackRes[stack].VtdBarAddress; + uint32_t ioapic_base = hob->PlatformData.IIO_resource[socket].StackRes[stack].IoApicBase; printk(BIOS_SPEW, "%s socket: %d, stack: %d, bus: 0x%x, pcie_seg: 0x%x, reg_base: 0x%x\n", __func__, socket, stack, bus, pcie_seg, reg_base);
@@ -212,18 +213,19 @@ // Add PCH IOAPIC 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, " + printk(BIOS_DEBUG, " [IOAPIC Device] Base: 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, + current += acpi_create_dmar_ds_ioapic_from_hw(current, ioapic_base, ioapic_bdf.bus, ioapic_bdf.dev, ioapic_bdf.fn); }
// Add IOAPIC entry - enum_id = soc_get_iio_ioapicid(socket, stack); - printk(BIOS_DEBUG, " [IOAPIC Device] Enumeration ID: 0x%x, PCI Bus Number: 0x%x, " - "PCI Path: 0x%x, 0x%x\n", enum_id, bus, APIC_DEV_NUM, APIC_FUNC_NUM); - current += acpi_create_dmar_ds_ioapic(current, enum_id, bus, + if (socket == 0 && stack == CSTACK) + ioapic_base += 0x1000; + printk(BIOS_DEBUG, " [IOAPIC Device] Base: 0x%x, PCI Bus Number: 0x%x, " + "PCI Path: 0x%x, 0x%x\n", ioapic_base, bus, APIC_DEV_NUM, APIC_FUNC_NUM); + current += acpi_create_dmar_ds_ioapic_from_hw(current, ioapic_base, bus, APIC_DEV_NUM, APIC_FUNC_NUM);
// Add CBDMA devices for CSTACK diff --git a/src/soc/intel/xeon_sp/skx/soc_util.c b/src/soc/intel/xeon_sp/skx/soc_util.c index 3258007..7e71914 100644 --- a/src/soc/intel/xeon_sp/skx/soc_util.c +++ b/src/soc/intel/xeon_sp/skx/soc_util.c @@ -148,24 +148,3 @@ else return -1; } - -uint8_t soc_get_iio_ioapicid(int socket, int stack) -{ - uint8_t ioapic_id = socket ? 0xf : 0x9; - switch (stack) { - case CSTACK: - break; - case PSTACK0: - ioapic_id += 1; - break; - case PSTACK1: - ioapic_id += 2; - break; - case PSTACK2: - ioapic_id += 3; - break; - default: - return 0xff; - } - return ioapic_id; -}