summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hill <ecgh@chromium.org>2018-11-27 12:40:17 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-11-27 19:14:11 -0800
commita478633db9e11c2300c113c8fb959adc9c894037 (patch)
treee3c4f324b1a052edd1a059c5579b8a7973209f39
parentd36116efce964b725631d78a44b7dcb5147fee63 (diff)
downloadchrome-ec-a478633db9e11c2300c113c8fb959adc9c894037.tar.gz
grunt: Enable PPC sink FET before hibernating
Some versions of some boards keep the port 0 PPC powered on while the EC hibernates (so Closed Case Debugging keeps working). Make sure the source FET is off and turn on the sink FET, so that plugging in AC will wake the EC. This matches the dead-battery behavior of the powered off PPC. BUG=b:119850162,b:113654692 BRANCH=grunt TEST=1) "ectool reboot_ec hibernate", wake on port 0 AC. 2) AP in S0, sink in port 0, EC console: "hibernate", unplug sink, wake on port 0 AC. Change-Id: I4dd7ebe5408bbb2d4c92da1a44ea8b4152dbb7da Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1352059 Reviewed-by: Raul E Rangel <rrangel@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r--baseboard/grunt/baseboard.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/baseboard/grunt/baseboard.c b/baseboard/grunt/baseboard.c
index 1c0d0d55fc..579b7758c5 100644
--- a/baseboard/grunt/baseboard.c
+++ b/baseboard/grunt/baseboard.c
@@ -586,3 +586,16 @@ uint32_t board_override_feature_flags1(uint32_t flags1)
{
return flags1;
}
+
+void board_hibernate(void)
+{
+ /*
+ * Some versions of some boards keep the port 0 PPC powered on while
+ * the EC hibernates (so Closed Case Debugging keeps working).
+ * Make sure the source FET is off and turn on the sink FET, so that
+ * plugging in AC will wake the EC. This matches the dead-battery
+ * behavior of the powered off PPC.
+ */
+ ppc_vbus_source_enable(0, 0);
+ ppc_vbus_sink_enable(0, 1);
+}