From: Denis Mukhin <[email protected]> Add a diagnostic console trace indicating the reset type.
Signed-off-by: Denis Mukhin <[email protected]> --- drivers/sysreset/sysreset-uclass.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/drivers/sysreset/sysreset-uclass.c b/drivers/sysreset/sysreset-uclass.c index d893c74e9121..8af370e0fa8b 100644 --- a/drivers/sysreset/sysreset-uclass.c +++ b/drivers/sysreset/sysreset-uclass.c @@ -22,6 +22,22 @@ #include <linux/err.h> #include <asm/global_data.h> +static const char *get_reset_type_str(enum sysreset_t reset_type) +{ + switch (reset_type) { + case SYSRESET_WARM: + return "warm"; + case SYSRESET_COLD: + return "cold"; + case SYSRESET_POWER: + return "PMIC"; + case SYSRESET_POWER_OFF: + return "power off"; + default: + return "unknown"; + } +} + int sysreset_request(struct udevice *dev, enum sysreset_t type) { struct sysreset_ops *ops = sysreset_get_ops(dev); @@ -169,7 +185,7 @@ int do_reset(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) reset_type = SYSRESET_COLD; } - printf("resetting ...\n"); + printf("resetting (%s)...\n", get_reset_type_str(reset_type)); mdelay(100); #if IS_ENABLED(CONFIG_SYSRESET_CMD_RESET_ARGS) -- 2.54.0

