Matt DeVillier has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/80004?usp=email )
Change subject: util/superiotool: reformat alternate dump output ......................................................................
util/superiotool: reformat alternate dump output
Reformat alternate dump output to show default values before read values, and to use brackets to visually indicate which values differ from the defaults.
TEST=build/dump registers from Erying SRMJ4 w/Nuvoton NCT6796D.
Change-Id: Idef2cc136151328b114620eb297ab8fd62b71bcd Signed-off-by: Matt DeVillier matt.devillier@gmail.com --- M util/superiotool/superiotool.c 1 file changed, 15 insertions(+), 8 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/04/80004/1
diff --git a/util/superiotool/superiotool.c b/util/superiotool/superiotool.c index 576e9e6..aee5026 100644 --- a/util/superiotool/superiotool.c +++ b/util/superiotool/superiotool.c @@ -107,25 +107,32 @@
if (alternate_dump) { int skip_def = 0; + int val;
- printf("\nidx val def\n"); + printf("\nidx def val\n");
for (k = 0; idx[k] != EOT; k++) { - printf("0x%02x: 0x%02x", idx[k], regval(port, idx[k])); - if (skip_def || def[k] == EOT) { skip_def = 1; printf("\n"); continue; } + + printf("0x%02x: ", idx[k]); + val = regval(port, idx[k]); + if (def[k] == NANA) - printf(" (NA)\n"); + printf("(NA) 0x%02x\n", val); else if (def[k] == RSVD) - printf(" (RR)\n"); + printf("(RR) 0x%02x\n", val); else if (def[k] == MISC) - printf(" (MM)\n"); - else - printf(" (0x%02x)\n", def[k]); + printf("(MM) 0x%02x\n", val); + else { + if (def[k] == val) + printf("0x%02x 0x%02x\n", def[k], val); + else + printf("0x%02x [0x%02x]\n", def[k], val); + } } } else { printf("\nidx");