summaryrefslogtreecommitdiffstats
path: root/src/soc/intel/common/block/cpu
diff options
context:
space:
mode:
authorSubrata Banik <subratabanik@google.com>2022-05-31 23:36:59 +0530
committerFelix Held <felix-coreboot@felixheld.de>2022-06-07 12:51:23 +0000
commitbdea3524b0452de08e409d9097d60f67b5afb455 (patch)
treefeca319b5d24f708f6aa891fe10f5aee4b518024 /src/soc/intel/common/block/cpu
parente43adb67bc699faa3e2e895da3260e526eb21c7b (diff)
downloadcoreboot-bdea3524b0452de08e409d9097d60f67b5afb455.tar.gz
coreboot-bdea3524b0452de08e409d9097d60f67b5afb455.tar.bz2
coreboot-bdea3524b0452de08e409d9097d60f67b5afb455.zip
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>
Diffstat (limited to 'src/soc/intel/common/block/cpu')
-rw-r--r--src/soc/intel/common/block/cpu/mp_init.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/soc/intel/common/block/cpu/mp_init.c b/src/soc/intel/common/block/cpu/mp_init.c
index cec767a9a0a3..52b1494fd274 100644
--- a/src/soc/intel/common/block/cpu/mp_init.c
+++ b/src/soc/intel/common/block/cpu/mp_init.c
@@ -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();
}