summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Michalec <tm@semihalf.com>2022-02-21 12:56:14 +0100
committerCommit Bot <commit-bot@chromium.org>2022-02-25 19:36:34 +0000
commitfa06f3d55f5ed80a6e2564f3f1954218a8413008 (patch)
tree0dd8abfe5963f69e3b0502f7becc14ea4601c654
parent7764e61ae0f0de1397b8de1e009df3d72b5e6540 (diff)
downloadchrome-ec-fa06f3d55f5ed80a6e2564f3f1954218a8413008.tar.gz
zephyr: drivers: Setup correct cable identity for BB test
BB retimer has different behaviour that depends on cable identity. This patch setups arbitrarily chosen cable identity to make sure that expected connection state is achieved. BUG=b:216307791 BRANCH=none TEST=zmake configure --test test-drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I96f7976faad6859e686408b1555ee8ed1978a3f3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3479835 Reviewed-by: Tristan Honscheid <honscheid@google.com> Tested-by: Tomasz Michalec <tmichalec@google.com> Commit-Queue: Tomasz Michalec <tmichalec@google.com>
-rw-r--r--zephyr/test/drivers/src/bb_retimer.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/zephyr/test/drivers/src/bb_retimer.c b/zephyr/test/drivers/src/bb_retimer.c
index 259d3105bd..84d8a4a836 100644
--- a/zephyr/test/drivers/src/bb_retimer.c
+++ b/zephyr/test/drivers/src/bb_retimer.c
@@ -96,7 +96,7 @@ ZTEST_USER(bb_retimer, test_bb_set_state)
/* Test USB3 gen2 mode */
disc = pd_get_am_discovery_and_notify_access(
USBC_PORT_C1, TCPCI_MSG_SOP_PRIME);
- disc->identity.product_t1.p_rev20.ss = USB_R20_SS_U31_GEN1_GEN2;
+ disc->identity.product_t1.p_rev30.ss = USB_R30_SS_U32_U40_GEN2;
prl_set_rev(USBC_PORT_C1, TCPCI_MSG_SOP_PRIME, PD_REV30);
zassert_equal(EC_SUCCESS, bb_usb_retimer.set(&usb_muxes[USBC_PORT_C1],
USB_PD_MUX_USB_ENABLED,
@@ -219,6 +219,7 @@ ZTEST_USER(bb_retimer, test_bb_set_dfp_state)
USBC_PORT_C1, TCPCI_MSG_SOP_PRIME);
disc->identity.idh.product_type = IDH_PTYPE_ACABLE;
disc->identity.product_t2.a2_rev30.active_elem = ACTIVE_RETIMER;
+ disc->identity.product_t1.p_rev30.ss = USB_R30_SS_U32_U40_GEN2;
prl_set_rev(USBC_PORT_C1, TCPCI_MSG_SOP_PRIME, PD_REV30);
/* Set cable VDO */
@@ -257,11 +258,7 @@ ZTEST_USER(bb_retimer, test_bb_set_dfp_state)
conn = bb_emul_get_reg(emul, BB_RETIMER_REG_CONNECTION_STATE);
exp_conn = BB_RETIMER_DATA_CONNECTION_PRESENT |
BB_RETIMER_USB_3_CONNECTION |
- /*
- * TODO(b/216307791) Need to investigate it, why this is not
- * set
- */
- /* BB_RETIMER_USB_3_SPEED | */
+ BB_RETIMER_USB_3_SPEED |
BB_RETIMER_RE_TIMER_DRIVER |
BB_RETIMER_ACTIVE_PASSIVE;
zassert_equal(exp_conn, conn, "Expected state 0x%lx, got 0x%lx",