From 18f4a483f073b3a8f64f1da2e1089f658e1dbba6 Mon Sep 17 00:00:00 2001 From: Nick Sanders Date: Fri, 13 Oct 2017 19:19:10 -0700 Subject: [PATCH] cr50: add rollback command In DEV, it's necessary to rollback to reenter prod signed images. Let's make this reasonably easy. BUG=None BRANCH=cr50 TEST=CR50_DEV fw does roll back to prod.. Signed-off-by: Nick Sanders Change-Id: Id39c3e501782da3f088760ec27d09f1ffc7b7f58 Reviewed-on: https://chromium-review.googlesource.com/734840 Reviewed-by: Vadim Bendebury --- board/cr50/board.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/board/cr50/board.c b/board/cr50/board.c index 1cc92e56b3..932fddaf9b 100644 --- a/board/cr50/board.c +++ b/board/cr50/board.c @@ -1504,3 +1504,17 @@ int chip_factory_mode(void) return mode_set & 1; } + +#ifdef CR50_DEV +static int command_rollback(int argc, char **argv) +{ + system_ensure_rollback(); + ccprintf("Rebooting to alternate RW due to manual request\n"); + cflush(); + system_reset(0); + + return EC_SUCCESS; +} +DECLARE_CONSOLE_COMMAND(rollback, command_rollback, + "", "Force rollback to escape DEV image."); +#endif