summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorNico Huber <nico.huber@secunet.com>2017-03-24 17:25:37 +0100
committerNico Huber <nico.h@gmx.de>2017-07-28 12:30:21 +0000
commitfa62294536a3ce5070e8d9065aaa1aa45031f910 (patch)
tree66152f87787e5c3c6ce2c9db903f8e1a70bd9311 /util
parent1dc3d420831b0ee482aede5f46ba53a0d2de4b74 (diff)
downloadflashrom-fa62294536a3ce5070e8d9065aaa1aa45031f910.tar.gz
flashrom-fa62294536a3ce5070e8d9065aaa1aa45031f910.tar.bz2
flashrom-fa62294536a3ce5070e8d9065aaa1aa45031f910.zip
ich_descriptors: Update for Intel Skylake
Interpretation of component clocks changed. Also more regions and more masters are supported now. The number of regions (NR) is now static per chipset (10 in the 100 Series case) and not coded into the descriptor any more. v2: o Use guess_ich_chipset() for read_ich_descriptors_from_dump(). o Update region extraction in `ich_descriptors_tool`. TEST=Run `ich_descriptors_tool` over a 100 Series dump and checked that output looks sane. Run `ich_descriptors_tool` over dumps of five different older systems (1 x Sandy Bridge, 3 x Ivy Bridge, 1 x Haswell). Beside whitespace changes, regions not accounted by `NR` are not printed any more. Change-Id: Idd60a857d1ecffcb2e437af21134d9de44dcceb8 Signed-off-by: Nico Huber <nico.huber@secunet.com> Reviewed-on: https://review.coreboot.org/18973 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 'util')
-rw-r--r--util/ich_descriptors_tool/ich_descriptors_tool.c40
1 files changed, 27 insertions, 13 deletions
diff --git a/util/ich_descriptors_tool/ich_descriptors_tool.c b/util/ich_descriptors_tool/ich_descriptors_tool.c
index 7dfa5c07e..82c74bd9c 100644
--- a/util/ich_descriptors_tool/ich_descriptors_tool.c
+++ b/util/ich_descriptors_tool/ich_descriptors_tool.c
@@ -40,15 +40,18 @@
#include <sys/mman.h>
#endif
-static void dump_file(const char *prefix, const uint32_t *dump, unsigned int len, struct ich_desc_region *reg, unsigned int i)
+static const char *const region_names[] = {
+ "Descriptor", "BIOS", "ME", "GbE", "Platform",
+ "Region5", "Region6", "Region7", "EC", "Region9",
+};
+
+static void dump_file(const char *prefix, const uint32_t *dump, unsigned int len,
+ const struct ich_desc_region *const reg, unsigned int i)
{
int ret;
char *fn;
const char *reg_name;
uint32_t file_len;
- const char *const region_names[5] = {
- "Descriptor", "BIOS", "ME", "GbE", "Platform"
- };
uint32_t base = ICH_FREG_BASE(reg->FLREGs[i]);
uint32_t limit = ICH_FREG_LIMIT(reg->FLREGs[i]);
@@ -94,12 +97,19 @@ static void dump_file(const char *prefix, const uint32_t *dump, unsigned int len
close(fh);
}
-void dump_files(const char *name, const uint32_t *buf, unsigned int len, struct ich_desc_region *reg)
+int min(int a, int b)
+{
+ return (a < b) ? a : b;
+}
+
+static void dump_files(const char *name, const uint32_t *buf, unsigned int len,
+ const enum ich_chipset cs, const struct ich_descriptors *const desc)
{
- unsigned int i;
+ ssize_t i;
+ const ssize_t nr = min(ich_number_of_regions(cs, &desc->content), ARRAY_SIZE(region_names));
printf("=== Dumping region files ===\n");
- for (i = 0; i < 5; i++)
- dump_file(name, buf, len, reg, i);
+ for (i = 0; i < nr; i++)
+ dump_file(name, buf, len, &desc->region, i);
printf("\n");
}
@@ -123,6 +133,7 @@ static void usage(char *argv[], char *error)
"\t- \"7\" or \"panther\" for Intel's 7 series chipsets.\n"
"\t- \"8\" or \"lynx\" for Intel's 8 series chipsets.\n"
"\t- \"9\" or \"wildcat\" for Intel's 9 series chipsets.\n"
+"\t- \"100\" or \"sunrise\" for Intel's 100 series chipsets.\n"
"If '-d' is specified some regions such as the BIOS image as seen by the CPU or\n"
"the GbE blob that is required to initialize the GbE are also dumped to files.\n",
argv[0], argv[0]);
@@ -208,9 +219,12 @@ int main(int argc, char *argv[])
else if ((strcmp(csn, "9") == 0) ||
(strcmp(csn, "wildcat") == 0))
cs = CHIPSET_9_SERIES_WILDCAT_POINT;
+ else if ((strcmp(csn, "100") == 0) ||
+ (strcmp(csn, "sunrise") == 0))
+ cs = CHIPSET_100_SERIES_SUNRISE_POINT;
}
- ret = read_ich_descriptors_from_dump(buf, len, &desc);
+ ret = read_ich_descriptors_from_dump(buf, len, &cs, &desc);
switch (ret) {
case ICH_RET_OK:
break;
@@ -228,15 +242,15 @@ int main(int argc, char *argv[])
prettyprint_ich_descriptors(cs, &desc);
- pMAC = (uint8_t *) &buf[ICH_FREG_BASE(desc.region.reg3_base) >> 2];
- if (len >= ICH_FREG_BASE(desc.region.reg3_base) + 6 && pMAC[0] != 0xff)
+ pMAC = (uint8_t *) &buf[ICH_FREG_BASE(desc.region.FLREGs[3]) >> 2];
+ if (len >= ICH_FREG_BASE(desc.region.FLREGs[3]) + 6 && pMAC[0] != 0xff)
printf("The MAC address might be at offset 0x%x: "
"%02x:%02x:%02x:%02x:%02x:%02x\n",
- ICH_FREG_BASE(desc.region.reg3_base),
+ ICH_FREG_BASE(desc.region.FLREGs[3]),
pMAC[0], pMAC[1], pMAC[2], pMAC[3], pMAC[4], pMAC[5]);
if (dump == 1)
- dump_files(fn, buf, len, &desc.region);
+ dump_files(fn, buf, len, cs, &desc);
return 0;
}