diff options
author | Edward Hill <ecgh@chromium.org> | 2020-09-23 14:14:48 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-09-23 23:38:53 +0000 |
commit | 54e4cbf51dd64f74d30a330ec5eb5df12c5c5948 (patch) | |
tree | d0448d1d28e43f35cadf1697128d8d4259e89005 | |
parent | e6cc0576f2829357ccf349896fb1536300f22f0f (diff) | |
download | chrome-ec-54e4cbf51dd64f74d30a330ec5eb5df12c5c5948.tar.gz |
zork: Update PS8802/PS8818 IN_HPD to match HW changes
Add a global variable board_usbc1_retimer_inhpd that boards can
set to IOEX_USB_C1_HPD_IN_DB or GPIO_USB_C1_HPD_IN_DB_V1 depending
on board version, that is then used by board_ps8802/ps881_mux_set
to enable/disable IN_HPD on the DB retimer.
BUG=b:168884674
BRANCH=zork
TEST=morphius dali + picasso USB-C1 display works
Signed-off-by: Edward Hill <ecgh@chromium.org>
Change-Id: Ifca733ce05a72cc095463b2b9365857232784d34
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2426959
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
-rw-r--r-- | baseboard/zork/baseboard.h | 3 | ||||
-rw-r--r-- | baseboard/zork/variant_trembyle.c | 8 | ||||
-rw-r--r-- | board/berknip/board.c | 13 | ||||
-rw-r--r-- | board/morphius/board.c | 6 | ||||
-rw-r--r-- | board/trembyle/board.c | 2 | ||||
-rw-r--r-- | board/woomax/board.c | 2 |
6 files changed, 25 insertions, 9 deletions
diff --git a/baseboard/zork/baseboard.h b/baseboard/zork/baseboard.h index eaaf390ce4..ddbde2604f 100644 --- a/baseboard/zork/baseboard.h +++ b/baseboard/zork/baseboard.h @@ -345,6 +345,9 @@ __override_proto void ppc_interrupt(enum gpio_signal signal); void board_print_temps(void); +/* GPIO or IOEX signal used to set IN_HPD on DB retimer. */ +extern int board_usbc1_retimer_inhpd; + #endif /* !__ASSEMBLER__ */ #endif /* __CROS_EC_BASEBOARD_H */ diff --git a/baseboard/zork/variant_trembyle.c b/baseboard/zork/variant_trembyle.c index 669ed5f6b7..32151cf0f9 100644 --- a/baseboard/zork/variant_trembyle.c +++ b/baseboard/zork/variant_trembyle.c @@ -420,10 +420,10 @@ static int board_ps8802_mux_set(const struct usb_mux *me, return rv; /* Enable IN_HPD on the DB */ - ioex_set_level(IOEX_USB_C1_HPD_IN_DB, 1); + gpio_or_ioex_set_level(board_usbc1_retimer_inhpd, 1); } else { /* Disable IN_HPD on the DB */ - ioex_set_level(IOEX_USB_C1_HPD_IN_DB, 0); + gpio_or_ioex_set_level(board_usbc1_retimer_inhpd, 0); } return rv; @@ -486,10 +486,10 @@ static int board_ps8818_mux_set(const struct usb_mux *me, return rv; /* Enable IN_HPD on the DB */ - gpio_or_ioex_set_level(PORT_TO_HPD(1), 1); + gpio_or_ioex_set_level(board_usbc1_retimer_inhpd, 1); } else { /* Disable IN_HPD on the DB */ - gpio_or_ioex_set_level(PORT_TO_HPD(1), 0); + gpio_or_ioex_set_level(board_usbc1_retimer_inhpd, 0); } return rv; diff --git a/board/berknip/board.c b/board/berknip/board.c index bd61e383dc..8f797d9539 100644 --- a/board/berknip/board.c +++ b/board/berknip/board.c @@ -285,10 +285,10 @@ static int board_tusb544_mux_set(const struct usb_mux *me, { if (mux_state & USB_PD_MUX_DP_ENABLED) { /* Enable IN_HPD on the DB */ - ioex_set_level(IOEX_USB_C1_HPD_IN_DB, 1); + ioex_set_level(board_usbc1_retimer_inhpd, 1); } else { /* Disable IN_HPD on the DB */ - ioex_set_level(IOEX_USB_C1_HPD_IN_DB, 0); + ioex_set_level(board_usbc1_retimer_inhpd, 0); } return EC_SUCCESS; } @@ -298,10 +298,10 @@ static int board_ps8743_mux_set(const struct usb_mux *me, { if (mux_state & USB_PD_MUX_DP_ENABLED) /* Enable IN_HPD on the DB */ - ioex_set_level(IOEX_USB_C1_HPD_IN_DB, 1); + ioex_set_level(board_usbc1_retimer_inhpd, 1); else /* Disable IN_HPD on the DB */ - ioex_set_level(IOEX_USB_C1_HPD_IN_DB, 0); + ioex_set_level(board_usbc1_retimer_inhpd, 0); return EC_SUCCESS; } @@ -326,6 +326,7 @@ const struct usb_mux usbc1_ps8743 = { */ enum gpio_signal GPIO_S0_PGOOD = GPIO_S0_PWROK_OD_V0; static uint32_t board_ver; +int board_usbc1_retimer_inhpd = GPIO_USB_C1_HPD_IN_DB_V1; static void board_version_check(void) { @@ -353,7 +354,9 @@ static void board_remap_gpio(void) * hardware is retired and no longer needed */ gpio_set_flags(GPIO_USB_C1_HPD_IN_DB_V1, GPIO_OUT_LOW); - } + board_usbc1_retimer_inhpd = GPIO_USB_C1_HPD_IN_DB_V1; + } else + board_usbc1_retimer_inhpd = IOEX_USB_C1_HPD_IN_DB; } static void setup_fw_config(void) diff --git a/board/morphius/board.c b/board/morphius/board.c index 0b8893957f..8dca1c99ed 100644 --- a/board/morphius/board.c +++ b/board/morphius/board.c @@ -271,6 +271,7 @@ BUILD_ASSERT(ARRAY_SIZE(usb_muxes) == USBC_PORT_COUNT); */ static uint32_t board_ver; enum gpio_signal gpio_ec_ps2_reset = GPIO_EC_PS2_RESET_V1; +int board_usbc1_retimer_inhpd = GPIO_USB_C1_HPD_IN_DB_V1; static void setup_v0_charger(void) { @@ -348,6 +349,11 @@ static void board_remap_gpio(void) ioex_enable_interrupt(IOEX_HDMI_CONN_HPD_3V3_DB); } + if (board_ver >= 4) + board_usbc1_retimer_inhpd = GPIO_USB_C1_HPD_IN_DB_V1; + else + board_usbc1_retimer_inhpd = IOEX_USB_C1_HPD_IN_DB; + ioex_get_level(IOEX_PPC_ID, &ppc_id); support_aoz_ppc = (board_ver == 3) || ((board_ver >= 4) && !ppc_id); diff --git a/board/trembyle/board.c b/board/trembyle/board.c index 10247219df..bcf1cc926c 100644 --- a/board/trembyle/board.c +++ b/board/trembyle/board.c @@ -329,6 +329,8 @@ BUILD_ASSERT(ARRAY_SIZE(usb_muxes) == USBC_PORT_COUNT); * Use FW_CONFIG to set correct configuration. */ +int board_usbc1_retimer_inhpd = IOEX_USB_C1_HPD_IN_DB; + static void setup_v0_charger(void) { chg_chips[0].i2c_port = I2C_PORT_CHARGER_V0; diff --git a/board/woomax/board.c b/board/woomax/board.c index 8b03905b44..f439bddda1 100644 --- a/board/woomax/board.c +++ b/board/woomax/board.c @@ -334,6 +334,8 @@ BUILD_ASSERT(ARRAY_SIZE(usb_muxes) == USBC_PORT_COUNT); * Use FW_CONFIG to set correct configuration. */ +int board_usbc1_retimer_inhpd = IOEX_USB_C1_HPD_IN_DB; + static void setup_fw_config(void) { /* Enable Gyro interrupts */ |