soc/intel/common: Fix the TCSS DisplayPort detection flow
After DisplayPort is plugged into type-C port, its hpd signal
instantly presents and EC has mux_info for dp and hpd. This change
fixes the DP detection flow to avoid the 1 second delay while no DP
is connected. If DP is present, there will be requests towards PMC
through the sequence of connect, safe mode, dp and hpd mode.
BUG=b:247670186
TEST=Built image and validated the DisplayPort preboot feature on Rex.
Change-Id: I7cb95ec7fcc7e1a86e86466e6d45390eedcc4531
Signed-off-by: zhaojohn <john.zhao@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/69694
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com>
diff --git a/src/soc/intel/common/block/tcss/tcss.c b/src/soc/intel/common/block/tcss/tcss.c
index df331c2..b4a5a0e 100644
--- a/src/soc/intel/common/block/tcss/tcss.c
+++ b/src/soc/intel/common/block/tcss/tcss.c
@@ -202,7 +202,6 @@
req.buf[0] = cmd;
return send_pmc_req(HPD_REQ, &req, &rsp, PMC_IPC_HPD_REQ_SIZE);
-
}
static int send_pmc_dp_mode_request(int port, const struct usbc_mux_info *mux_data,
@@ -287,7 +286,7 @@
static void tcss_configure_dp_mode(const struct tcss_port_map *port_map, size_t num_ports)
{
- int ret, port_bitmask;
+ int ret;
size_t i;
const struct usbc_ops *ops;
struct usbc_mux_info mux_info;
@@ -300,24 +299,9 @@
if (ops == NULL)
return;
- port_bitmask = ops->dp_ops.wait_for_connection(WAIT_FOR_DISPLAYPORT_TIMEOUT_MS);
- if (!port_bitmask) /* No DP device is connected */
- return;
-
for (i = 0; i < num_ports; i++) {
- if (!(port_bitmask & BIT(i)))
- continue;
-
- ret = ops->dp_ops.enter_dp_mode(i);
- if (ret < 0)
- continue;
-
- ret = ops->dp_ops.wait_for_hpd(i, WAIT_FOR_HPD_TIMEOUT_MS);
- if (ret < 0)
- continue;
-
ret = ops->mux_ops.get_mux_info(i, &mux_info);
- if (ret < 0)
+ if ((ret < 0) || (!mux_info.dp))
continue;
port_info = &port_map[i];