From 662ac546fc386c10d6302f404c77ac7f01f31628 Mon Sep 17 00:00:00 2001 From: Marc Jones Date: Mon, 2 Nov 2020 21:26:41 -0700 Subject: [PATCH] soc/intel/xeon_sp: Don't add memory resource twice The resource function is called for each device VID/DID. Only add the memory resource map from the boot CPU (bus 0) and not for each socket/CPU. This is a NUMA architecture and has a shared memory map. All the resources must match across the sockets/CPUs, so they should only be added to the map once. Change-Id: Ia336f604441ae8d30b8418300da7c34ab9907cae Signed-off-by: Marc Jones Reviewed-on: https://review.coreboot.org/c/coreboot/+/47173 Tested-by: build bot (Jenkins) Reviewed-by: Jay Talbott Reviewed-by: Arthur Heymans --- src/soc/intel/xeon_sp/uncore.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/soc/intel/xeon_sp/uncore.c b/src/soc/intel/xeon_sp/uncore.c index 332b9a44a3..15a9f0ff17 100644 --- a/src/soc/intel/xeon_sp/uncore.c +++ b/src/soc/intel/xeon_sp/uncore.c @@ -155,6 +155,10 @@ static void mc_add_dram_resources(struct device *dev, int *res_count) struct resource *resource; int index = *res_count; + /* Only add dram resources once. */ + if (dev->bus->secondary != 0) + return; + fsp_find_reserved_memory(&fsp_mem); /* Read in the MAP registers and report their values. */