summaryrefslogtreecommitdiff
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
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>
-rw-r--r--board/coachz/board.c20
-rw-r--r--board/lazor/board.c20
-rw-r--r--board/pompom/board.c20
-rw-r--r--board/trogdor/board.c13
4 files changed, 73 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)
{
diff --git a/board/lazor/board.c b/board/lazor/board.c
index 6ef3e2c0f9..366c1acfc6 100644
--- a/board/lazor/board.c
+++ b/board/lazor/board.c
@@ -529,6 +529,26 @@ static void board_init(void)
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
+void board_hibernate(void)
+{
+ int i;
+
+ /*
+ * Board rev 5+ has the hardware fix. Don't need the following
+ * workaround.
+ */
+ if (system_get_board_version() >= 5)
+ 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)
{
/*
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 */
diff --git a/board/trogdor/board.c b/board/trogdor/board.c
index b39e100b56..193ff8f96a 100644
--- a/board/trogdor/board.c
+++ b/board/trogdor/board.c
@@ -313,6 +313,19 @@ void board_tcpc_init(void)
}
DECLARE_HOOK(HOOK_INIT, board_tcpc_init, HOOK_PRIO_INIT_I2C+1);
+void board_hibernate(void)
+{
+ int i;
+
+ /*
+ * 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)
{