summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2014-07-30 15:49:48 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-08-23 02:42:11 +0000
commit6f22113a78ba2958128bf129fae80e48148d890e (patch)
tree5da86f29184168fe95cb0bb442deeb503682beea
parent1b82905cfe66ae472cdb42f0e17c2ec94aa466c3 (diff)
downloadchrome-ec-6f22113a78ba2958128bf129fae80e48148d890e.tar.gz
Request to hard-reboot EC should reboot PD as well
Software sync on the AP will ask the EC to reboot to RO after the AP shuts down. This allows the AP to do a clean shutdown before the EC reboots. The PD chip should be rebooted at the same time the EC reboots itself, so that in a low-battery case the requested PD reboot also takes place after AP shutdown. BUG=chrome-os-partner:30079 BRANCH=none TEST=From the EC console, 'reboot hard' also reboots the PD chip. Change-Id: I109a495ca32ad1ac4aac42708935962d3226792e Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/210570 Reviewed-by: Alec Berg <alecaberg@chromium.org>
-rw-r--r--common/system.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/system.c b/common/system.c
index db5d171b58..a9040899f2 100644
--- a/common/system.c
+++ b/common/system.c
@@ -612,6 +612,12 @@ static int handle_pending_reboot(enum ec_reboot_cmd cmd)
case EC_REBOOT_JUMP_RW:
return system_run_image_copy(SYSTEM_IMAGE_RW);
case EC_REBOOT_COLD:
+#ifdef HAS_TASK_PDCMD
+ /* Reboot the PD chip as well */
+ gpio_set_level(GPIO_USB_MCU_RST_L, 0);
+ usleep(100);
+ gpio_set_level(GPIO_USB_MCU_RST_L, 1);
+#endif
system_reset(SYSTEM_RESET_HARD);
/* That shouldn't return... */
return EC_ERROR_UNKNOWN;