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 <kapilporwal@google.com>
Change-Id: I5137c346fbf1edabc60a53e0978e32f54885c330
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76369
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c
index ef82867..a3b1fe3 100644
--- a/src/ec/google/chromeec/ec.c
+++ b/src/ec/google/chromeec/ec.c
@@ -1388,6 +1388,16 @@
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);