| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allow the startup messages to be optional and don't require
a specific ordering. Also add PR_Swap when PD_ROLE_UFP.
BUG=none
BRANCH=none
TEST=make run-usb_tcpmv2_compliance
Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: Ifef6fa558a789c2ce34a9f9fbf38529dc90d5e6f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2774580
Tested-by: Denis Brockus <dbrockus@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Diana Z <dzigterman@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When executing a fast role swap, ensure that any 3.0 A selected current
is preserved through the select_current_limit_rp in the TC layer.
Additionally, use this selected current to set our current limit when
first attaching as a source.
If FRS is disabled on a port, restore the default Rp value for the
board.
BRANCH=None
BUG=b:180434465
TEST=Check that a 3A FRS device loaded over 1.5 A is able to
successfully complete FRS
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I6e6b2f95066a3f8972664c6ac62b450e179e408d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2757096
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If a condition is reached outside the PD task which requires USB Type-C
Error Recovery, it can now use pd_set_error_recovery() to request that
the PD task execute this. Note that this will return before the error
recovery has completed, which is in contrast to the suspend port
behavior.
BRANCH=None
BUG=b:180453483
TEST=make -j buildall
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I487e0da3ef65c201ff406500f0c95244b460afcb
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2718836
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When no PD sinks require 3.0 A and no FRS ports require it, offer this
current level to non-PD sinking devices. The non-PD devices will be
downgraded whenever a higher-priority type of port is connected.
BRANCH=None
BUG=b:141690755
TEST=on madoo, verify:
- plugging in a flash drive, it is offered 3.0 A
- plugging in a 3.0 A PD sink, flash drive CC resistor is downgraded
- unplugging 3.0 A PD sink, flash drive CC resistor is back to 3.0 A
- connect power to 3.0 A PD sink, flash drive CC resistor is back to
3.0 A
With FRS config check commented out, verify:
- flash drive is downgraded and FRS enabled on powered hub plug in
- flash drive is back to 3.0 A on FRS hub detach
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: Iaa5c3f0a6a4f41db83978bb1e1d0b54f2519abb2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2692030
Reviewed-by: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When there are no PD sinks requiring 3.0 A, any FRS ports which require
that much current will have FRS detection enabled. If a PD sink
requiring 3.0 A is attached, then FRS detection will be disabled on that
port again.
FRS port partners which require only USB or 1.5 A of current will always
have FRS detection enabled.
BRANCH=None
BUG=b:141690755
TEST=on volteer-based system, verify:
- FRS source partners requiring 1.5 A or less always have FRS detection
enabled
- FRS detection is disabled on detach
- FRS source partner requiring 3.0 A has FRS detection enabled if no PD
sink needing 3.0 A is present
- Plugging in a 3.0 A PD sink disables FRS detection for the 3.0 A FRS
partner
- Unplugging a 3.0 A PD sink enables FRS detection for the 3.0 A FRS
partner
- When FRS occurs on 3.0 A port with detection enabled, partner is
offered appropriate starting current in first source caps
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: Ib067ac7c1c2f4a6e64f36aeffd1b8dde5cb93760
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2676084
Reviewed-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Eric Herrmann <eherrmann@chromium.org>
Tested-by: Eric Herrmann <eherrmann@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is now unused in implementation code.
BUG=b:179198412,b:173725284
TEST=make buildall
BRANCH=none
Signed-off-by: Abe Levkoy <alevkoy@chromium.org>
Change-Id: If9ce77f5958d4ee168412b22bd77cba2c4d0ec49
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2679992
Reviewed-by: Diana Z <dzigterman@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When booting into S0, take the current charge port into account when
deciding whether to power role swap. If the port has been selected from
the UI as a charge port, then refrain from swapping and continue to
charge from it.
BRANCH=None
BUG=b:179334214,b:179095748,b:178070314
TEST=on madoo, connect to magolor and select charging from magolor on
the UI. Go through suspend and shutdown iterations and confirm that
madoo continues to charge from magolor
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I40ef73309f75372b0a34a7542282244ff30868ed
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2676924
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
BRANCH=none
BUG=b:177908650
TEST=Flash icetower v0.2, observed FP_SPI_SEL on console
TEST=Flash nocturne, observed FP_SPI_SEL on console
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I2b221139fed817de4c58db3b6c8198942ab86e7b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2648731
Reviewed-by: Craig Hesling <hesling@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
| |
BRANCH=none
BUG=b:178648877
TEST=view in gitiles
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I0ac5581ba7bc512234d40dbf34222422afa9c725
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2650551
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the device has a USB superspeed UFP (which is uncommon, this is
either servo v4.1 or a laptop port in SS device-mode), if we connect as
a sink *before* trying PD communication, we should connect the SS mux
without waiting for the partner PD comm capability as we might never be
able to communicate with it over PD.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BUG=b:150614702
BRANCH=servo
TEST=use the sink mode enabled by 'cc pdsnk', connect to a USB-C
Chromebook, try both video output on USB-C->mini-DP and USB 3.0.
Change-Id: Iea0409fce2cb7aca089814ae406a7c05848dd8e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2637647
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allow tests to use a mock charge_manager. Do not build the real charge
manager when this is used.
BUG=b:173023378,b:169385081,b:172709198,b:173028832,b:173028791
BUG=b:173141941,b:173142113
TEST=make buildall
BRANCH=none
Signed-off-by: Abe Levkoy <alevkoy@chromium.org>
Change-Id: I49caccafd024515833880d7251092b77623d4a71
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2639584
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After an FRS signal, the initial sink will attempt to initiate the FR
Swap AMS, and the initial source should apply SinkTxOk. If the initial
source is removed entirely, FRS will be triggered butSinkTxOk will
never be applied and this will get the initial sink state machine stuck.
So, in the case of an FRS ignore the CC voltage. After an FRS signal,
the source isn't allowed to initiate an AMS.
BUG=b:171740860
TEST=On Volteer with the PS8815, enable FRS and remove the FRS device.
Make sure we enter ErrorRecovery instead of hanging in
PE_PRS_SNK_SRC_Send_Swap
TEST=make buildall
BRANCH=none
Change-Id: I8373a76c0c19feeb909b0623a1ae2d6b0ad5fa60
Signed-off-by: Eric Herrmann <eherrmann@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2633654
Commit-Queue: Diana Z <dzigterman@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=none
BRANCH=none
TEST=make runhosttests
Signed-off-by: dossym@chromium.org
Change-Id: I7338c137540ddf08886887d66ac92e7b7d57911c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2622068
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=none
BRANCH=none
TEST=make buildall
Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: Iaa6888d2e0d861d64b2747856465789304dde414
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2613724
Tested-by: Denis Brockus <dbrockus@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=none
BRANCH=none
TEST=make buildall
Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: I1b06d512b3b869a300c981c4dd6bda54a236f342
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2614773
Tested-by: Denis Brockus <dbrockus@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This header cannot currently be accessed by Zephyr since it is in a
driver directory, not an include directory. This header has quite a
bit of public stuff in it, so it seems reasonable to consider
everything public.
Move the header file and update all users.
BUG=b:175434113
BRANCH=none
TEST=make buildall -j30
build volteer on zephyr
Signed-off-by: Simon Glass <sjg@chromium.org>
Change-Id: Ibba37f47a06783fafb5095f853f2a68d92b6df87
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2607745
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=none
BRANCH=none
TEST=make buildall
Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: Iafbb0dd23a72ef32a1b3100fdfdeaf57c58b51f8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2613249
Tested-by: Denis Brockus <dbrockus@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
Commit-Queue: Edward Hill <ecgh@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=none
BRANCH=none
TEST=make buildall
Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: I6d1f1ea59c07fa36d5817b9d3a8615ac633964d4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2613247
Tested-by: Denis Brockus <dbrockus@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
Commit-Queue: Edward Hill <ecgh@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=none
BRANCH=none
TEST=make buildall
Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: I0b498d56dd189e3360fd1498acbfb5314c9870d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2602844
Tested-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=none
BRANCH=none
TEST=make buildall
Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: I262e99c7442acca0118250764017f942239ed493
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2604561
Tested-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In an earlier cleanup, the need for returning the
original transmit type value became no longer
needed. So remove it.
BUG=none
BRANCH=none
TEST=make builadll
Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: I8fe30d7a9a87325bda6c4da6b4a5070b2d3ee6c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2604560
Tested-by: Denis Brockus <dbrockus@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that the DPM will be handling source-out decisions for TCPMv2,
remove references to its old configuration options from TCPMv2 boards in
order to avoid any confusion as to what code is running now. Also
remove the charge manager notifications of sink attach/detach since the
policy is being centralized into the DPM.
Note that the previous configuration options only ever allocated one 3.0
A port, and so the default number of 3.0 A ports has been set to 1.
BRANCH=None
BUG=b:168862110,b:141690755
TEST=make -j buildall
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: Ie452e3da32b04226503539daa67b6b9f4a58aa58
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597431
Reviewed-by: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the sourcing policy from the charge_manager to the DPM for TCPMv2.
The first step of this policy will be to allocate 3.0 A only if a
peripheral reports requiring more than 1.5 A in their Sink Capabilities
vSafe5V operational current. For this commit, leave in some
charge_manager APIs for linking which will be re-named or removed later.
BRANCH=None
BUG=b:141690755,b:168862110
TEST=on drawcia verify:
- non-PD sink only offered 1.5 A Rp
- PD sink requiring 1.5 A or less Rp isn't offered 3.0 A
- PD sink requiring 3.0 A is offered a new 3.0 A Source Capability after
sink capability probing. Port continues to receive 3.0 A over both hard
and soft resets.
- When 2 3.0 A sinks are plugged in, only the first is offered 3.0 A.
After the first is unplugged, the second receives a 3.0 A source
capability message
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: Iec48312df1125086db2919c1503c7ba31fe12bcc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597429
Reviewed-by: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove test/usb_tcpmv2_tcpci.c to avoid duplication with
test/usb_tcpmv2_compliance.c
BUG=none
BRANCH=none
TEST=make run-usb_tcpmv2_compliance
Signed-off-by: Edward Hill <ecgh@chromium.org>
Change-Id: Ie62d0f7e2cc30c3086e03103a43dede5515006b4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597598
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Be explicit about checking all transmitted messages to avoid
getting out of sync.
Fix retries check in TD.PD.LL.E3, retries are handled by TCPC.
BUG=b:175144677
BRANCH=none
TEST=make run-usb_tcpmv2_compliance
Signed-off-by: Edward Hill <ecgh@chromium.org>
Change-Id: I017244c669e0c50e49b8974a7462007625c354ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597597
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=b:175144677
BRANCH=none
TEST=make run-usb_tcpmv2_compliance
Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: I629e2811b2cba5aa9821d8c855e039a6cfaa32ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2595816
Tested-by: Denis Brockus <dbrockus@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Place mock functions in the mock libraries corresponding to the layers
of the real implementations. Broadly, move towards one layer of the TCPM
stack as a UUT, with mocks for the other layers as needed. There should
be a one-to-one correspondence between real modules and mock modules.
usb_pd_mock.c does not correspond to any real implementation module or
TCPM stack layer, so remove it and move its contents to the layers
corresponding to their real implementations.
Also clean up some redundant or misplaced mocks inside tests.
BUG=b:153071799,b:173791979
TEST=make buildall
BRANCH=none
Signed-off-by: Abe Levkoy <alevkoy@chromium.org>
Change-Id: Ic44df8675de2b9f1f8c7669cd97dcdc296bf107f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2578200
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Better mock tx and rx messages, add sop type.
BUG=b:161835483 b:173791979
BRANCH=none
TEST=make run-usb_pe_drp
Signed-off-by: Edward Hill <ecgh@chromium.org>
Change-Id: If1f91b6385d6841d662a8a6262af6382645da92e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2553343
Reviewed-by: Diana Z <dzigterman@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
| |
BRANCH=none
BUG=b:171370392
TEST=make buildall
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I1517a7080bd4853918ffc7127d44e1955d925789
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2510455
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove redundant checks for VCONN Source in pe_attempt_port_discovery
(which prevent discovery from running). Allow pe_vdm_send_request to
attempt to become VCONN Source if necessary. Make the checks in the VDM
request child states more complete (not just checking for VCONN Source).
BUG=b:170662791
TEST=Attach Tapex Creek board; observed successful discovery
BRANCH=none
Signed-off-by: Abe Levkoy <alevkoy@chromium.org>
Change-Id: Id7d3a1b82d1029f69b3e05b845632e7237524bc6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2486303
Tested-by: Li1 Feng <li1.feng@intel.com>
Reviewed-by: Diana Z <dzigterman@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
USB4 mode:
Added a function to check if the USB4 entry is completed
Thunderbolt mode:
Added 2 flags TBT_RETRY_DONE, TBT_EXIT_DONE to track the
Thunderbolt mode's exit and if retry is needed and a new function
to check if if the Thunderbolt mode entry is completed
DisplayPort mode:
Added a function to check if the DisplayPort entry is completed
BUG=b:169169804
BRANCH=None
TEST=1. Able to enter alternate mode on hotplug and reboot
2. Able to exit the alternate mode on chipset transition and on
DPM's exit mode request.
Change-Id: I09662449143ad8d94b30ae102ed5ce79db852687
Signed-off-by: Ayushee <ayushee.shah@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2421425
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When chipset is transitioning to a new state or on sysjump, the EC
re-negotiates to enter an alternate mode on booting up.
This commit adds support for exiting Thunderbolt mode for SOP' and SOP''
for active cable on chipset transition and also moves all the alternate
mode exit rotines to their respective files.
It also delays deleting the SVID data until after the EXIT_MODE message
has ACKed and avoids pd_dfp_exit_mode() from changing the alternate
mode's internal states.
This commit also makes sure that the mux is set to safe state before
exiting the alternate mode and it is reconfigured according to the
port's current data role on receiving ACK/NAK from the cable/port
partner.
BUG=b:151169925, b:159717794
BRANCH=none
TEST=On reboot, able to exit and re-enter into DisplayPort mode,
Thunderbolt mode with passive cable and thunderbolt mode with
active cable.
Change-Id: If1e48e9f31cd678e23fe89bd3494551b5d1a78f1
Signed-off-by: Ayushee <ayushee.shah@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2415082
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For boards which use Vbus ADCs, add a VBUS_REMOVED check level. The
level for VBUS_PRESENT should be used in any locations looking for
"Vbus is present" on transition, but in order to correctly detect
disconnection with a load on Vbus, VBUS_REMOVED (vSinkDisconnect)
is required. TODO statements have been added for places where work
will be needed to support vSinkDisconnectPD in the future.
For boards detecting Vbus through an external chip, the levels will
likely be indistinguishable due to the chips setting a lower threshold
for disconnect than for connection.
Unit test code has also been added to encourage new Vbus levels to be
added to the mock, and remind developers to update all locations using
the vbus_level enum.
BRANCH=None
BUG=b:168831161
TEST=make -j buildall
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I04014ce54ec162dd9c62f545126d921c6d880741
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2436580
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As requested in CL:2321869 review, make a new version of
test_send_caps_error that uses the external interface of the PE
layer.
BUG=b:161835483
BRANCH=none
TEST=make run-usb_pe_drp
Signed-off-by: Edward Hill <ecgh@chromium.org>
Change-Id: I983b145cd1e731e844363955896898a2374a0a30
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2419834
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For now, just support exiting the entered mode, if that mode happens to
be DisplayPort (getting TBT3 and USB4 to work correctly will require
some more work). Support this command in ectool.
BUG=b:168030639
TEST=ectool typeccontrol 0 1; observe DP Exit Mode exchange in PD trace
BRANCH=none
Signed-off-by: Abe Levkoy <alevkoy@chromium.org>
Change-Id: Ib30479cc88696115060e9ff74f6815ce074e6bf5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2415069
Reviewed-by: Diana Z <dzigterman@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a new unit test for usb_pe_drp with mocks for the various
subsystems that it will use.
The fake_prl module is already essentially a mock for the PRL layer,
so just move it into the mocks directory and make it available as
mock to other tests.
BUG=b:163421994
BRANCH=None
TEST=`make runhosttests` succeeds
Signed-off-by: Paul Fagerburg <pfagerburg@google.com>
Change-Id: I2aea3fa0694e8d9e6bae1f47516cb4d5d2a1e714
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2364050
Tested-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
BRANCH=none
BUG=b:76037094
TEST=make buildall -j
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: Ibe8649c3cf77ef4542b5fc46d7df5eee03293b56
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2364755
Commit-Queue: Craig Hesling <hesling@chromium.org>
Reviewed-by: Craig Hesling <hesling@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We need to ensure that the previous Rd or Rp has been held long enough
before we transition into hardware auto toggle otherwise the first
toggle might be too short and violate the DRP timing spec
BRANCH=none
BUG=b:163095971
TEST=Verify on scope
Signed-off-by: Jett Rink <jettrink@chromium.org>
Change-Id: I92e9f5ca7dbca2b347e438d774551cc11476195b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2343176
Reviewed-by: Edward Hill <ecgh@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove tc_set_data_role and tc_set_power_role from usb_pd_mock.
BUG=b:163421165
BRANCH=None
TEST=`make runhosttests`, all unit tests pass
Signed-off-by: Paul Fagerburg <pfagerburg@chromium.org>
Change-Id: Ib380d2f04f833b58e23a16d0c6421316b72329fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2349282
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add test for TD.PD.SRC3.E26.Soft_Reset sent regardless of Rp value.
BUG=b:161835483
BRANCH=none
TEST=make -j run-usb_tcpmv2_tcpci
Signed-off-by: Edward Hill <ecgh@chromium.org>
Change-Id: I972bffcb1c7a330aef4ebdff98fcd33af9a667be
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2340486
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We are retrying in both the TCPC hardware (4 total) and
in the Protocol layer (3 total) when we do not get a GoodCRC back from
the port partner. We are only suppose to retry up to nRetryCount times
which is 2. This means we should be sending 3 total replies.
Also correct a misinterpretation of the spec around SOP' and SOP"
retries. We were not retrying those packets, but we should be retry them
as the SOP. The SOP' device will not retry, but we (as the SOP) should
retry packet that we are sending to them.
The TCPM is not fast enough to meet the timing for tRetry (195 usec), so
we need to perform the retries in the TCPC hardware layer.
BRANCH=none
BUG=b:150617035
TEST=Verify passing compliance test with GRL-C2 on Trembyle
Change-Id: I55c4ab2f5ce8f64acf21af943862d96d9088622d
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2248960
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=b:162369240
BRANCH=none
TEST=make -j run-usb_tcpmv2_tcpci
Signed-off-by: Edward Hill <ecgh@chromium.org>
Change-Id: I61a9f99a10c3432135a91699ac04ff65690388e7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2335455
Commit-Queue: Jett Rink <jettrink@chromium.org>
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
| |
BRANCH=none
BUG=none
TEST=view in gitiles
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I7ea94d81c9faf51ae9c317fe304e22d8745e64de
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2323714
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add unit tests for the packet discard logic for packets while going
into SinkTxNG.
BUG=b:160622527, b:161174072
BRANCH=None
TEST=`TEST_LIST_HOST=usb_prl make runhosttests`
Signed-off-by: Paul Fagerburg <pfagerburg@chromium.org>
Change-Id: Ied7689d2fe40da93069e58b53ea32e053ab887b8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2300690
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a new test that runs a full set of TCPMv2 layers and state
machines, talking to a simulated TCPC via I2C.
Initial test cases:
1) Plug in a non-PD power supply -> we connect as sink.
2) AP S5 > S3 > S0 -> auto-toggle + low power.
BUG=b:161167893
BRANCH=none
TEST=make -j run-usb_tcpmv2_tcpci
Signed-off-by: Edward Hill <ecgh@chromium.org>
Change-Id: If8b8eb2cca722ed01cbe1d6000fb3e4f4b70149c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2283911
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After CL:2208221, the check for the PD_CMD task no longer trigger,
so we end up not calling suspend on our TCPC ports.
We want to continue to suspend, which will apply CC open in
TCPMv2 for a cooperative shutdown
Also, correct override keyword usage for board_get_usb_pd_port_count
since I had to touch those definitions to make IS_ENABLE work
BRANCH=none
BUG=b:160243292
TEST=See that software sync reboot, applies CC open (and browns out system)
Change-Id: I00bf08c7d347441d77834e2c5122a09ca2316280
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2276318
Reviewed-by: Diana Z <dzigterman@chromium.org>
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The driver function to set FRS enable only exists if
CONFIG_USB_PD_FRS_PPC is enabled, so we must also make its callers
conditional in the same way. For consistency, also revise the TCPC
FRS code paths to be conditional.
BUG=b:146393213
BRANCH=None
TEST=make buildall
Signed-off-by: Peter Marheine <pmarheine@chromium.org>
Change-Id: I3fb14c711dd2abdf6ef77d469b2103f37daac182
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2276125
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The old declaration with void is incompatible with the use of
tcpci_tcpc_fast_role_swap_enable in the one driver that currently
implements that function, causing build failure when
CONFIG_USB_PC_FRS_TCPC is enabled and using the nct38xx TCPC driver.
Because the underlying function may fail, walk up the stack and make all
users capable of failure as well (however the top level user currently
ignores the result).
BUG=b:146393213
BRANCH=None
TEST=make buildall
Change-Id: Ib8cabf4a435731ed804a3cc4696dfea97eef3c98
Signed-off-by: Peter Marheine <pmarheine@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2276124
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit creates a reporting function for the PRL to let the PE know
when messages have been discarded.
States will have to handle message discard internally since the response
depends on the portion of the AMS sequence they're in. For some states
which begin AMSes, a new shared parent has been added which runs the
sender response timer and checks discard for the child.
More states (and discard mid-AMS) are expected to be added in future
CLs.
The new parent state saves an average of 124 bytes of flash space.
BRANCH=None
BUG=b:158248741,b:157228506
TEST=on waddledoo, Dell dock no longer soft resets during power role
swap
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I61b3e96e1d14634dcd5edda4e133968ace769b21
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2241577
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The original get_chip_info() returns a point of point to the chip_info.
This way helps to cache the chip_info to a static variable and the
function just returns the pointer to the static variable.
This static variable has a race condition on the PS8805 chip. The PS8805
chip returns a different PID when the firmware is corrupted, i.e. 0x8803
instead of 0x8805. The !live case fixes the PID, by modifying the static
variable directly. When another task calls the same function for the
live case, the static variable is modified and has a race condition.
This change fixes the issue by changing the get_chip_info() parameter to
a point of the chip_info. The caller has to allocate a buffer in the
stack and pass the address to the function. For the !live case, the
function copies the cache value from the static variable to the buffer.
So the static variable doesn't have a race condition.
BRANCH=None
BUG=b:159588335
TEST=Used ectool to check the PD chip PID 0x8805 (was 0x8803).
localhost ~ # ectool pdchipinfo 1
vendor_id: 0x1da0
product_id: 0x8805
device_id: 0x1
fw_version: 0x0
min_req_fw_version: 0x0
Change-Id: Ic24615af77ea58016d286480572d2a282c4fa09a
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2264477
Reviewed-by: Julius Werner <jwerner@chromium.org>
|