diff options
-rw-r--r-- | src/soc/intel/xeon_sp/cpx/chip.c | 2 | ||||
-rw-r--r-- | src/soc/intel/xeon_sp/gnr/chip.c | 2 | ||||
-rw-r--r-- | src/soc/intel/xeon_sp/include/soc/numa.h | 4 | ||||
-rw-r--r-- | src/soc/intel/xeon_sp/numa.c | 13 | ||||
-rw-r--r-- | src/soc/intel/xeon_sp/skx/chip.c | 2 | ||||
-rw-r--r-- | src/soc/intel/xeon_sp/spr/chip.c | 1 | ||||
-rw-r--r-- | src/soc/intel/xeon_sp/spr/soc_util.c | 3 | ||||
-rw-r--r-- | src/soc/intel/xeon_sp/uncore.c | 9 |
8 files changed, 21 insertions, 15 deletions
diff --git a/src/soc/intel/xeon_sp/cpx/chip.c b/src/soc/intel/xeon_sp/cpx/chip.c index 8b9a673597..e6b2bdbee9 100644 --- a/src/soc/intel/xeon_sp/cpx/chip.c +++ b/src/soc/intel/xeon_sp/cpx/chip.c @@ -12,6 +12,7 @@ #include <intelblocks/p2sb.h> #include <soc/acpi.h> #include <soc/chip_common.h> +#include <soc/numa.h> #include <soc/pch.h> #include <soc/soc_pch.h> #include <soc/ramstage.h> @@ -167,6 +168,7 @@ static void chip_init(void *data) printk(BIOS_DEBUG, "coreboot: calling fsp_silicon_init\n"); fsp_silicon_init(); + setup_pds(); attach_iio_stacks(); override_hpet_ioapic_bdf(); diff --git a/src/soc/intel/xeon_sp/gnr/chip.c b/src/soc/intel/xeon_sp/gnr/chip.c index 23458944c7..aa9b37874b 100644 --- a/src/soc/intel/xeon_sp/gnr/chip.c +++ b/src/soc/intel/xeon_sp/gnr/chip.c @@ -4,6 +4,7 @@ #include <intelblocks/pmclib.h> #include <soc/pm.h> #include <soc/chip_common.h> +#include <soc/numa.h> #include <soc/ramstage.h> #include "chip.h" @@ -38,6 +39,7 @@ static void chip_init(void *data) printk(BIOS_DEBUG, "coreboot: calling fsp_silicon_init\n"); fsp_silicon_init(); + setup_pds(); attach_iio_stacks(); pch_enable_ioapic(); diff --git a/src/soc/intel/xeon_sp/include/soc/numa.h b/src/soc/intel/xeon_sp/include/soc/numa.h index 7bc86ae52c..d12451774c 100644 --- a/src/soc/intel/xeon_sp/include/soc/numa.h +++ b/src/soc/intel/xeon_sp/include/soc/numa.h @@ -57,9 +57,7 @@ struct proximity_domains { extern struct proximity_domains pds; -void dump_pds(void); -void fill_pds(void); -void fill_pd_distances(void); +void setup_pds(void); /* * Return the total size of memory regions in generic initiator affinity diff --git a/src/soc/intel/xeon_sp/numa.c b/src/soc/intel/xeon_sp/numa.c index 69ca0637b1..81331edb67 100644 --- a/src/soc/intel/xeon_sp/numa.c +++ b/src/soc/intel/xeon_sp/numa.c @@ -11,7 +11,7 @@ #include <soc/util.h> #include <types.h> -void dump_pds(void) +static void dump_pds(void) { printk(BIOS_DEBUG, "====== Proximity Domain Dump ======\n"); printk(BIOS_DEBUG, "number of proximity domains: %d\n", pds.num_pds); @@ -25,7 +25,7 @@ void dump_pds(void) } } -void fill_pds(void) +static void fill_pds(void) { uint8_t num_sockets = soc_get_num_cpus(); uint8_t num_cxlnodes = get_cxl_node_count(); @@ -151,7 +151,7 @@ uint32_t memory_to_pd(const struct SystemMemoryMapElement *mem) #define PD_DISTANCE_MAX 0xFF #define PD_DISTANCE_IO_EXTRA 0x01 -void fill_pd_distances(void) +static void fill_pd_distances(void) { for (int i = 0; i < pds.num_pds; i++) { for (int j = 0; j < pds.num_pds; j++) { @@ -173,3 +173,10 @@ void fill_pd_distances(void) } } } + +void setup_pds(void) +{ + fill_pds(); + fill_pd_distances(); + dump_pds(); +} diff --git a/src/soc/intel/xeon_sp/skx/chip.c b/src/soc/intel/xeon_sp/skx/chip.c index 903d0cc69b..37535a3cf0 100644 --- a/src/soc/intel/xeon_sp/skx/chip.c +++ b/src/soc/intel/xeon_sp/skx/chip.c @@ -7,6 +7,7 @@ #include <intelblocks/acpi.h> #include <soc/acpi.h> #include <soc/chip_common.h> +#include <soc/numa.h> #include <soc/pch.h> #include <soc/soc_pch.h> #include <soc/ramstage.h> @@ -42,6 +43,7 @@ static void soc_init(void *data) printk(BIOS_DEBUG, "coreboot: calling fsp_silicon_init\n"); fsp_silicon_init(); + setup_pds(); attach_iio_stacks(); override_hpet_ioapic_bdf(); diff --git a/src/soc/intel/xeon_sp/spr/chip.c b/src/soc/intel/xeon_sp/spr/chip.c index ec23940f2b..1eab917284 100644 --- a/src/soc/intel/xeon_sp/spr/chip.c +++ b/src/soc/intel/xeon_sp/spr/chip.c @@ -125,6 +125,7 @@ static void chip_init(void *data) printk(BIOS_DEBUG, "coreboot: calling fsp_silicon_init\n"); fsp_silicon_init(); + setup_pds(); attach_iio_stacks(); override_hpet_ioapic_bdf(); diff --git a/src/soc/intel/xeon_sp/spr/soc_util.c b/src/soc/intel/xeon_sp/spr/soc_util.c index 9ad09f4c4b..17addfc75c 100644 --- a/src/soc/intel/xeon_sp/spr/soc_util.c +++ b/src/soc/intel/xeon_sp/spr/soc_util.c @@ -90,6 +90,9 @@ bool is_ioat_iio_stack_res(const STACK_RES *res) */ bool is_iio_cxl_stack_res(const STACK_RES *res) { + /* pds should be setup ahead of this call */ + assert(pds.num_pds); + for (uint8_t i = 0; i < pds.num_pds; i++) { if (pds.pds[i].pd_type == PD_TYPE_PROCESSOR) continue; diff --git a/src/soc/intel/xeon_sp/uncore.c b/src/soc/intel/xeon_sp/uncore.c index efa61b7c16..4c226854aa 100644 --- a/src/soc/intel/xeon_sp/uncore.c +++ b/src/soc/intel/xeon_sp/uncore.c @@ -336,15 +336,6 @@ static void mmapvtd_read_resources(struct device *dev) { int index = 0; - static bool once; - if (!once) { - /* Construct NUMA data structure. This is needed for CXL. */ - fill_pds(); - fill_pd_distances(); - dump_pds(); - once = true; - } - /* Read standard PCI resources. */ pci_dev_read_resources(dev); |