summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* tablet_mode: ensure that tablet mode is always initializedstabilize-quickfix-12607.83.Bstabilize-mtbf-12607.83.Bstabilize-12607.82.Bstabilize-12607.58.Bstabilize-12607.55.Bstabilize-12607.15.Bstabilize-12607.112.Brelease-R79-12607.BJett Rink2019-11-011-47/+54
| | | | | | | | | | | | | | | | | | | The board init should ensure that tablet_mode is always set so the rest of the subsystems can rely on this. We assume notebook mode if we don't have any input from the GSR 360 hall sensor. That matches the default up in AP firmware as well. BRANCH=none BUG=b:141494453,chromium:1010343 TEST=put arcada at 200 degrees and see that tablet mode it initialized correctly. Change-Id: I4e23d3ba149f9add84f9667a5af676803cf50da5 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1845779 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> (cherry picked from commit 9a133025d89a04a9f5afd6e57373f48564b40ed3) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1893315
* krane: set end of charge current threshold to 140mAstabilize-12607.6.Bstabilize-12607.5.Bstabilize-12607.3.BTing Shen2019-10-181-0/+14
| | | | | | | | | | | | | | | | According to the battery spec in b/142097561#comment15, EoC current should be 140mA. BUG=b:142097561 TEST=make BRANCH=kukui Change-Id: I913a1abecd2fc6ac28ba16513c3f0cc145afc38c Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1866212 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* kukui: remove battery SoC overwrite hackTing Shen2019-10-181-1/+3
| | | | | | | | | | | | | | | | | On-pack battery gauges should have better knowledge about battery life, so maybe we can trust SoC value reported from gauge and don't need this hack. BUG=b:142097561 TEST=confirm battery SoC won't jump to 97% unexpectedly BRANCH=kukui Change-Id: Ie3efdcbfa6d6525040e68b5abe0345a4b6c1fcde Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1866210 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* board/hammer: Fix masterball touchpad settingsNicolas Boichat2019-10-183-8/+9
| | | | | | | | | | | | | | | | | | | | | | | | | Fix the dimensions, and also the size, and make sure that updating the FW actually works (it seems like increasing the timeout to 2000ms is needed). BRANCH=kukui BUG=b:140596094 TEST=Flash masterball, no warning in console on start TEST= Host: make TOUCHPAD_FW=S8648A-15H0_FW01.bin BOARD=masterball -j USE=updater_utils emerge-kukui -av ec-utils cros deploy $IP ec-utils DUT: usb_updater2 -d 18d1:503c -r; sleep 0.5; \ usb_updater2 -d 18d1:503c -s; usb_updater2 -d 18d1:503c ec.bin usb_updater2 -d 18d1:503c -p S8648A-15H0_FW01.bin Change-Id: Ia473ac420b42f52ad1639f950a3f08ff5d32df09 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1847512 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org>
* krane: Modify the Charging and Fully charged LED colorLeo Zhou2019-10-181-5/+4
| | | | | | | | | | | | | | | Based on the Lenovo requirement,modify the Charging and Fully charged LED color as white BUG=b:137618886 BRANCH=kukui TEST=Do a charge test Change-Id: I75a3e9f24c98a67cb6b9dda8294c73926c20d4d7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1706248 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Tested-by: Leo Zhou <zhoubo@huaqin.corp-partner.google.com> Commit-Queue: Nicolas Boichat <drinkcat@chromium.org>
* panic.h: include required stdint.hCaveh Jalali2019-10-181-2/+3
| | | | | | | | | | | | | | | | | panic.h uses types from stdint.h, so it should really include it by default. also, order standard header files ahead of project specific header files. BRANCH=none BUG=b:142031466 TEST=make buildall passes Change-Id: I8ac6d42f1da412bd3ce20df2838b8e420ad25e52 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1855643 Tested-by: Caveh Jalali <caveh@google.com> Commit-Queue: Caveh Jalali <caveh@google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* helios: Modify EC fan control tableMichael5 Chen2019-10-181-12/+6
| | | | | | | | | | | | | | | | | | Modify EC fan control table by Thermal request. (#21) BUG=b:136565336 BRANCH=none TEST=Manual Verify fan behavior by thermal team. Remove DPTF and check fan speed with temperature. When temperature over 65 degree, the fan start working. When temperature over 85 degree, the fan full run. And check system shutdown when temperature over 90 degree. Change-Id: I0d4633e9ba93ba12f28d4d069a9ae2a7a82fcedd Signed-off-by: Michael5 Chen <michael5_chen@pegatroncorp.com> Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1833944
* dratini: correct accel orientationDevin Lu2019-10-181-7/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BUG=none BRANCH=none 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: -1040 4336 15408 Sensor 1: 760 -291 17127 Sensor 2: 0 0 0 When on the base bottom edge, report gravity along Y axis: localhost ~ # ectool motionsense Motion sensing active Sensor 0: -960 14112 -5952 Sensor 1: 453 16136 -373 Sensor 2: 0 0 0 When on its left side, report gravity along X axis: localhost ~ # ectool motionsense Motion sensing active Sensor 0: 16352 -432 64 Sensor 1: 16802 -338 192 Sensor 2: 0 0 0 and check the screen rotation was normally. Change-Id: Idbe7184d5c14eb31d7823f9e17648d9bf3df4443 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1866209 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* Cr50: In hash crypto test, return valid hash for empty input.Gurleen Grewal2019-10-172-2/+2
| | | | | | | | | | | | | | | | | | | | FIPS ACVP tests require that on an empty input, the result is the hash of the empty string. In the current implementation, an empty result is returned. Change the implementation so it matches FIPS expectations. Also added two test cases in hash crypto test to check the corner case of the empty input. BUG=None BRANCH=cr50 TEST=test/tpm_test/tpmtest.py Change-Id: I9f5c3f71e4b10cbce2ea204eeb52e57ef26ad0e7 Signed-off-by: Gurleen Grewal <gurleengrewal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1866444 Reviewed-by: Andrey Pronin <apronin@chromium.org> Tested-by: Gurleen Grewal <gurleengrewal@google.com>
* fpsensor: Improve unit test for enable/disable positive match secretYicheng Li2019-10-171-11/+27
| | | | | | | | | | | | | | | Initialize the local struct so that the test is not flaky. Also extract helper function and add more asserts to make the logic more explicit to readers. BUG=none BRANCH=nocturne TEST=make -j buildall Change-Id: I84ccd097b64c3ff304f4af228121b2cb989e6ab7 Signed-off-by: Yicheng Li <yichengli@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1865956 Reviewed-by: Craig Hesling <hesling@chromium.org>
* volteer: Configure power sequencing signalsAbe Levkoy2019-10-174-0/+26
| | | | | | | | | | | | | | Configure power sequencing interrupts and power-enable lines. Leave SLP_S4_L, which will be virtual, unimplemented for now. BUG=b:139553375 TEST=make buildall BRANCH=none Change-Id: Idf11290c84deb9ea2a71f5498a4a0db5363d2a3b Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1865481 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* fuzz: Add fuzz test for TCPMv2Edward Hill2019-10-174-3/+56
| | | | | | | | | | | | | | | | | | | | | Add usb_tcpm_v2_fuzz, a TCPMv2 version of usb_pd_fuzz. This gives some fuzz test coverage of: common/usbc/usb_pe_drp_sm.c common/usbc/usb_prl_sm.c common/usbc/usb_sm.c common/usbc/usb_tc_drp_acc_trysrc_sm.c common/usbc/usbc_task.c BRANCH=none BUG=none TEST=make run-usb_tcpm_v2_fuzz Change-Id: Ic129d9ebbe9bb37c2ca2674106e2a6652d08ee2a Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1865017 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* kukui: runtime usb mux config selectionTing Shen2019-10-173-3/+28
| | | | | | | | | | | | | | | | | The compile time IF_ENABLED(CONFIG_USB_MUX_XXX) does not work on kukui, change this to runtime selection. BUG=b:135079572 TEST=On Krane Rev5/Kodama, verify the mux switch to dp + usb mode (i2cxfer r 0 0x48 0x11 returns 0x03 or 0x13) BRANCH=kukui Change-Id: Ib44f0c383ed5f9156e3dd3bf6faa3daebb22e146 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1864493 Tested-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
* chip/it83xx: introduction of IT83202/BX versionDino Li2019-10-174-16/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Changing PLL and standby instruction didn't work on AX have been fixed on this version, so we can remove patches dedicated for AX. - Enable more chip config option. - Disable IT83XX_INTC_GROUP_21_22_SUPPORT option: Because IT8xxx2 series has its own interrupt group 21 and 22, so we will create another CL to support them. - System triggers a soft reset by default if IT83XX_ETWD_HW_RESET_SUPPORT option is enabled. BUG=b:134542199; b:133460224; b:142029177 BRANCH=none TEST=boots on BX version. console command reboot: reboot hard Hard-Rebooting! [Reset cause: power-on hard] reboot Rebooting! [Reset cause: soft] Change-Id: I06e57952cd758b4f344ada0f87729c961b1e747b Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1835884 Reviewed-by: Jett Rink <jettrink@chromium.org>
* pd: Extend READY_HOLD_OFF_US timer value for SRCScott Collyer2019-10-171-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | The READY_HOLD_OFF_US was set to 200 msec for both SNK and SRC connections. However, in the case of SRC, there can be a race condition with charge through hubs that initiate a power swap request and the SRC port sending the VDM discover idenity message. This CL makes the holdoff timer delay longer for SRC connections and prefixes READY_HOLD_OFF_US with SNK/SRC to differentiate the two timer values. BUG=b:140092163 BRANCH=None TEST=Tested with the AA-AM1N95W charge through hub. Verfied that this can be attached to Kohaku with external power already connected and successfully power role swap into source to charge the kohaku port. Tested 20-25 connections with no failures. Prior to this change the failure rate was 1 out of 3 attempts. Change-Id: I375415fec96baf44ecd4592033e8b44ed4616011 Signed-off-by: Scott Collyer <scollyer@google.com> Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1776844 Tested-by: Scott Collyer <scollyer@chromium.org> Tested-by: Jongpil Jung <jongpil19.jung@samsung.corp-partner.google.com>
* cr50: Fix building with CRYPTO_TEST=1Vadim Sukhomlinov2019-10-172-3/+2
| | | | | | | | | | | | | | | | | | | | 1. Recent change https://crrev/1730605 introduced syntax error which is only affecting build with CRYPTO_TEST=1. This patch fixes it. 2. -Wformat which was turned on for /platform/ec caught another issue with CPRINTF() not receiving right number of parameters. BUG=none BRANCH=cr50 TEST=make BOARD=cr50 CRYPTO_TEST=1 Change-Id: Id5e61f7633d6e93aff761771c22b888aebd87265 Signed-off-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1863813 Tested-by: Andrey Pronin <apronin@chromium.org> Commit-Queue: Andrey Pronin <apronin@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org>
* pd: Prevent trasmitting messages if rx messages are pendingScott Collyer2019-10-171-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | This CL adds a check in pd_transmit to prevent sending tx messages if there are pending rx messages to be processed. This fixes an issue where a power role swap request is received, but before the accept reply can be sent a VDM discover identity message is sent which confuses the other side of the connection. BUG=b:140092163 BRANCH=None TEST=Tested with the AA-AM1N95W charge through hub. Verfied that this can be attached to Kohaku with external power already connected and successfully power role swap into source to charge the kohaku port. Tested 20-25 connections with no failures. Prior to this change the failure rate was 1 out of 3 attempts. Change-Id: Iebe53e0fc52bf817b709d58ef3e0ee7b226b0aa9 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1799288 Reviewed-by: Jett Rink <jettrink@chromium.org> Tested-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org>
* fleex: Change adjust charge max sleep time to 10selthanhuang2019-10-161-0/+11
| | | | | | | | | | | | | | | Change CHARGE_MAX_SLEEP_USEC to 10 seconds. BUG=b:133375756 BRANCH=octopus TEST=Verify access battery once per 10 seconds by ec console. Change-Id: I273ec13381d131866c536b879f5a912a63a53ecb Signed-off-by: elthanhuang <elthan_huang@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1852864 Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org> Tested-by: Jett Rink <jettrink@chromium.org>
* charge: allow boards to customize max battery poll timeJett Rink2019-10-161-0/+3
| | | | | | | | | | | | | | Some designs need to keep their battery from going to sleep. Allow boards to specify their max delay for polling the battery. BUG=b:133375756 BRANCH=octopus TEST=Verify access battery once per 10 seconds by ec console. Change-Id: I7e70a45fe643af567434f8187344e0e0d18d733c Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1865253
* driver: bmi160: Move commit to end of loopYuval Peress2019-10-161-2/+7
| | | | | | | | | | | | | | | | | | This change moves the motion_sense_fifo_commit_data call outside of the do...while loop in irq_handler. This is needed to allow for 1 commit per last_interrupt_timestamp which makes the commit more efficient and accurate. BUG=b:137758297,b:140157960 TEST=Ran CTS on Kohaku (this doesn't fix all the issues but improves the state) BRANCH=None Change-Id: Ifd680fb8d6eb47383928e25858898ac828fe4e92 Signed-off-by: Yuval Peress <peress@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1856829 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* common: motion_sense: Refactor common code out of event processYuval Peress2019-10-161-50/+48
| | | | | | | | | | | | | Refactor motion_sense_process to include less repeated code. TEST=buildall and run on Kohaku BUG=None BRANCH=None Change-Id: I2e5af84f20cc7e50d3ddfb39d661238643aa99b3 Signed-off-by: Yuval Peress <peress@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1856828 Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
* cleanup: Refactor #ifdefs toenable use of IS_ENABLEAyushee2019-10-161-38/+42
| | | | | | | | | | | | | | This change fixes #ifdef gaurds around CONFIG_USB_PD_TCPC_LOW_POWER and CONFIG_USB_PE_SM by replacing it with IS_ENABLED condition BUG=b:141971044 BRANCH=None TEST=make buildall -j Change-Id: I889752a8c4cdd8e22c97ede99643945fe2db868a Signed-off-by: Ayushee <ayushee.shah@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1863823 Reviewed-by: Keith Short <keithshort@chromium.org>
* pd: Add PE FRS unit test for new stackDenis Brockus2019-10-1612-2/+551
| | | | | | | | | | | BUG=none BRANCH=none TEST=make buildall -j Change-Id: I55453ddf1d1da0fdee902a33e14357716fb12c4a Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1859826 Reviewed-by: Jett Rink <jettrink@chromium.org>
* pd: fix timer issue on pe_prs_snk_src_source_on_runDenis Brockus2019-10-161-9/+8
| | | | | | | | | | | | BUG=none BRANCH=none TEST=make buildall -j Change-Id: I12fbeb0a85d45bce8173c0c3831f663f5b618cc8 Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1862621 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org>
* ectool: Add new mkbpget command to get button/switch statusNicolas Boichat2019-10-161-0/+83
| | | | | | | | | | | | | | | | The base attached switch is not exposed to userspace via /dev/input, so provide an alternative way to read it on boot. BRANCH=none BUG=b:109839180 TEST=ectool mkbpget buttons/switches prints correct states Change-Id: Id0314c7f15149ec8d863e43bd4a05a0f7bed9f02 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1844655 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org>
* dratini: enable ec_feature kbbacklit by SKUIDDevin Lu2019-10-162-0/+25
| | | | | | | | | | | | | BUG=b:140610519 BRANCH=none TEST=make sure ectool inventory has shown keyboard backlight support with dratini/dragonair kbbacklit SKU. Change-Id: I8fceebc417d4b5b319dbc6126d8311346f09bdcf Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1859234 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* util/ectool: move `struct command` into `ectool.h`Harry Cutts2019-10-162-9/+16
| | | | | | | | | | | | | | | This allows it to be used by private host binaries (such as the one in https://crrev.com/i/1914158), which may wish to follow the same pattern as `ectool`. While we're at it, add some documentation comments. BRANCH=none BUG=chromium:1008568 TEST=Check `ectool` builds and runs. Change-Id: I94b02f9b734f65b1344a79d6ac8752c40ecf1f04 Signed-off-by: Harry Cutts <hcutts@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1861075 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* NPCX ESPI: fix some typosEdward Hill2019-10-162-8/+8
| | | | | | | | | | | | BUG=none BRANCH=none TEST=buildall Change-Id: I7f9089ce8028f12a94d8e73dd58a5bb36ebc614f Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1862090 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* usbc: make pe_init() staticEdward Hill2019-10-153-9/+2
| | | | | | | | | | | | | | pe_init() is called via pe_run(), so make it static. BRANCH=none BUG=none TEST=build Change-Id: I56928369e50a2022fc7e2aee2f68f09ebe7c06b6 Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1850191 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* usbc: rename exe_state to run_stateEdward Hill2019-10-159-12/+12
| | | | | | | | | | | | | | | | | Just a simple rename. run_state() seems more readable to me, and "run" is used in many of the related functions and comments. exe_state used to be called sm_run_state_machine before the great refactoring of CL:1733744. BRANCH=none BUG=none TEST=build Change-Id: I5fe9e5b98042d7a5b9b9e9bde48ebecbda420458 Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1848970 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* usbc: remove evt_timeout from struct type_cEdward Hill2019-10-156-74/+3
| | | | | | | | | | | | | | | | Simplify the pd_task loop timeout by making it a fixed 5 milliseconds. If there is nothing to do then it shouldn't take long to realize this. This allows removal of evt_timeout, tc_set_timeout, tc_get_timeout. BRANCH=none BUG=none TEST=usbc unit tests (make -j runhosttests) Change-Id: I067309b191e5118fbe9e89a92a650fa837fb75fa Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1857216 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* usbc: fix flaky usb_typec_ctvpd testEdward Hill2019-10-151-1/+5
| | | | | | | | | | | | | | | | | | | When testing "Host Port VBUS Removed" at the end of test_vpd_host_src_detection_vbus(), we go to TC_UNATTACHED_SNK but then quickly move to TC_ATTACH_WAIT_SNK. Reduce the task_wait_event() timeout in wait_for_state_change() to make checking this transition more reliable. BRANCH=none BUG=none TEST=usb_typec_ctvpd test still passes Change-Id: I11a927fabbcff4a7adc50f5495fab796129b04ab Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1857215 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* Trembyle: Add USB-A retimer GPIO definitionsEdward Hill2019-10-151-1/+4
| | | | | | | | | | | | | | Add enable and reset IO expander signal definitions for USB-A PS8811 retimers. BUG=b:138600008 BRANCH=none TEST=none Change-Id: I48731c143c08f450047a920c090c6abc6b30af4f Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1854373 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* icelake: Cleanup GPIO_PCH_DSW_PWROKKeith Short2019-10-153-10/+12
| | | | | | | | | | | | | | | | | | Change GPIO_EC_PCH_DSW_PWROK to GPIO_PCH_DSW_PWROK to match convention for EC to PCH signals used by other Intel processors (specifically cannonlake already used GPIO_PCH_DSW_PWROK). BUG=none BRANCH=none TEST=buildall -j Change-Id: I59fb8d3ee3867c70dde74c186ba3974490c3cd27 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1848252 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* cometlake: Cleanup GPIO_PCH_SYS_PWROKKeith Short2019-10-158-51/+58
| | | | | | | | | | | | | | | | | | | | Change GPIO_EC_PCH_SYS_PWROK to GPIO_PCH_SYS_PWROK on cometlake to conform with naming convention used on other Intel processors. Leave gpio.inc files unchanged and add a mapping from GPIO_EC_PCH_SYS_PWROK to GPIO_PCH_SYS_PWROK in the board files. BUG=none BRANCH=none TEST=make buildall -j TEST=boot kohaku Change-Id: I722cb06dd90ee5d7e426664508f54a5cbe19de4a Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1848251 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* cometlake/icelake: cleanup GPIO_PCH_RSMRST_LKeith Short2019-10-153-3/+2
| | | | | | | | | | | | | | | | | | | | | Replaced references of GPIO_EC_PCH_RSMRST_L with GPIO_PCH_RSMRST_L in to match convention used in common Intel power sequencing. Boards still use GPIO_EC_PCH_RSMRST_L in their gpio.inc files to match schematic net names. BUG=none BRANCH=none TEST=buildall -j TEST=boot kohaku (cometlake device) TEST=run "apshutdown" on kohaku Change-Id: Ic9fa13dbf2d4e6c8953b82a9dd20f48a6cf8d2c8 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1846690 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* power_button_x86: Make sure PWRBTN_STATE_INIT_ON base 100 millisecondsben.chen2@quanta.corp-partner.google.com2019-10-151-23/+22
| | | | | | | | | | | | | | | | Fix sub function state_machine PWRBTN_STATE_INIT_ON case, should be first check charge_prevent_power_on until POWER Button Time out. BUG=b:141260790 BRANCH=Master TEST=check PB task timing with power on timing be sure the same time. Change-Id: I15a599773afe94e0730755dd60674cb4c4ea27d6 Signed-off-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1847571 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* treeya: apply USB EQ setting to PS8751 USB muxLu Zhang2019-10-151-1/+12
| | | | | | | | | | | | | | | | | | | The default USB TYPE C connector facing receiver equalization setting is 0x90, compensate for channel loss up to 15.4dB It's high for some dongles. Apply lower USB EQ to 8.7dB BUG=b:140472120 BRANCH=none TEST=build and boot on, read back registers to verify > ectool i2cread 8 2 0x16 0xe7 0x40 Signed-off-by: Lu Zhang <lu.zhang@bitland.corp-partner.google.com> Change-Id: I1fce255d0dbe8c5a12cf8c8ff5b3c506e8d19475 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1830538 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Paul Ma <magf@bitland.corp-partner.google.com> Tested-by: Paul Ma <magf@bitland.corp-partner.google.com>
* kohaku: Change halt temperature to 90 CTim Wawrzynczak2019-10-151-1/+1
| | | | | | | | | | | BUG=b:142410208 BRANCH=none TEST=buildall Change-Id: I8eb8d2b8ef35572f50cc3dfd1a56b7503fadb1e1 Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1859828 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* Fix race condition in spiflashfw.Allen Webb2019-10-151-7/+10
| | | | | | | | | | | | BRANCH=None BUG=chromium:1011870 TEST=make -j buildall Change-Id: Ifa0241cf9ea02ecf989fc7257f37c24efb17c3a7 Signed-off-by: Allen Webb <allenwebb@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1860720 Reviewed-by: LaMont Jones <lamontjones@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* common: Comment typo correctionCraig Hesling2019-10-151-1/+1
| | | | | | | | | | | | | | Corrects the spelling of "functions". This is more text than the actual diff. BRANCH=none TEST=none BUG=none Change-Id: Id911bf020d8db9b1d6ad7bfb62d431c5114a64d8 Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1854659 Reviewed-by: Jett Rink <jettrink@chromium.org>
* usbc: use future time for disabling timerJett Rink2019-10-141-112/+93
| | | | | | | | | | | | | | | | If we use -1 instead of 0 for disabling timers, then we don't need to check for the 0 value when evaluating the timer. BRANCH=none BUG=none TEST=builds Change-Id: Ie1e68579728d23d645d1f17f31210fc275c38e36 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1837999 Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* test: don't rely on system time for testsJett Rink2019-10-142-7/+11
| | | | | | | | | | | | | | | | Instead of relying on the host's clock, we need to monotonically increase a timestamp. This gives tests predictability. BRANCH=none BUG=chromium:1013701 TEST=ran usb_prl over 100 times without failure Change-Id: Id4a1e9a8cbd9dd44509747916c9073444d71af5c Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1860474 Tested-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org>
* usbc: fix pe_src_discovery return issueJett Rink2019-10-141-3/+5
| | | | | | | | | | | | | | | | We were returning early within pe_src_discovery state and not giving other conditions a chance to evaluate and transition states. BRANCH=none BUG=none TEST=builds Change-Id: If438479b5a8bf2a703760f84a85c48bc7db72507 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1837998 Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org>
* usbc: go to hard reset after noResponseTimerJett Rink2019-10-141-3/+4
| | | | | | | | | | | | | | | | | We should transition to the hard reset state after the noResponseTimer expires without getting a single PD response from a port partner until we reach the hard reset count. BRANCH=none BUG=none TEST=builds Change-Id: Iaee53369dec863ed8220b9f4ffed5f252cf08c4d Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1837997 Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org>
* helios: Support GMR sensor for rev2 boardMichael5 Chen2019-10-143-1/+16
| | | | | | | | | | | | | BUG=b:141723737 BRANCH=Master TEST=Manual Check tablet mode behavior for board version 1 and 2. Change-Id: Iea992b726d9c5a8e4562362dbd24aec8460742c4 Signed-off-by: Michael5 Chen <michael5_chen@pegatroncorp.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1831933 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* helios: Detect PPC sn5s330 CC1/CC2 OVP and release OVP.Michael5 Chen2019-10-142-14/+58
| | | | | | | | | | | | | | | | If PPC have CC OVP protection, check VBUS_GOOD. If VBUS_GOOD is ok, release CC OVP. BUG=b:141587322 BRANCH=Master TEST=Manual Do ESD test to trigger CC1/CC2 OVP. Using EC console command PPC_DUMP to check ppc regiset is correct. Change-Id: I3b817cc1dcec4c14ed4e2098b7ad7582b938f613 Signed-off-by: Michael5 Chen <michael5_chen@pegatroncorp.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1826098 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* Kled: fix rotation matrices of lid sensorsben.chen2@quanta.corp-partner.google.com2019-10-141-7/+2
| | | | | | | | | | | | | | | | Has a set lid sensors place change.The rotation of lid matrices need to be fixed. BUG=b:142029194 BRANCH=Master TEST=Using ec console 'accelinfo on' verified lid angle now goes from 0 to 360 and swtiches to tablet mode after crossing 180 threshold. Change-Id: I0cc5ef07368366f9a645fa44fa29cceec5181539 Signed-off-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1839712 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Philip Chen <philipchen@chromium.org>
* common:test: Add comparators to test_util.hstabilize-12593.BYuval Peress2019-10-121-0/+4
| | | | | | | | | | | | | Add <, <=, >, >= tests to test_util.h BUG=None BRANCH=None TEST=buildall Change-Id: I5d8ddfc3eda59f0193707c77d52d97962ef1a325 Signed-off-by: Yuval Peress <peress@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1853694 Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
* chip/stm32: Fix bug that LPTIM_PERIOD_US became unsigned long.Yicheng Li2019-10-121-1/+7
| | | | | | | | | | | | | | | | | | Due to a refactoring of bit shifts (BIT macro), LPTIM_PERIOD_US changed from int to unsigned int, which in turn changed behavior of set_lptim_event. This causes a watchdog reset during a long suspend. In particular, this caused the stm32h7 FPMCU to reboot during long suspend and fingerprint unlock to not work. BUG=b:140538084 BRANCH=none TEST=verified that FPMCU no longer reboots during deep sleep, fingerprint unlock works after deep sleeping for a whole night. Change-Id: If2ed9cb94aad4216012e28ffec530bc4ce858093 Signed-off-by: Yicheng Li <yichengli@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1854785 Reviewed-by: Nicolas Norvez <norvez@chromium.org>