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>
This commit is contained in:
Felix Held 2023-02-16 20:34:46 +01:00
parent b9a6223453
commit 15024e06e8
1 changed files with 3 additions and 5 deletions

View File

@ -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 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);