Retry twice when operating at PD 3.0 and thrice when operating at PD
2.0. Provide a TCPM-agnostic interface to get the number of retries.
BUG=b:173025773,b:173025737
TEST=Pass TD.PD.LL.E3 Soft Reset Usage and TD.PD.LL.E4 Hard Reset Usage
BRANCH=firmware-volteer-13521.B-master
Signed-off-by: Abe Levkoy <alevkoy@chromium.org>
Change-Id: I422447718f1bfc9a9d4f8ffc5b284723a5332833
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2578201
Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Paul Fagerburg <pfagerburg@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>
There is an option in the task_set_event function which force
the calling task to wait for an event. However, the option is never
used thus remove it.
This also will help in the Zephyr migration process.
BUG=b:172360521
BRANCH=none
TEST=make buildall
Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com>
Change-Id: Ic152fd3d6862d487bcc0024c48d136556c0b81bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2521599
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
The existing configuration code assumes that provided addresses are
at least as aligned as the requested size, which is not true on
NPCX797WC (and likely others) where RAM regions are only 64k-aligned
but have larger sizes (like 256k).
Use a new greedy approach to configuring the MPU which handles these
situations corrently: for any given request take the largest possible
chunk from the bottom of the memory region (subject to size and address
alignment). Maximize the space by aggressively using MPU subregions-
this means that in many well-aligned situations this algorithm selects a
larger region than the requested size and enables one subregion, but in
more difficult situations it is capable of enabling subregions with more
exotic positions.
BUG=b:169276765
BRANCH=zork
TEST=With a test harness to print out computed configurations, manually
verified the correctness of a variety taken from real chip
configurations (request first, MPU region(s) indented):
0x20000000 size 0x1000 # stm32f03x
0x20000000 size 0x8000 srd fe
0x20000000 size 0x2000 # stm32f03x
0x20000000 size 0x10000 srd fe
0x20000000 size 0x2800 # stm32l100
0x20000000 size 0x4000 srd e0
0x20000000 size 0x4000 # stm32f412
0x20000000 size 0x20000 srd fe
0x80000 size 0xc000 # it8320
0x80000 size 0x20000 srd f8
0xff200000 size 0xa0000 # ish5p4
0xff200000 size 0x100000 srd e0
0x200b0000 size 0x20000 # npcx797wb
0x20080000 size 0x80000 srd e7
0x10070000 size 0x40000 # npcx797wb
0x10000000 size 0x80000 srd 7f
0x10080000 size 0x80000 srd f8
0x200c0000 size 0x10000 # npcx796f
0x20080000 size 0x80000 srd ef
0x10090000 size 0x30000 # npcx796f
0x10080000 size 0x80000 srd f1
0x10090000 size 0x20
0x10090000 size 0x100 srd fe
Further verified MPU configuration with the new algorithm succeeds
on Dalboz, and test/mpu.c passes on Dragonclaw.
Signed-off-by: Peter Marheine <pmarheine@chromium.org>
Change-Id: I71d8e2b37c7e20fc7a39166b90eea0b7f7ebcf43
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2434601
Reviewed-by: Edward Hill <ecgh@chromium.org>
Stub out returns of 0 and NULL for the source and sink cap pd_ APIs if
a board is not using the PE layer.
BRANCH=None
BUG=None
TEST=make -j buildall
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I32e74f3f29aacdf47aca9bc9d0664a4d799da3b2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2585749
Reviewed-by: Scott Collyer <scollyer@chromium.org>
Commit-Queue: Scott Collyer <scollyer@chromium.org>
Have the pd_ functions which query fixed PDO flags retrieve the fixed
PDO themselves, rather than going through stored TC flags. This reduces
the liklihood of problems with the flags getting out of sync, and
reflects our future goal of being able to provide the AP with the PDOs
directly for decision-making.
BRANCH=dedede
BUG=b:173166474
TEST=on waddledoo, perform many DUT-DUT connections and verify that the
other DUT will always show up as DR power and data in the "ectool usbpd"
output
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I4dd46f5ef4156377d11169545a541b11e60a2cf4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2576453
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
This change allows the `accelspoof` ec command to also
override the calibration data (bypassing the calibration
module). This config flag should be used when testing
layers above the EC (kernel and up)'s handling of the
calibration values.
BRANCH=none
BUG=none
TEST=Built on eve and added unit tests.
TEST=make run-online_calibration_spoof -j
Signed-off-by: Yuval Peress <peress@chromium.org>
Change-Id: I4735b9613c152af5559661a91565b05635d6495e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2494986
Wake the PD task from pe_message_received(), pe_message_sent(), and
pe_report_error() to avoid having to wait USBC_EVENT_TIMEOUT.
BUG=none
BRANCH=none
TEST=make run-usb_pe_drp
Signed-off-by: Edward Hill <ecgh@chromium.org>
Change-Id: I2fd1465796224507e1eb64ea20572165918d5bf3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2564818
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Add a test for the other half of handling an error on sending
source capabilities. Before connection, PE_SRC_Send_Capabilities
goes to PE_SRC_Discovery on send error. Once connected, to goes
to PE_Send_Soft_Reset.
BUG=b:161835483
BRANCH=none
TEST=make run-usb_pe_drp
Signed-off-by: Edward Hill <ecgh@chromium.org>
Change-Id: I92df9159286536bdda76e5b8530494c6aa368af1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2553344
Reviewed-by: Diana Z <dzigterman@chromium.org>
Set collection_rate to 0 when sensor is not in initialized state anymore.
It will prevent the motion_sense task to be neededlessly scheduled.
Export wait_us to be tested.
BUG=b:170703322
BRANCH=kukui
TEST=unit test
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Change-Id: I1dc4c7a07ff30fa10997ef87784114c725f100d5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2520297
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Chen-Tsung Hsieh <chentsung@chromium.org>
Reviewed-by: Yuval Peress <peress@chromium.org>
TCPMv1 used PD_FLAGS_CHECK_PR_ROLE and
pd_check_pr_role() to accomplish this. This was
missing from TCPMv2.
In the TCPMv2 implementation, policy
pd_can_source_from_device was added to put the
logic in one place to detect if the PDO for a
partner device can and should be the source
Using this policy the AP resume code will check
to see if an already attached partner that we
are sinking from should be sinking from us instead.
BUG=b:169299049
BRANCH=zork
TEST=verify DRP phone will swap back to SNK on AP resume
Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: I8e584446445c8ee2e1c91973a58a04405cdf9e1b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2555865
Tested-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
Put sensors in forced mode, since interrupts are not generated in test
mode.
Remove unnecessary task wakeup, since motion sense are sending them.
Fix comments and remove empty code.
BUG=b:170703322
BRANCH=kukui
TEST=unittest
Change-Id: Ic9096998a29cebeb47bed5cc2c148b7743f6c78f
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2523295
Reviewed-by: Yuval Peress <peress@chromium.org>
Reviewed-by: Ting Shen <phoenixshen@chromium.org>
some refactoring for does_respond_to_discov_sop_xxx
and is_usb_pd_supported was added to make the common
code available for other uses as well
BUG=b:172434299
BRANCH=none
TEST=verify XML output
Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: I36c7df53e61734fcbdd176e3ea292a3f8914fdf9
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2550309
Tested-by: Denis Brockus <dbrockus@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
Some device data is only valid if Device_Supports_USB_Data
in the Upstream Facing Port Fields group.
Some host data is only valid if Host_Supports_USB_Data
in Downstream Facing Port Fields
BUG=b:172441959,b:172438944
BRANCH=none
TEST=verify XML output
Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: I41edde27d9cc6fb49934e0d176efc90540a9faee
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2550308
Tested-by: Denis Brockus <dbrockus@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
Copy sink caps for later reference, and report them up to the AP in the
TYPEC_STATUS host command return. This also moves the location of the
DPM set for sink caps, to be symmetrical between source and sink inits.
Set the old unit tests to clear all DPM requests. New PE tests will
correctly handle our startup sequence, but the old tests may have
erratic behavior based on how many states run before the connection is
forced over to READY.
BRANCH=None
BUG=b:160009733,b:168862110
TEST=on drawcia, verify sink capabilities match those from PD traces
with several docks and dongles
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: Iadc6ef4c7364d7c709878a75fd5e707a965f77f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2540390
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
This commit adds the ability to always probe the partner for sink
capabilities, and re-names the state to reflect that sources may use it
now too. This also fixes some issues in the state to get sink
capabilities, including correcting the message detection and soft
resetting with the SOP* of the unexpected message.
This also updates the unit tests to expect a Get_Sink_Caps message as a
part of typical startup.
BRANCH=None
BUG=b:168862110,b:160009733
TEST=on drawcia, observe sink caps are requested from source and sink
partners
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I5da3adc17ccec71f6cad9e8f152b9570ec99691d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2540389
Reviewed-by: Keith Short <keithshort@chromium.org>
Since this is the most common correct answer, I am changing
the default from USB 2 to USB 3.2 GEN 1x1
BUG=b:172441959,b:172438944
BRANCH=none
TEST=verify XML output
Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: I758ec7ec0df2f285466d83ddb0dcfa8cc98efa55
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2547192
Tested-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
Any of the following will run the test from platform/ec
make buildall
make runtests
make run-genvif_test
The following will run the test from platform/ec/test/genvif
make clean test
BUG=b:173219559
BRANCH=none
TEST=make buildall
Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: Ic5594ae96d040adc332c2afc8fa8a8eb8b373882
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2542745
Tested-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Shim in support for crc8 used in CBI, I2C, and other
applications within platform/ec
BRANCH=none
BUG=b:168032589
TEST=add unit test for platform/ec and zephyr based
CRC8 approaches and verify they both pass.
Signed-off-by: Jett Rink <jettrink@chromium.org>
Change-Id: I9b6112cb83dab81a44a1ac020d4efb1b7bb1df5f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2532692
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Instead of creating a new test for crc8, just make the existing crc32
test more generic.
BRANCH=none
BUG=none
TEST=none
Signed-off-by: Jett Rink <jettrink@chromium.org>
Change-Id: Ie630d4991d4e2c7dc441842c39d63fc0281ac809
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2532690
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
When AP changes range, unlike offset or ODR, it was not surviving init()
call. If the sensor is powered off in S3, at resume the range would be
back to the default.
To make it consistent with other attributes, remember range change until
EC powers down.
- remove get_range
- add current_range to store the range currently used.
This is modifiable by the AP
- when the AP shutdown, revert current_range to default_range
- Remove const attribute for sensor structure when init and set_range is
called.
BUG=chromium:1083791
BRANCH=none
TEST=One eve branch, check range is preserved even after 'shutdown -h 0'
Change-Id: Ia7126ac0cc9c3fef60b4464d95d6dd15e64b0fc4
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2215751
Reviewed-by: Yuval Peress <peress@chromium.org>
Something slipped through CQ coverage. Need to figure out, but in the
mean time, revert the 3 CLs that seemed to have caused the issue.
BRANCH=none
BUG=chromium:1147953
TEST=none
This reverts commit 5ec269c5a7.
Change-Id: I90f812cd4d4f83ea05d34740541db0076abce392
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2533356
Tested-by: Rajat Jain <rajatja@google.com>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Something slipped through CQ coverage. Need to figure out, but in the
mean time, revert the 3 CLs that seemed to have caused the issue.
BRANCH=none
BUG=chromium:1147953
TEST=none
This reverts commit 22ee9a3467.
Change-Id: I5617e39204a7c05001363d5780fa2f52e3e1ea05
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2533355
A long is 32-bit, but a long long is 64-bit. The function name should be
strtoull if it is returning 64 bits of data.
BRANCH=none
BUG=b:172592963
TEST=builds
Signed-off-by: Jett Rink <jettrink@chromium.org>
Change-Id: I04c40f9256ed37eb1cf9b6bd1b0ef0320fe49b0c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2530874
Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Shim in support for crc8 used in CBI, I2C, and other
applications within platform/ec
BRANCH=none
BUG=b:168032589
TEST=add unit test for platform/ec and zephyr based
CRC8 approaches and verify they both pass.
Change-Id: Ib609f98596c4edc6e6f0d01b6242e62a1f95ad72
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2527811
Reviewed-by: Yuval Peress <peress@chromium.org>
Instead of creating a new test for crc8, just make the existing crc32
test more generic.
BRANCH=none
BUG=none
TEST=none
Signed-off-by: Jett Rink <jettrink@chromium.org>
Change-Id: I459e9b721a6cc0d94cef8c0d93102ad372095c34
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2527493
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
This is so that the unittest can be built for a board that actually
uses 3072-byte RSA in RW signature verification, and run on-device.
E.g. `build --BOARD=hatch_fp test-rsa`
BRANCH=none
BUG=b:169256204
TEST=make -j buildall
TEST=make BOARD=bloonchipper test-rsa3, flash to Dragonclaw,
rwsig verify OK, test passes.
Change-Id: I1e67f05b76b53d96fe508832a94e9af5ad896d4d
Signed-off-by: Yicheng Li <yichengli@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2429392
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
This change replaces the stubbed irq_(un)lock static functions
defined in task.h with new functions that behave more like the
Zephyr implementation of irq_(un)lock functions. This should
make the migration from interrupt_(dis|en)able to Zephyr more
seamless.
BRANCH=none
BUG=b:172060699
TEST=Added unit tests, make runtests -j, and built for various
boards: eve, volteer, arcada_ish, atlas, hatch, kohaku,
nocturne, samus, and scarlet
Signed-off-by: Yuval Peress <peress@chromium.org>
Change-Id: Ia7ad2b8d7d411a11699353bf5d3cc36a261fad14
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2511720
After the atomic functions change, there is a compilation error of
test-stm32_rtc. Remove volatile qualifier, because it is not needed for
atomic functions - 'rtc_fired' is changed only by them.
BUG=b:172079887
BRANCH=none
TEST=make BOARD=bloonchipper test-stm32f_rtc
Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com>
Change-Id: I38c48697b0ce1b639dcf767d939bb8dcf1215f79
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2512205
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Rename atomic_read_clear to atomic_clear to be consistent with the rest
of the atomic functions, which return the previous value of the
variable.
BUG=b:169151160
BRANCH=none
TEST=buildall
Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com>
Change-Id: I2588971bd7687879a28ec637cf5f6c3d27d393f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2505143
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Note that the "fpsensor_uart_ro" test is broken at this point due to
b/171370392 and will be fixed in a followup commit.
BRANCH=none
BUG=b:171370392
TEST=Using dragonclaw v0.2 and servo_micro:
./test/run_device_tests.py -t fpsensor_uart_ro
./test/run_device_tests.py -t fpsensor_uart_rw
./test/run_device_tests.py -t fpsensor_spi_ro
./test/run_device_tests.py -t fpsensor_spi_rw
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I00cb5dd975fefe577381f1889e88aad000c8ba57
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2508859
Reviewed-by: Bhanu Prakash Maiya <bhanumaiya@google.com>
The RUN_TEST macro is needed to perform the bookeeping on failures for
the tests that are run.
BRANCH=none
BUG=b:171370392
TEST=make buildall -j
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I8b74c8ee39fd95391417267993e186eb2056456d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2508858
Reviewed-by: Bhanu Prakash Maiya <bhanumaiya@google.com>
It is done as a part of porting to Zephyr.
Since the implementation of atomic functions is done for all architectures
use atomic_* instead of deprecated_atomic_*.
Sometimes there was a compilation error "discards 'volatile' qualifier"
due to dropping "volatile" in the argument of the functions, thus
some pointers casts need to be made. It shouldn't cause any issues,
because we are sure about generated asm (store operation will be
performed).
BUG=b:169151160
BRANCH=none
TEST=buildall
Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com>
Change-Id: I98f590c323c3af52035e62825e8acfa358e0805a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2478949
Tested-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Provide a translation layer in test_utils.h for the Zephyr zassert
macros to map onto EC's TEST_ASSERT macros. With a little bit of
duplicated-but-not-quite-duplicated code (test_main vs. run_test)
and some extra macros for the return type of the test cases, the
tests can build for either the EC framework (by default) or the
Zephyr Ztest framework (#ifdef CONFIG_ZEPHYR).
Update the unit test documentation to explain why (and a brief
"how") developers should use the Ztest API for new unit tests.
BUG=b:168032590
BRANCH=none
TEST=`TEST_LIST_HOST=base32 make runhosttests`
Signed-off-by: Paul Fagerburg <pfagerburg@google.com>
Change-Id: I26e60788c1468e44fed565dd31162759c7587ea6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2492527
Tested-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Commit-Queue: 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>
- Fix compilation error: sizeof() of an input array
was not calculated properly.
- Fix calling convention: use sensor pointer instead of
sensor number
- Use common formula to calculate sensor number.
BUG=none
BRANCH=none
TEST=compile, unittest, load on eve with online calibration added.
Change-Id: I06ff30eb5710cbe8f91c939b2ccc084c20a37847
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2486304
Reviewed-by: Yuval Peress <peress@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>
Icetower is an STM32H743 device, so this test does not compile.
BRANCH=none
BUG=b:170432597
TEST=On Icetower v0.1 connected via servo_micro:
./test/run_device_tests.py -b dartmonkey
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: Iaff85c24649ee50101441c9a75c57bd10b605c51
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2462159
Reviewed-by: Yicheng Li <yichengli@chromium.org>
Count an instance of ASSERTION_FAILURE as a test failure. There was a
bug where the rollback tests correctly hit the data access violation,
but then went into a boot loop due to hitting an ASSERTION_FAILURE. We
now check the all the logs for failures.
BRANCH=none
BUG=b:170147314
TEST=./test/run_device_tests.py -b dartmonkey -t rollback_region0
TEST=./test/run_device_tests.py -b dartmonkey -t rollback_region1
TEST=./test/run_device_tests.py -b bloonchipper
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: Iebe980af38383d6e71f46f799314e6275f047336
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2462544
Reviewed-by: Yicheng Li <yichengli@chromium.org>
console.h currently relies on many config options to selectively
define macros. It does not currently include config.h, which means
these config options are not guaranteed to be defined by this point.
We will need this for Zephyr as well.
There were a few configuration header files which implicitly relied on
the ording of including console.h to bring in stdint.h at some point.
We explicitly include what we use here to fix that.
BUG=b:167590251
BRANCH=none
TEST=build passes
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Change-Id: Ia005577a2579962ee8b14c61930f37fe28bc8f5c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2427088
Reviewed-by: Yuval Peress <peress@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
We will move to an API compatible with Zephyr's API. See the bug for
complete rationale and plan.
BUG=b:169151160
BRANCH=none
TEST=buildall
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Change-Id: Id611f663446abf00b24298a669f2ae47fef7f632
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2427507
Tested-by: Dawid Niedźwiecki <dn@semihalf.com>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>