cpu/x86/mp_init.c: Make it work for !CONFIG_SMP

With very little changes this code can be used to initialize systems
without SMP. The linker will remove most of the code.

Change-Id: Ia0e8fdf8ed7bc2e0e4ff01be8d3e3c3cb837e6c7
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59692
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Arthur Heymans 2021-11-26 14:50:42 +01:00 committed by Felix Held
parent acb17fec34
commit 48fbf2f21d
2 changed files with 6 additions and 1 deletions

View File

@ -1,12 +1,13 @@
config PARALLEL_MP config PARALLEL_MP
def_bool y def_bool y
depends on !LEGACY_SMP_INIT depends on !LEGACY_SMP_INIT
depends on SMP
select CPU_INFO_V2 select CPU_INFO_V2
help help
This option uses common MP infrastructure for bringing up APs This option uses common MP infrastructure for bringing up APs
in parallel. It additionally provides a more flexible mechanism in parallel. It additionally provides a more flexible mechanism
for sequencing the steps of bringing up the APs. for sequencing the steps of bringing up the APs.
The code also works for just initialising the BSP in case there
are no APs.
config PARALLEL_MP_AP_WORK config PARALLEL_MP_AP_WORK
def_bool n def_bool n

View File

@ -593,6 +593,10 @@ static enum cb_err mp_init(struct bus *cpu_bus, struct mp_params *p)
return CB_ERR; return CB_ERR;
} }
/* We just need to run things on the BSP */
if (!CONFIG(SMP))
return bsp_do_flight_plan(p);
/* Default to currently running CPU. */ /* Default to currently running CPU. */
num_cpus = allocate_cpu_devices(cpu_bus, p); num_cpus = allocate_cpu_devices(cpu_bus, p);