diff options
author | Jett Rink <jettrink@chromium.org> | 2018-05-18 09:14:17 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-05-22 21:57:16 -0700 |
commit | 11bd4c0f4d11357ab830982d7dec164813c886dd (patch) | |
tree | 0ae0482ed383cfea5cd83d8d46224a944559b019 /baseboard/octopus/baseboard.c | |
parent | 4f27014532e308f8bb6652c8956c75bc6f0b19e2 (diff) | |
download | chrome-ec-11bd4c0f4d11357ab830982d7dec164813c886dd.tar.gz |
bip: enabled PPC interrupts
Need to enable PPC interrupts, otherwise system doesn't work correctly
include USB 2.0 not working (since the BC1.2 chip won't be powered after
the Vbus change)
BRANCH=none
BUG=b:79886742
TEST=USB 2.0 works on insertion on C0 on bip
Change-Id: I227dcfac22128389c3d3ab3efdddd045141dff7e
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1066221
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Diffstat (limited to 'baseboard/octopus/baseboard.c')
-rw-r--r-- | baseboard/octopus/baseboard.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/baseboard/octopus/baseboard.c b/baseboard/octopus/baseboard.c index 6bc0436473..cd14adb6d3 100644 --- a/baseboard/octopus/baseboard.c +++ b/baseboard/octopus/baseboard.c @@ -16,6 +16,7 @@ #include "power.h" #include "system.h" #include "task.h" +#include "usb_mux.h" #include "usbc_ppc.h" #include "util.h" @@ -177,7 +178,38 @@ void chipset_do_shutdown(void) } /******************************************************************************/ -/* Charger/PD functions */ +/* Power Delivery and charing functions */ + +void baseboard_tcpc_init(void) +{ + int count = 0; + int port; + + /* Wait for disconnected battery to wake up */ + while (battery_get_disconnect_state() != BATTERY_NOT_DISCONNECTED) { + usleep(100 * MSEC); + /* Give up waiting after more than 1 second */ + if (++count > 10) { + ccprintf("Battery still disconnected > 1 second!\n"); + break; + } + } + + /* Only reset TCPC if not sysjump */ + if (!system_jumped_to_this_image()) + board_reset_pd_mcu(); + + /* + * Initialize HPD to low; after sysjump SOC needs to see + * HPD pulse to enable video path + */ + for (port = 0; port < CONFIG_USB_PD_PORT_COUNT; port++) { + const struct usb_mux *mux = &usb_muxes[port]; + + mux->hpd_update(port, 0, 0); + } +} +DECLARE_HOOK(HOOK_INIT, baseboard_tcpc_init, HOOK_PRIO_INIT_I2C + 1); int board_set_active_charge_port(int port) { |