sysreset: Support a hot reset
In some cases we may wish to return back to the program which started U-Boot. Add the concept of a 'hot' reset, to support this. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -125,8 +125,19 @@ int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||
if (argc > 2)
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if (argc == 2 && argv[1][0] == '-' && argv[1][1] == 'w') {
|
||||
reset_type = SYSRESET_WARM;
|
||||
if (argc == 2 && argv[1][0] == '-') {
|
||||
int type = argv[1][1];
|
||||
|
||||
switch (type) {
|
||||
case 'h':
|
||||
reset_type = SYSRESET_HOT;
|
||||
break;
|
||||
case 'w':
|
||||
reset_type = SYSRESET_WARM;
|
||||
break;
|
||||
default:
|
||||
return CMD_RET_USAGE;
|
||||
}
|
||||
}
|
||||
|
||||
printf("resetting ...\n");
|
||||
|
||||
@@ -65,6 +65,7 @@ static int sandbox_sysreset_request(struct udevice *dev, enum sysreset_t type)
|
||||
return -EACCES;
|
||||
sandbox_exit();
|
||||
case SYSRESET_POWER:
|
||||
case SYSRESET_HOT:
|
||||
if (!state->sysreset_allowed[type])
|
||||
return -EACCES;
|
||||
sandbox_exit();
|
||||
|
||||
Reference in New Issue
Block a user