Attention is currently required from: Arthur Heymans, Christian Walter, Johnny Lin, Tim Chu.
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/80257?usp=email )
Change subject: soc/intel/xeon_sp/numa: Store pointer to device ......................................................................
soc/intel/xeon_sp/numa: Store pointer to device
Instead of a BDF number store a pointer to the device itself.
Change-Id: I3fef93c5e54c8af792102bcd25364c43b554a5f0 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/soc/intel/xeon_sp/include/soc/numa.h M src/soc/intel/xeon_sp/spr/chip.c M src/soc/intel/xeon_sp/spr/numa.c M src/soc/intel/xeon_sp/spr/soc_util.c M src/soc/intel/xeon_sp/uncore_acpi_cxl.c 5 files changed, 8 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/57/80257/1
diff --git a/src/soc/intel/xeon_sp/include/soc/numa.h b/src/soc/intel/xeon_sp/include/soc/numa.h index 48141c7..6aaf172 100644 --- a/src/soc/intel/xeon_sp/include/soc/numa.h +++ b/src/soc/intel/xeon_sp/include/soc/numa.h @@ -41,7 +41,7 @@ /* * Below fields are set to 0 for processor domains. */ - uint32_t device_handle; /* This holds PCIe device segment, BDF info */ + struct device *dev; uint32_t base; /* Memory region base address in the unit of 64MB */ uint32_t size; /* Memory region size in the unit of 64MB */ }; diff --git a/src/soc/intel/xeon_sp/spr/chip.c b/src/soc/intel/xeon_sp/spr/chip.c index 2b529b9..d57b240 100644 --- a/src/soc/intel/xeon_sp/spr/chip.c +++ b/src/soc/intel/xeon_sp/spr/chip.c @@ -196,7 +196,7 @@ for (i = 0; i < pds.num_pds; i++) { if (pds.pds[i].pd_type == PD_TYPE_PROCESSOR) continue; - ep_bus = pds.pds[i].device_handle >> 20; + ep_bus = PCI_BDF(pds.pds[i].dev) >> 20; if (ep_bus == ecrc_bus + 1) break; } diff --git a/src/soc/intel/xeon_sp/spr/numa.c b/src/soc/intel/xeon_sp/spr/numa.c index ef1c153..169f4f8 100644 --- a/src/soc/intel/xeon_sp/spr/numa.c +++ b/src/soc/intel/xeon_sp/spr/numa.c @@ -19,7 +19,7 @@ printk(BIOS_DEBUG, "\tproximity domain %d:\n", i); printk(BIOS_DEBUG, "\t\ttype:%d\n", pds.pds[i].pd_type); printk(BIOS_DEBUG, "\t\tsocket_bitmap:0x%x\n", pds.pds[i].socket_bitmap); - printk(BIOS_DEBUG, "\t\tdevice_handle:0x%x\n", pds.pds[i].device_handle); + printk(BIOS_DEBUG, "\t\tdevice:%s\n", pds.pds[i].dev ? dev_path(pds.pds[i].dev) : ""); printk(BIOS_DEBUG, "\t\tbase(64MB):0x%x\n", pds.pds[i].base); printk(BIOS_DEBUG, "\t\tsize(64MB):0x%x\n", pds.pds[i].size); } @@ -85,7 +85,7 @@ pds.pds[i].base = node.Address; pds.pds[i].size = node.Size; dev = pcie_find_dsn(node.SerialNumber, node.VendorId, 0); - pds.pds[i].device_handle = PCI_BDF(dev); + pds.pds[i].dev = dev; pds.pds[i].distances = malloc(sizeof(uint8_t) * pds.num_pds); if (!pds.pds[i].distances) die("%s %d out of memory.", __FILE__, __LINE__); diff --git a/src/soc/intel/xeon_sp/spr/soc_util.c b/src/soc/intel/xeon_sp/spr/soc_util.c index 07515e9..970b641 100644 --- a/src/soc/intel/xeon_sp/spr/soc_util.c +++ b/src/soc/intel/xeon_sp/spr/soc_util.c @@ -91,7 +91,7 @@ if (pds.pds[i].pd_type == PD_TYPE_PROCESSOR) continue;
- uint32_t bus = pds.pds[i].device_handle >> 20; + uint32_t bus = PCI_BDF(pds.pds[i].dev) >> 20; if (bus >= res->BusBase && bus <= res->BusLimit) return true; } diff --git a/src/soc/intel/xeon_sp/uncore_acpi_cxl.c b/src/soc/intel/xeon_sp/uncore_acpi_cxl.c index de776eb..6785937 100644 --- a/src/soc/intel/xeon_sp/uncore_acpi_cxl.c +++ b/src/soc/intel/xeon_sp/uncore_acpi_cxl.c @@ -16,9 +16,9 @@ uint8_t bus, dev, func; uint32_t base, size; for (uint8_t i = soc_get_num_cpus(); i < pds.num_pds; i++) { - bus = pds.pds[i].device_handle >> 20; - dev = (pds.pds[i].device_handle >> 15) & 0x1f; - func = (pds.pds[i].device_handle >> 12) & 0x07; + bus = PCI_BDF(pds.pds[i].dev) >> 20; + dev = (PCI_BDF(pds.pds[i].dev) >> 15) & 0x1f; + func = (PCI_BDF(pds.pds[i].dev) >> 12) & 0x07; printk(BIOS_DEBUG, "adding srat GIA ID: %d, seg: 0x%x, bus: 0x%x, dev: 0x%x, func: 0x%x\n", i, seg, bus, dev, func);