Nico Huber has uploaded a new change for review. ( https://review.coreboot.org/19046 )
Change subject: ich_descriptors: Draw +0xfff into ICH_FREG_LIMIT() ......................................................................
ich_descriptors: Draw +0xfff into ICH_FREG_LIMIT()
The condition `base > limit` is still valid since `base` is always at least 4096 greater than `limit` in this case.
Change-Id: I11ac0a50b3f32f47879e7cfb7a26068cd0572ede Signed-off-by: Nico Huber nico.huber@secunet.com --- M ich_descriptors.c M ich_descriptors.h M ichspi.c M util/ich_descriptors_tool/ich_descriptors_tool.c 4 files changed, 5 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/46/19046/1
diff --git a/ich_descriptors.c b/ich_descriptors.c index 26d1f27..a4c86ec 100644 --- a/ich_descriptors.c +++ b/ich_descriptors.c @@ -248,7 +248,7 @@ if (base > limit) msg_pdbg2("is unused.\n"); else - msg_pdbg2("0x%08x - 0x%08x\n", base, limit | 0x0fff); + msg_pdbg2("0x%08x - 0x%08x\n", base, limit); }
void prettyprint_ich_descriptor_region(const struct ich_descriptors *desc) diff --git a/ich_descriptors.h b/ich_descriptors.h index df4dd76..f7d196b 100644 --- a/ich_descriptors.h +++ b/ich_descriptors.h @@ -64,7 +64,7 @@ /* 24-31: reserved */
#define ICH_FREG_BASE(flreg) (((flreg) << 12) & 0x01fff000) -#define ICH_FREG_LIMIT(flreg) (((flreg) >> 4) & 0x01fff000) +#define ICH_FREG_LIMIT(flreg) ((((flreg) >> 4) & 0x01fff000) | 0x00000fff)
void prettyprint_ich_reg_vscc(uint32_t reg_val, int verbosity, bool print_vcl);
diff --git a/ichspi.c b/ichspi.c index 31eee38..0b30b31 100644 --- a/ichspi.c +++ b/ichspi.c @@ -1560,14 +1560,12 @@ msg_pdbg("0x%02X: 0x%08x ", offset, freg); if (rwperms == 0x3) { msg_pdbg("FREG%i: %s region (0x%08x-0x%08x) is %s.\n", i, - region_name, base, (limit | 0x0fff), - access_names[rwperms]); + region_name, base, limit, access_names[rwperms]); return 0; }
msg_pwarn("FREG%i: Warning: %s region (0x%08x-0x%08x) is %s.\n", i, - region_name, base, (limit | 0x0fff), - access_names[rwperms]); + region_name, base, limit, access_names[rwperms]); return 1; }
@@ -1597,7 +1595,7 @@
msg_pdbg("0x%02X: 0x%08x ", off, pr); msg_pwarn("PR%u: Warning: 0x%08x-0x%08x is %s.\n", i, ICH_FREG_BASE(pr), - ICH_FREG_LIMIT(pr) | 0x0fff, access_names[rwperms]); + ICH_FREG_LIMIT(pr), access_names[rwperms]); return 1; }
diff --git a/util/ich_descriptors_tool/ich_descriptors_tool.c b/util/ich_descriptors_tool/ich_descriptors_tool.c index 250abf0..7dfa5c0 100644 --- a/util/ich_descriptors_tool/ich_descriptors_tool.c +++ b/util/ich_descriptors_tool/ich_descriptors_tool.c @@ -58,7 +58,6 @@ return; }
- limit = limit | 0x0fff; file_len = limit + 1 - base; if (base + file_len > len) { printf("The %s region is spanning 0x%08x-0x%08x, but it is "