diff options
author | Andrey Petrov <anpetrov@fb.com> | 2020-04-23 10:54:18 -0700 |
---|---|---|
committer | Andrey Petrov <andrey.petrov@gmail.com> | 2020-04-24 19:44:19 +0000 |
commit | 5d76958de124af3877f9b399a4ec8a6377fe4ffd (patch) | |
tree | 8ae58064b6e0610cae3c576d8f8eba83e2772b19 /src/soc/intel/xeon_sp/cpx/cpu.c | |
parent | e37d1f724a3df9d680ec616f0b13adbc07c4e744 (diff) | |
download | coreboot-5d76958de124af3877f9b399a4ec8a6377fe4ffd.tar.xz |
soc/intel/xeon_sp/cpx: Calculate number of threads based on sockets
Assuming given system is populated with multiple CPUs of same SKUs,
calculate number of threads based on MAX_SOCKET.
This is a stop gap solution until proper way of identifying total
number of sockets is determined.
Change-Id: I7ebad3d57c47b9eeb7d727ffb21bc0a1a84734fd
Signed-off-by: Andrey Petrov <anpetrov@fb.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/40671
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Maxim Polyakov <max.senia.poliak@gmail.com>
Diffstat (limited to 'src/soc/intel/xeon_sp/cpx/cpu.c')
-rw-r--r-- | src/soc/intel/xeon_sp/cpx/cpu.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/soc/intel/xeon_sp/cpx/cpu.c b/src/soc/intel/xeon_sp/cpx/cpu.c index a62c2f0318..a7a4c54e7f 100644 --- a/src/soc/intel/xeon_sp/cpx/cpu.c +++ b/src/soc/intel/xeon_sp/cpx/cpu.c @@ -63,7 +63,14 @@ static int get_thread_count(void) cpu_read_topology(&num_phys, &num_virts); printk(BIOS_SPEW, "Detected %u cores and %u threads\n", num_phys, num_virts); - return num_virts; + /* + * Currently we do not know a way to figure out how many CPUs we have total + * on multi-socketed. So we pretend all sockets are populated with CPUs with + * same thread/core fusing. + * TODO: properly figure out number of active sockets OR refactor MPinit code + * to remove requirements of having to know total number of CPUs in advance. + */ + return num_virts * CONFIG_MAX_SOCKET; } static const struct mp_ops mp_ops = { |