summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Wawrzynczak <twawrzynczak@chromium.org>2019-07-23 14:10:34 -0600
committerCommit Bot <commit-bot@chromium.org>2019-07-24 18:16:55 +0000
commit0eae4e603588fbbce3c7028a3f6a78bb05ee860d (patch)
tree4f7c480c496979ce3846cc73805506b6cab3ad81
parent2d4d05f6667d1fe26f9e9147fe8d6216c0679975 (diff)
downloadchrome-ec-0eae4e603588fbbce3c7028a3f6a78bb05ee860d.tar.gz
hatch: Override board_hibernate
In the board_hibernate function, shut down the AP, and wait 300ms for the chipset state machine to settle down. This allows the EC to actually hibernate; otherwise, it would simply reboot the device. BUG=b:135073910 BRANCH=none TEST=Verify that EC goes into hibernate with Alt+Volume Up+H, then boots back up from time 0 on PB press. Verified that EC will wake from hibernate on insertion of AC. Change-Id: Ie98333e9ce65778df8d07ce6ae165b5c7140edf1 Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1715907 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
-rw-r--r--baseboard/hatch/baseboard.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/baseboard/hatch/baseboard.c b/baseboard/hatch/baseboard.c
index 5ea397538c..83b57a04a9 100644
--- a/baseboard/hatch/baseboard.c
+++ b/baseboard/hatch/baseboard.c
@@ -114,6 +114,35 @@ static void baseboard_chipset_shutdown(void)
DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN, baseboard_chipset_shutdown,
HOOK_PRIO_DEFAULT);
+void board_hibernate(void)
+{
+ int port;
+
+ /*
+ * To support hibernate from ectool, keyboard, and console,
+ * ensure that the AP is fully shutdown before hibernating.
+ */
+#ifdef HAS_TASK_CHIPSET
+ chipset_force_shutdown(CHIPSET_SHUTDOWN_BOARD_CUSTOM);
+#endif
+
+ /*
+ * If VBUS is not being provided by any of the PD ports,
+ * then enable the SNK FET to allow AC to pass through
+ * if it is later connected to ensure that AC_PRESENT
+ * will wake up the EC from this state
+ */
+ for (port = 0; port < CONFIG_USB_PD_PORT_COUNT; ++port)
+ ppc_vbus_sink_enable(port, 1);
+
+ /*
+ * This seems like a hack, but the AP chipset state machine
+ * needs time to work through the transitions. Also, it
+ * works.
+ */
+ msleep(300);
+}
+
/******************************************************************************/
/* USB-C PPC Configuration */
struct ppc_config_t ppc_chips[CONFIG_USB_PD_PORT_COUNT] = {