summaryrefslogtreecommitdiff
path: root/src/cpu
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2019-02-28 22:57:16 +0100
committerNico Huber <nico.h@gmx.de>2019-03-03 10:54:37 +0000
commit2d0fe4ff22f0c1ca5d71b20339f3c9858c38b71a (patch)
treeb3f5e49c8ca410e9d5f59266907b540115d719ca /src/cpu
parent97445f20edf9f0cda0ad184b42eed060095ff860 (diff)
cpu/intel/model_1067x: Implement microcode loading
We load it once for the BSP in advance and let the MP init handle it for the APs. The BSP load could also be done earlier, e.g. before CAR setup, to align with other platforms. TEST=Booted ThinkPad X200s and checked log: Microcode is loaded correctly on the BSP before SMM setup, and reported to be up to date on all cores after. Change-Id: I85adb22a608ca3e7355bd486ebba52ec8fdd396c Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/31664 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Diffstat (limited to 'src/cpu')
-rw-r--r--src/cpu/intel/model_1067x/mp_init.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/cpu/intel/model_1067x/mp_init.c b/src/cpu/intel/model_1067x/mp_init.c
index acd56c82a8..16ea8fccb4 100644
--- a/src/cpu/intel/model_1067x/mp_init.c
+++ b/src/cpu/intel/model_1067x/mp_init.c
@@ -27,6 +27,8 @@ static const void *microcode_patch;
static void pre_mp_init(void)
{
+ intel_microcode_load_unlocked(microcode_patch);
+
/* Setup MTRRs based on physical address size. */
x86_setup_mtrrs_with_detect();
x86_mtrr_check();
@@ -42,6 +44,12 @@ static int get_cpu_count(void)
return cores;
}
+static void get_microcode_info(const void **microcode, int *parallel)
+{
+ *microcode = microcode_patch;
+ *parallel = 1;
+}
+
/* the SMRR enable and lock bit need to be set in IA32_FEATURE_CONTROL
to enable SMRR so configure IA32_FEATURE_CONTROL early on */
static void pre_mp_smm_init(void)
@@ -98,6 +106,7 @@ static const struct mp_ops mp_ops = {
.pre_mp_init = pre_mp_init,
.get_cpu_count = get_cpu_count,
.get_smm_info = smm_info,
+ .get_microcode_info = get_microcode_info,
.pre_mp_smm_init = pre_mp_smm_init,
.per_cpu_smm_trigger = per_cpu_smm_trigger,
.relocation_handler = smm_relocation_handler,
@@ -106,6 +115,8 @@ static const struct mp_ops mp_ops = {
void bsp_init_and_start_aps(struct bus *cpu_bus)
{
+ microcode_patch = intel_microcode_find();
+
if (mp_init_with_smm(cpu_bus, &mp_ops))
printk(BIOS_ERR, "MP initialization failure.\n");
}