From 4fbefc5282916550fe7cdd718263fe4cd957a2f3 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Tue, 23 Oct 2018 14:35:37 +0200 Subject: soc/amd/stoneyridge: Replace public magic numbers Some "magic" numbers became public available registers/bits after the code was originally written. Find all magic numbers, and if available in a public BKDG than replace them with literals. BUG=b:117648026 TEST=Build and boot grunt. Change-Id: I96ac59fd92c4a5e27c3836f77bf6633e9b0c4990 Signed-off-by: Richard Spiegel Reviewed-on: https://review.coreboot.org/c/29198 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- src/soc/amd/stoneyridge/acpi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/soc/amd/stoneyridge/acpi.c') diff --git a/src/soc/amd/stoneyridge/acpi.c b/src/soc/amd/stoneyridge/acpi.c index d56e105607..1f6e62abb7 100644 --- a/src/soc/amd/stoneyridge/acpi.c +++ b/src/soc/amd/stoneyridge/acpi.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -237,11 +238,10 @@ void acpi_create_fadt(acpi_fadt_t *fadt, acpi_facs_t *facs, void *dsdt) void generate_cpu_entries(struct device *device) { int cores, cpu; - struct device *cdb_dev; /* Stoney Ridge is single node, just report # of cores */ - cdb_dev = dev_find_slot(0, NB_DEVFN); - cores = (pci_read_config32(cdb_dev, 0x84) & 0xff) + 1; + cores = pci_read_config32(SOC_NB_DEV, NB_CAPABILITIES2) & CMP_CAP_MASK; + cores++; /* number of cores is CmpCap+1 */ printk(BIOS_DEBUG, "ACPI \\_PR report %d core(s)\n", cores); -- cgit v1.2.3