diff options
author | Vijay Hiremath <vijay.p.hiremath@intel.com> | 2019-12-02 15:22:12 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-12-04 02:28:21 +0000 |
commit | b4f8858cef8105edee5a049beb8c93b102186bc3 (patch) | |
tree | e86f3c08f9fbedc932d57692407b98364e83f2a1 /baseboard | |
parent | a1f2cfe2146c818be848876a24415a72ad36933c (diff) | |
download | chrome-ec-b4f8858cef8105edee5a049beb8c93b102186bc3.tar.gz |
volteer: Enable USB-C Port 1
BUG=b:140578872
BRANCH=none
TEST=Able to boot to OS from Zinger connected on Port 1
Change-Id: I2db9763370ecfae2a38081b6fc607b1ef1d06b67
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1947426
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'baseboard')
-rw-r--r-- | baseboard/volteer/baseboard.c | 34 | ||||
-rw-r--r-- | baseboard/volteer/baseboard.h | 4 |
2 files changed, 35 insertions, 3 deletions
diff --git a/baseboard/volteer/baseboard.c b/baseboard/volteer/baseboard.c index 703a4e9922..de403eaaa2 100644 --- a/baseboard/volteer/baseboard.c +++ b/baseboard/volteer/baseboard.c @@ -9,6 +9,7 @@ #include "charge_state.h" #include "driver/bc12/pi3usb9201.h" #include "driver/ppc/sn5s330.h" +#include "driver/ppc/syv682x.h" #include "driver/tcpm/tusb422.h" #include "driver/temp_sensor/thermistor.h" #include "fan.h" @@ -73,6 +74,10 @@ const struct pi3usb9201_config_t pi3usb9201_bc12_chips[] = { .i2c_port = I2C_PORT_USB_C0, .i2c_addr_flags = PI3USB9201_I2C_ADDR_3_FLAGS, }, + [USBC_PORT_C1] = { + .i2c_port = I2C_PORT_USB_C1, + .i2c_addr_flags = PI3USB9201_I2C_ADDR_3_FLAGS, + }, }; BUILD_ASSERT(ARRAY_SIZE(pi3usb9201_bc12_chips) == USBC_PORT_COUNT); @@ -312,6 +317,15 @@ const struct tcpc_config_t tcpc_config[] = { .drv = &tusb422_tcpm_drv, .usb23 = USBC_PORT_0_USB2_NUM | (USBC_PORT_0_USB3_NUM << 4), }, + [USBC_PORT_C1] = { + .bus_type = EC_BUS_TYPE_I2C, + .i2c_info = { + .port = I2C_PORT_USB_C1, + .addr_flags = TUSB422_I2C_ADDR_FLAGS, + }, + .drv = &tusb422_tcpm_drv, + .usb23 = USBC_PORT_1_USB2_NUM | (USBC_PORT_1_USB3_NUM << 4), + }, }; BUILD_ASSERT(ARRAY_SIZE(tcpc_config) == USBC_PORT_COUNT); BUILD_ASSERT(CONFIG_USB_PD_PORT_MAX_COUNT == USBC_PORT_COUNT); @@ -322,7 +336,12 @@ struct ppc_config_t ppc_chips[] = { [USBC_PORT_C0] = { .i2c_port = I2C_PORT_USB_C0, .i2c_addr_flags = SN5S330_ADDR0_FLAGS, - .drv = &sn5s330_drv + .drv = &sn5s330_drv, + }, + [USBC_PORT_C1] = { + .i2c_port = I2C_PORT_USB_C1, + .i2c_addr_flags = SYV682X_ADDR0_FLAGS, + .drv = &syv682x_drv, }, }; BUILD_ASSERT(ARRAY_SIZE(ppc_chips) == USBC_PORT_COUNT); @@ -335,6 +354,10 @@ struct usb_mux usb_muxes[] = { .driver = &virtual_usb_mux_driver, .hpd_update = &virtual_hpd_update, }, + [USBC_PORT_C1] = { + .driver = &virtual_usb_mux_driver, + .hpd_update = &virtual_hpd_update, + }, }; BUILD_ASSERT(ARRAY_SIZE(usb_muxes) == USBC_PORT_COUNT); @@ -343,9 +366,11 @@ static void baseboard_tcpc_init(void) { /* Enable PPC interrupts. */ gpio_enable_interrupt(GPIO_USB_C0_PPC_INT_ODL); + gpio_enable_interrupt(GPIO_USB_C1_PPC_INT_ODL); /* Enable TCPC interrupts. */ gpio_enable_interrupt(GPIO_USB_C0_TCPC_INT_ODL); + gpio_enable_interrupt(GPIO_USB_C1_TCPC_INT_ODL); } DECLARE_HOOK(HOOK_INIT, baseboard_tcpc_init, HOOK_PRIO_INIT_I2C + 1); @@ -379,6 +404,8 @@ uint16_t tcpc_get_alert_status(void) */ if (!gpio_get_level(GPIO_USB_C0_TCPC_INT_ODL)) status |= PD_STATUS_TCPC_ALERT_0; + if (!gpio_get_level(GPIO_USB_C1_TCPC_INT_ODL)) + status |= PD_STATUS_TCPC_ALERT_1; return status; } @@ -391,7 +418,10 @@ void tcpc_alert_event(enum gpio_signal signal) switch (signal) { case GPIO_USB_C0_TCPC_INT_ODL: - port = 0; + port = USBC_PORT_C0; + break; + case GPIO_USB_C1_TCPC_INT_ODL: + port = USBC_PORT_C1; break; default: return; diff --git a/baseboard/volteer/baseboard.h b/baseboard/volteer/baseboard.h index 41eb887d4e..2b51696708 100644 --- a/baseboard/volteer/baseboard.h +++ b/baseboard/volteer/baseboard.h @@ -106,7 +106,7 @@ #define CONFIG_USB_PD_DISCHARGE_PPC #define CONFIG_USB_PD_DUAL_ROLE #define CONFIG_USB_PD_MAX_SINGLE_SOURCE_CURRENT TYPEC_RP_3A0 -#define CONFIG_USB_PD_PORT_MAX_COUNT 1 +#define CONFIG_USB_PD_PORT_MAX_COUNT 2 #define CONFIG_USB_PD_TCPC_LOW_POWER #define CONFIG_USB_PD_TCPM_TCPCI #define CONFIG_USB_PD_TCPM_TUSB422 /* USBC port C0 */ @@ -122,6 +122,7 @@ * CONFIG_USBC_PPC_VCONN */ #define CONFIG_USBC_PPC_SN5S330 /* USBC port C0 */ +#define CONFIG_USBC_PPC_SYV682X /* USBC port C1 */ #define CONFIG_INTEL_VIRTUAL_MUX #define CONFIG_USBC_SS_MUX @@ -204,6 +205,7 @@ enum temp_sensor_id { enum usbc_port { USBC_PORT_C0 = 0, + USBC_PORT_C1, USBC_PORT_COUNT }; |