summaryrefslogtreecommitdiffstats
path: root/ich_descriptors.c
diff options
context:
space:
mode:
authorNico Huber <nico.huber@secunet.com>2017-06-17 03:10:15 +0200
committerNico Huber <nico.h@gmx.de>2017-07-28 12:31:58 +0000
commit67d71792929f94d4638a3663f2fc19aea4918681 (patch)
treeea1f35914191ac66f66734777a1e1542ea20b403 /ich_descriptors.c
parent500263434b69594dc01b3ccfe5e2c4c498d87656 (diff)
downloadflashrom-67d71792929f94d4638a3663f2fc19aea4918681.tar.gz
flashrom-67d71792929f94d4638a3663f2fc19aea4918681.tar.bz2
flashrom-67d71792929f94d4638a3663f2fc19aea4918681.zip
ich_descriptors: Pretty print an assumed chipset
Change-Id: Id28cb3abc45c6e7f4c4accfc019579c7448c45d7 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: https://review.coreboot.org/20247 Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Reviewed-by: David Hendricks <david.hendricks@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'ich_descriptors.c')
-rw-r--r--ich_descriptors.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/ich_descriptors.c b/ich_descriptors.c
index a2aa94024..a2f8edf3c 100644
--- a/ich_descriptors.c
+++ b/ich_descriptors.c
@@ -90,6 +90,21 @@ void prettyprint_ich_reg_vscc(uint32_t reg_val, int verbosity, bool print_vcl)
#define getFISBA(cont) (((cont)->FLMAP1 >> 12) & 0x00000ff0)
#define getFMSBA(cont) (((cont)->FLMAP2 << 4) & 0x00000ff0)
+void prettyprint_ich_chipset(enum ich_chipset cs)
+{
+ static const char *const chipset_names[] = {
+ "Unknown ICH", "ICH8", "ICH9", "ICH10",
+ "5 series Ibex Peak", "6 series Cougar Point", "7 series Panther Point",
+ "8 series Lynx Point", "Baytrail", "8 series Lynx Point LP", "8 series Wellsburg",
+ "9 series Wildcat Point", "9 series Wildcat Point LP", "100 series Sunrise Point",
+ };
+ if (cs < CHIPSET_ICH8 || cs - CHIPSET_ICH8 + 1 >= ARRAY_SIZE(chipset_names))
+ cs = 0;
+ else
+ cs = cs - CHIPSET_ICH8 + 1;
+ msg_pdbg2("Assuming chipset '%s'.\n", chipset_names[cs]);
+}
+
void prettyprint_ich_descriptors(enum ich_chipset cs, const struct ich_descriptors *desc)
{
prettyprint_ich_descriptor_content(cs, &desc->content);
@@ -881,8 +896,10 @@ int read_ich_descriptors_from_dump(const uint32_t *const dump, const size_t len,
desc->component.FLILL = dump[(getFCBA(&desc->content) >> 2) + 1];
desc->component.FLPB = dump[(getFCBA(&desc->content) >> 2) + 2];
- if (*cs == CHIPSET_ICH_UNKNOWN)
+ if (*cs == CHIPSET_ICH_UNKNOWN) {
*cs = guess_ich_chipset(&desc->content, &desc->component);
+ prettyprint_ich_chipset(*cs);
+ }
/* region */
const ssize_t nr = ich_number_of_regions(*cs, &desc->content);