Thomas Heijligen has uploaded this change for review. ( https://review.coreboot.org/25296
Change subject: ifdtool: dump all PCH Straps ......................................................................
ifdtool: dump all PCH Straps
The length of the PCH Strap is defined in FLMAP1 as ISL. Use this value to dump all PCH Straps. Set MAX_PCHSTRP to 0x58 (Skylake-H), the lagest value known to me.
Change-Id: I56c02c00923e018bbd6a0409a08715f39b854d0a Signed-off-by: Thomas Heijligen src@posteo.de --- M util/ifdtool/ifdtool.c M util/ifdtool/ifdtool.h 2 files changed, 7 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/96/25296/1
diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c index 8397f5c..4fade18 100644 --- a/util/ifdtool/ifdtool.c +++ b/util/ifdtool/ifdtool.c @@ -411,11 +411,13 @@ (fcba->flpb & 0xfff) << 12); }
-static void dump_fpsba(const fpsba_t *fpsba) +static void dump_fpsba(const fpsba_t *fpsba, const uint32_t isl) { - unsigned int i; printf("Found PCH Strap Section\n"); - for (i = 0; i < ARRAY_SIZE(fpsba->pchstrp); i++) + if (isl > MAX_PCHSTRP) + printf("PCH Strap Length is bigger than known\n"); + uint32_t i; + for (i = 0; i < isl; i++) printf("PCHSTRP%u:%s 0x%08x\n", i, i < 10 ? " " : "", fpsba->pchstrp[i]); printf("\n"); @@ -622,7 +624,7 @@ if (frba && fcba && fpsba && fmba && fmsba) { dump_frba(frba); dump_fcba(fcba); - dump_fpsba(fpsba); + dump_fpsba(fpsba, (fdb->flmap1 >> 24) & 0xff); dump_fmba(fmba); dump_fmsba(fmsba); } else { diff --git a/util/ifdtool/ifdtool.h b/util/ifdtool/ifdtool.h index cd5af79..bbb94f0 100644 --- a/util/ifdtool/ifdtool.h +++ b/util/ifdtool/ifdtool.h @@ -73,7 +73,7 @@ } __attribute__((packed)) fcba_t;
// pch strap -#define MAX_PCHSTRP 18 +#define MAX_PCHSTRP 0x58
typedef struct { uint32_t pchstrp[MAX_PCHSTRP];