summaryrefslogtreecommitdiff
path: root/baseboard
diff options
context:
space:
mode:
authorEdward Hill <ecgh@chromium.org>2018-11-27 12:40:17 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2018-11-29 20:21:33 +0000
commitfe6034e36dd260d336acb66a890f2341e818707b (patch)
treed69162ede8ed88115543c6e415806568dc079402 /baseboard
parent9784183ede8b35294b64a59f5dfb2748fc55dd5f (diff)
downloadchrome-ec-fe6034e36dd260d336acb66a890f2341e818707b.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> (cherry picked from commit a478633db9e11c2300c113c8fb959adc9c894037) Reviewed-on: https://chromium-review.googlesource.com/c/1351928
Diffstat (limited to 'baseboard')
-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);
+}