Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/73070 )
Change subject: soc/amd/stoneyridge/acpi: use available number of CPUs for CPU entries ......................................................................
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 felix-coreboot@felixheld.de Change-Id: I6850edfa305304060092cb5480f4296f4f5ddacc Reviewed-on: https://review.coreboot.org/c/coreboot/+/73070 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Matt DeVillier matt.devillier@amd.corp-partner.google.com --- M src/soc/amd/stoneyridge/acpi.c 1 file changed, 22 insertions(+), 5 deletions(-)
Approvals: build bot (Jenkins): Verified Matt DeVillier: Looks good to me, approved
diff --git a/src/soc/amd/stoneyridge/acpi.c b/src/soc/amd/stoneyridge/acpi.c index bc3e73a..34d1571 100644 --- a/src/soc/amd/stoneyridge/acpi.c +++ b/src/soc/amd/stoneyridge/acpi.c @@ -16,6 +16,7 @@ #include <gpio.h> #include <amdblocks/acpimmio.h> #include <amdblocks/acpi.h> +#include <amdblocks/cpu.h> #include <amdblocks/ioapic.h> #include <soc/acpi.h> #include <soc/pci_devs.h> @@ -94,11 +95,8 @@
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);