soc/intel/cmn/mp_init: Create helper function to load microcode

This patch creates a helper function named `initialize_microcode()`
to load microcode and ease for all function to peform loading
microcode using this helper function.

BUG=b:233199592
TEST=Build and boot google/taeko to ChromeOS.

Signed-off-by: Subrata Banik <subratabanik@google.com>
Change-Id: I7155fc2da7383629930ce147a90ac582782fa5ae
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64835
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
This commit is contained in:
Subrata Banik 2022-05-31 23:36:59 +05:30 committed by Felix Held
parent e43adb67bc
commit bdea3524b0
1 changed files with 8 additions and 4 deletions

View File

@ -15,12 +15,17 @@
#include <intelblocks/msr.h>
#include <soc/cpu.h>
static void initialize_microcode(void)
{
const void *microcode_patch = intel_microcode_find();
intel_microcode_load_unlocked(microcode_patch);
}
static void init_one_cpu(struct device *dev)
{
soc_core_init(dev);
const void *microcode_patch = intel_microcode_find();
intel_microcode_load_unlocked(microcode_patch);
initialize_microcode();
}
static struct device_operations cpu_dev_ops = {
@ -148,8 +153,7 @@ static void coreboot_init_cpus(void *unused)
if (CONFIG(USE_INTEL_FSP_MP_INIT))
return;
const void *microcode_patch = intel_microcode_find();
intel_microcode_load_unlocked(microcode_patch);
initialize_microcode();
init_cpus();
}