aboutsummaryrefslogtreecommitdiff
path: root/src/soc/intel/xeon_sp/cpx/soc_util.c
diff options
context:
space:
mode:
authorJonathan Zhang <jonzhang@fb.com>2020-05-28 17:53:48 -0700
committerPatrick Georgi <pgeorgi@google.com>2020-06-14 16:44:58 +0000
commit3172f987fa632189ad3bb44d61614b58be0b142a (patch)
tree93a586c8335b1cbafec9f9e5d823b7325476c8f1 /src/soc/intel/xeon_sp/cpx/soc_util.c
parent2c4866228e83e3dc4ae547356fe4be4ce4fda77b (diff)
soc/intel/xeon_sp/cpx: add NUMA ACPI tables
Add NUMA ACPI tables: SRAT, SLIT. TESTED=Boot CPX-SP based server, check /sys/firmware/acpi/tables for SRAT/SLIT tables. Signed-off-by: Jonathan Zhang <jonzhang@fb.com> Signed-off-by: Reddy Chagam <anjaneya.chagam@intel.com> Change-Id: I3374b802afd2d001e841afd85e7ae07bc27c01ff Reviewed-on: https://review.coreboot.org/c/coreboot/+/41902 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Diffstat (limited to 'src/soc/intel/xeon_sp/cpx/soc_util.c')
-rw-r--r--src/soc/intel/xeon_sp/cpx/soc_util.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/soc/intel/xeon_sp/cpx/soc_util.c b/src/soc/intel/xeon_sp/cpx/soc_util.c
index 2d106575c3..2e183ef062 100644
--- a/src/soc/intel/xeon_sp/cpx/soc_util.c
+++ b/src/soc/intel/xeon_sp/cpx/soc_util.c
@@ -9,6 +9,30 @@
#include <stdlib.h>
#include <string.h>
+int get_threads_per_package(void)
+{
+ unsigned int core_count, thread_count;
+ cpu_read_topology(&core_count, &thread_count);
+ return thread_count;
+}
+
+int get_platform_thread_count(void)
+{
+ return xeon_sp_get_cpu_count() * get_threads_per_package();
+}
+
+const struct SystemMemoryMapHob *get_system_memory_map(void)
+{
+ size_t hob_size;
+ const uint8_t mem_hob_guid[16] = FSP_SYSTEM_MEMORYMAP_HOB_GUID;
+
+ const void *memmap_addr = fsp_find_extension_hob_by_guid(mem_hob_guid, &hob_size);
+ assert(memmap_addr != NULL && hob_size != 0);
+ printk(BIOS_DEBUG, "FSP_SYSTEM_MEMORYMAP_HOB_GUID hob_size: %ld\n", hob_size);
+
+ return (const struct SystemMemoryMapHob *) memmap_addr;
+}
+
void get_cpu_info_from_apicid(uint32_t apicid, uint32_t core_bits, uint32_t thread_bits,
uint8_t *package, uint8_t *core, uint8_t *thread)
{