Aaron Durbin (adurbin@chromium.org) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/14592
-gerrit
commit ed0dc4b87f0d7fe1a41ba4e816eef4bc444e9724 Author: Aaron Durbin adurbin@chromium.org Date: Tue May 3 15:26:29 2016 -0500
soc/intel/fsp_broadwell_de: convert to using common MP init
In order to reduce duplication of code use the common MP initialization flow.
Change-Id: I2a7c628cfae7cf6af6e89fa8fc274f59127ff7c7 Signed-off-by: Aaron Durbin adurbin@chromium.org --- src/soc/intel/fsp_broadwell_de/cpu.c | 60 +++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 28 deletions(-)
diff --git a/src/soc/intel/fsp_broadwell_de/cpu.c b/src/soc/intel/fsp_broadwell_de/cpu.c index 2f6487a..ca08204 100644 --- a/src/soc/intel/fsp_broadwell_de/cpu.c +++ b/src/soc/intel/fsp_broadwell_de/cpu.c @@ -27,15 +27,42 @@ #include <soc/pattrs.h> #include <soc/ramstage.h>
-static void configure_mca(void); +static void pre_mp_init(void) +{ + x86_mtrr_check(); + + /* Enable the local cpu apics */ + setup_lapic(); +} + +static int get_cpu_count(void) +{ + const struct pattrs *pattrs = pattrs_get();
-static struct mp_flight_record mp_steps[] = { - MP_FR_BLOCK_APS(mp_initialize_cpu, mp_initialize_cpu), + return pattrs->num_cpus; +} + +static void get_microcode_info(const void **microcode, int *parallel) +{ + const struct pattrs *pattrs = pattrs_get(); + + *microcode = pattrs->microcode_patch; + *parallel = 1; +} + +static const struct mp_ops mp_ops = { + .pre_mp_init = pre_mp_init, + .get_cpu_count = get_cpu_count, + .get_microcode_info = get_microcode_info, };
-static int adjust_apic_id(int index, int apic_id) +void broadwell_de_init_cpus(device_t dev) { - return index; + struct bus *cpu_bus = dev->link_list; + + if (mp_init_with_smm(cpu_bus, &mp_ops)) { + printk(BIOS_ERR, "MP initialization failure.\n"); + } }
static void configure_mca(void) @@ -63,29 +90,6 @@ static void configure_mca(void) wrmsr(MSR_IA32_MC0_STATUS + (i * 4), msr); }
-void broadwell_de_init_cpus(device_t dev) -{ - struct bus *cpu_bus = dev->link_list; - const struct pattrs *pattrs = pattrs_get(); - struct mp_params mp_params; - - x86_mtrr_check(); - - /* Enable the local cpu apics */ - setup_lapic(); - - 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 = pattrs->microcode_patch; - - if (mp_init(cpu_bus, &mp_params)) { - printk(BIOS_ERR, "MP initialization failure.\n"); - } -} - static void broadwell_de_core_init(device_t cpu) { printk(BIOS_DEBUG, "Init Broadwell-DE core.\n");