summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorEdward Hill <ecgh@chromium.org>2020-09-23 14:14:48 -0600
committerCommit Bot <commit-bot@chromium.org>2020-09-23 23:38:53 +0000
commit54e4cbf51dd64f74d30a330ec5eb5df12c5c5948 (patch)
treed0448d1d28e43f35cadf1697128d8d4259e89005 /board
parente6cc0576f2829357ccf349896fb1536300f22f0f (diff)
downloadchrome-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>
Diffstat (limited to 'board')
-rw-r--r--board/berknip/board.c13
-rw-r--r--board/morphius/board.c6
-rw-r--r--board/trembyle/board.c2
-rw-r--r--board/woomax/board.c2
4 files changed, 18 insertions, 5 deletions
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 */