From bdea3524b0452de08e409d9097d60f67b5afb455 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Tue, 31 May 2022 23:36:59 +0530 Subject: [PATCH] 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 Change-Id: I7155fc2da7383629930ce147a90ac582782fa5ae Reviewed-on: https://review.coreboot.org/c/coreboot/+/64835 Tested-by: build bot (Jenkins) Reviewed-by: Lean Sheng Tan --- src/soc/intel/common/block/cpu/mp_init.c | 12 ++++++++---- 1 file 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 cec767a9a0..52b1494fd2 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 #include +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(); }