From 315bb30cd764a3f57cc6ce36a481e7361ac3a0c0 Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Thu, 24 Oct 2013 14:55:42 -0500 Subject: baytrail: get rid of global microcode_ptr A global microcode_ptr was added when doing the MP development work. However, this is unnecessary as the pattrs structure already contains the pointer. Use that instead. BUG=chrome-os-partner:22862 BRANCH=None TEST=Built and booted. Microcode still being loaded correctly. Change-Id: I0abba66fc7741699411d14bd3e1bb28cf1618028 Signed-off-by: Aaron Durbin Reviewed-on: https://chromium-review.googlesource.com/174552 Reviewed-by: Shawn Nematbakhsh Reviewed-on: http://review.coreboot.org/4901 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Ronald G. Minnich --- src/soc/intel/baytrail/cpu.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/soc/intel/baytrail/cpu.c') diff --git a/src/soc/intel/baytrail/cpu.c b/src/soc/intel/baytrail/cpu.c index c93d253020..1226e471ad 100644 --- a/src/soc/intel/baytrail/cpu.c +++ b/src/soc/intel/baytrail/cpu.c @@ -32,8 +32,6 @@ #include #include -static const void *microcode_ptr; - static void smm_relocate(void *unused); static void enable_smis(void *unused); @@ -61,15 +59,12 @@ void baytrail_init_cpus(device_t dev) x86_setup_var_mtrrs(pattrs->address_bits, 2); x86_mtrr_check(); - /* Stash microcode. */ - microcode_ptr = intel_microcode_find(); - mp_params.num_cpus = pattrs->num_cpus, mp_params.parallel_microcode_load = 1, mp_params.adjust_apic_id = adjust_apic_id; mp_params.flight_plan = &mp_steps[0]; mp_params.num_records = ARRAY_SIZE(mp_steps); - mp_params.microcode_pointer = microcode_ptr; + mp_params.microcode_pointer = pattrs->microcode_patch; if (mp_init(cpu_bus, &mp_params)) { printk(BIOS_ERR, "MP initialization failure.\n"); @@ -220,6 +215,8 @@ static int smm_load_handlers(void) static void smm_relocate(void *unused) { + const struct pattrs *pattrs = pattrs_get(); + /* Load relocation and permanent handler. */ if (boot_cpu()) { if (smm_load_handlers() < 0) { @@ -233,7 +230,7 @@ static void smm_relocate(void *unused) smm_initiate_relocation(); /* Load microcode after SMM relocation. */ - intel_microcode_load_unlocked(microcode_ptr); + intel_microcode_load_unlocked(pattrs->microcode_patch); } static void enable_smis(void *unused) -- cgit v1.2.3