summaryrefslogtreecommitdiff
path: root/chip/stm32/usb_pd_phy.c
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2015-04-23 14:39:41 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-04-24 02:47:19 +0000
commit934f345ec566aca297a72f8548a36cc024e5f64a (patch)
treea269a70a7ea79f65716693c0379f5b7b08af33c5 /chip/stm32/usb_pd_phy.c
parent9aea3710b22a5e235ddd03a62daa0d60dc913aa9 (diff)
downloadchrome-ec-934f345ec566aca297a72f8548a36cc024e5f64a.tar.gz
pd: ignore cable reset
Identify and ignore cable reset PD command BUG=chrome-os-partner:39464 BRANCH=samus TEST=connect two samus'. on one samus add code to send a cable reset like such: int send_cable_reset(int port) { int off; CPRINTF("C%d Send cable reset\n", port); /* 64-bit preamble */ off = pd_write_preamble(port); /* Hard-Reset: 3x RST-1 + 1x RST-2 */ off = pd_write_sym(port, off, BMC(PD_RST1)); off = pd_write_sym(port, off, BMC(PD_SYNC1)); off = pd_write_sym(port, off, BMC(PD_RST1)); off = pd_write_sym(port, off, BMC(PD_SYNC3)); /* Ensure that we have a final edge */ off = pd_write_last_edge(port, off); /* Transmit the packet */ if (pd_start_tx(port, pd[port].polarity, off) < 0) { pd[port].send_error = -5; return -5; } pd_tx_done(port, pd[port].polarity); /* Keep RX monitoring on */ pd_rx_enable_monitoring(port); return 0; } Without this CL, the receiving samus times out and ends up causing equivalent of hard reset. With this CL, we receive cable reset and drop it. Also used twinkie to measure goodCRC delay. No measureable change in delay on samus and zinger. Samus delay is ~70us and zinger delay is ~65us. Change-Id: Ic0e871c8cf96502b861f430e05ee145881fb55fa Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/266981 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'chip/stm32/usb_pd_phy.c')
-rw-r--r--chip/stm32/usb_pd_phy.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/chip/stm32/usb_pd_phy.c b/chip/stm32/usb_pd_phy.c
index 1db963c588..6c53281346 100644
--- a/chip/stm32/usb_pd_phy.c
+++ b/chip/stm32/usb_pd_phy.c
@@ -180,7 +180,9 @@ int pd_find_preamble(int port)
if (all == 0x36db6db6)
return bit - 1; /* should be SYNC-1 */
if (all == 0xF33F3F3F)
- return -2; /* got HARD-RESET */
+ return PD_ERR_HARD_RESET; /* got HARD-RESET */
+ if (all == 0x3c7fe0ff)
+ return PD_ERR_CABLE_RESET; /* got CABLE-RESET */
}
return -1;
}