From 38c9b8045e16148eefd9dc3262484d87191dc354 Mon Sep 17 00:00:00 2001 From: Jonathan Zhang Date: Tue, 16 Jun 2020 17:14:42 -0700 Subject: soc/intel/xeon_sp/cpx: rename xeon_sp_get_cpu_count() Rename function from xeon_sp_get_cpu_count() to xeon_sp_get_socket_count(). This function returns CPU socket count, by getting it from the field named as numCpus in FSP HOB. Signed-off-by: Jonathan Zhang Signed-off-by: Reddy Chagam Change-Id: Ic96bdf4ab042ac15d43f9b636185627c63fbf8a1 Reviewed-on: https://review.coreboot.org/c/coreboot/+/42439 Reviewed-by: Angel Pons Tested-by: build bot (Jenkins) --- src/soc/intel/xeon_sp/cpx/acpi.c | 2 +- src/soc/intel/xeon_sp/cpx/include/soc/soc_util.h | 3 ++- src/soc/intel/xeon_sp/cpx/soc_util.c | 15 +++++++-------- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/soc/intel/xeon_sp') diff --git a/src/soc/intel/xeon_sp/cpx/acpi.c b/src/soc/intel/xeon_sp/cpx/acpi.c index 16663b0422..abaa45397e 100644 --- a/src/soc/intel/xeon_sp/cpx/acpi.c +++ b/src/soc/intel/xeon_sp/cpx/acpi.c @@ -449,7 +449,7 @@ static unsigned long acpi_fill_srat(unsigned long current) static unsigned long acpi_fill_slit(unsigned long current) { - unsigned int nodes = xeon_sp_get_cpu_count(); + unsigned int nodes = xeon_sp_get_socket_count(); uint8_t *p = (uint8_t *)current; memset(p, 0, 8 + nodes * nodes); diff --git a/src/soc/intel/xeon_sp/cpx/include/soc/soc_util.h b/src/soc/intel/xeon_sp/cpx/include/soc/soc_util.h index 2d33d0e355..412730b647 100644 --- a/src/soc/intel/xeon_sp/cpx/include/soc/soc_util.h +++ b/src/soc/intel/xeon_sp/cpx/include/soc/soc_util.h @@ -34,7 +34,8 @@ const IIO_UDS *get_iio_uds(void); void get_core_thread_bits(uint32_t *core_bits, uint32_t *thread_bits); 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); -unsigned int xeon_sp_get_cpu_count(void); +/* Return socket count, as obtained from FSP HOB */ +unsigned int xeon_sp_get_socket_count(void); int get_platform_thread_count(void); int get_threads_per_package(void); diff --git a/src/soc/intel/xeon_sp/cpx/soc_util.c b/src/soc/intel/xeon_sp/cpx/soc_util.c index f7cebb55f0..fb78910a19 100644 --- a/src/soc/intel/xeon_sp/cpx/soc_util.c +++ b/src/soc/intel/xeon_sp/cpx/soc_util.c @@ -22,7 +22,7 @@ int get_threads_per_package(void) int get_platform_thread_count(void) { - return xeon_sp_get_cpu_count() * get_threads_per_package(); + return xeon_sp_get_socket_count() * get_threads_per_package(); } const struct SystemMemoryMapHob *get_system_memory_map(void) @@ -82,8 +82,9 @@ const IIO_UDS *get_iio_uds(void) return hob; } -unsigned int xeon_sp_get_cpu_count(void) +unsigned int xeon_sp_get_socket_count(void) { + /* The FSP IIO UDS HOB has field numCpus, it is actually socket count */ return get_iio_uds()->SystemStatus.numCpus; } @@ -94,7 +95,7 @@ void xeonsp_init_cpu_config(void) int num_apics = 0; uint32_t core_bits, thread_bits; unsigned int core_count, thread_count; - unsigned int num_cpus; + unsigned int num_sockets; /* * sort APIC ids in asending order to identify apicid ranges for @@ -114,11 +115,9 @@ void xeonsp_init_cpu_config(void) if (num_apics > 1) bubblesort(apic_ids, num_apics, NUM_ASCENDING); - /* Here num_cpus is the number of processors */ - /* The FSP HOB parameter has it named as num_cpus */ - num_cpus = xeon_sp_get_cpu_count(); + num_sockets = xeon_sp_get_socket_count(); cpu_read_topology(&core_count, &thread_count); - assert(num_apics == (num_cpus * thread_count)); + assert(num_apics == (num_sockets * thread_count)); /* sort them by thread i.e., all cores with thread 0 and then thread 1 */ int index = 0; @@ -308,7 +307,7 @@ void set_bios_init_completion(void) * to receive the BIOS init completion message. So, we send it to all non-SBSP * sockets first. */ - for (uint32_t socket = 0; socket < xeon_sp_get_cpu_count(); ++socket) { + for (uint32_t socket = 0; socket < xeon_sp_get_socket_count(); ++socket) { if (socket == sbsp_socket_id) continue; set_bios_init_completion_for_package(socket); -- cgit v1.2.3