summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce <Bruce.Wan@quantatw.com>2016-11-17 13:29:10 +0800
committerchrome-bot <chrome-bot@chromium.org>2016-11-17 16:09:35 -0800
commita1ec4e2d59604a22f15f9b65472c30db7a14c8c0 (patch)
tree67f71caa3032d37216b73ba80a45b0128c5a22b1
parent342bf53465ae106febceab563d8159ff7ed17fd5 (diff)
downloadchrome-ec-a1ec4e2d59604a22f15f9b65472c30db7a14c8c0.tar.gz
pyro/snappy: Add force wake for PS8751.
If PS8751 goes into low power mode during sysjump, then tcpm_init will fail since PS8751 is not accessible via I2C, so force it to wake up during hook_init. BUG=none BRANCH=none TEST=make buildall Change-Id: I5edfef2ac4524310d4cb5485dec68999bed08210 Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/411646 Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com> Tested-by: Keith Tzeng <keith.tzeng@quantatw.com> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
-rw-r--r--board/pyro/board.c11
-rw-r--r--board/snappy/board.c11
2 files changed, 20 insertions, 2 deletions
diff --git a/board/pyro/board.c b/board/pyro/board.c
index 38f4fa83fe..326c4b0a2c 100644
--- a/board/pyro/board.c
+++ b/board/pyro/board.c
@@ -317,12 +317,21 @@ void board_print_tcpc_fw_version(int port)
void board_tcpc_init(void)
{
- int port;
+ int port, reg;
/* Only reset TCPC if not sysjump */
if (!system_jumped_to_this_image())
board_reset_pd_mcu();
+ /*
+ * Force PS8751 A2 to wake from low power mode.
+ * If PS8751 remains in low power mode after sysjump,
+ * TCPM_INIT will fail due to not able to access PS8751.
+ *
+ * NOTE: PS8751 A3 will wake on any I2C access.
+ */
+ i2c_read8(NPCX_I2C_PORT0_1, 0x10, 0xA0, &reg);
+
/* Enable TCPC0 interrupt */
gpio_enable_interrupt(GPIO_USB_C0_PD_INT_ODL);
diff --git a/board/snappy/board.c b/board/snappy/board.c
index f9abb27b71..6d70c8c035 100644
--- a/board/snappy/board.c
+++ b/board/snappy/board.c
@@ -316,12 +316,21 @@ void board_print_tcpc_fw_version(int port)
void board_tcpc_init(void)
{
- int port;
+ int port, reg;
/* Only reset TCPC if not sysjump */
if (!system_jumped_to_this_image())
board_reset_pd_mcu();
+ /*
+ * Force PS8751 A2 to wake from low power mode.
+ * If PS8751 remains in low power mode after sysjump,
+ * TCPM_INIT will fail due to not able to access PS8751.
+ *
+ * NOTE: PS8751 A3 will wake on any I2C access.
+ */
+ i2c_read8(NPCX_I2C_PORT0_1, 0x10, 0xA0, &reg);
+
/* Enable TCPC0 interrupt */
gpio_enable_interrupt(GPIO_USB_C0_PD_INT_ODL);