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:
Simon Glass
2025-08-29 14:08:24 -06:00
parent a5f843f0f2
commit 9fdab58b86
6 changed files with 23 additions and 2 deletions

View File

@@ -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");

View File

@@ -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();