summaryrefslogtreecommitdiff
path: root/baseboard/volteer
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2020-02-14 14:31:18 -0700
committerCommit Bot <commit-bot@chromium.org>2020-02-26 01:04:51 +0000
commitff6cbc138b6ed692fcbae21bd9bf12837c2aeb79 (patch)
tree4ec732a06ca8582ca419e893e7030fb0c2134c61 /baseboard/volteer
parent2696c706b8b97f28dfc5448687f168e9225cc61f (diff)
downloadchrome-ec-ff6cbc138b6ed692fcbae21bd9bf12837c2aeb79.tar.gz
volteer: Update USB C1 reset for next buildstabilize-volteer-12931.B-master
Update the GPIO assignment for the USB_C1_RT_RST_ODL signal for the next board build. BUG=b:144933528, b:148243971 BRANCH=none TEST=make buildall TEST=Check unassigned board ID or board ID=0 uses legacy GPIO setting. Otherwise new GPIO setting is used. Change-Id: I4621e039e4461a4e10ab87bc2d4e000b5dcaa885 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2057496 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'baseboard/volteer')
-rw-r--r--baseboard/volteer/baseboard.c24
-rw-r--r--baseboard/volteer/baseboard.h1
2 files changed, 22 insertions, 3 deletions
diff --git a/baseboard/volteer/baseboard.c b/baseboard/volteer/baseboard.c
index c9e7543ad3..207a6c0491 100644
--- a/baseboard/volteer/baseboard.c
+++ b/baseboard/volteer/baseboard.c
@@ -407,7 +407,7 @@ struct usb_mux usb_muxes[] = {
};
BUILD_ASSERT(ARRAY_SIZE(usb_muxes) == USBC_PORT_COUNT);
-const struct bb_usb_control bb_controls[] = {
+struct bb_usb_control bb_controls[] = {
[USBC_PORT_C0] = {
/* USB-C port 0 doesn't have a retimer */
},
@@ -468,14 +468,16 @@ void ppc_interrupt(enum gpio_signal signal)
/******************************************************************************/
/* TCPC support routines */
+static enum gpio_signal ps8xxx_rst_odl = GPIO_USB_C1_RT_RST_ODL;
+
static void ps8815_reset(void)
{
int val;
- gpio_set_level(GPIO_USB_C1_RT_RST_ODL, 0);
+ gpio_set_level(ps8xxx_rst_odl, 0);
msleep(GENERIC_MAX(PS8XXX_RESET_DELAY_MS,
PS8815_PWR_H_RST_H_DELAY_MS));
- gpio_set_level(GPIO_USB_C1_RT_RST_ODL, 1);
+ gpio_set_level(ps8xxx_rst_odl, 1);
msleep(PS8815_FW_INIT_DELAY_MS);
/*
@@ -661,6 +663,20 @@ static void config_db_usb3(void)
sizeof(usb_retimers[USBC_PORT_C1]));
}
+/*
+ * Reconfigure Volteer GPIOs based on the board ID
+ */
+static void config_volteer_gpios(void)
+{
+ /* Legacy support for the first board build */
+ if (get_board_id() == 0) {
+ /* Reassign USB_C1_RT_RST_ODL */
+ bb_controls[USBC_PORT_C1].retimer_rst_gpio =
+ GPIO_USB_C1_RT_RST_ODL_BOARDID_0;
+ ps8xxx_rst_odl = GPIO_USB_C1_RT_RST_ODL_BOARDID_0;
+ }
+}
+
static uint8_t board_id;
uint8_t get_board_id(void)
@@ -688,6 +704,8 @@ static void cbi_init(void)
CPRINTS("Board ID: %d", board_id);
+ config_volteer_gpios();
+
/* FW config */
if (cbi_get_fw_config(&cbi_val) != EC_SUCCESS) {
diff --git a/baseboard/volteer/baseboard.h b/baseboard/volteer/baseboard.h
index 7fd84e7acf..9be9e208fb 100644
--- a/baseboard/volteer/baseboard.h
+++ b/baseboard/volteer/baseboard.h
@@ -225,6 +225,7 @@
/* Retimer */
#define CONFIG_USBC_MUX_RETIMER
#define CONFIG_USBC_RETIMER_INTEL_BB
+#define CONFIG_USBC_RETIMER_INTEL_BB_RUNTIME_CONFIG
#define USBC_PORT_C1_BB_RETIMER_I2C_ADDR 0x40
/*