diff options
author | Jett Rink <jettrink@chromium.org> | 2018-08-07 15:03:42 -0600 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-08-23 17:42:49 -0700 |
commit | bb7cee5a6b9a160c9df6a073ce16d5595d1433b4 (patch) | |
tree | d1d3a43ced27d71f9d51844cb52b81f36946c015 /baseboard/octopus/baseboard.c | |
parent | 7487f9eef6159b9b3253b4d30e9dd0b114bd07e1 (diff) | |
download | chrome-ec-bb7cee5a6b9a160c9df6a073ce16d5595d1433b4.tar.gz |
octopus: update bip for lower power hibernate
Pulled hibernate_wake_pins into each EC variant because the 4/5
item array was getting pretty fractured.
Bip EC now wakes up based on PPC interrupts instead of AC_PRESENT. This
allows the PPCs to disable the SNK FET (and all OVP circuitry). The power
won't get from the USB-C connector to the battery charger until the EC
wakes up, but that isn't an issue.
BRANCH=none
BUG=b:111006203,b:111520593
TEST=bip PD_A rail is 3.97mW during hiberate with this CL stack
Change-Id: I2d08ca5bb2b0b7181c7a0f0c5894b8f59ccbd85f
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1166184
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Diffstat (limited to 'baseboard/octopus/baseboard.c')
-rw-r--r-- | baseboard/octopus/baseboard.c | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/baseboard/octopus/baseboard.c b/baseboard/octopus/baseboard.c index 577d9c28ba..0835753855 100644 --- a/baseboard/octopus/baseboard.c +++ b/baseboard/octopus/baseboard.c @@ -27,22 +27,6 @@ #define CPRINTFUSB(format, args...) cprintf(CC_USBCHARGE, format, ## args) /******************************************************************************/ -/* Wake up pins */ -const enum gpio_signal hibernate_wake_pins[] = { - GPIO_LID_OPEN, - GPIO_AC_PRESENT, - GPIO_POWER_BUTTON_L, -#if defined(VARIANT_OCTOPUS_EC_NPCX796FB) && defined(CONFIG_HIBERNATE_PSL) - /* - * Enable EC_RST_ODL as a wake source if using NPCX EC variant and PSL - * hibernate mode is enabled. - */ - GPIO_EC_RST_ODL, -#endif -}; -const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins); - -/******************************************************************************/ /* Power signal list. Must match order of enum power_signal. */ const struct power_signal_info power_signal_list[] = { #ifdef CONFIG_POWER_S0IX @@ -294,15 +278,30 @@ void board_hibernate(void) pd_request_source_voltage(port, NX20P348X_SAFE_RESET_VBUS_MV); #endif + /* + * If Vbus isn't already on this port, then we need to put the PPC into + * low power mode or open the SNK FET based on which signals wake up + * the EC from hibernate. + */ for (port = 0; port < CONFIG_USB_PD_PORT_COUNT; port++) { - /* - * If Vbus isn't already on this port, then open the SNK path - * to allow AC to pass through to the charger when connected. - * This is need if the TCPC/PPC rails do not go away. - * (b/79173959) - */ - if (!pd_is_vbus_present(port)) + if (!pd_is_vbus_present(port)) { +#ifdef VARIANT_OCTOPUS_EC_ITE8320 + /* + * ITE variant uses the PPC interrupts instead of + * AC_PRESENT to wake up, so we do not need to enable + * the SNK FETS. + */ + ppc_enter_low_power_mode(port); +#else + /* + * Open the SNK path to allow AC to pass through to the + * charger when connected. This is need if the TCPC/PPC + * rails do not go away and AC_PRESENT wakes up the EC + * (b/79173959). + */ ppc_vbus_sink_enable(port, 1); +#endif + } } /* |