diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/arch/x86/include/arch/cpu.h | 5 | ||||
-rw-r--r-- | src/soc/amd/picasso/soc_util.c | 17 |
2 files changed, 10 insertions, 12 deletions
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) { diff --git a/src/soc/amd/picasso/soc_util.c b/src/soc/amd/picasso/soc_util.c index 59c82c65cd..d2ac6db7cd 100644 --- a/src/soc/amd/picasso/soc_util.c +++ b/src/soc/amd/picasso/soc_util.c @@ -93,32 +93,29 @@ static bool is_mystery_silicon(void) static bool is_fam17_1x(void) { - /* mask lower model number nibble and stepping */ - return cpuid_eax(1) >> 8 == PICASSO_B0_CPUID >> 8; + return cpuid_match(cpuid_eax(1), PICASSO_B0_CPUID, + CPUID_ALL_STEPPINGS_AND_BASE_MODELS_MASK); } static bool is_fam17_11(void) { - /* only mask stepping */ - return cpuid_eax(1) >> 4 == RAVEN1_B0_CPUID >> 4; + return cpuid_match(cpuid_eax(1), RAVEN1_B0_CPUID, CPUID_ALL_STEPPINGS_MASK); } static bool is_fam17_18(void) { - /* only mask stepping */ - return cpuid_eax(1) >> 4 == PICASSO_B0_CPUID >> 4; + return cpuid_match(cpuid_eax(1), PICASSO_B0_CPUID, CPUID_ALL_STEPPINGS_MASK); } static bool is_fam17_2x(void) { - /* mask lower model number nibble and stepping */ - return cpuid_eax(1) >> 8 == RAVEN2_A0_CPUID >> 8; + return cpuid_match(cpuid_eax(1), RAVEN2_A0_CPUID, + CPUID_ALL_STEPPINGS_AND_BASE_MODELS_MASK); } static bool is_fam17_20(void) { - /* only mask stepping */ - return cpuid_eax(1) >> 4 == RAVEN2_A0_CPUID >> 4; + return cpuid_match(cpuid_eax(1), RAVEN2_A0_CPUID, CPUID_ALL_STEPPINGS_MASK); } enum silicon_type get_silicon_type(void) |