Michał Kopeć has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/59841 )
Change subject: northbridge/amd/agesa/family14: Enable PARALLEL_MP ......................................................................
northbridge/amd/agesa/family14: Enable PARALLEL_MP
Disable LEGACY_SMP_INIT to enable PARALLEL_MP.
Tested on a PC Engines apu1 board.
Inspired by CB:59693.
Signed-off-by: Michał Kopeć michal.kopec@3mdeb.com Change-Id: I958bffefb2b60abb33b12f25335369496e70e9e8 --- M src/northbridge/amd/agesa/family14/Kconfig M src/northbridge/amd/agesa/family14/northbridge.c 2 files changed, 16 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/41/59841/1
diff --git a/src/northbridge/amd/agesa/family14/Kconfig b/src/northbridge/amd/agesa/family14/Kconfig index 941972b..b1bde22 100644 --- a/src/northbridge/amd/agesa/family14/Kconfig +++ b/src/northbridge/amd/agesa/family14/Kconfig @@ -2,7 +2,6 @@
config NORTHBRIDGE_AMD_AGESA_FAMILY14 bool - select LEGACY_SMP_INIT select RESOURCE_ALLOCATOR_V3
if NORTHBRIDGE_AMD_AGESA_FAMILY14 diff --git a/src/northbridge/amd/agesa/family14/northbridge.c b/src/northbridge/amd/agesa/family14/northbridge.c index 4b4ab67..497cc29 100644 --- a/src/northbridge/amd/agesa/family14/northbridge.c +++ b/src/northbridge/amd/agesa/family14/northbridge.c @@ -10,7 +10,7 @@ #include <device/pci_ids.h> #include <string.h> #include <lib.h> -#include <cpu/cpu.h> +#include <cpu/x86/mp.h> #include <cpu/amd/msr.h> #include <cpu/amd/mtrr.h> #include <northbridge/amd/nb_common.h> @@ -638,9 +638,21 @@ } }
-static void cpu_bus_init(struct device *dev) +static int get_cpu_count(void) { - initialize_cpus(dev->link_list); + uint8_t siblings = cpuid_ecx(0x80000008) & 0xff; + + return siblings + 1; +} + +static const struct mp_ops mp_ops = { + .get_cpu_count = get_cpu_count, +}; + +void mp_init_cpus(struct bus *cpu_bus) +{ + /* TODO: Handle mp_init_with_smm failure? */ + mp_init_with_smm(cpu_bus, &mp_ops); }
/* North Bridge Structures */ @@ -812,7 +824,7 @@ static struct device_operations cpu_bus_ops = { .read_resources = noop_read_resources, .set_resources = noop_set_resources, - .init = cpu_bus_init, + .init = mp_cpu_bus_init, .scan_bus = cpu_bus_scan, };