summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShuo Liu <shuo.liu@intel.com>2024-05-10 04:35:41 +0800
committerLean Sheng Tan <sheng.tan@9elements.com>2024-05-23 09:27:59 +0000
commit0f87730a9468b18e847983c70839bbb43e2531b0 (patch)
tree431ddf8f95b6f2a36a6b7a53f2f70d40a22d14d6 /src
parenta839eb116bde528ddfeec55f15033f71b2ae5806 (diff)
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>
Diffstat (limited to 'src')
-rw-r--r--src/soc/intel/xeon_sp/cpx/chip.c2
-rw-r--r--src/soc/intel/xeon_sp/gnr/chip.c2
-rw-r--r--src/soc/intel/xeon_sp/include/soc/numa.h4
-rw-r--r--src/soc/intel/xeon_sp/numa.c13
-rw-r--r--src/soc/intel/xeon_sp/skx/chip.c2
-rw-r--r--src/soc/intel/xeon_sp/spr/chip.c1
-rw-r--r--src/soc/intel/xeon_sp/spr/soc_util.c3
-rw-r--r--src/soc/intel/xeon_sp/uncore.c9
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);