From a75a2fa1d6bd791e27275105af45f9d5babcb5a3 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Tue, 1 Dec 2020 15:20:10 +0100 Subject: mb/emulation/x86: Add optional parallel_mp init support This makes it possible to select both the legacy LAPIC AP init or the newer parallel MP init. Tested on i440fx with -smp 32. Change-Id: I007b052ccd3c34648cd172344d55768232acfd88 Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/48210 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Rudolph --- src/mainboard/emulation/qemu-i440fx/northbridge.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/mainboard/emulation/qemu-i440fx') diff --git a/src/mainboard/emulation/qemu-i440fx/northbridge.c b/src/mainboard/emulation/qemu-i440fx/northbridge.c index d19d6c8207..f49d47dac9 100644 --- a/src/mainboard/emulation/qemu-i440fx/northbridge.c +++ b/src/mainboard/emulation/qemu-i440fx/northbridge.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -244,9 +245,22 @@ static struct device_operations pci_domain_ops = { #endif }; +static const struct mp_ops mp_ops_no_smm = { + .get_cpu_count = fw_cfg_max_cpus, +}; + +void mp_init_cpus(struct bus *cpu_bus) +{ + if (mp_init_with_smm(cpu_bus, &mp_ops_no_smm)) + printk(BIOS_ERR, "MP initialization failure.\n"); +} + static void cpu_bus_init(struct device *dev) { - initialize_cpus(dev->link_list); + if (CONFIG(PARALLEL_MP)) + mp_cpu_bus_init(dev); + else + initialize_cpus(dev->link_list); } static void cpu_bus_scan(struct device *bus) -- cgit v1.2.3