summaryrefslogtreecommitdiff
path: root/board/cr50/board.c
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2017-02-06 19:10:53 -0800
committerchrome-bot <chrome-bot@chromium.org>2017-02-07 20:14:39 -0800
commite7cfdd8c926c4812e43a6fee1d1809f718cb3495 (patch)
treeda17d554ab10cb4d4864f216785318309c3599d8 /board/cr50/board.c
parent8e4bcd49c05cc9859a10d170477e240403718979 (diff)
downloadchrome-ec-e7cfdd8c926c4812e43a6fee1d1809f718cb3495.tar.gz
cr50: print reset count in sysinfo
The reset count is very useful for debugging whether the tpm is locked or if the version rolled back. This change makes reading the value easier by adding it to the sysinfo command BUG=none BRANCH=none TEST=reboot cr50 8 times verifying the reset count value is correct each time and that sysinfo also shows a rollback is detected after the 7th boot. Change-Id: I94ac11a444ee73aa04bbdcc066c8e1c7a0a3ae8e Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/438788 Reviewed-by: Scott Collyer <scollyer@chromium.org>
Diffstat (limited to 'board/cr50/board.c')
-rw-r--r--board/cr50/board.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/board/cr50/board.c b/board/cr50/board.c
index 61543647bf..afa9826f68 100644
--- a/board/cr50/board.c
+++ b/board/cr50/board.c
@@ -1173,10 +1173,14 @@ static int command_sysinfo(int argc, char **argv)
enum system_image_copy_t active;
uintptr_t vaddr;
const struct SignedHeader *h;
+ int reset_count = GREG32(PMU, LONG_LIFE_SCRATCH0);
ccprintf("Reset flags: 0x%08x (", system_get_reset_flags());
system_print_reset_flags();
ccprintf(")\n");
+ if (reset_count > 6)
+ ccprintf("Rollback detected\n");
+ ccprintf("Reset count: %d\n", reset_count);
ccprintf("Chip: %s %s %s\n", system_get_chip_vendor(),
system_get_chip_name(), system_get_chip_revision());