Attention is currently required from: Arthur Heymans, Christian Walter, Johnny Lin, Lean Sheng Tan, Patrick Rudolph, Tim Chu.
Shuo Liu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/81049?usp=email )
Change subject: soc/intel/xeon_sp: Rewrite acpi_create_satc ......................................................................
soc/intel/xeon_sp: Rewrite acpi_create_satc
Change-Id: I1dfc56ccf279b77cfab4ae3457aa8799d2d57a34 Signed-off-by: Shuo Liu shuo.liu@intel.com --- M src/soc/intel/xeon_sp/uncore_acpi.c 1 file changed, 9 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/49/81049/1
diff --git a/src/soc/intel/xeon_sp/uncore_acpi.c b/src/soc/intel/xeon_sp/uncore_acpi.c index 1ae6a1f..6f29dce 100644 --- a/src/soc/intel/xeon_sp/uncore_acpi.c +++ b/src/soc/intel/xeon_sp/uncore_acpi.c @@ -509,9 +509,9 @@ return current; }
-static unsigned long xeonsp_create_satc_ioat(unsigned long current, const STACK_RES *ri) +static unsigned long xeonsp_create_satc_ioat(unsigned long current, struct device *domain) { - for (int b = ri->BusBase; b <= ri->BusLimit; ++b) { + for (int b = domain->downstream->secondary; b <= domain->downstream->max_subordinate; ++b) { struct device *dev = pcidev_path_on_bus(b, PCI_DEVFN(0, 0)); while (dev) { if (pciexp_find_extended_cap(dev, PCIE_EXT_CAP_ID_ATS, 0)) { @@ -532,6 +532,7 @@ static unsigned long acpi_create_satc(unsigned long current, const IIO_UDS *hob) { const unsigned long tmp = current; + struct device *dev;
// Add the SATC header current += acpi_create_dmar_satc(current, 0, 0); @@ -540,11 +541,12 @@ for (int socket = CONFIG_MAX_SOCKET - 1; socket >= 0; --socket) { if (!soc_cpu_is_enabled(socket)) continue; - for (int stack = (MAX_LOGIC_IIO_STACK - 1); stack >= 0; --stack) { - const STACK_RES *ri = &hob->PlatformData.IIO_resource[socket].StackRes[stack]; - // Add the IOAT ATS devices to the SATC - if (CONFIG(HAVE_IOAT_DOMAINS) && is_ioat_iio_stack_res(ri)) - current = xeonsp_create_satc_ioat(current, ri); + dev = NULL; + while ((dev = dev_find_path(dev, DEVICE_PATH_DOMAIN))) { + if (iio_pci_domain_socket_from_dev(dev) != socket) + continue; + if (CONFIG(HAVE_IOAT_DOMAINS) && is_dev_on_ioat_domain(dev)) + current = xeonsp_create_satc_ioat(current, dev); } }