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 <nsanders@chromium.org>
Change-Id: Id39c3e501782da3f088760ec27d09f1ffc7b7f58
Reviewed-on: https://chromium-review.googlesource.com/734840
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
This commit is contained in:
Nick Sanders
2017-10-13 19:19:10 -07:00
committed by chrome-bot
parent 734fe2d40b
commit 18f4a483f0

View File

@@ -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