summaryrefslogtreecommitdiff
path: root/src/soc/amd
diff options
context:
space:
mode:
authorFelix Held <felix-coreboot@felixheld.de>2023-02-06 15:19:11 +0100
committerFelix Held <felix-coreboot@felixheld.de>2023-02-08 15:07:45 +0000
commit6a6ac1e0b929a47aedcff41420990cd700e22d13 (patch)
tree669b654a6876be7ae88045783bda9254b55e457e /src/soc/amd
parent2fe5d3e5a5982169aeac86188949a301ab9ed0aa (diff)
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 <felix-coreboot@felixheld.de> Change-Id: I0540b514ca42591c0d3468307a82b5612585f614 Reviewed-on: https://review.coreboot.org/c/coreboot/+/72847 Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com> Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/soc/amd')
-rw-r--r--src/soc/amd/cezanne/cpu.c4
-rw-r--r--src/soc/amd/glinda/cpu.c4
-rw-r--r--src/soc/amd/mendocino/cpu.c4
-rw-r--r--src/soc/amd/phoenix/cpu.c4
-rw-r--r--src/soc/amd/picasso/cpu.c12
-rw-r--r--src/soc/amd/stoneyridge/cpu.c6
6 files changed, 17 insertions, 17 deletions
diff --git a/src/soc/amd/cezanne/cpu.c b/src/soc/amd/cezanne/cpu.c
index 78ca9e506d..ddd4afeb2e 100644
--- a/src/soc/amd/cezanne/cpu.c
+++ b/src/soc/amd/cezanne/cpu.c
@@ -47,8 +47,8 @@ static struct device_operations cpu_dev_ops = {
};
static struct cpu_device_id cpu_table[] = {
- { X86_VENDOR_AMD, CEZANNE_A0_CPUID},
- { 0, 0 },
+ { X86_VENDOR_AMD, CEZANNE_A0_CPUID, CPUID_EXACT_MATCH_MASK },
+ { 0, 0, 0 },
};
static const struct cpu_driver zen_2_3 __cpu_driver = {
diff --git a/src/soc/amd/glinda/cpu.c b/src/soc/amd/glinda/cpu.c
index 372ec4a32c..c5a0ec43e1 100644
--- a/src/soc/amd/glinda/cpu.c
+++ b/src/soc/amd/glinda/cpu.c
@@ -50,8 +50,8 @@ static struct device_operations cpu_dev_ops = {
};
static struct cpu_device_id cpu_table[] = {
- { X86_VENDOR_AMD, GLINDA_A0_CPUID}, /* TODO: Update for Glinda */
- { 0, 0 },
+ { X86_VENDOR_AMD, GLINDA_A0_CPUID, CPUID_EXACT_MATCH_MASK }, /* TODO: Update for Glinda */
+ { 0, 0, 0 },
};
static const struct cpu_driver zen_2_3 __cpu_driver = {
diff --git a/src/soc/amd/mendocino/cpu.c b/src/soc/amd/mendocino/cpu.c
index fe5b0549d7..7561b245f1 100644
--- a/src/soc/amd/mendocino/cpu.c
+++ b/src/soc/amd/mendocino/cpu.c
@@ -48,8 +48,8 @@ static struct device_operations cpu_dev_ops = {
};
static struct cpu_device_id cpu_table[] = {
- { X86_VENDOR_AMD, MENDOCINO_A0_CPUID},
- { 0, 0 },
+ { X86_VENDOR_AMD, MENDOCINO_A0_CPUID, CPUID_EXACT_MATCH_MASK },
+ { 0, 0, 0 },
};
static const struct cpu_driver zen_2_3 __cpu_driver = {
diff --git a/src/soc/amd/phoenix/cpu.c b/src/soc/amd/phoenix/cpu.c
index 68e440be43..cba22e97e3 100644
--- a/src/soc/amd/phoenix/cpu.c
+++ b/src/soc/amd/phoenix/cpu.c
@@ -51,8 +51,8 @@ static struct device_operations cpu_dev_ops = {
static struct cpu_device_id cpu_table[] = {
/* TODO: Add Phoenix CPUID */
- { X86_VENDOR_AMD, PHOENIX2_A0_CPUID},
- { 0, 0 },
+ { X86_VENDOR_AMD, PHOENIX2_A0_CPUID, CPUID_EXACT_MATCH_MASK },
+ { 0, 0, 0 },
};
static const struct cpu_driver zen_2_3 __cpu_driver = {
diff --git a/src/soc/amd/picasso/cpu.c b/src/soc/amd/picasso/cpu.c
index 47c71ab139..0ec753da37 100644
--- a/src/soc/amd/picasso/cpu.c
+++ b/src/soc/amd/picasso/cpu.c
@@ -48,12 +48,12 @@ static struct device_operations cpu_dev_ops = {
};
static struct cpu_device_id cpu_table[] = {
- { X86_VENDOR_AMD, RAVEN1_B0_CPUID},
- { X86_VENDOR_AMD, PICASSO_B0_CPUID },
- { X86_VENDOR_AMD, PICASSO_B1_CPUID },
- { X86_VENDOR_AMD, RAVEN2_A0_CPUID },
- { X86_VENDOR_AMD, RAVEN2_A1_CPUID },
- { 0, 0 },
+ { X86_VENDOR_AMD, RAVEN1_B0_CPUID, CPUID_EXACT_MATCH_MASK },
+ { X86_VENDOR_AMD, PICASSO_B0_CPUID, CPUID_EXACT_MATCH_MASK },
+ { X86_VENDOR_AMD, PICASSO_B1_CPUID, CPUID_EXACT_MATCH_MASK },
+ { X86_VENDOR_AMD, RAVEN2_A0_CPUID, CPUID_EXACT_MATCH_MASK },
+ { X86_VENDOR_AMD, RAVEN2_A1_CPUID, CPUID_EXACT_MATCH_MASK },
+ { 0, 0, 0 },
};
static const struct cpu_driver model_17 __cpu_driver = {
diff --git a/src/soc/amd/stoneyridge/cpu.c b/src/soc/amd/stoneyridge/cpu.c
index 8e44ede39e..a40b54bb81 100644
--- a/src/soc/amd/stoneyridge/cpu.c
+++ b/src/soc/amd/stoneyridge/cpu.c
@@ -60,9 +60,9 @@ static struct device_operations cpu_dev_ops = {
};
static struct cpu_device_id cpu_table[] = {
- { X86_VENDOR_AMD, 0x660f01 },
- { X86_VENDOR_AMD, 0x670f00 },
- { 0, 0 },
+ { X86_VENDOR_AMD, 0x660f01, CPUID_EXACT_MATCH_MASK },
+ { X86_VENDOR_AMD, 0x670f00, CPUID_EXACT_MATCH_MASK },
+ { 0, 0, 0 },
};
static const struct cpu_driver model_15 __cpu_driver = {