summaryrefslogtreecommitdiff
path: root/board/coachz
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2020-10-07 17:02:51 -0700
committerCommit Bot <commit-bot@chromium.org>2020-10-08 21:58:14 +0000
commit61c3590ddefc3e5119bad6e0a8d3c27921537e00 (patch)
tree487191f43565581ce81278e902d9dbe128044f8c /board/coachz
parent255b4be3b644bb75dcacd7d411dbd8acb4f9e9b6 (diff)
downloadchrome-ec-61c3590ddefc3e5119bad6e0a8d3c27921537e00.tar.gz
Trogdor: Enable PPC power sink path before hibernate on old boards
The old boards don't have the hardware fix b/169797080. They need the workaround to make ACOK functional to wake EC up from hibernate. EC enables the PPC power sink path before EC enters hibernate, such that the ACOK won't be blocked by PPC. Otherwise, the PPC keeps the sink path disconnected; ACOK won't go High and can't wake EC up. Do it in board_hibernate() instead of board_hibernate_late(), which has I2C disabled. BRANCH=None BUG=b:170324206 TEST=Tested on Lazor, without the hardware rework. Triggered EC into hibernate; plugging AC can wake EC up. Change-Id: I3a97f59a344aff88b12fb19e2ea3ae126d1a8715 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2461939 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Diffstat (limited to 'board/coachz')
-rw-r--r--board/coachz/board.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/board/coachz/board.c b/board/coachz/board.c
index 3e9b46655b..62c13f5b71 100644
--- a/board/coachz/board.c
+++ b/board/coachz/board.c
@@ -338,6 +338,26 @@ void board_tcpc_init(void)
}
DECLARE_HOOK(HOOK_INIT, board_tcpc_init, HOOK_PRIO_INIT_I2C+1);
+void board_hibernate(void)
+{
+ int i;
+
+ /*
+ * Board rev 1+ has the hardware fix. Don't need the following
+ * workaround.
+ */
+ if (system_get_board_version() >= 1)
+ return;
+
+ /*
+ * Enable the PPC power sink path before EC enters hibernate;
+ * otherwise, ACOK won't go High and can't wake EC up. Check the
+ * bug b/170324206 for details.
+ */
+ for (i = 0; i < CONFIG_USB_PD_PORT_MAX_COUNT; i++)
+ ppc_vbus_sink_enable(i, 1);
+}
+
/* Called on AP S0 -> S3 transition */
static void board_chipset_suspend(void)
{