soc/intel/xeon_sp: Move proximity domain setting up
Move proximity domain setting up to ahead of attach_iio_stacks()
so that proximity domain info could be ready before
attach_iio_stacks()/create_xeonsp_domains().
For example in SPR, is_iio_cxl_stack_res() refers to proximity
domain info, and it will be called in create_xeonsp_domains().
TEST=Build and boot on intel/archercity
No significant boot log difference except for proximity domain
dump info display are moved ahead (with correct contents).
Change-Id: I594f0ec0c23e3b62c3bdd917ebf6e45be6e4069e
Signed-off-by: Shuo Liu <shuo.liu@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/82267
Reviewed-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/soc/intel/xeon_sp/cpx/chip.c b/src/soc/intel/xeon_sp/cpx/chip.c
index 8b9a673..e6b2bdb 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 @@
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 2345894..aa9b378 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 @@
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 7bc86ae..d124517 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 @@
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 69ca063..81331ed 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 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 @@
#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 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 903d0cc..37535a3 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 @@
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 ec23940..1eab917 100644
--- a/src/soc/intel/xeon_sp/spr/chip.c
+++ b/src/soc/intel/xeon_sp/spr/chip.c
@@ -125,6 +125,7 @@
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 9ad09f4..17addfc 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_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 efa61b7..4c22685 100644
--- a/src/soc/intel/xeon_sp/uncore.c
+++ b/src/soc/intel/xeon_sp/uncore.c
@@ -336,15 +336,6 @@
{
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);