mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00:00
sysreset: switch to using SYSRESET_POWER_OFF for poweroff
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>
This commit is contained in:
parent
7ba79f2696
commit
857f39d7b0
4 changed files with 4 additions and 5 deletions
|
@ -14,7 +14,7 @@ int do_poweroff(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
|
||||||
puts("poweroff ...\n");
|
puts("poweroff ...\n");
|
||||||
mdelay(100);
|
mdelay(100);
|
||||||
|
|
||||||
ret = sysreset_walk(SYSRESET_POWER);
|
ret = sysreset_walk(SYSRESET_POWER_OFF);
|
||||||
|
|
||||||
if (ret == -EINPROGRESS)
|
if (ret == -EINPROGRESS)
|
||||||
mdelay(1000);
|
mdelay(1000);
|
||||||
|
|
|
@ -355,7 +355,6 @@ void state_reset_for_test(struct sandbox_state *state)
|
||||||
{
|
{
|
||||||
/* No reset yet, so mark it as such. Always allow power reset */
|
/* No reset yet, so mark it as such. Always allow power reset */
|
||||||
state->last_sysreset = SYSRESET_COUNT;
|
state->last_sysreset = SYSRESET_COUNT;
|
||||||
state->sysreset_allowed[SYSRESET_POWER] = true;
|
|
||||||
state->sysreset_allowed[SYSRESET_POWER_OFF] = true;
|
state->sysreset_allowed[SYSRESET_POWER_OFF] = true;
|
||||||
|
|
||||||
memset(&state->wdt, '\0', sizeof(state->wdt));
|
memset(&state->wdt, '\0', sizeof(state->wdt));
|
||||||
|
|
|
@ -18,7 +18,7 @@ static int psci_sysreset_request(struct udevice *dev, enum sysreset_t type)
|
||||||
case SYSRESET_COLD:
|
case SYSRESET_COLD:
|
||||||
function_id = PSCI_0_2_FN_SYSTEM_RESET;
|
function_id = PSCI_0_2_FN_SYSTEM_RESET;
|
||||||
break;
|
break;
|
||||||
case SYSRESET_POWER:
|
case SYSRESET_POWER_OFF:
|
||||||
function_id = PSCI_0_2_FN_SYSTEM_OFF;
|
function_id = PSCI_0_2_FN_SYSTEM_OFF;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -57,13 +57,13 @@ static int sandbox_sysreset_request(struct udevice *dev, enum sysreset_t type)
|
||||||
case SYSRESET_COLD:
|
case SYSRESET_COLD:
|
||||||
state->last_sysreset = type;
|
state->last_sysreset = type;
|
||||||
break;
|
break;
|
||||||
case SYSRESET_POWER:
|
case SYSRESET_POWER_OFF:
|
||||||
state->last_sysreset = type;
|
state->last_sysreset = type;
|
||||||
if (!state->sysreset_allowed[type])
|
if (!state->sysreset_allowed[type])
|
||||||
return -EACCES;
|
return -EACCES;
|
||||||
sandbox_exit();
|
sandbox_exit();
|
||||||
break;
|
break;
|
||||||
case SYSRESET_POWER_OFF:
|
case SYSRESET_POWER:
|
||||||
if (!state->sysreset_allowed[type])
|
if (!state->sysreset_allowed[type])
|
||||||
return -EACCES;
|
return -EACCES;
|
||||||
sandbox_exit();
|
sandbox_exit();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue