diff options
author | xiong.huang <xiong.huang@bitland.corp-partner.google.com> | 2020-07-16 16:50:27 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-07-21 04:55:57 +0000 |
commit | 60e32f992378026af9586492ab6d53d727d47aa3 (patch) | |
tree | 0ed501cd60fd89ce54424402c8d7f59bd06c2811 /board/malefor | |
parent | 17f1d0296434d1b1c6f031eea1a3412043415aa1 (diff) | |
download | chrome-ec-60e32f992378026af9586492ab6d53d727d47aa3.tar.gz |
malefor: configure DB PD
Fill tcpc_config[] and usb_muxes[] base on DB type, make sure DB type-C
work well.
BUG=b:159024035, b:159157584
BRANCH=none
TEST=Type-C function is OK at DB.
Signed-off-by: xiong.huang <xiong.huang@bitland.corp-partner.google.com>
Change-Id: I4f4f34930cd0bb22467a8c88d85f30cd0be447fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2301560
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'board/malefor')
-rw-r--r-- | board/malefor/board.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/board/malefor/board.c b/board/malefor/board.c index 5841ea0385..778f22260c 100644 --- a/board/malefor/board.c +++ b/board/malefor/board.c @@ -13,6 +13,8 @@ #include "driver/ppc/sn5s330.h" #include "driver/ppc/syv682x.h" #include "driver/sync.h" +#include "driver/tcpm/ps8xxx.h" +#include "driver/tcpm/tcpci.h" #include "extpower.h" #include "fan.h" #include "fan_chip.h" @@ -309,6 +311,32 @@ const struct pwm_t pwm_channels[] = { }; BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT); +/* USBC TCPC configuration for port 1 on USB3 board */ +static const struct tcpc_config_t tcpc_config_p1_usb3 = { + .bus_type = EC_BUS_TYPE_I2C, + .i2c_info = { + .port = I2C_PORT_USB_C1, + .addr_flags = PS8751_I2C_ADDR1_FLAGS, + }, + .flags = TCPC_FLAGS_TCPCI_REV2_0 | TCPC_FLAGS_TCPCI_REV2_0_NO_VSAFE0V, + .drv = &ps8xxx_tcpm_drv, + .usb23 = USBC_PORT_1_USB2_NUM | (USBC_PORT_1_USB3_NUM << 4), +}; + +static const struct usb_mux usbc1_usb3_db_retimer = { + .usb_port = USBC_PORT_C1, + .driver = &tcpci_tcpm_usb_mux_driver, + .hpd_update = &ps8xxx_tcpc_update_hpd_status, + .next_mux = NULL, +}; + +static const struct usb_mux mux_config_p1_usb3 = { + .usb_port = USBC_PORT_C1, + .driver = &virtual_usb_mux_driver, + .hpd_update = &virtual_hpd_update, + .next_mux = &usbc1_usb3_db_retimer, +}; + void board_reset_pd_mcu(void) { /* TODO(b/159024035): Malefor: check USB PD reset operation */ @@ -316,7 +344,9 @@ void board_reset_pd_mcu(void) __override void board_cbi_init(void) { - /* TODO(b/159024035): Malefor: check FW_CONFIG fields for USB DB type */ + /* Config DB USB3 */ + tcpc_config[USBC_PORT_C1] = tcpc_config_p1_usb3; + usb_muxes[USBC_PORT_C1] = mux_config_p1_usb3; } /******************************************************************************/ |