From 8f13bbc9f56c0230809c42a6df77e188fdcdc74a Mon Sep 17 00:00:00 2001 From: Yu-An Chen Date: Tue, 22 Jun 2021 16:32:18 +0800 Subject: Chronicler: Remove unused daughterboard configuration Remove unused daughterboard configuration BUG=b:191551619 BRANCH=volteer TEST=Check USB C1 port working normally Cq-Depend: chrome-internal:4066744 Signed-off-by: Yu-An Chen Change-Id: I553213fab05ce1ca5d864170454b54f8381abfc9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2978651 Reviewed-by: Abe Levkoy Reviewed-by: YH Lin Commit-Queue: YH Lin --- board/chronicler/board.c | 2 - board/chronicler/board.h | 14 +-- board/chronicler/cbi.c | 1 - board/chronicler/usbc_config.c | 194 +++-------------------------------------- 4 files changed, 20 insertions(+), 191 deletions(-) diff --git a/board/chronicler/board.c b/board/chronicler/board.c index 980d18e733..c86ad462e1 100644 --- a/board/chronicler/board.c +++ b/board/chronicler/board.c @@ -4,12 +4,10 @@ */ /* Chronicler board-specific configuration */ -#include "bb_retimer.h" #include "button.h" #include "common.h" #include "accelgyro.h" #include "cbi_ec_fw_config.h" -#include "driver/retimer/bb_retimer.h" #include "driver/sync.h" #include "driver/tcpm/ps8xxx.h" #include "extpower.h" diff --git a/board/chronicler/board.h b/board/chronicler/board.h index e9697f55ab..a7acd37723 100644 --- a/board/chronicler/board.h +++ b/board/chronicler/board.h @@ -54,13 +54,6 @@ #define PD_MAX_CURRENT_MA 3000 #define PD_MAX_VOLTAGE_MV 20000 -/* Enabling Thunderbolt-compatible mode */ -#define CONFIG_USB_PD_TBT_COMPAT_MODE - -/* Enabling USB4 mode */ -#define CONFIG_USB_PD_USB4 -#define USBC_PORT_C1_BB_RETIMER_I2C_ADDR 0x40 - /* USB Type A Features */ #define USB_PORT_COUNT 1 #define CONFIG_USB_PORT_POWER_DUMB @@ -69,6 +62,9 @@ #define CONFIG_USBC_PPC_SN5S330 /* USBC port C0 */ #define CONFIG_USBC_PPC_SYV682X /* USBC port C1 */ #define CONFIG_USB_PD_FRS_PPC +#undef CONFIG_USB_PD_TCPC_RUNTIME_CONFIG +#undef CONFIG_USB_PD_TCPM_TUSB422 +#undef CONFIG_USB_MUX_RUNTIME_CONFIG /* BC 1.2 */ @@ -82,6 +78,10 @@ #define CONFIG_CHARGER_SENSE_RESISTOR 10 #define CONFIG_CHARGER_SENSE_RESISTOR_AC 10 +/* Retimer */ +#undef CONFIG_USBC_RETIMER_INTEL_BB +#undef CONFIG_USBC_RETIMER_INTEL_BB_RUNTIME_CONFIG + /* Keyboard feature */ #define CONFIG_KEYBOARD_FACTORY_TEST diff --git a/board/chronicler/cbi.c b/board/chronicler/cbi.c index 371d73dd7b..210207eeac 100644 --- a/board/chronicler/cbi.c +++ b/board/chronicler/cbi.c @@ -20,7 +20,6 @@ union volteer_cbi_fw_config fw_config_defaults = { __override void board_cbi_init(void) { - config_usb3_db_type(); if ((!IS_ENABLED(TEST_BUILD) && !ec_cfg_has_numeric_pad()) || get_board_id() <= 2) keyboard_raw_set_cols(KEYBOARD_COLS_NO_KEYPAD); diff --git a/board/chronicler/usbc_config.c b/board/chronicler/usbc_config.c index 29fb373ae9..4a7738682a 100644 --- a/board/chronicler/usbc_config.c +++ b/board/chronicler/usbc_config.c @@ -25,17 +25,6 @@ #define CPRINTS(format, args...) cprints(CC_CHIPSET, format, ## args) -/* USBC TCPC configuration for USB3 daughter 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, -}; - /* * USB3 DB mux configuration - the top level mux still needs to be set to the * virtual_usb_mux_driver so the AP gets notified of mux changes and updates @@ -48,102 +37,6 @@ static const struct usb_mux usbc1_usb3_db_retimer = { .next_mux = NULL, }; -static const struct usb_mux mux_config_p1_usb3_active = { - .usb_port = USBC_PORT_C1, - .driver = &virtual_usb_mux_driver, - .hpd_update = &virtual_hpd_update, - .next_mux = &usbc1_usb3_db_retimer, -}; - -static const struct usb_mux mux_config_p1_usb3_passive = { - .usb_port = USBC_PORT_C1, - .driver = &virtual_usb_mux_driver, - .hpd_update = &virtual_hpd_update, -}; - -/* - * Set up support for the USB3 daughterboard: - * Parade PS8815 TCPC (integrated retimer) - * Diodes PI3USB9201 BC 1.2 chip (same as USB4 board) - * Silergy SYV682A PPC (same as USB4 board) - * Virtual mux with stacked retimer - */ -static void config_db_usb3_active(void) -{ - tcpc_config[USBC_PORT_C1] = tcpc_config_p1_usb3; - usb_muxes[USBC_PORT_C1] = mux_config_p1_usb3_active; -} - -/* - * Set up support for the passive USB3 daughterboard: - * TUSB422 TCPC (already the default) - * PI3USB9201 BC 1.2 chip (already the default) - * Silergy SYV682A PPC (already the default) - * Virtual mux without stacked retimer - */ - -static void config_db_usb3_passive(void) -{ - usb_muxes[USBC_PORT_C1] = mux_config_p1_usb3_passive; -} - -static void config_port_discrete_tcpc(int port) -{ - /* - * Support 2 Pin-to-Pin compatible parts: TUSB422 and RT1715, for - * simplicity allow either and decide at runtime which we are using. - * Default to TUSB422, and switch to RT1715 if it is on the I2C bus and - * the VID matches. - */ - - int regval; - - if (i2c_read16(port ? I2C_PORT_USB_C1 : I2C_PORT_USB_C0, - RT1715_I2C_ADDR_FLAGS, TCPC_REG_VENDOR_ID, - ®val) == EC_SUCCESS) { - if (regval == RT1715_VENDOR_ID) { - CPRINTS("C%d: RT1715 detected", port); - tcpc_config[port].i2c_info.addr_flags = - RT1715_I2C_ADDR_FLAGS; - tcpc_config[port].drv = &rt1715_tcpm_drv; - return; - } - } - CPRINTS("C%d: Default to TUSB422", port); -} - -static const char *db_type_prefix = "USB DB type: "; -void config_usb3_db_type(void) -{ - enum ec_cfg_usb_db_type usb_db = ec_cfg_usb_db_type(); - - config_port_discrete_tcpc(0); - switch (usb_db) { - case DB_USB_ABSENT: - CPRINTS("%sNone", db_type_prefix); - break; - case DB_USB4_GEN2: - config_port_discrete_tcpc(1); - CPRINTS("%sUSB4 Gen1/2", db_type_prefix); - break; - case DB_USB4_GEN3: - config_port_discrete_tcpc(1); - CPRINTS("%sUSB4 Gen3", db_type_prefix); - break; - case DB_USB3_ACTIVE: - config_db_usb3_active(); - CPRINTS("%sUSB3 Active", db_type_prefix); - break; - case DB_USB3_PASSIVE: - config_db_usb3_passive(); - config_port_discrete_tcpc(1); - CPRINTS("%sUSB3 Passive", db_type_prefix); - break; - default: - CPRINTS("%sID %d not supported", db_type_prefix, usb_db); - } -} - /******************************************************************************/ /* USBC PPC configuration */ struct ppc_config_t ppc_chips[] = { @@ -179,22 +72,24 @@ void ppc_interrupt(enum gpio_signal signal) /******************************************************************************/ /* USBC TCPC configuration */ -struct tcpc_config_t tcpc_config[] = { +const struct tcpc_config_t tcpc_config[] = { [USBC_PORT_C0] = { .bus_type = EC_BUS_TYPE_I2C, .i2c_info = { .port = I2C_PORT_USB_C0, - .addr_flags = TUSB422_I2C_ADDR_FLAGS, + .addr_flags = RT1715_I2C_ADDR_FLAGS, }, - .drv = &tusb422_tcpm_drv, + .drv = &rt1715_tcpm_drv, }, [USBC_PORT_C1] = { .bus_type = EC_BUS_TYPE_I2C, .i2c_info = { .port = I2C_PORT_USB_C1, - .addr_flags = TUSB422_I2C_ADDR_FLAGS, + .addr_flags = PS8751_I2C_ADDR1_FLAGS, }, - .drv = &tusb422_tcpm_drv, + .flags = TCPC_FLAGS_TCPCI_REV2_0 | + TCPC_FLAGS_TCPCI_REV2_0_NO_VSAFE0V, + .drv = &ps8xxx_tcpm_drv, }, }; BUILD_ASSERT(ARRAY_SIZE(tcpc_config) == USBC_PORT_COUNT); @@ -209,13 +104,7 @@ const int usb_port_enable[USB_PORT_COUNT] = { /******************************************************************************/ /* USBC mux configuration - Tiger Lake includes internal mux */ -struct usb_mux usbc1_tcss_usb_mux = { - .usb_port = USBC_PORT_C1, - .driver = &virtual_usb_mux_driver, - .hpd_update = &virtual_hpd_update, -}; - -struct usb_mux usb_muxes[] = { +const struct usb_mux usb_muxes[] = { [USBC_PORT_C0] = { .usb_port = USBC_PORT_C0, .driver = &virtual_usb_mux_driver, @@ -223,66 +112,13 @@ struct usb_mux usb_muxes[] = { }, [USBC_PORT_C1] = { .usb_port = USBC_PORT_C1, - .driver = &bb_usb_retimer, - .next_mux = &usbc1_tcss_usb_mux, - .i2c_port = I2C_PORT_USB_1_MIX, - .i2c_addr_flags = USBC_PORT_C1_BB_RETIMER_I2C_ADDR, + .driver = &virtual_usb_mux_driver, + .hpd_update = &virtual_hpd_update, + .next_mux = &usbc1_usb3_db_retimer, }, }; BUILD_ASSERT(ARRAY_SIZE(usb_muxes) == USBC_PORT_COUNT); -struct bb_usb_control bb_controls[] = { - [USBC_PORT_C0] = { - /* USB-C port 0 doesn't have a retimer */ - }, - [USBC_PORT_C1] = { - .usb_ls_en_gpio = GPIO_USB_C1_LS_EN, - .retimer_rst_gpio = GPIO_USB_C1_RT_RST_ODL, - }, -}; -BUILD_ASSERT(ARRAY_SIZE(bb_controls) == USBC_PORT_COUNT); - -__override enum tbt_compat_cable_speed board_get_max_tbt_speed(int port) -{ - enum ec_cfg_usb_db_type usb_db = ec_cfg_usb_db_type(); - - if (port == USBC_PORT_C1) { - if (usb_db == DB_USB4_GEN2) { - /* - * Older boards violate 205mm trace length prior - * to connection to the re-timer and only support up - * to GEN2 speeds. - */ - return TBT_SS_U32_GEN1_GEN2; - } else if (usb_db == DB_USB4_GEN3) { - return TBT_SS_TBT_GEN3; - } - } - - /* - * Thunderbolt-compatible mode not supported - * - * TODO (b/147726366): All the USB-C ports need to support same speed. - * Need to fix once USB-C feature set is known for Volteer. - */ - return TBT_SS_RES_0; -} - -__override bool board_is_tbt_usb4_port(int port) -{ - enum ec_cfg_usb_db_type usb_db = ec_cfg_usb_db_type(); - - /* - * Volteer reference design only supports TBT & USB4 on port 1 - * if the USB4 DB is present. - * - * TODO (b/147732807): All the USB-C ports need to support same - * features. Need to fix once USB-C feature set is known for Volteer. - */ - return ((port == USBC_PORT_C1) - && ((usb_db == DB_USB4_GEN2) || (usb_db == DB_USB4_GEN3))); -} - static void ps8815_reset(void) { int val; @@ -374,14 +210,10 @@ DECLARE_HOOK(HOOK_CHIPSET_STARTUP, board_ps8xxx_init, HOOK_PRIO_LAST); void board_reset_pd_mcu(void) { - enum ec_cfg_usb_db_type usb_db = ec_cfg_usb_db_type(); - /* No reset available for TCPC on port 0 */ /* Daughterboard specific reset for port 1 */ - if (usb_db == DB_USB3_ACTIVE) { - ps8815_reset(); - usb_mux_hpd_update(USBC_PORT_C1, 0, 0); - } + ps8815_reset(); + usb_mux_hpd_update(USBC_PORT_C1, 0, 0); } static void board_tcpc_init(void) -- cgit v1.2.1