summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* power/cometlake-discrete: implement power sequencingstabilize-12748.B-masterPeter Marheine2019-12-104-95/+271
| | | | | | | | | | | | | | | | | | | | | A first go at the power sequencing needed for Puff. This abuses the Intel common power code a little bit because we don't actually have all the inputs it assumes, but that seems preferable to replacing it wholesale. The one limitation right now is inability to detect transitions on the rails that we only have analog monitoring on; either we need to design a way to monitor those, or decide that detecting dropouts on those rails is unimportant. BUG=b:143188569 TEST=still builds BRANCH=None Change-Id: Ia960f5dd2ccfb1ca2c7d4107ba4e3737adc8f69f Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1925787 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* TCPMv2: Fixed PR swap request from charge managerSam Hurst2019-12-105-6/+20
| | | | | | | | | | | | | | | | | | | 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>
* Define board_override_features_flags APIs as overridablednojiri2019-12-1023-98/+27
| | | | | | | | | | | | | | | | | | | | | | Currently board_override_features_flags0/1 are enabled by CONFIG_EC_FEATURE_BOARD_OVERRIDE. This patch defines the callbacks as overridable. It will allow us to remove CONFIG_EC_FEATURE_BOARD_OVERRIDE and the redundancy it incurs. Signed-off-by: dnojiri <dnojiri@chromium.org> BUG=none BRANCH=none TEST=buildall Change-Id: I0c2870b746879b272ada35b9615b611627a9f426 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1951810 Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org>
* puff: implement PP5000 port power controlPeter Marheine2019-12-106-9/+262
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The EC watches current limiting on the USB and HDMI ports to keep system load on the 5V rail within the limits of the regulator. The EC's goal is to ensure that any single future state change (connecting or disconnecting a port) doesn't push the 5V rail overcurrent. Verification is done via symbolic execution with Klee; ensuring that there exists no state where plugging something into a port with no further changes would put us over the power budget. Sample verification output: > KLEE: Using Z3 solver backend > > KLEE: done: total instructions = 4439 > KLEE: done: completed paths = 30 > KLEE: done: generated tests = 30 v2: convert ad-hoc state space exploration for verification to symbolic execution, allowing port control code to be reused for both. BUG=b:143190102 TEST=make buildall BRANCH=none Change-Id: If06e319c8d38bd11b29a7e69499d40357176a97e Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1911261 Reviewed-by: Andrew McRae <amcrae@chromium.org>
* tcpci: add tcpc_update routines for read/mod/writeDenis Brockus2019-12-102-56/+69
| | | | | | | | | | | | BUG=none BRANCH=none TEST=verify TCPCI is still functioning Change-Id: I325b025bf65d3b0cb6e15cf8dab8488138cc76d5 Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1953124 Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org>
* i2c: add generic read/modify/write operationsDenis Brockus2019-12-102-0/+137
| | | | | | | | | | | | | | | | i2c_update is used to set or clear a mask i2c_field_update is used to clear out a field before the set BUG=none BRANCH=none TEST=make buildall -j Change-Id: I7f8f93f4894fb9635092931a93961d328eacfeb9 Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1956437 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org>
* volteer: Delay assertion of SYS_PWROKKeith Short2019-12-091-0/+11
| | | | | | | | | | | | | | | | | | Delay the assertion of the PCH_SYS_PWROK signal by 50ms after assertion of PG_EC_ALL_SYS_PWRGD is detected. BUG=b:144478941, b:144867384 BRANCH=none TEST=make buildall TEST=instrument Ice Lake power module, confirm 50ms delay from PG_EC_ALL_SYS_PWRGD to PCH_SYS_PWROK Change-Id: Ib6a04cc5e1b27f3c53b5d8b00da7f0653225b0e4 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1956148 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* TCPMv2: Fixed the pointer problem with decoding SRC_CAP PDOSam Hurst2019-12-091-1/+1
| | | | | | | | | | | | | | | | | | A pointer to the PDO was getting incorrectly incremented, causing an unknown value to be sent to the pe_update_pdo_flags function. BUG=chromium:1027252 BRANCH=none TEST=make -j buildall Plugged in an apple dock and verified that the PDO was being correctly decoded. Change-Id: I06f11aad0043f63ef43f75beccf48241f739ae46 Signed-off-by: Sam Hurst <shurst@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1928794 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* ccd_howtos: add ccd faft setupMary Ruthven2019-12-091-2/+167
| | | | | | | | | | | BUG=none BRANCH=none TEST=none Change-Id: Ibe22f9131dc34ce4185379d8db166de42a3d1e24 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1873853 Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
* Morphius: create new boardEdward Hill2019-12-098-0/+424
| | | | | | | | | | | BUG=b:144029292 BRANCH=none TEST=build Change-Id: Id362ac64a43082e0ae2cb59c0259f040c693dd1f Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1954308 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* tcpci: add command to dump standard TCPCI registersKeith Short2019-12-092-0/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add new console command "tcpci_dump", enabled with a new config option CONFIG_CMD_TCPCI_DUMP. Command consumes about 2 KiB of flash space in both the RO and RW images. Typical output: > tcpci_dump 0 TCPC_REG_VENDOR_ID (0x00) = 0x0451 TCPC_REG_PRODUCT_ID (0x02) = 0x0422 TCPC_REG_BCD_DEV (0x04) = 0x0100 TCPC_REG_TC_REV (0x06) = 0x0011 TCPC_REG_PD_REV (0x08) = 0x2011 TCPC_REG_PD_INT_REV (0x0a) = 0x1010 TCPC_REG_ALERT (0x10) = 0x0000 TCPC_REG_ALERT_MASK (0x12) = 0x007d TCPC_REG_CONFIG_STD_OUTPUT (0x18) = 0x60 TCPC_REG_TCPC_CTRL (0x19) = 0x01 TCPC_REG_ROLE_CTRL (0x1a) = 0x1a TCPC_REG_FAULT_CTRL (0x1b) = 0x06 TCPC_REG_POWER_CTRL (0x1c) = 0x70 TCPC_REG_CC_STATUS (0x1d) = 0x1c TCPC_REG_POWER_STATUS (0x1e) = 0x0c TCPC_REG_FAULT_STATUS (0x1f) = 0x00 TCPC_REG_ALERT_EXT (0x21) = 0x00 TCPC_REG_DEV_CAP_1 (0x24) = 0x1e98 TCPC_REG_DEV_CAP_2 (0x26) = 0x00c5 TCPC_REG_STD_INPUT_CAP (0x28) = 0x00 TCPC_REG_STD_OUTPUT_CAP (0x29) = 0x00 TCPC_REG_CONFIG_EXT_1 (0x2a) = 0x00 TCPC_REG_MSG_HDR_INFO (0x2e) = 0x02 TCPC_REG_RX_DETECT (0x2f) = 0x21 TCPC_REG_RX_BYTE_CNT (0x30) = 0x00 TCPC_REG_RX_BUF_FRAME_TYPE (0x31) = 0x00 TCPC_REG_TRANSMIT (0x50) = 0x00 TCPC_REG_VBUS_VOLTAGE (0x70) = 0x0000 TCPC_REG_VBUS_SINK_DISCONNECT_THRESH (0x72) = 0x0000 TCPC_REG_VBUS_STOP_DISCHARGE_THRESH (0x74) = 0x0000 TCPC_REG_VBUS_VOLTAGE_ALARM_HI_CFG (0x76) = 0x0000 TCPC_REG_VBUS_VOLTAGE_ALARM_LO_CFG (0x78) = 0x0000 BUG=none BRANCH=none TEST=make buildall TEST=Enable CONFIG_CMD_TCPCI_DUMP and run "tcpci 0" on a Volteer board. Change-Id: I231e6ece621e88722027186ec380a0e424ccb2c7 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1955905 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* TCPMv2: Handle unexpected msgs received during Port DiscoverySam Hurst2019-12-091-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During a port discovery, unexpected messages such as SRC_CAPs and Not_Supported are handled by the Src.Attached or Snk.Attached state and the port discovery process is terminated. BUG=chromium:1027252 BRANCH=none TEST=make -j buildall Manual Test: Used an Anker charger to verify that Not Supported messages are handle correctly during a Port Discovery. Total Phase output: Source:DFP, Source_Cap Sink:UFP, GoodCRC Sink:UFP, Request Source:DFP, GoodCRC Source:DFP, Accept Sink:UFP, GoodCRC Source:DFP, PS_RDY Sink:UFP, GoodCRC Sink:UFP, VDM:DiscIdentity Source:DFP, GoodCRC Source:DFP, Not_Supported Sink:UFP, GoodCRC Change-Id: I48db149c0c59affe6aad49b8b1bcfb6dc3656142 Signed-off-by: Sam Hurst <shurst@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1928793 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* cr50: narrow the condition for custom TPM command codesNamyoon Woo2019-12-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | CR50 used to detects the custom TPM command code if the vendor specific bit field is set. This patch enfornces this condition by comparing the command code to 0x20000000 value. It is planned to support extended TPM commands, which are not yet standard, and those commands shall have 0x20000000|x as their command code. This patch will pass those commands to tpm2 library directly by calling ExecuteCommand(). BUG=b:140527213 BRANCH=cr50 TEST=ran gsctools with -m, -o, -i options. Cq-Depend: chromium:1892419 Change-Id: I43ce52bee96f6b6def8e4bf3a14f092b3235740a Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1891523 Reviewed-by: Andrey Pronin <apronin@chromium.org>
* jacuzzi: remove CONFIG_USB_PD_VBUS_MEASURE_NOT_PRESENTTing Shen2019-12-093-3/+0
| | | | | | | | | | | | | BUG=b:145376409 TEST=`ectool usbpdpower` BRANCH=none Change-Id: I95fea133997643408652e1884fe53215ef17e2a9 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1947508 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* fusb302: implement vbus measurement using tcpcTing Shen2019-12-095-0/+88
| | | | | | | | | | | | | | | | Jacuzzi measure vbus using fusb302, add a config option CONFIG_USB_PD_VBUS_MEASURE_TCPC and related implementation. BUG=b:145376409 TEST=`ectool usbpdpower` BRANCH=none Change-Id: I84019a75338121f777a344a4b92710e2117a6bda Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1947507 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* charger/rt946x: fix updating CHARGE_SUPPLIER_NONEEric Yilun Lin2019-12-091-1/+2
| | | | | | | | | | | | | | | If the supplier is CHARGE_SUPPLIER_NONE (-1), then we shouldn't update charge_manager information. TEST=plug PD charger, and unplug, and see manual_voltage and manual_current are not clobbered. BUG=b:145721867, b:141005922 BRANCH=kukui Change-Id: I05c17a8f600cc780288d732ac9ed28fd86090867 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1957610 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* baseboard/kukui: enable CONFIG_USB_PD_PREFER_MVYilun Lin2019-12-092-0/+22
| | | | | | | | | | | | | | TEST=Set prefer_mv to 5000 and ensure PD voltage could pick 9V/12V when desired voltage > 15W (5V/3A) and pick 5V when desired voltage <= 15W BUG=b:141170279 b:141903096 b:144073892 BRANCH=kukui Change-Id: Iaf26c5ae4d9679064f3ebd1e01f4834c17e1e552 Signed-off-by: Yilun Lin <yllin@chromium.org> Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1911266 Reviewed-by: Jett Rink <jettrink@chromium.org>
* usb_pd: request preferred voltage PDOYilun Lin2019-12-097-7/+279
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add CONFIG_USB_PD_PREFER_MV to support PD will request preferred voltage. One should define pd_pref_config, including preferd voltage, e.g. 5000, and PD_PREFER_BOOST or PD_PREFER_BUCK based on the board charging efficiency. Also, system PLT power is needed for evaluating board's desired power. The option will try to find a most fit PDO: 1. Pick the PDO which fulfills the system desired power. If a preferred voltage PDO doesn't provide enough power, it will be skipped. 2. If none of the PDO meets the preferred voltage, it will pick the closest voltage PDO based on prefer boost or prefer bulk. 3. The system desired power will be constantly updated when system in constant voltage stage (battery percent > 70%). This is done by monitoring the battery charging current. 4. If the system desired power changes, it will re-evaluate the PDO and send request if has a better fit. TEST=Set prefer_mv to 5000 and ensure PD voltage could pick 9V/12V when desired voltage > 15W (5V/3A) and pick 5V when desired voltage <= 15W BUG=b:141170279 b:141903096 b:144073892 BRANCH=kukui Change-Id: I94646cb1c74c10cf8db889f19c3df6339844042c Signed-off-by: Yilun Lin <yllin@chromium.org> Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1871499
* jinlon: correct accel orientationDevin Lu2019-12-091-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BUG=none BRANCH=hatch TEST=When device is laying on a table, lid angle at 180, both sensors report gravity along Z axis: localhost ~ # ectool motionsense Motion sensing active Sensor 0: -816 1904 16144 Sensor 1: 115 -136 16228 Sensor 2: 0 0 0 When on the base bottom edge, report gravity along Y axis: localhost ~ # ectool motionsense Motion sensing active Sensor 0: -3344 16160 -1616 Sensor 1: 5 16381 1029 Sensor 2: 0 0 0 When on its left side, report gravity along X axis: localhost ~ # ectool motionsense Motion sensing active Sensor 0: 16416 4272 -1280 Sensor 1: 16403 627 -1691 Sensor 2: 0 0 0 and check the screen rotation was normally. Change-Id: Ie9afa76954c6fd4e5996809255df203688953440 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1955104 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* volteer: update battery parameterScott Chao2019-12-091-5/+5
| | | | | | | | | | | | | Update battery parameter BUG=b:145786003 BRANCH=NONE TEST=make buildall Change-Id: Ie0941cb06d82902a3b32b9165644a62efdb05746 Signed-off-by: Scott Chao <scott_chao@wistron.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1955106 Reviewed-by: Keith Short <keithshort@chromium.org>
* board: Set min/max frequency attributesGwendal Grignou2019-12-099-2/+24
| | | | | | | | | | | | | | | On some boards, min_/max_frequency attributes were not set, esp. for kx022 acceleometers. BUG=b:145799480 BRANCH=octopus,coral TEST=compile Change-Id: I6d32926541505f02f183539ca3ad9f70c1ae7a6b Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1957374 Reviewed-by: Justin TerAvest <teravest@chromium.org> Tested-by: Justin TerAvest <teravest@chromium.org>
* tpmtest: added more corner case, make it work again with OpenSSL 1.1Vadim Sukhomlinov2019-12-072-34/+315
| | | | | | | | | | | | | | | | | | | | | | | | | | | The TPM test directory has bitrotted and does not compile any more, leave alone pass tests. This patch updates the tests to match changed EC codebase: test/tpm_test/Makefile - look for include files in more directories test/tpm_test/bn_test.c - 1. add support for OpenSSL 1.1 where BIGNUM structure became opaque and require special functions to access it. 2. added backward compatibility layer for OpenSSL 1.0.2 3. fixed issues with OpenSSL memory allocations 4. added support to print details of failure 5. added more cases for modulo inverse testing 6. added testing for bn_div to increase branch coverage BRANCH=cr50 BUG=none TEST=./test/tpm_test (../../build/tpm_test/bn_test) now passes Change-Id: Ida5fb07277909977f78ad1199e7a0f3677aabdc3 Signed-off-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1764711 Reviewed-by: Andrey Pronin <apronin@chromium.org> Commit-Queue: Andrey Pronin <apronin@chromium.org>
* gsctool: add 'force_ro' optionVadim Bendebury2019-12-072-2/+12
| | | | | | | | | | | | | | | | | | | | | | By design gsctool does not update the inactive RO unless the running RO version is lower than the version in the Cr50 image being transferred. With transition to the new RO version, keys and rollback map state, there is a need to enforce that both ROs on the device are updated. This patch adds a command line option which allows to update the inactive RO to the contents of the Cr50 image. BRANCH=none BUG=b:136284186 TEST=running 'gsctool -q cr50.bin' updates the inactive RO section. Change-Id: I79c21fc2cd41c40070352d8fbce0b71dd3ae2b1f Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1949547 Reviewed-by: Namyoon Woo <namyoon@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org>
* TCPMv2: Operating as a SNK, clear the End AMS flagSam Hurst2019-12-071-3/+17
| | | | | | | | | | | | | | | | | | While operating as a sink, the End AMS flag is cleared at the end of the Atomic Message Sequence. BUG=b:145812132 BRANCH=none TEST=make -j buildall manual tests: Using a kohaku and a Kensington dock, I verified that the END_AMS flag is cleard and PD communication does not stop. Change-Id: Ia8b40ab42916dc5b2a690a6fb7f519015912a6fa Signed-off-by: Sam Hurst <shurst@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1954256 Reviewed-by: Jett Rink <jettrink@chromium.org>
* cr50_rma_open: Disable UART timestampsEvan Green2019-12-071-1/+2
| | | | | | | | | | | | | | | | | The log timestamps are unexpected by the script, and cause issues. Send a dut-control command to disable UART timestamps. Also fix the regex in the board ID portion to accept a colon as well as a comma, whichever comes first. BUG=None TEST=Try cr50_rma_unlock.py BRANCH=None Change-Id: Ie9e54e65b86c52aef120fa3249453bfc090cf6f0 Signed-off-by: Evan Green <evgreen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1921703 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* TCPMv2: Don't use SinkTXOK/NG in middle of partner-initiated PD3.0 AMSSam Hurst2019-12-071-25/+35
| | | | | | | | | | | | | | | | | | Don't send ACCEPT message (to PR_SWAP AMS initiated by partner) after lowering Rp to SnkTXNG. BUG=chromium:1023064 BRANCH=none TEST=make -j buildall manual tests: Connected several docks with charger and verified PR_SWAP. Also works with the CM dock that triggered this bug. Change-Id: Iab5474174cf8313c24bae8a7869565005504af25 Signed-off-by: Sam Hurst <shurst@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1912161 Reviewed-by: Jett Rink <jettrink@chromium.org>
* volteer: Enable BC1.2 charge rampVijay Hiremath2019-12-074-19/+46
| | | | | | | | | | | | BUG=b:145683021 BRANCH=none TEST=Able to charge ramp BC1.2 devices on both the ports Change-Id: Iccabb3a1cf51c2cf22c6620e560d7ab74415a2cf Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1951426 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* volteer: Enable Burnisde Bridge retimerVijay Hiremath2019-12-077-10/+41
| | | | | | | | | | | | BUG=b:145560203 BRANCH=none TEST=BB retimer can communicate via I2C Change-Id: Ibc9b61d909ff1d07794e13927796e26aa1e53e03 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1947427 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* TCPMv2: Don't turn off VCONN during a PR_SWAPSam Hurst2019-12-061-1/+1
| | | | | | | | | | | | | | | | | A flag that tracks PR_SWAP was being prematurely cleared, causing VCONN to turn off. BUG=chromium:1031304 BRANCH=none TEST=make -j buildall manual tests: Using a kohaku and a Kensington dock, I verified that VCONN does not turn off during a PR_SWAP Change-Id: I2947bd50f299684d58f4cbdcd9c649f395c3d7d2 Signed-off-by: Sam Hurst <shurst@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1954311 Reviewed-by: Jett Rink <jettrink@chromium.org>
* build_assert: use _Static_assertJett Rink2019-12-061-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We have compiler support for _static_assert, so we should use it. Also allow for an option message in BUILD_ASSERT that will display as a part of the failure. Here is an example of a compile failure with the optional message ... CC RW/chip/npcx/gpio.o CC RW/chip/npcx/header.o In file included from include/common.h:13, from include/adc.h:11, from board/phaser/board.c:8: include/compile_time_macros.h:13:2: error: static assertion failed: "board/phaser/board.c:74: Size mismatch" _Static_assert(cond, file ":" #line ": " msg) ... BRANCH=none BUG=none TEST=verified by manually update BUILD_ASSERTS and viewing output. Change-Id: I6421084868ea81be8b3fa6ad0613730f4e4e149b Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1950820 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* usbc: use different task pause for each portDenis Brockus2019-12-061-4/+6
| | | | | | | | | | | | | | | Switching over to using an array with an entry per port so each port is individually paused and awaken. BUG=none BRANCH=none TEST=charger attach unattach repeated time should work Change-Id: I570f93876d2ea60a5a0707f2096969ceb269b31f Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1954307 Commit-Queue: Jett Rink <jettrink@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* hatch: refactor PD_MAX_VOLTAGE/PD_MAX_CURRENT/PD_MAX_POWER/PD_OPERATING_POWER/Josh Tsai2019-12-069-6/+45
| | | | | | | | | | | | | | 1) The four config is determined by board, move it into board.h. 2) Update the config variables above for stryke. BUG=b:145257655 BRANCH=hatch TEST=make buildall Change-Id: I1dd6a4f2a78b5196006821bc5d2686f68206c2e1 Signed-off-by: Josh Tsai <josh_tsai@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1950270 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* make: Add check for flash supportCraig Hesling2019-12-061-1/+4
| | | | | | | | | | | | | | | | | BRANCH=none BUG=none TEST=make buildall -j TEST=make BOARD=hatch flash # Should emit error that board isn't supported TEST=make BOARD=nucleo-f072rb flash # Should start openocd or error that command not found Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: Id13847d51392cc098ff7b289d120978202019aaf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1952198 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* make: Add help messages for flash variantsCraig Hesling2019-12-061-0/+4
| | | | | | | | | | | | BRANCH=none BUG=none TEST=make help Change-Id: Ic32777ec1c92fd79b803f8d20591ce47685af784 Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1952197 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* Revert "chell: Remove chell from master"Dmitry Torokhov2019-12-0610-0/+1527
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2de33140216be7f95c33990317483d3c65ae641b. Reason for revert: breaks chell postsubmit builder Original change's description: > chell: Remove chell from master > > chell is out of space and we've removed a lot functions but it's still > full. Now it's time to delete it. "Cara mia addio..." > > BUG=none > BRANCH=None > TEST=`make -j buildall` > > Change-Id: I064d55356012000e51654a1aa247226b33a8f0ff > Signed-off-by: Aseda Aboagye <aaboagye@google.com> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1953761 > Tested-by: Aseda Aboagye <aaboagye@chromium.org> > Auto-Submit: Aseda Aboagye <aaboagye@chromium.org> > Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> > Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Bug: none Change-Id: I7ecd836b6214a42d51c448650891c3a8e003a2c6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1955163 Reviewed-by: Dmitry Torokhov <dtor@chromium.org> Commit-Queue: Dmitry Torokhov <dtor@chromium.org> Tested-by: Dmitry Torokhov <dtor@chromium.org>
* Volteer: Disable TCPC Low power modeEric Herrmann2019-12-061-1/+2
| | | | | | | | | | | | | | | | The TCPC low power mode was breaking the type-C sink detection. Disabling for now so this issue doesn't effect other bringup efforts. BUG=b:145250123 BRANCH=none TEST=make buildall TEST=check that power is supplied to SNKs connected to C0 Change-Id: I5ef062761969d37c52b1f49a69014d8eecdb44da Signed-off-by: Eric Herrmann <eherrmann@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1951416 Reviewed-by: Keith Short <keithshort@chromium.org> Tested-by: Keith Short <keithshort@chromium.org>
* docs: update to vboot2-style vb2ex_ec_vboot_doneJoel Kitching2019-12-061-1/+1
| | | | | | | | | | | | | | BUG=b:124141368, chromium:1016688 TEST=none BRANCH=none Change-Id: I638acd4e9c32176e0ae39537fad8359404dd7a79 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1918996 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* ec: remove entering_mode host commandJoel Kitching2019-12-064-31/+3
| | | | | | | | | | | | | | | | | After this host command is called, the value is stored in g_vboot_mode and never accessed again. BUG=b:124141368, chromium:1014379 TEST=make buildall -j BRANCH=none Change-Id: I7923658139d15394c1c3c07baca7168e34c111e9 Signed-off-by: Joel Kitching <kitching@google.com> Cq-Depend: chromium:1830239, chromium:1864533 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1865050 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* lick: Initial EC imagestabilize-quickfix-12739.94.B-masterstabilize-quickfix-12739.71.B-release-R80-12739.B-masterstabilize-excelsior-12739.67.B-release-R80-12739.B-masterstabilize-excelsior-12739.67.Bstabilize-12739.111.B-masterstabilize-12739.106.B-masterstabilize-12739.105.B-masterrelease-R80-12739.B-masterHash.Hung2019-12-067-0/+856
| | | | | | | | | | | | | | | | | | | The starting point for Lick EC image. Remove unuse battery(PANASONIC). Set project default sku 255 to non-convertible. Modify Sunwoda start_charging_max_c from 60 to 50. BUG=b:145181137 TEST=make BRANCH=master BOARD=lick Change-Id: Id9a8d488c648b75528b8dfcd135a457a63c8d0ff Signed-off-by: Hash.Hung <hash1.hung@lcfc.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1942367 Reviewed-by: Henry Sun <henrysun@google.com> Commit-Queue: Henry Sun <henrysun@google.com> Tested-by: Henry Sun <henrysun@google.com>
* kukui: enlarge stack for hook_taskEric Yilun Lin2019-12-061-1/+1
| | | | | | | | | | | | | | We are seeing a stack overflow from hook_task. Enlarge it to prevent from crashing. TEST=not seeing a EC crash BUG=none BRANCH=kukui Change-Id: I1c574ecd577528dda57c2771bd4e67b3aa557b75 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1954833 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* volteer: Keep RSMRST# pin low at initVijay Hiremath2019-12-061-1/+1
| | | | | | | | | | | | | | Keeping the RSMRST# pin is low at init based on the TGL PDG power sequence Timing Diagram. BUG=b:145767544 BRANCH=none TEST=Verified on scope, RSMRST# pin is low at init Change-Id: Ia5d5c76ce3f173d1c283da706dd1113ce1dad550 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1954875 Reviewed-by: Keith Short <keithshort@chromium.org>
* volteer: disable PD 3.0 stackKeith Short2019-12-062-0/+39
| | | | | | | | | | | | | The PD 3.0 stack isn't reliably charging the battery. BUG=b:145622441 BRANCH=none TEST=make buildall TEST=verify PD negotiation with battery connected and battery charging Change-Id: Idccf6a4f325e94fdbf2df310b539a0b75125be92 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1949148
* ppc: Use hard reset to recover from CC overvoltageEdward Hill2019-12-063-66/+39
| | | | | | | | | | | | | | | When sn5s330 PPC detects CC overvoltage, recover via hard reset and don't enable PP2 sink FET directly. Also clean up the interrupt unmasking in sn5s330_init(). BUG=b:144892533 BRANCH=grunt TEST=Do ESD test to trigger CC1/CC2 OVP, device recovers to sink Change-Id: I662bf164b55508be4d5cc1b3ad639c9613bd1935 Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1949264 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* usbc: Move PPC overcurrent functions to usb_common.cEdward Hill2019-12-064-108/+67
| | | | | | | | | | | | | Share single copy of PPC overcurrent functions between TCPMv1 and TCPMv2. BUG=none BRANCH=none TEST=build Change-Id: I70e25e8580f6bbfebe6269552cd186f3bb981ede Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1954305 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* chip/host: Avoid concurrent recipes of libcryptoc.aYicheng Li2019-12-054-28/+4
| | | | | | | | | | | | | | | | | | | | CONFIG_DCRYPTO compiles and links thirdparty/libcryptoc for cr50. CONFIG_LIBCRYPTOC does similar things for other boards that configures it, including host. This resulted in cr50_fuzz having concurrent recipes for libcryptoc, as it has both configs. This change separates CONFIG_DCRYPTO from the responsibility of building and linking libcryptoc. Libcryptoc is now solely handles by CONFIG_LIBCRYPTOC. BRANCH=none BUG=b:144811298 TEST=make -j buildall > /dev/null Observed no more "warning: overriding recipe for target 'build/host/cr50_fuzz/cryptoc/libcryptoc.a' " Change-Id: I2186cbead773629456da254df5f82b96e9646fc2 Signed-off-by: Yicheng Li <yichengli@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1949554 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* docs/fingerprint: Fix diagrams in fingerprint design docTom Hughes2019-12-054-3/+9
| | | | | | | | | | | | | | | | | The doc links are not accessible publicly, so add PNG versions of the images using Drive's export functionality (i.e., append "export/png" to the end of the link). The original doc links are kept as comments so we know where they came from if we need to make changes. BRANCH=none BUG=none TEST=view in gitiles Change-Id: Ic6cf514032cfa9205c7c763716bf489597f2e08d Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1954312 Reviewed-by: Craig Hesling <hesling@chromium.org> Commit-Queue: Craig Hesling <hesling@chromium.org>
* chell: Remove chell from masterAseda Aboagye2019-12-0510-1527/+0
| | | | | | | | | | | | | | | | | chell is out of space and we've removed a lot functions but it's still full. Now it's time to delete it. "Cara mia addio..." BUG=none BRANCH=None TEST=`make -j buildall` Change-Id: I064d55356012000e51654a1aa247226b33a8f0ff Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1953761 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* tcpci: POWER_CTRL auto discharge disconnect initDenis Brockus2019-12-056-59/+80
| | | | | | | | | | | | | | | | | Change TCPCI to use HOOK_USB_PD_CONNECT/DISCONNECT to set/clear TCPC_REG_POWER_CTRL_AUTO_DISCHARGE_DISCONNECT according to the TCPCI spec. Change the definition of HOOK_USB_PD_CONNECT to occur after CC and VBus are stable. BUG=b:144126745,chromium:951683 BRANCH=none TEST=Charger attach/pull with AP not running Change-Id: I625efbba80f190322e3e92de6318b710b3ce7ade Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1940777
* docs/fingerprint: Add note about generating keysCraig Hesling2019-12-051-0/+7
| | | | | | | | | | | BRANCH=none BUG=none TEST=view in gitile Change-Id: I7aee42a1eb6f526836c6ef387bf05e1342d2b65f Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1952287 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* cleanup: format help text to ease readingJett Rink2019-12-051-3/+5
| | | | | | | | | | | BRANCH=none BUG=none TEST=verify help text on command line Change-Id: Iec19641eb0a61f1f0de1afe4b59b587b8f0d7410 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1945820 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>