diff options
author | Eric Herrmann <eherrmann@chromium.org> | 2021-03-10 17:43:30 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-25 19:33:15 +0000 |
commit | 88dee7497eead7bd713926004ea0dec5faff8fb9 (patch) | |
tree | dd8f4f837144d3de76c569efec5d00436ea48f1a | |
parent | 61bedab8f0649e0f2265353fadf2e213f4297ef0 (diff) | |
download | chrome-ec-88dee7497eead7bd713926004ea0dec5faff8fb9.tar.gz |
Drobit: Enable FRS
Set flag and configure GPIOs to enable Fast Role Swap. Clear the GPIOs
passed to the PPC driver for boards which don't support FRS due to older
PPC versions.
BUG=b:148144711
TEST=make buildall
BRANCH=None
Signed-off-by: Eric Herrmann <eherrmann@chromium.org>
Change-Id: I1236d6c4e9e3c66ce7289817f5737186163b7144
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2752340
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
-rw-r--r-- | board/drobit/board.c | 18 | ||||
-rw-r--r-- | board/drobit/board.h | 1 | ||||
-rw-r--r-- | board/drobit/gpio.inc | 2 |
3 files changed, 21 insertions, 0 deletions
diff --git a/board/drobit/board.c b/board/drobit/board.c index f54d5b8308..a13ff9bea9 100644 --- a/board/drobit/board.c +++ b/board/drobit/board.c @@ -271,11 +271,13 @@ struct ppc_config_t ppc_chips[] = { [USBC_PORT_C0] = { .i2c_port = I2C_PORT_USB_C0, .i2c_addr_flags = SYV682X_ADDR0_FLAGS, + .frs_en = GPIO_USB_C0_FRS_EN, .drv = &syv682x_drv, }, [USBC_PORT_C1] = { .i2c_port = I2C_PORT_USB_C1, .i2c_addr_flags = SYV682X_ADDR0_FLAGS, + .frs_en = GPIO_USB_C1_FRS_EN, .drv = &syv682x_drv, }, }; @@ -297,6 +299,22 @@ void ppc_interrupt(enum gpio_signal signal) } } +/* Disable FRS on boards with the SYV682A. FRS only works on the SYV682B. */ +void setup_board_ppc(void) +{ + uint8_t board_id = get_board_id(); + + if (board_id < 2) { + ppc_chips[USBC_PORT_C0].frs_en = 0; + ppc_chips[USBC_PORT_C1].frs_en = 0; + } +} + +__override void board_cbi_init(void) +{ + setup_board_ppc(); +} + /******************************************************************************/ /* BC1.2 charger detect configuration */ const struct pi3usb9201_config_t pi3usb9201_bc12_chips[] = { diff --git a/board/drobit/board.h b/board/drobit/board.h index 2f3b023622..faf33faa5c 100644 --- a/board/drobit/board.h +++ b/board/drobit/board.h @@ -81,6 +81,7 @@ /* USBC PPC*/ #define CONFIG_USBC_PPC_SYV682X +#define CONFIG_USB_PD_FRS_PPC /* BC 1.2 */ diff --git a/board/drobit/gpio.inc b/board/drobit/gpio.inc index ce8d9fa613..bc7d625195 100644 --- a/board/drobit/gpio.inc +++ b/board/drobit/gpio.inc @@ -83,6 +83,8 @@ GPIO(USB_C0_RT_RST_ODL, PIN(D, 4), GPIO_ODR_LOW) GPIO(USB_C1_RT_RST_ODL, PIN(8, 3), GPIO_ODR_LOW) GPIO(USB_C0_OC_ODL, PIN(B, 1), GPIO_ODR_HIGH) GPIO(USB_C1_OC_ODL, PIN(5, 0), GPIO_ODR_HIGH) +GPIO(USB_C0_FRS_EN, PIN(6, 0), GPIO_OUT_LOW) +GPIO(USB_C1_FRS_EN, PIN(9, 4), GPIO_OUT_LOW) /* There is currently no need to service this interrupt. */ GPIO(USB_C0_RT_INT_ODL, PIN(F, 2), GPIO_INPUT) GPIO(USB_C1_RT_INT_ODL, PIN(F, 3), GPIO_INPUT) |