mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-31 19:41:46 +00:00
It seems that SYSRESET_POWER_OFF was added recently, and all previous code used SYSRESET_POWER for poweroff. SYSRESET_POWER is supposed to be a PMIC-level power cycle, not a poweroff. (Comment by Simon Glass) SYSRESET_POWER means to do a power reset (removing and reinstating all power) SYSRESET_POWER_OFF means to turn the device off and leave it off Signed-off-by: Urja Rannikko <urjaman@gmail.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@st.com> (Update comment to help understand the patch) Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
24 lines
461 B
C
24 lines
461 B
C
// SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
|
|
/*
|
|
* Copyright (C) 2019, STMicroelectronics - All Rights Reserved
|
|
*/
|
|
|
|
#include <common.h>
|
|
#include <command.h>
|
|
#include <sysreset.h>
|
|
|
|
int do_poweroff(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
|
{
|
|
int ret;
|
|
|
|
puts("poweroff ...\n");
|
|
mdelay(100);
|
|
|
|
ret = sysreset_walk(SYSRESET_POWER_OFF);
|
|
|
|
if (ret == -EINPROGRESS)
|
|
mdelay(1000);
|
|
|
|
/*NOTREACHED when power off*/
|
|
return CMD_RET_FAILURE;
|
|
}
|