From 21f6ccf3a43d3e3ffc9db82ee28718f672acadf9 Mon Sep 17 00:00:00 2001 From: Jeremy Compostella Date: Mon, 29 Sep 2025 16:07:56 -0700 Subject: [PATCH] soc/intel/pantherlake: Use CPU ID mask for all stepping This commit refactors the handling of CPU IDs for the Pantherlake and Wildcat Lake series by using a single CPU ID mask instead of listing each individual stepping. This change simplifies the code by reducing redundancy and making it easier to manage CPU IDs. Previously, each stepping of the Pantherlake series had its own entry, which led to unnecessary complexity. By consolidating these into a single entry with a mask, we improve maintainability and reduce potential errors. These modifications do not affect the existing functionality but streamline the codebase for future updates and maintenance. TEST=CPU ID c06c1 is properly identified as "Pantherlake". Change-Id: Ie52ed860c096a3d157ae6580aeedf3acb8c723ab Signed-off-by: Jeremy Compostella Reviewed-on: https://review.coreboot.org/c/coreboot/+/89375 Reviewed-by: Bora Guvendik Reviewed-by: Wonkyu Kim Reviewed-by: Jamie Ryu Tested-by: build bot (Jenkins) --- src/include/cpu/intel/cpu_ids.h | 7 ++----- src/soc/intel/common/block/cpu/mp_init.c | 7 ++----- src/soc/intel/pantherlake/bootblock/report_platform.c | 9 +++------ 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/src/include/cpu/intel/cpu_ids.h b/src/include/cpu/intel/cpu_ids.h index d8b067c1fa..ada3bfd216 100644 --- a/src/include/cpu/intel/cpu_ids.h +++ b/src/include/cpu/intel/cpu_ids.h @@ -86,10 +86,7 @@ #define CPUID_LUNARLAKE_A0_1 0xb06d0 #define CPUID_LUNARLAKE_A0_2 0xb06d1 #define CPUID_ARROWLAKE_H_A0 0xc0652 -#define CPUID_PANTHERLAKE_A0 0xc06c0 -#define CPUID_PANTHERLAKE_B0_1 0xc06c1 -#define CPUID_PANTHERLAKE_B0_2 0xc06c2 -#define CPUID_PANTHERLAKE_B0_3 0xc06c3 +#define CPUID_PANTHERLAKE 0xc06c0 #define CPUID_SNOWRIDGE_A0 0x80660 #define CPUID_SNOWRIDGE_A1 0x80661 #define CPUID_SNOWRIDGE_A2 0x80662 @@ -97,6 +94,6 @@ #define CPUID_SNOWRIDGE_B0 0x80664 #define CPUID_SNOWRIDGE_B1 0x80665 #define CPUID_SNOWRIDGE_C0 0x80667 -#define CPUID_WILDCATLAKE_A0 0xd0650 +#define CPUID_WILDCATLAKE 0xd0650 #endif /* CPU_INTEL_CPU_IDS_H */ diff --git a/src/soc/intel/common/block/cpu/mp_init.c b/src/soc/intel/common/block/cpu/mp_init.c index b4ee88a0ad..fdee38d254 100644 --- a/src/soc/intel/common/block/cpu/mp_init.c +++ b/src/soc/intel/common/block/cpu/mp_init.c @@ -32,11 +32,8 @@ static struct device_operations cpu_dev_ops = { }; static const struct cpu_device_id cpu_table[] = { - { X86_VENDOR_INTEL, CPUID_WILDCATLAKE_A0, CPUID_EXACT_MATCH_MASK }, - { X86_VENDOR_INTEL, CPUID_PANTHERLAKE_A0, CPUID_EXACT_MATCH_MASK }, - { X86_VENDOR_INTEL, CPUID_PANTHERLAKE_B0_1, CPUID_EXACT_MATCH_MASK }, - { X86_VENDOR_INTEL, CPUID_PANTHERLAKE_B0_2, CPUID_EXACT_MATCH_MASK }, - { X86_VENDOR_INTEL, CPUID_PANTHERLAKE_B0_3, CPUID_EXACT_MATCH_MASK }, + { X86_VENDOR_INTEL, CPUID_WILDCATLAKE, CPUID_ALL_STEPPINGS_MASK }, + { X86_VENDOR_INTEL, CPUID_PANTHERLAKE, CPUID_ALL_STEPPINGS_MASK }, { X86_VENDOR_INTEL, CPUID_LUNARLAKE_A0_1, CPUID_EXACT_MATCH_MASK }, { X86_VENDOR_INTEL, CPUID_LUNARLAKE_A0_2, CPUID_EXACT_MATCH_MASK }, { X86_VENDOR_INTEL, CPUID_METEORLAKE_A0_1, CPUID_EXACT_MATCH_MASK }, diff --git a/src/soc/intel/pantherlake/bootblock/report_platform.c b/src/soc/intel/pantherlake/bootblock/report_platform.c index 540358238d..70d644ff52 100644 --- a/src/soc/intel/pantherlake/bootblock/report_platform.c +++ b/src/soc/intel/pantherlake/bootblock/report_platform.c @@ -20,11 +20,8 @@ static struct { u32 cpuid; const char *name; } cpu_table[] = { - { CPUID_PANTHERLAKE_A0, "Pantherlake A0" }, - { CPUID_PANTHERLAKE_B0_1, "Pantherlake B0" }, - { CPUID_PANTHERLAKE_B0_2, "Pantherlake B0" }, - { CPUID_PANTHERLAKE_B0_3, "Pantherlake B0" }, - { CPUID_WILDCATLAKE_A0, "Wildcatlake A0" }, + { CPUID_PANTHERLAKE, "Pantherlake" }, + { CPUID_WILDCATLAKE, "Wildcatlake" }, }; static struct { @@ -187,7 +184,7 @@ static void report_cpu_info(void) /* Look for string to match the name */ for (i = 0; i < ARRAY_SIZE(cpu_table); i++) { - if (cpu_table[i].cpuid == cpu_id) { + if (cpuid_match(cpu_table[i].cpuid, cpu_id, CPUID_ALL_STEPPINGS_MASK)) { cpu_type = cpu_table[i].name; break; }