diff options
-rw-r--r-- | src/soc/amd/common/block/cpu/cpu.c | 7 | ||||
-rw-r--r-- | src/soc/amd/common/block/cpu/noncar/cpu.c | 7 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/soc/amd/common/block/cpu/cpu.c b/src/soc/amd/common/block/cpu/cpu.c index 1e1915f98f..bce0fc3ad6 100644 --- a/src/soc/amd/common/block/cpu/cpu.c +++ b/src/soc/amd/common/block/cpu/cpu.c @@ -2,6 +2,7 @@ #include <acpi/acpi.h> #include <amdblocks/cpu.h> +#include <cpu/amd/cpuid.h> #include <cpu/cpu.h> #include <device/device.h> @@ -10,6 +11,12 @@ int get_cpu_count(void) return 1 + (cpuid_ecx(0x80000008) & 0xff); } +unsigned int get_threads_per_core(void) +{ + return 1 + ((cpuid_ebx(CPUID_EBX_CORE_ID) & CPUID_EBX_THREADS_MASK) + >> CPUID_EBX_THREADS_SHIFT); +} + struct device_operations amd_cpu_bus_ops = { .read_resources = noop_read_resources, .set_resources = noop_set_resources, diff --git a/src/soc/amd/common/block/cpu/noncar/cpu.c b/src/soc/amd/common/block/cpu/noncar/cpu.c index 8151b964d0..3f78aa4211 100644 --- a/src/soc/amd/common/block/cpu/noncar/cpu.c +++ b/src/soc/amd/common/block/cpu/noncar/cpu.c @@ -1,7 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include <amdblocks/cpu.h> -#include <cpu/amd/cpuid.h> #include <cpu/cpu.h> #include <cpu/x86/msr.h> #include <cpu/amd/msr.h> @@ -13,12 +12,6 @@ unsigned int smbios_processor_family(struct cpuid_result res) return 0x6b; /* Zen */ } -unsigned int get_threads_per_core(void) -{ - return 1 + ((cpuid_ebx(CPUID_EBX_CORE_ID) & CPUID_EBX_THREADS_MASK) - >> CPUID_EBX_THREADS_SHIFT); -} - void set_cstate_io_addr(void) { msr_t cst_addr; |