summaryrefslogtreecommitdiff
path: root/board/pompom/board.c
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/pompom/board.c
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/pompom/board.c')
-rw-r--r--board/pompom/board.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/board/pompom/board.c b/board/pompom/board.c
index 041993b01b..be41800109 100644
--- a/board/pompom/board.c
+++ b/board/pompom/board.c
@@ -242,6 +242,26 @@ static void board_init(void)
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
+void board_hibernate(void)
+{
+ int i;
+
+ /*
+ * Board rev 2+ has the hardware fix. Don't need the following
+ * workaround.
+ */
+ if (system_get_board_version() >= 2)
+ 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);
+}
+
__override uint16_t board_get_ps8xxx_product_id(int port)
{
/* Pompom rev 1+ changes TCPC from PS8751 to PS8805 */