From b6969db5c2313b60dcfe0c318c06e5b97780e880 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Mon, 6 Feb 2023 19:47:11 +0100 Subject: soc/amd/picasso/soc_util: use cpuid_match Now that there is a cpuid_match function, we can use it instead of doing basically the same thing manually. In the functions is_fam17_1x and is_fam17_2x both the stepping number and the lower nibble of the model number are masked out. To avoid having magic constants in the code, introduce the CPUID_ALL_STEPPINGS_AND_BASE_MODELS_MASK definition. Signed-off-by: Felix Held Change-Id: I758f9564c08c62c747cc4f93a8d6b540a1834a62 Reviewed-on: https://review.coreboot.org/c/coreboot/+/72860 Reviewed-by: Fred Reitberger Reviewed-by: Martin Roth Reviewed-by: Eric Lai Tested-by: build bot (Jenkins) --- src/arch/x86/include/arch/cpu.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/arch/x86/include') diff --git a/src/arch/x86/include/arch/cpu.h b/src/arch/x86/include/arch/cpu.h index cd8f8b4c97..a0a5840f78 100644 --- a/src/arch/x86/include/arch/cpu.h +++ b/src/arch/x86/include/arch/cpu.h @@ -121,8 +121,9 @@ struct device; ((model) & 0xf) << 4 | \ ((stepping) & 0xf) << 0) -#define CPUID_EXACT_MATCH_MASK 0xffffffff -#define CPUID_ALL_STEPPINGS_MASK 0xfffffff0 +#define CPUID_EXACT_MATCH_MASK 0xffffffff +#define CPUID_ALL_STEPPINGS_MASK 0xfffffff0 +#define CPUID_ALL_STEPPINGS_AND_BASE_MODELS_MASK 0xffffff00 static inline bool cpuid_match(uint32_t a, uint32_t b, uint32_t mask) { -- cgit v1.2.3