summaryrefslogtreecommitdiff
path: root/common/system.c
diff options
context:
space:
mode:
authorPi-Hsun Shih <pihsun@chromium.org>2020-09-25 17:03:38 +0800
committerCommit Bot <commit-bot@chromium.org>2020-11-17 08:29:12 +0000
commitb0c66ad28ce20a7dfb5081828a680b1ecb1647eb (patch)
treeea6e629eb2148af274bd069531447bd34951d4cf /common/system.c
parentf0ed846e721e7c7fc6fbf4b49a3afc485d8512ac (diff)
downloadchrome-ec-b0c66ad28ce20a7dfb5081828a680b1ecb1647eb.tar.gz
system: Add EC_REBOOT_COLD_AP_OFF command
Add EC_REBOOT_COLD_AP_OFF as a command of EC_CMD_REBOOT_EC host command, that would cold reboot EC without booting AP. BUG=chromium:1121907 TEST=With CL:2422025 CL:2459802, echo 1 > /var/lib/power_manager/reset_ec_on_next_shutdown click shutdown on UI and observe that EC is rebooted and AP is still off. TEST=With CL:2422025 CL:2459802, echo 1 > /var/lib/power_manager/reset_ec_on_next_shutdown dbus-send --system --print-reply --dest=org.chromium.PowerManager \ /org/chromium/PowerManager \ org.chromium.PowerManager.RequestRestart \ int32:0 string:test observe that EC is rebooted. Change-Id: Ifccff3831d785091b7c99def0e43a0d20bfc412b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2428361 Commit-Queue: Pi-Hsun Shih <pihsun@chromium.org> Tested-by: Pi-Hsun Shih <pihsun@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Diffstat (limited to 'common/system.c')
-rw-r--r--common/system.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/common/system.c b/common/system.c
index 2f11945d71..e657859160 100644
--- a/common/system.c
+++ b/common/system.c
@@ -891,6 +891,7 @@ static int handle_pending_reboot(enum ec_reboot_cmd cmd)
case EC_REBOOT_JUMP_RW:
return system_run_image_copy(system_get_active_copy());
case EC_REBOOT_COLD:
+ case EC_REBOOT_COLD_AP_OFF:
/*
* Reboot the PD chip(s) as well, but first suspend the ports
* if this board has PD tasks running so they don't query the
@@ -916,7 +917,11 @@ static int handle_pending_reboot(enum ec_reboot_cmd cmd)
board_reset_pd_mcu();
cflush();
- system_reset(SYSTEM_RESET_HARD);
+ if (cmd == EC_REBOOT_COLD_AP_OFF)
+ system_reset(SYSTEM_RESET_HARD |
+ SYSTEM_RESET_LEAVE_AP_OFF);
+ else
+ system_reset(SYSTEM_RESET_HARD);
/* That shouldn't return... */
return EC_ERROR_UNKNOWN;
case EC_REBOOT_DISABLE_JUMP:
@@ -1618,7 +1623,8 @@ enum ec_status host_command_reboot(struct host_cmd_handler_args *args)
if (p.cmd == EC_REBOOT_JUMP_RO ||
p.cmd == EC_REBOOT_JUMP_RW ||
p.cmd == EC_REBOOT_COLD ||
- p.cmd == EC_REBOOT_HIBERNATE) {
+ p.cmd == EC_REBOOT_HIBERNATE ||
+ p.cmd == EC_REBOOT_COLD_AP_OFF) {
/* Clean busy bits on host for commands that won't return */
args->result = EC_RES_SUCCESS;
host_send_response(args);