mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-24 13:43:28 +00:00
sysreset: provide type of reset in do_reset cmd
Add additional param for reset cmd, which provides type of reset. Signed-off-by: Igor Opaniuk <igor.opaniuk@foundries.io>
This commit is contained in:
parent
91f00ba2c1
commit
a6713b3a3c
2 changed files with 11 additions and 2 deletions
|
@ -56,7 +56,7 @@ U_BOOT_CMD(
|
|||
#endif
|
||||
|
||||
U_BOOT_CMD(
|
||||
reset, 1, 0, do_reset,
|
||||
reset, 2, 0, do_reset,
|
||||
"Perform RESET of the CPU",
|
||||
""
|
||||
);
|
||||
|
|
|
@ -122,10 +122,19 @@ void reset_cpu(void)
|
|||
#if IS_ENABLED(CONFIG_SYSRESET_CMD_RESET)
|
||||
int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
|
||||
{
|
||||
enum sysreset_t reset_type = SYSRESET_COLD;
|
||||
|
||||
if (argc > 2)
|
||||
return CMD_RET_USAGE;
|
||||
|
||||
if (argc == 2 && argv[1][0] == '-' && argv[1][1] == 'w') {
|
||||
reset_type = SYSRESET_WARM;
|
||||
}
|
||||
|
||||
printf("resetting ...\n");
|
||||
mdelay(100);
|
||||
|
||||
sysreset_walk_halt(SYSRESET_COLD);
|
||||
sysreset_walk_halt(reset_type);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue