From 6a6ac1e0b929a47aedcff41420990cd700e22d13 Mon Sep 17 00:00:00 2001 From: Felix Held Date: Mon, 6 Feb 2023 15:19:11 +0100 Subject: arch/x86/cpu: introduce and use device_match_mask Instead of always doing exact matches between the CPUID read in identify_cpu and the device entries of the CPU device ID table, offer the possibility to use a bit mask in the CPUID matching. This allows covering all steppings of a CPU family/model with one entry and avoids that case of a missing new stepping causing the CPUs not being properly initialized. Some of the CPU device ID tables can now be deduplicated using the CPUID_ALL_STEPPINGS_MASK define, but that's outside of the scope of this patch. Signed-off-by: Felix Held Change-Id: I0540b514ca42591c0d3468307a82b5612585f614 Reviewed-on: https://review.coreboot.org/c/coreboot/+/72847 Reviewed-by: Fred Reitberger Reviewed-by: Martin Roth Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- src/soc/intel/apollolake/cpu.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/soc/intel/apollolake') diff --git a/src/soc/intel/apollolake/cpu.c b/src/soc/intel/apollolake/cpu.c index 7407415737..c942b595cf 100644 --- a/src/soc/intel/apollolake/cpu.c +++ b/src/soc/intel/apollolake/cpu.c @@ -110,13 +110,13 @@ static struct device_operations cpu_dev_ops = { }; static const struct cpu_device_id cpu_table[] = { - { X86_VENDOR_INTEL, CPUID_APOLLOLAKE_A0 }, - { X86_VENDOR_INTEL, CPUID_APOLLOLAKE_B0 }, - { X86_VENDOR_INTEL, CPUID_APOLLOLAKE_E0 }, - { X86_VENDOR_INTEL, CPUID_GLK_A0 }, - { X86_VENDOR_INTEL, CPUID_GLK_B0 }, - { X86_VENDOR_INTEL, CPUID_GLK_R0 }, - { 0, 0 }, + { X86_VENDOR_INTEL, CPUID_APOLLOLAKE_A0, CPUID_EXACT_MATCH_MASK }, + { X86_VENDOR_INTEL, CPUID_APOLLOLAKE_B0, CPUID_EXACT_MATCH_MASK }, + { X86_VENDOR_INTEL, CPUID_APOLLOLAKE_E0, CPUID_EXACT_MATCH_MASK }, + { X86_VENDOR_INTEL, CPUID_GLK_A0, CPUID_EXACT_MATCH_MASK }, + { X86_VENDOR_INTEL, CPUID_GLK_B0, CPUID_EXACT_MATCH_MASK }, + { X86_VENDOR_INTEL, CPUID_GLK_R0, CPUID_EXACT_MATCH_MASK }, + { 0, 0, 0 }, }; static const struct cpu_driver driver __cpu_driver = { -- cgit v1.2.3