summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2018-08-17 13:33:02 -0600
committerchrome-bot <chrome-bot@chromium.org>2018-09-07 18:36:36 -0700
commite8070b44b088e99e38ec741ed8091c7e4a033bef (patch)
treededc7bce6201fba05b92f4e48ec4405366fbc76b /include
parente6a13850e9b5a6b2889549c03caddf2944e7fc63 (diff)
downloadchrome-ec-e8070b44b088e99e38ec741ed8091c7e4a033bef.tar.gz
tcpm: add TCPC RX circular buffer in EC
The alert line for TCPC will stay asserted as long as there are RX messages for the TCPM (i.e. EC) to pull from the TCPC. We should clear all of the RX messages we know about during a single alert handling session. This CL can stand on its own, but it is a part of a CL stack that will tighten the critical section of time between received messages from the TCPC and sending follow up message out through the TCPC. See go/usb-pd-slow-response-time for more details. BRANCH=none BUG=b:112088135,b:112344286,b:111909282,b:112848644,b:113124761 BUG=b:113057273,b:112825261 TEST=Reduces reset issue in most cases for phaser, bobba. Does not seem to adversely affect state machine negotiation. Full CL stack consistently sends a REQUEST at 18ms after a SRC_CAP GoodCRC, which is well below the 24 ms threshold we need to be under for USB PD spec compliance. Also testing pd_suspend scenario manually and EC was responsive after port 1 suspend because of "bad behavior" Change-Id: I1654b46400e9881f2927a5f6d6ace589edd182de Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1185727
Diffstat (limited to 'include')
-rw-r--r--include/usb_pd.h1
-rw-r--r--include/usb_pd_tcpc.h1
-rw-r--r--include/usb_pd_tcpm.h4
3 files changed, 3 insertions, 3 deletions
diff --git a/include/usb_pd.h b/include/usb_pd.h
index 5675bac4ef..643ed309aa 100644
--- a/include/usb_pd.h
+++ b/include/usb_pd.h
@@ -38,7 +38,6 @@ enum pd_rx_errors {
};
/* Events for USB PD task */
-#define PD_EVENT_RX (1<<2) /* Incoming packet event */
#define PD_EVENT_TX (1<<3) /* Outgoing packet event */
#define PD_EVENT_CC (1<<4) /* CC line change event */
#define PD_EVENT_TCPC_RESET (1<<5) /* TCPC has reset */
diff --git a/include/usb_pd_tcpc.h b/include/usb_pd_tcpc.h
index 1b93cd822c..2c2da66c84 100644
--- a/include/usb_pd_tcpc.h
+++ b/include/usb_pd_tcpc.h
@@ -57,5 +57,6 @@ int tcpc_set_rx_enable(int port, int enable);
int tcpc_get_message(int port, uint32_t *payload, int *head);
int tcpc_transmit(int port, enum tcpm_transmit_type type, uint16_t header,
const uint32_t *data);
+int rx_buf_is_empty(int port);
#endif /* __CROS_EC_USB_PD_TCPC_H */
diff --git a/include/usb_pd_tcpm.h b/include/usb_pd_tcpm.h
index 08402dda07..1c600c8d7e 100644
--- a/include/usb_pd_tcpm.h
+++ b/include/usb_pd_tcpm.h
@@ -158,7 +158,7 @@ struct tcpm_drv {
int (*set_rx_enable)(int port, int enable);
/**
- * Read last received PD message.
+ * Read received PD message from the TCPC
*
* @param port Type-C port number
* @param payload Pointer to location to copy payload of message
@@ -166,7 +166,7 @@ struct tcpm_drv {
*
* @return EC_SUCCESS or error
*/
- int (*get_message)(int port, uint32_t *payload, int *head);
+ int (*get_message_raw)(int port, uint32_t *payload, int *head);
/**
* Transmit PD message