From d98b588c985a6fb537e0ebc7c7e201761f39cbaa Mon Sep 17 00:00:00 2001 From: Scott Date: Wed, 4 Mar 2015 17:18:27 -0800 Subject: pd: Modify BIST mode according to ECR#PD2.0.1.0.004 - Changed TX BIST mode so that it transmits for 50 msec instead of transmitting forever. - Added console command to initiate TX BIST mode. - Fixed an issue with circular DMA mode which was causing watchdog. - Modified RX BIST to account for shorter TX BIST duration. BUG=chrome-os-partner:36335 TEST=Manual on Samus to Samus, manual on Zinger to Samus BRANCH=Samus Signed-off-by: Scott Collyer Change-Id: I666347de47c81b5b7a1e82c2b99345ff3ebbb7d4 Reviewed-on: https://chromium-review.googlesource.com/256194 Tested-by: Alec Berg Reviewed-by: Alec Berg Reviewed-by: Scott Collyer Trybot-Ready: Alec Berg Commit-Queue: Alec Berg --- include/usb_pd.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'include/usb_pd.h') diff --git a/include/usb_pd.h b/include/usb_pd.h index 75b0967406..33460bb732 100644 --- a/include/usb_pd.h +++ b/include/usb_pd.h @@ -134,6 +134,8 @@ enum pd_errors { #define PD_T_SRC_TURN_ON (275*MSEC) /* 275ms */ #define PD_T_SAFE_0V (650*MSEC) /* 650ms */ #define PD_T_NO_RESPONSE (5500*MSEC) /* between 4.5s and 5.5s */ +#define PD_T_BIST_TRANSMIT (50*MSEC) /* 50ms (used for task_wait arg) */ +#define PD_T_BIST_RECEIVE (60*MSEC) /* 60ms (max time to process bist) */ /* number of edges and time window to detect CC line is not idle */ #define PD_RX_TRANSITION_COUNT 3 @@ -626,7 +628,8 @@ enum pd_states { PD_STATE_HARD_RESET_SEND, PD_STATE_HARD_RESET_EXECUTE, #ifdef CONFIG_COMMON_RUNTIME - PD_STATE_BIST, + PD_STATE_BIST_RX, + PD_STATE_BIST_TX, #endif /* Number of states. Not an actual state. */ @@ -1262,6 +1265,13 @@ int pd_start_tx(int port, int polarity, int bit_len); */ void pd_tx_set_circular_mode(int port); +/** + * Stop PD TX DMA circular mode transaction already in progress. + * + * @param port USB-C port number + */ +void pd_tx_clear_circular_mode(int port); + /** * Call when we are done sending a packet. * -- cgit v1.2.1