diff options
author | Jett Rink <jettrink@chromium.org> | 2018-05-21 14:56:33 -0600 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-05-29 13:37:35 -0700 |
commit | 65cd9c106c8ac1e3425acec534e71744c3b472e5 (patch) | |
tree | aa97a9ee4388d50a0766f29adba7e9daecec572d /baseboard | |
parent | ecd0d1b5767c829f4c73a79a9eb6abae343284fb (diff) | |
download | chrome-ec-65cd9c106c8ac1e3425acec534e71744c3b472e5.tar.gz |
yorp: drive PPC EN_SNK from TCPC gpio
Since the PS8751 is now driving the EN_SNK GPIO on the PPC, we cannot
reset without a battery otherwise we will brown out the board.
BRANCH=none
BUG=b:78896495,b:78021059
TEST=verified with reworked board.
Change-Id: Ibadf46de922c49f5fdd08c43991e71f852ff7600
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1067711
Diffstat (limited to 'baseboard')
-rw-r--r-- | baseboard/octopus/variant_usbc_standalone_tcpcs.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/baseboard/octopus/variant_usbc_standalone_tcpcs.c b/baseboard/octopus/variant_usbc_standalone_tcpcs.c index a027e6ed42..93ec1923bd 100644 --- a/baseboard/octopus/variant_usbc_standalone_tcpcs.c +++ b/baseboard/octopus/variant_usbc_standalone_tcpcs.c @@ -21,6 +21,9 @@ #include "usbc_ppc.h" #include "util.h" +#define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ## args) +#define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args) + #define USB_PD_PORT_ANX7447 0 #define USB_PD_PORT_PS8751 1 @@ -69,9 +72,6 @@ struct ppc_config_t ppc_chips[CONFIG_USB_PD_PORT_COUNT] = { .i2c_port = I2C_PORT_TCPC1, .i2c_addr = NX20P3483_ADDR2, .drv = &nx20p3483_drv, - .flags = PPC_CFG_FLAGS_GPIO_CONTROL, - .snk_gpio = GPIO_USB_C1_CHARGE_ON, - .src_gpio = GPIO_EN_USB_C1_5V_OUT, }, }; unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips); @@ -117,8 +117,19 @@ void board_reset_pd_mcu(void) { /* C0: ANX7447 does not have a reset pin. */ - /* C1: Assert reset to TCPC1 (PS8751) for required delay (1ms) */ - gpio_set_level(GPIO_USB_C1_PD_RST_ODL, 0); - msleep(PS8XXX_RESET_DELAY_MS); - gpio_set_level(GPIO_USB_C1_PD_RST_ODL, 1); + /* + * C1: Assert reset to TCPC1 (PS8751) for required delay (1ms) only if + * we have a battery, otherwise we may brown out the system. + */ + if (battery_is_present() == BP_YES) { + /* + * TODO(crbug:846412): After refactor, ensure that battery has + * enough charge to last the reboot as well + */ + gpio_set_level(GPIO_USB_C1_PD_RST_ODL, 0); + msleep(PS8XXX_RESET_DELAY_MS); + gpio_set_level(GPIO_USB_C1_PD_RST_ODL, 1); + } else { + CPRINTS("Skipping C1 TCPC reset because no battery"); + } } |