diff options
author | Patrick Rudolph <patrick.rudolph@9elements.com> | 2024-10-23 18:10:28 +0200 |
---|---|---|
committer | Lean Sheng Tan <sheng.tan@9elements.com> | 2024-11-16 20:19:06 +0000 |
commit | b4a4a76a71fc72fe3d57f62e7e58ae04777184d5 (patch) | |
tree | 1938da0e07e6cf0c9c7b30d136497cd71c6c8b19 /src/soc/intel/xeon_sp/gnr | |
parent | 70546ebc4045f4805ee257172301364147fa7d80 (diff) |
soc/intel/xeon_sp: Reduce code differences
Use get_platform_thread_count() instead of duplicated
get_thread_count(), that is also less precise.
Change-Id: I70c095c284aab6898b8351e82243f534963f333b
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/84845
Reviewed-by: Shuo Liu <shuo.liu@intel.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/intel/xeon_sp/gnr')
-rw-r--r-- | src/soc/intel/xeon_sp/gnr/cpu.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/src/soc/intel/xeon_sp/gnr/cpu.c b/src/soc/intel/xeon_sp/gnr/cpu.c index 580503537c..71edd70e7c 100644 --- a/src/soc/intel/xeon_sp/gnr/cpu.c +++ b/src/soc/intel/xeon_sp/gnr/cpu.c @@ -63,21 +63,6 @@ static void pre_mp_init(void) x86_mtrr_check(); } -static int get_thread_count(void) -{ - unsigned int num_phys = 0, num_virts = 0; - - /* - * This call calculates the thread count which is corresponding to num_virts - * (logical cores), while num_phys is corresponding to physical cores (in SMT - * system, one physical core has multiple threads, a.k.a. logical cores). - * Hence num_phys is not actually used. - */ - cpu_read_topology(&num_phys, &num_virts); - printk(BIOS_SPEW, "Detected %u cores and %u threads\n", num_phys, num_virts); - return num_virts * soc_get_num_cpus(); -} - static void post_mp_init(void) { if (CONFIG(HAVE_SMI_HANDLER)) @@ -86,7 +71,7 @@ static void post_mp_init(void) static const struct mp_ops mp_ops = { .pre_mp_init = pre_mp_init, - .get_cpu_count = get_thread_count, + .get_cpu_count = get_platform_thread_count, #if CONFIG(HAVE_SMI_HANDLER) .get_smm_info = get_smm_info, .pre_mp_smm_init = smm_southbridge_clear_state, |