diff options
author | Marc Jones <marcjones@sysproconsulting.com> | 2020-10-28 17:00:31 -0600 |
---|---|---|
committer | Marc Jones <marc@marcjonesconsulting.com> | 2020-10-30 18:55:58 +0000 |
commit | 70907b00e6b16f7bf6407c3f58a06473209a1843 (patch) | |
tree | af93b5e390a76e2ff01b34a082dbbdc73fd7830d /src/soc/intel/xeon_sp/cpx | |
parent | 444fda45287822920d389809d9dd1f935f22c592 (diff) |
soc/intel/xeon_sp: Call common soc_get_num_cpus()
Use a common function to get the number of CPUs for each soc. This
removes a #if for different function names in the common code.
Change-Id: I3348d37fcae72247731e465ec2a65d9583a2f180
Signed-off-by: Marc Jones <marcjones@sysproconsulting.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/46970
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/soc/intel/xeon_sp/cpx')
-rw-r--r-- | src/soc/intel/xeon_sp/cpx/include/soc/soc_util.h | 2 | ||||
-rw-r--r-- | src/soc/intel/xeon_sp/cpx/soc_util.c | 8 |
2 files changed, 5 insertions, 5 deletions
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 3e19bac6e9..f0c257508a 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 @@ -19,7 +19,7 @@ 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); /* Return socket count, as obtained from FSP HOB */ -unsigned int xeon_sp_get_socket_count(void); +unsigned int soc_get_num_cpus(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 8debc6a236..bc4a1e15b1 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_socket_count() * get_threads_per_package(); + return soc_get_num_cpus() * get_threads_per_package(); } const struct SystemMemoryMapHob *get_system_memory_map(void) @@ -86,7 +86,7 @@ const IIO_UDS *get_iio_uds(void) return hob; } -unsigned int xeon_sp_get_socket_count(void) +unsigned int soc_get_num_cpus(void) { /* The FSP IIO UDS HOB has field numCpus, it is actually socket count */ return get_iio_uds()->SystemStatus.numCpus; @@ -119,7 +119,7 @@ void xeonsp_init_cpu_config(void) if (num_apics > 1) bubblesort(apic_ids, num_apics, NUM_ASCENDING); - num_sockets = xeon_sp_get_socket_count(); + num_sockets = soc_get_num_cpus(); cpu_read_topology(&core_count, &thread_count); assert(num_apics == (num_sockets * thread_count)); @@ -310,7 +310,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_socket_count(); ++socket) { + for (uint32_t socket = 0; socket < soc_get_num_cpus(); ++socket) { if (socket == sbsp_socket_id) continue; set_bios_init_completion_for_package(socket); |