summaryrefslogtreecommitdiffstats
path: root/src/soc/intel/xeon_sp/spr/cpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/intel/xeon_sp/spr/cpu.c')
-rw-r--r--src/soc/intel/xeon_sp/spr/cpu.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/src/soc/intel/xeon_sp/spr/cpu.c b/src/soc/intel/xeon_sp/spr/cpu.c
index f9c8e2627393..ad099ab70b71 100644
--- a/src/soc/intel/xeon_sp/spr/cpu.c
+++ b/src/soc/intel/xeon_sp/spr/cpu.c
@@ -1,28 +1,17 @@
/* SPDX-License-Identifier: GPL-2.0-only */
-#include <acpi/acpigen.h>
-#include <acpi/acpi.h>
-#include <console/console.h>
#include <console/debug.h>
-#include <cpu/cpu.h>
-#include <cpu/intel/cpu_ids.h>
#include <cpu/intel/common/common.h>
-#include <cpu/intel/em64t101_save_state.h>
#include <cpu/intel/microcode.h>
#include <cpu/intel/smm_reloc.h>
#include <cpu/intel/turbo.h>
-#include <cpu/x86/lapic.h>
#include <cpu/x86/mp.h>
-#include <cpu/x86/mtrr.h>
#include <cpu/x86/topology.h>
-#include <device/pci_mmio_cfg.h>
#include <intelblocks/cpulib.h>
#include <intelblocks/mp_init.h>
#include <intelpch/lockdown.h>
#include <soc/msr.h>
-#include <soc/pci_devs.h>
#include <soc/pm.h>
-#include <soc/soc_util.h>
#include <soc/smmrelocate.h>
#include <soc/util.h>
@@ -235,6 +224,12 @@ 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();
@@ -273,12 +268,9 @@ void mp_init_cpus(struct bus *bus)
chip_config = bus->dev->chip_info;
microcode_patch = intel_microcode_find();
-
- if (!microcode_patch)
- printk(BIOS_ERR, "microcode not found in CBFS!\n");
-
intel_microcode_load_unlocked(microcode_patch);
- if (mp_init_with_smm(bus, &mp_ops) < 0)
- printk(BIOS_ERR, "MP initialization failure.\n");
+ enum cb_err ret = mp_init_with_smm(bus, &mp_ops);
+ if (ret != CB_SUCCESS)
+ printk(BIOS_ERR, "MP initialization failure %d.\n", ret);
}