summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Herrmann <eherrmann@chromium.org>2020-11-19 12:25:39 -0800
committerCommit Bot <commit-bot@chromium.org>2020-11-20 03:16:09 +0000
commit49f18a1879e452630b89304c14156c7fd22a3605 (patch)
treedb80955f714c5419931355f513f9511dbe7a3ef7
parentf51a5ebbd7cb6f84311b9c4f5c893861ad53b45e (diff)
downloadchrome-ec-49f18a1879e452630b89304c14156c7fd22a3605.tar.gz
Delbin: Remove USB4 code to save space
Delbin doesn't support USB4 but some unused drivers were still being compiled for it, remove these to save space. Before: 4960 bytes RO, 4944 bytes RW After: 9760 bytes RO, 9740 bytes RW BUG=none TEST=make BOARD=delbin TEST=make sure display out works on Delbin BRANCH=none Signed-off-by: Eric Herrmann <eherrmann@chromium.org> Change-Id: I904046f50af377c3a932d842becf896e526f9462 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2551217 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
-rw-r--r--board/delbin/board.c155
-rw-r--r--board/delbin/board.h12
2 files changed, 30 insertions, 137 deletions
diff --git a/board/delbin/board.c b/board/delbin/board.c
index 6ec89b910a..1c712724bc 100644
--- a/board/delbin/board.c
+++ b/board/delbin/board.c
@@ -4,7 +4,6 @@
*/
/* Volteer board-specific configuration */
-#include "bb_retimer.h"
#include "button.h"
#include "common.h"
#include "accelgyro.h"
@@ -13,7 +12,6 @@
#include "driver/accelgyro_bmi260.h"
#include "driver/bc12/pi3usb9201.h"
#include "driver/ppc/syv682x.h"
-#include "driver/retimer/bb_retimer.h"
#include "driver/tcpm/ps8xxx.h"
#include "driver/tcpm/tcpci.h"
#include "driver/tcpm/tusb422.h"
@@ -36,7 +34,6 @@
#include "uart.h"
#include "usb_mux.h"
#include "usb_pd.h"
-#include "usb_pd_tbt.h"
#include "usb_pd_tcpm.h"
#include "usbc_ppc.h"
#include "util.h"
@@ -75,47 +72,6 @@ static void board_init(void)
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
-__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)));
-}
-
/******************************************************************************/
/* Physical fans. These are logically separate from pwm_channels. */
@@ -279,59 +235,6 @@ const struct pwm_t pwm_channels[] = {
};
BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT);
-static const struct tcpc_config_t tcpc_config_p0_usb3 = {
- .bus_type = EC_BUS_TYPE_I2C,
- .i2c_info = {
- .port = I2C_PORT_USB_C0,
- .addr_flags = PS8751_I2C_ADDR1_FLAGS,
- },
- .flags = TCPC_FLAGS_TCPCI_REV2_0 | TCPC_FLAGS_TCPCI_REV2_0_NO_VSAFE0V,
- .drv = &ps8xxx_tcpm_drv,
-};
-
-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,
-};
-
-static const struct usb_mux usbc0_usb3_mb_retimer = {
- .usb_port = USBC_PORT_C0,
- .driver = &tcpci_tcpm_usb_mux_driver,
- .hpd_update = &ps8xxx_tcpc_update_hpd_status,
- .next_mux = NULL,
-};
-
-static const struct usb_mux mux_config_p0_usb3 = {
- .usb_port = USBC_PORT_C0,
- .driver = &virtual_usb_mux_driver,
- .hpd_update = &virtual_hpd_update,
- .next_mux = &usbc0_usb3_mb_retimer,
-};
-
-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,
-};
-
-static const struct bb_usb_control bb_p0_control = {
- .usb_ls_en_gpio = GPIO_USB_C0_LS_EN,
- .retimer_rst_gpio = GPIO_USB_C0_RT_RST_ODL,
-};
-
/******************************************************************************/
/* USB-A charging control */
@@ -384,18 +287,6 @@ void board_reset_pd_mcu(void)
usb_mux_hpd_update(USBC_PORT_C1, 0, 0);
}
-__override void board_cbi_init(void)
-{
- /* Config MB USB3 */
- tcpc_config[USBC_PORT_C0] = tcpc_config_p0_usb3;
- usb_muxes[USBC_PORT_C0] = mux_config_p0_usb3;
- bb_controls[USBC_PORT_C0] = bb_p0_control;
-
- /* Config DB USB3 */
- tcpc_config[USBC_PORT_C1] = tcpc_config_p1_usb3;
- usb_muxes[USBC_PORT_C1] = mux_config_p1_usb3;
-}
-
/******************************************************************************/
/* USBC PPC configuration */
struct ppc_config_t ppc_chips[] = {
@@ -481,22 +372,26 @@ BUILD_ASSERT(ARRAY_SIZE(pi3usb9201_bc12_chips) == USBC_PORT_COUNT);
/******************************************************************************/
/* 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 = 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,
},
[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);
@@ -504,38 +399,36 @@ BUILD_ASSERT(CONFIG_USB_PD_PORT_MAX_COUNT == USBC_PORT_COUNT);
/******************************************************************************/
/* USBC mux configuration - Tiger Lake includes internal mux */
-struct usb_mux usbc1_usb4_db_retimer = {
+static const struct usb_mux usbc0_usb3_mb_retimer = {
+ .usb_port = USBC_PORT_C0,
+ .driver = &tcpci_tcpm_usb_mux_driver,
+ .hpd_update = &ps8xxx_tcpc_update_hpd_status,
+ .next_mux = NULL,
+};
+
+static const struct usb_mux usbc1_usb3_db_retimer = {
.usb_port = USBC_PORT_C1,
- .driver = &bb_usb_retimer,
- .i2c_port = I2C_PORT_USB_1_MIX,
- .i2c_addr_flags = USBC_PORT_C1_BB_RETIMER_I2C_ADDR,
+ .driver = &tcpci_tcpm_usb_mux_driver,
+ .hpd_update = &ps8xxx_tcpc_update_hpd_status,
+ .next_mux = NULL,
};
-struct usb_mux usb_muxes[] = {
+
+const struct usb_mux usb_muxes[] = {
[USBC_PORT_C0] = {
.usb_port = USBC_PORT_C0,
.driver = &virtual_usb_mux_driver,
.hpd_update = &virtual_hpd_update,
+ .next_mux = &usbc0_usb3_mb_retimer,
},
[USBC_PORT_C1] = {
.usb_port = USBC_PORT_C1,
.driver = &virtual_usb_mux_driver,
.hpd_update = &virtual_hpd_update,
- .next_mux = &usbc1_usb4_db_retimer,
+ .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);
-
static void board_tcpc_init(void)
{
/* Don't reset TCPCs after initial reset */
diff --git a/board/delbin/board.h b/board/delbin/board.h
index 57b7341d34..0b8278d867 100644
--- a/board/delbin/board.h
+++ b/board/delbin/board.h
@@ -68,12 +68,8 @@
#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
+#undef CONFIG_USB_PD_TCPC_RUNTIME_CONFIG
+#undef CONFIG_USB_MUX_RUNTIME_CONFIG
/* USB Type A Features */
#define USB_PORT_COUNT 1
@@ -93,6 +89,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
+
/*
* Macros for GPIO signals used in common code that don't match the
* schematic names. Signal names in gpio.inc match the schematic and are