diff options
author | Arthur Heymans <arthur@aheymans.xyz> | 2021-06-22 11:14:24 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-06-23 12:17:54 +0000 |
commit | 0424a2c59fb28201494aa97a17f873c23645ddfd (patch) | |
tree | 355d69727896ff01414d36cbd2cd0eb38aad558a /util | |
parent | 7ea7986963e15eeb84ebc70340c64017b3782866 (diff) |
util/ifdtool: Fix printing or setting PCH straps
When printing or setting the PCH straps use the PSL directly instead
of multiplying it by 4.
Change-Id: Ia91697fdf0c6d80502e8611b259c444f39c6cd57
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/55753
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'util')
-rw-r--r-- | util/ifdtool/ifdtool.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/util/ifdtool/ifdtool.c b/util/ifdtool/ifdtool.c index bc62b4859f..e97efcc206 100644 --- a/util/ifdtool/ifdtool.c +++ b/util/ifdtool/ifdtool.c @@ -700,11 +700,11 @@ static void dump_fcba(const fcba_t *fcba, const fpsba_t *fpsba) static void dump_fpsba(const fdbar_t *fdb, const fpsba_t *fpsba) { unsigned int i; - /* SoC Strap Length, aka PSL, aka ISL */ - unsigned int SSL = ((fdb->flmap1 >> 24) & 0xff) * sizeof(uint32_t); + /* SoC Straps, aka PSL, aka ISL */ + unsigned int SS = (fdb->flmap1 >> 24) & 0xff; printf("Found PCH Strap Section\n"); - for (i = 0; i < SSL; i++) + for (i = 0; i < SS; i++) printf("PCHSTRP%-3u: 0x%08x\n", i, fpsba->pchstrp[i]); if (ifd_version >= IFD_VERSION_2) { @@ -1362,10 +1362,10 @@ static void set_pchstrap(fpsba_t *fpsba, const fdbar_t *fdb, const int strap, exit(EXIT_FAILURE); } - /* SoC Strap Length, aka PSL, aka ISL */ - int SSL = ((fdb->flmap1 >> 24) & 0xff) * sizeof(uint32_t); - if (strap >= SSL) { - fprintf(stderr, "Strap index %d out of range (max: %d)\n", strap, SSL); + /* SoC Strap, aka PSL, aka ISL */ + int SS = (fdb->flmap1 >> 24) & 0xff; + if (strap >= SS) { + fprintf(stderr, "Strap index %d out of range (max: %d)\n", strap, SS); exit(EXIT_FAILURE); } fpsba->pchstrp[strap] = value; |