From 15024e06e89dba6f7254bd16b3cd0d1f60a82ebf Mon Sep 17 00:00:00 2001 From: Felix Held Date: Thu, 16 Feb 2023 20:34:46 +0100 Subject: soc/amd/stoneyridge/acpi: use available number of CPUs for CPU entries It's sufficient to generate CPU devices for all available CPU cores/ threads instead of for the maximum number of possible CPU cores/threads. TEST=google/careena with 2 cores still boots and Linux doesn't complain about ACPI errors due to referenced but not present CPU objects. Signed-off-by: Felix Held Change-Id: I6850edfa305304060092cb5480f4296f4f5ddacc Reviewed-on: https://review.coreboot.org/c/coreboot/+/73070 Tested-by: build bot (Jenkins) Reviewed-by: Matt DeVillier --- src/soc/amd/stoneyridge/acpi.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/soc/amd/stoneyridge/acpi.c b/src/soc/amd/stoneyridge/acpi.c index bc3e73a973..34d1571fbc 100644 --- a/src/soc/amd/stoneyridge/acpi.c +++ b/src/soc/amd/stoneyridge/acpi.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -94,11 +95,8 @@ void acpi_fill_fadt(acpi_fadt_t *fadt) void generate_cpu_entries(const struct device *device) { - int cores, cpu; - - /* Stoney Ridge is single node, just report # of cores */ - cores = pci_read_config32(SOC_NB_DEV, NB_CAPABILITIES2) & CMP_CAP_MASK; - cores++; /* number of cores is CmpCap+1 */ + int cpu; + const int cores = get_cpu_count(); printk(BIOS_DEBUG, "ACPI \\_SB report %d core(s)\n", cores); -- cgit v1.2.3