Skip to content
Snippets Groups Projects
Commit 5f1a08b6 authored by Bin Meng's avatar Bin Meng Committed by Priyanka Jain
Browse files

dm: sysreset: Add a Kconfig option for the 'reset' command


sysreset uclass driver provides an implementation of 'reset'
command using the sysreset_ APIs unconditionally. It also
supports the 'poweroff' command using the sysreset_ APIs,
but under a Kconfig option CONFIG_SYSRESET_CMD_POWEROFF.

Let's do the same for the 'reset' command, by introducing a
new Kconfig option CONFIG_SYSRESET_CMD_RESET, and set it to
on by default, to allow a board that don't have a sysreset
reset driver yet, but have a sysreset poweroff driver to
compile without any issue.

Signed-off-by: Bin Meng's avatarBin Meng <bmeng.cn@gmail.com>
Reviewed-by: Simon Glass's avatarSimon Glass <sjg@chromium.org>
Reviewed-by: Priyanka Jain's avatarPriyanka Jain <priyanka.jain@nxp.com>
parent e022403a
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,12 @@ config TPL_SYSRESET
if SYSRESET
config SYSRESET_CMD_RESET
bool "sysreset implementation of the reset command"
default y
help
Enable sysreset implementation of the reset command.
if CMD_POWEROFF
config SYSRESET_CMD_POWEROFF
......
......@@ -119,6 +119,7 @@ void reset_cpu(ulong addr)
}
#if IS_ENABLED(CONFIG_SYSRESET_CMD_RESET)
int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
{
printf("resetting ...\n");
......@@ -128,6 +129,7 @@ int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
return 0;
}
#endif
#if IS_ENABLED(CONFIG_SYSRESET_CMD_POWEROFF)
int do_poweroff(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment