Attention is currently required from: Stefan Reinauer.
Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/68698 )
Change subject: ifdtool: Don't print reserved regions ......................................................................
ifdtool: Don't print reserved regions
Use the introduced array to determine if a region is reserved.
Change-Id: Ied1ed8b9b901ba02cbb9e6dbeb8a60e7ed773254 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M util/ifdtool/ifdtool.c M util/ifdtool/ifdtool.h M util/ifdtool/regions.c 3 files changed, 23 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/98/68698/1
diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c index 1d236b3..f543c9d 100644 --- a/util/ifdtool/ifdtool.c +++ b/util/ifdtool/ifdtool.c @@ -274,7 +274,7 @@ for (i = 0; i < max_regions; i++) { region = get_region(frba, i); /* Skip unused & reserved Flash Region */ - if (region.size < 1 && !strcmp(region_name(i), "Reserved")) + if (region.size < 1 && !region_supported(chipset, i)) continue;
printf("FLREG%u: 0x%08x\n", i, frba->flreg[i]); diff --git a/util/ifdtool/ifdtool.h b/util/ifdtool/ifdtool.h index 53f46dc..a4e2cdf 100644 --- a/util/ifdtool/ifdtool.h +++ b/util/ifdtool/ifdtool.h @@ -212,4 +212,5 @@ void dump_region(unsigned int num, const frba_t *frba); void dump_region_layout(char *buf, size_t bufsize, unsigned int num, const frba_t *frba); +bool region_supported(const enum ich_chipset chip, const unsigned int i); int max_regions_per_chipset(const enum ich_chipset chip); \ No newline at end of file diff --git a/util/ifdtool/regions.c b/util/ifdtool/regions.c index 09c9dbe..e97e5f5 100644 --- a/util/ifdtool/regions.c +++ b/util/ifdtool/regions.c @@ -175,6 +175,15 @@ region.base, region.limit, region_name_short(num)); }
+bool region_supported(const enum ich_chipset chip, const unsigned int i) +{ + if (chip >= ARRAY_SIZE(region_support_by_chipset)) { + fprintf(stderr, "Unknown chipset: %d\n", chip); + return 0; + } + return !!(region_support_by_chipset[chip] & (1 << i)); +} + int max_regions_per_chipset(const enum ich_chipset chip) { int num = MAX_REGIONS;