From c056d18fbe13fd90a141e9c713969efb9f0915d7 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Tue, 31 May 2022 21:40:30 +0200 Subject: soc/amd/stoneyridge: Align get_cpu_count to other targets The CPUID function to get the number of cores on a package is common across multiple generations of AMD cpus. Change-Id: I28bff875ea2df7837e4495787cf8a4c2d522d43d Signed-off-by: Arthur Heymans Reviewed-on: https://review.coreboot.org/c/coreboot/+/64869 Reviewed-by: Paul Menzel Tested-by: build bot (Jenkins) Reviewed-by: Marshall Dawson --- src/soc/amd/stoneyridge/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/soc/amd') diff --git a/src/soc/amd/stoneyridge/cpu.c b/src/soc/amd/stoneyridge/cpu.c index e691a51b3992..94beed865abf 100644 --- a/src/soc/amd/stoneyridge/cpu.c +++ b/src/soc/amd/stoneyridge/cpu.c @@ -43,7 +43,7 @@ static void pre_mp_init(void) static int get_cpu_count(void) { - return (pci_read_config16(SOC_HT_DEV, D18F0_CPU_CNT) & CPU_CNT_MASK) + 1; + return 1 + (cpuid_ecx(0x80000008) & 0xff); } static const struct mp_ops mp_ops = { -- cgit v1.2.3