summaryrefslogtreecommitdiff
path: root/test/usb_pe_drp.c
Commit message (Collapse)AuthorAgeFilesLines
* test: Pass commandline arguments to run_testTom Hughes2020-05-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | run_test is called by the "runtest" console command. Console commands can take arguments, so pass along the arguments to run_test to allow parameters to be passed to run_test. The following command was used for automatic replacement: git grep --name-only 'void run_test(void)' |\ xargs sed -i 's#void run_test(void)#void run_test(int argc, char **argv)##' BRANCH=none BUG=b:155897971 TEST=make buildall -j TEST=Build and flash flash_write_protect test > runtest 1 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ib20b955d5ec6b98f525c94c24aadefd7a6a320a5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2209418 Reviewed-by: Yicheng Li <yichengli@chromium.org> Commit-Queue: Yicheng Li <yichengli@chromium.org> Tested-by: Yicheng Li <yichengli@chromium.org>
* TCPMv2: Revamp pe_attempt_port_discoveryDiana Z2020-04-171-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revamps pe_attempt_port_discovery to be called from the ready run states, try once to be DFP and Vconn source, and moves timer check and discovery calls into this function. Note that nDiscoverIdentityCount and DiscoverIdentityTimer are only applicable to cable plugs, though here the discover identity timer is also repurposed to space out requests to a BUSY partner. Long term, the policy decisions regarding our data and vconn role will be moved out into their own file in order to support allowing the AP to override EC default policies. BRANCH=None BUG=b:152417977 TEST=on kindred running TCPMv2, ensured we could complete discovery and enter mode DP mode (when applicable) with: - PD 2.0 Apple dongle, with and without external power - PD 2.0 Acer hub - PD 2.0 charger which would DR swap - PD 3.0 Cable Matters hub, with and without external power - PD 3.0 Hoo Too hub, with and without external power Ensured we did not attempt discovery with: - PD 2.0 charger which won't DR swap Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I9c049690a87f3fc0eca3b9d2c85128470cbb2a91 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2130478 Reviewed-by: Jett Rink <jettrink@chromium.org>
* TCPMv2: Configure PE test for alternate modesDiana Z2020-04-161-0/+7
| | | | | | | | | | | | Configures the TCPMv2 PE test to build the alternate mode code. BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I4cb5824875e2a4b4e93fbae0a4d8762195b987f5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2137258
* tcpmv2: move function from TC layer to PEJett Rink2020-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | | - Move pd_ function that belong in PE layer to PE layer. Remove the extra pe_ layer. - Remove unnecessary PE and Vconn ifdef guards in TC layer - Remove unused print_dev_info function - Move host commands in TC layer to host command file - Move RW hash stuff from TC to PE, since this only has to do with VDO (Which is a PE layer thing) - Removed dependency for tc_drp test on usbc_fake as we don't really need it anymore once we don't pull in the PRL and PE layers anymore (based on previously landed CLs) BRANCH=none BUG=b:153071799 TEST=everything still builds and passes tests Change-Id: Id1d1efa291c3525f57bc26af9fddda6ddace1b58 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2132871
* config: update TCPMv2 config optionsJett Rink2020-03-271-0/+5
| | | | | | | | | | | | | | | | | | | Reorganize how the TCPMv2 options are used - Update documentation in config.h and bring TCPMv2 items close together - Make the layer defines consistent on how they include compilation units - Update tests to account for how files are included now - Remove unnecessary defines in board.h since they are default on BRANCH=none BUG=none TEST=builds Change-Id: I91fca51648912deef44db23492ecc7775b2e3062 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2120063 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* TCPMv2: Split PD message buffers into separate TX/RX buffersSam Hurst2020-03-211-2/+2
| | | | | | | | | | | | | | | | | | | | | Use separate buffers for transmit and reception of PD messages. This prevents the potential corruption of PD messages waiting to be transmitted when an unexpected PD message is received BUG=b:150637227 BUG=b:149662829 BRANCH=none TEST=make -j buildall Manual tests: Tested hatch device and powered dock. Used total phase to verify that transmitted messages were not corrupted by unexpected message reception. Change-Id: I12df471f59fb7510e642bb92b769ccbddd79c84f Signed-off-by: Sam Hurst <shurst@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2103253 Reviewed-by: Diana Z <dzigterman@chromium.org>
* TCPMv1/v2: Move pd_set_vbus_discharge() to common fileVijay Hiremath2020-02-121-0/+5
| | | | | | | | | | | BUG=b:148528713 BRANCH=none TEST=make buildall -j Change-Id: Id7b0d10396300c4bd5b8253b7ce77c1fe59c9bc8 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2051216 Reviewed-by: Keith Short <keithshort@chromium.org>
* TCPMv1/v2: Move EC_CMD_PD_CHIP_INFO host command to common fileVijay Hiremath2020-01-241-0/+2
| | | | | | | | | | | BUG=b:142911453 BRANCH=none TEST=make buildall -j Change-Id: Ia858db061811c58a14b2525d17d6abdc35ea6fa7 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2008299 Reviewed-by: Keith Short <keithshort@chromium.org>
* TCPMv2: Fixed PR swap request from charge managerSam Hurst2019-12-101-0/+4
| | | | | | | | | | | | | | | | | | | The PR swap request from the charge manager was locking up the TC state machine. The pd_request_power_swap function was changed so that it sends the request to the policy engine instead of initiating it directly. BUG=chromium:1027247 BRANCH=none TEST=make -j buildall Tested with apple dongle "A2119 2019 HBR3" known to reproduce this problem. Change-Id: Ic59036056434ed525a839cd781cff93e3b5bfc53 Signed-off-by: Sam Hurst <shurst@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1928795 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* usbc: fix vbus discharge path for GPIOJett Rink2019-11-071-0/+17
| | | | | | | | | | | | | Code on Tot assumes that port count was the port to discharge instead of port parameter BRANCH=none BUG=none TEST=verified with unit test (in this CL) Change-Id: I17658a0c555f9cea56fa4ec1652e0faf62e3d6cc Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1896125
* pd: Add PE FRS unit test for new stackDenis Brockus2019-10-161-0/+134
BUG=none BRANCH=none TEST=make buildall -j Change-Id: I55453ddf1d1da0fdee902a33e14357716fb12c4a Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1859826 Reviewed-by: Jett Rink <jettrink@chromium.org>