diff options
author | Vadim Bendebury <vbendeb@chromium.org> | 2017-03-06 18:23:17 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-03-09 03:24:01 -0800 |
commit | 855ac132242cab78197463bdd7d11fa57c108d9a (patch) | |
tree | d2730f62f2ea9b7886fe2cab8f5f39ffdea991c5 /board/cr50 | |
parent | 3c16e87eb4703d3eb029526965bb59d3ada9794d (diff) | |
download | chrome-ec-855ac132242cab78197463bdd7d11fa57c108d9a.tar.gz |
cr50: add rollback information to the sysinfo command output
With enabling INFO1 map based rollback protection it is important to
be able to tell the state of the flash map and the currently installed
images' infomap header field.
The new function counts number of zero words in the info map and zero
bits in both RW headers, and returns them in a string printed out by
the sysinfo command.
BRANCH=cr50
BUG=b:35774863
TEST=built images with different manifest info field contents and
verified that the string printed by the sysinfo command makes sense.
Change-Id: If633a6c678dc34197b2dad116b6180b2d549e089
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/450905
Reviewed-by: Nagendra Modadugu <ngm@google.com>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
Diffstat (limited to 'board/cr50')
-rw-r--r-- | board/cr50/board.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/board/cr50/board.c b/board/cr50/board.c index 8faf81bb55..ade07be2a5 100644 --- a/board/cr50/board.c +++ b/board/cr50/board.c @@ -1293,6 +1293,7 @@ static int command_sysinfo(int argc, char **argv) uintptr_t vaddr; const struct SignedHeader *h; int reset_count = GREG32(PMU, LONG_LIFE_SCRATCH0); + char rollback_str[15]; ccprintf("Reset flags: 0x%08x (", system_get_reset_flags()); system_print_reset_flags(); @@ -1317,6 +1318,9 @@ static int command_sysinfo(int argc, char **argv) ccprintf("DEV_ID: 0x%08x 0x%08x\n", GREG32(FUSE, DEV_ID0), GREG32(FUSE, DEV_ID1)); + system_get_rollback_bits(rollback_str, sizeof(rollback_str)); + ccprintf("Rollback: %s\n", rollback_str); + return EC_SUCCESS; } DECLARE_SAFE_CONSOLE_COMMAND(sysinfo, command_sysinfo, |