summaryrefslogtreecommitdiffstats
path: root/ich_descriptors.c
diff options
context:
space:
mode:
authorDavid Hendricks <ddaveh@amazon.com>2021-09-20 21:56:40 -0700
committerNico Huber <nico.h@gmx.de>2021-10-01 11:46:22 +0000
commit106f097ef66ad6c02d5efb58dd778dbece02667e (patch)
tree82c1ba448f2ae073d6ee4b856659bf25a547e0eb /ich_descriptors.c
parent86867eaa19cbc2467994f8e1d96a6ecddddcaad7 (diff)
downloadflashrom-106f097ef66ad6c02d5efb58dd778dbece02667e.tar.gz
flashrom-106f097ef66ad6c02d5efb58dd778dbece02667e.tar.bz2
flashrom-106f097ef66ad6c02d5efb58dd778dbece02667e.zip
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>
Diffstat (limited to 'ich_descriptors.c')
-rw-r--r--ich_descriptors.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/ich_descriptors.c b/ich_descriptors.c
index d56ade759..7927493ad 100644
--- a/ich_descriptors.c
+++ b/ich_descriptors.c
@@ -912,10 +912,8 @@ void prettyprint_ich_descriptor_upper_map(const struct ich_desc_upper_map *umap)
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 @@ static enum ich_chipset guess_ich_chipset_from_content(const struct ich_desc_con
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 @@ static enum ich_chipset guess_ich_chipset_from_content(const struct ich_desc_con
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;
}
}