summaryrefslogtreecommitdiff
path: root/chip/host
diff options
context:
space:
mode:
authorSam Hurst <shurst@google.com>2018-12-28 11:06:01 -0800
committerchrome-bot <chrome-bot@chromium.org>2019-01-07 19:40:45 -0800
commit1f7de7c939c1f0bf318f4d8b6012183d5755df91 (patch)
tree47761cbff48ae0b9a90cfd2c76ccc6cfdab8239e /chip/host
parentaed008f87c3c880edecf7608ab24eaa4bee1bc46 (diff)
downloadchrome-ec-1f7de7c939c1f0bf318f4d8b6012183d5755df91.tar.gz
pd: Enable USB PD SOP' and SOP'' Communication
Currently, the PD stack ignores messages received from SOP' and SOP'' and this prevents the stack from communicating with VCONN Power Devices and Cable Plugs in general. I propose encoding the message address (SOP*) in the message header. The message header is encoded as a 16-bit value but the TCPC drivers use a 32-bit type for the header. The SOP* address will be stored in bits 31 to 28 of the message header and the PD stack can check those bits to determine the address of the message. BUG=b:122109575 BRANCH=none TEST=manual Change-Id: I2b34c16cae186202c9cf0bc5f940e05151e88cbf Signed-off-by: Sam Hurst <shurst@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1390951 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Sam Hurst <shurst@google.com> Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'chip/host')
-rw-r--r--chip/host/usb_pd_phy.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/chip/host/usb_pd_phy.c b/chip/host/usb_pd_phy.c
index 96d7f06ea8..dd16890e6b 100644
--- a/chip/host/usb_pd_phy.c
+++ b/chip/host/usb_pd_phy.c
@@ -92,6 +92,22 @@ void pd_test_rx_msg_append_sop(int port)
pd_test_rx_msg_append_kcode(port, PD_SYNC2);
}
+void pd_test_rx_msg_append_sop_prime(int port)
+{
+ pd_test_rx_msg_append_kcode(port, PD_SYNC1);
+ pd_test_rx_msg_append_kcode(port, PD_SYNC1);
+ pd_test_rx_msg_append_kcode(port, PD_SYNC3);
+ pd_test_rx_msg_append_kcode(port, PD_SYNC3);
+}
+
+void pd_test_rx_msg_append_sop_prime_prime(int port)
+{
+ pd_test_rx_msg_append_kcode(port, PD_SYNC1);
+ pd_test_rx_msg_append_kcode(port, PD_SYNC3);
+ pd_test_rx_msg_append_kcode(port, PD_SYNC1);
+ pd_test_rx_msg_append_kcode(port, PD_SYNC3);
+}
+
void pd_test_rx_msg_append_eop(int port)
{
pd_test_rx_msg_append_kcode(port, PD_EOP);
@@ -152,6 +168,24 @@ int pd_test_tx_msg_verify_sop(int port)
pd_test_tx_msg_verify_kcode(port, PD_SYNC2);
}
+int pd_test_tx_msg_verify_sop_prime(int port)
+{
+ crc32_init();
+ return pd_test_tx_msg_verify_kcode(port, PD_SYNC1) &&
+ pd_test_tx_msg_verify_kcode(port, PD_SYNC1) &&
+ pd_test_tx_msg_verify_kcode(port, PD_SYNC3) &&
+ pd_test_tx_msg_verify_kcode(port, PD_SYNC3);
+}
+
+int pd_test_tx_msg_verify_sop_prime_prime(int port)
+{
+ crc32_init();
+ return pd_test_tx_msg_verify_kcode(port, PD_SYNC1) &&
+ pd_test_tx_msg_verify_kcode(port, PD_SYNC3) &&
+ pd_test_tx_msg_verify_kcode(port, PD_SYNC1) &&
+ pd_test_tx_msg_verify_kcode(port, PD_SYNC3);
+}
+
int pd_test_tx_msg_verify_eop(int port)
{
return pd_test_tx_msg_verify_kcode(port, PD_EOP);