Nico Huber submitted this change.
ich_descriptors: Add explicit checks for all chipsets
This partially undoes changes made in commit cd9b7b427
(ich_descriptors: Normalize chipset detection) to re-add explicit
matching of each chipset with one or more strap length values.
Since ranges are checked explicitly, the `warn_if` parameter to
warn_peculiar_desc() is no longer necessary and is removed.
Change-Id: Ica49477492876810a6fa212768b1ab9e8c12001f
Signed-off-by: David Hendricks <ddaveh@amazon.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/57793
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Nico Huber <nico.h@gmx.de>
---
M ich_descriptors.c
1 file changed, 19 insertions(+), 10 deletions(-)
diff --git a/ich_descriptors.c b/ich_descriptors.c
index d56ade7..7927493 100644
--- a/ich_descriptors.c
+++ b/ich_descriptors.c
@@ -912,10 +912,8 @@
msg_pdbg2("\n");
}
-static inline void warn_peculiar_desc(const bool warn_if, const char *const name)
+static inline void warn_peculiar_desc(const char *const name)
{
- if (!warn_if)
- return;
msg_pwarn("Peculiar flash descriptor, assuming %s compatibility.\n", name);
}
@@ -933,15 +931,19 @@
return CHIPSET_ICH9;
if (content->ISL <= 10)
return CHIPSET_ICH10;
+ if (content->ISL <= 16)
+ return CHIPSET_5_SERIES_IBEX_PEAK;
if (content->FLMAP2 == 0) {
if (content->ISL == 19)
return CHIPSET_APOLLO_LAKE;
- warn_peculiar_desc(content->ISL != 23, "Gemini Lake");
+ if (content->ISL == 23)
+ return CHIPSET_GEMINI_LAKE;
+ warn_peculiar_desc("Gemini Lake");
return CHIPSET_GEMINI_LAKE;
}
if (content->ISL <= 80)
return CHIPSET_C620_SERIES_LEWISBURG;
- warn_peculiar_desc(content->ISL != 16, "Ibex Peak");
+ warn_peculiar_desc("Ibex Peak");
return CHIPSET_5_SERIES_IBEX_PEAK;
} else if (upper->MDTBA == 0x00) {
if (content->ICCRIBA < 0x31 && content->FMSBA < 0x30) {
@@ -949,18 +951,25 @@
return CHIPSET_BAYTRAIL;
if (content->MSL <= 1 && content->ISL <= 18)
return CHIPSET_6_SERIES_COUGAR_POINT;
- warn_peculiar_desc(content->MSL != 1 || content->ISL != 21, "Lynx Point");
+ if (content->MSL <= 1 && content->ISL <= 21)
+ return CHIPSET_8_SERIES_LYNX_POINT;
+ warn_peculiar_desc("Lynx Point");
return CHIPSET_8_SERIES_LYNX_POINT;
}
if (content->NM == 6) {
- warn_peculiar_desc(content->ICCRIBA > 0x34, "C620 series");
+ if (content->ICCRIBA <= 0x34)
+ return CHIPSET_C620_SERIES_LEWISBURG;
+ warn_peculiar_desc("C620 series");
return CHIPSET_C620_SERIES_LEWISBURG;
}
- warn_peculiar_desc(content->ICCRIBA != 0x31, "100 series");
+ if (content->ICCRIBA == 0x31)
+ return CHIPSET_100_SERIES_SUNRISE_POINT;
+ warn_peculiar_desc("100 series");
return CHIPSET_100_SERIES_SUNRISE_POINT;
} else {
- if (content->ICCRIBA != 0x34)
- msg_pwarn("Unknown flash descriptor, assuming 300 series compatibility.\n");
+ if (content->ICCRIBA == 0x34)
+ return CHIPSET_300_SERIES_CANNON_POINT;
+ msg_pwarn("Unknown flash descriptor, assuming 300 series compatibility.\n");
return CHIPSET_300_SERIES_CANNON_POINT;
}
}
To view, visit change 57793. To unsubscribe, or for help writing mail filters, visit settings.