summaryrefslogtreecommitdiff
path: root/include
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 /include
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 'include')
-rw-r--r--include/usb_pd.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/include/usb_pd.h b/include/usb_pd.h
index 97dbeed51e..478f840193 100644
--- a/include/usb_pd.h
+++ b/include/usb_pd.h
@@ -14,10 +14,12 @@
#define PD_HOST_COMMAND_TIMEOUT_US SECOND
enum pd_errors {
- PD_ERR_INVAL = -1, /* Invalid packet */
- PD_ERR_HARD_RESET = -2, /* Got a Hard-Reset packet */
- PD_ERR_CRC = -3, /* CRC mismatch */
- PD_ERR_ID = -4, /* Invalid ID number */
+ PD_ERR_INVAL = -1, /* Invalid packet */
+ PD_ERR_HARD_RESET = -2, /* Got a Hard-Reset packet */
+ PD_ERR_CRC = -3, /* CRC mismatch */
+ PD_ERR_ID = -4, /* Invalid ID number */
+ PD_ERR_UNSUPPORTED_SOP = -5, /* Unsupported SOP */
+ PD_ERR_CABLE_RESET = -6 /* Got a Cable-Reset packet */
};
/* incoming packet event (for the USB PD task) */