From 1d85464df80eaefeef06df9a74018ed93f67e19d Mon Sep 17 00:00:00 2001 From: Kapil Porwal Date: Mon, 10 Jul 2023 11:31:59 +0000 Subject: ec/google/chromeec: Call `wait_for_dp_hpd` only in AP mode entry Wait for DP/HPD flags only in AP initiated mode entry BUG=b:247670186 TEST=Verify display over TCSS and its impact on boot time for google/rex Signed-off-by: Kapil Porwal Change-Id: I5137c346fbf1edabc60a53e0978e32f54885c330 Reviewed-on: https://review.coreboot.org/c/coreboot/+/76369 Reviewed-by: Eric Lai Reviewed-by: Subrata Banik Tested-by: build bot (Jenkins) --- src/ec/google/chromeec/ec.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/ec/google/chromeec') diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c index ef82867e8b..a3b1fe3045 100644 --- a/src/ec/google/chromeec/ec.c +++ b/src/ec/google/chromeec/ec.c @@ -1388,6 +1388,16 @@ int google_chromeec_wait_for_dp_hpd(int port, long timeout_ms) uint8_t mux_flags; struct stopwatch sw; + if (!google_chromeec_check_feature(EC_FEATURE_TYPEC_REQUIRE_AP_MODE_ENTRY)) { + google_chromeec_usb_get_pd_mux_info(port, &mux_flags); + if (!(mux_flags & USB_PD_MUX_HPD_LVL) || !(mux_flags & USB_PD_MUX_DP_ENABLED)) { + printk(BIOS_WARNING, "DP/HPD not ready. Abort.\n"); + return -1; + } + + return 0; + } + stopwatch_init_msecs_expire(&sw, timeout_ms); do { google_chromeec_usb_get_pd_mux_info(port, &mux_flags); -- cgit v1.2.3