summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* blooglet: override battery LEDs to indicate system suspendstabilize-12464.BDevin Lu2019-08-291-0/+23
| | | | | | | | | | | | | | | As meep, careena and snappy we have some SKUs are non-power LED design, blinking both two side battery white LEDs (1 sec on/1 sec off) to indicate system suspend with non-charging state. BUG=none BRANCH=octopus TEST=make sure both two side LEDs are blinking white after system suspend. Change-Id: I2839309acb91e365b98b5aac024bb7d7ebf287eb Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1771099 Reviewed-by: Marco Chen <marcochen@chromium.org>
* makefile: support PORT for flash_ecYilun Lin2019-08-292-1/+4
| | | | | | | | | | | | | | Add variable PORT to select the flashing port. TEST=make BOARD=kukui flash_ec PORT=9998, and flash success BUG=none BRANCH=none Change-Id: Ic9ba318ffee70ec1f7789f2dcccc6025263e5436 Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1770330 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* cr50: added references to FIPS / NIST standards to cryptographic functionsVadim Sukhomlinov2019-08-294-22/+109
| | | | | | | | | | | | | Clarified standards compliance status for cryptographic functions. BRANCH=cr50 BUG=b:138574542 TEST=code compiles, unit tests pass Change-Id: I75ce155b53d1ce049e5063d2aaa1464b75f7d678 Signed-off-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1769420 Reviewed-by: Andrey Pronin <apronin@chromium.org>
* usb: document ChromeOS power policy for USBJett Rink2019-08-281-0/+250
| | | | | | | | | | | | | BRANCH=none BUG=chromium:974302 TEST=builds Change-Id: I9b44b51876a0c46cb7b6aaf765afbf2c73c8d87c Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1755644 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: David Schneider <dnschneid@chromium.org> Reviewed-by: Benson Leung <bleung@google.com>
* util/ectool: Protect against out-of-memory conditionPatrick Georgi2019-08-281-1/+6
| | | | | | | | | | | | | | | Found by Coverity Scan BUG=none BRANCH=none TEST=none Change-Id: I9c29f915a732e8dc762b6ebcdffda6f433e983c2 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1768652 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Commit-Queue: Patrick Georgi <pgeorgi@chromium.org>
* common/i2c_master: don't bitshift negativelyPatrick Georgi2019-08-281-0/+4
| | | | | | | | | | | | | | | That's undefined behavior. Found by Coverity Scan. BUG=none BRANCH=none TEST=none Change-Id: I85927adeee91ccf06a9651f0279999391b2a5e69 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1768651 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Commit-Queue: Patrick Georgi <pgeorgi@chromium.org>
* mchp/espi: fix error condition handlingPatrick Georgi2019-08-281-7/+10
| | | | | | | | | | | | | | | | | As uint tidx can't be < 0 which can lead to overflow further down. (Found by Coverity Scan) BUG=none BRANCH=none TEST=none Change-Id: I63988be98a64292362cdc017beceac296ddde0dc Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1768650 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Commit-Queue: Patrick Georgi <pgeorgi@chromium.org>
* mchp/i2c: Fix boundary checkPatrick Georgi2019-08-281-8/+8
| | | | | | | | | | | | | | | | | | It's an off-by-one and the same test is implemented properly in the following function, so use that. (Found by Coverity Scan) BUG=none BRANCH=none TEST=none Change-Id: Idfe3ae0f1128e430a0d52c151e264de86579c67a Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1768649 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Commit-Queue: Patrick Georgi <pgeorgi@chromium.org>
* kindred: support keyboard backlight for kledben.chen2@quanta.corp-partner.google.com2019-08-282-0/+24
| | | | | | | | | | | | | | | | Enable keyboard backlight control by SKU ID of kled, which number is 1,2,3,4. BUG=b:138326244 BRANCH=master TEST=Use console command "kblight 0-100" to check keyboard backlight works. Change-Id: I96047b991850a54ce4a600a273d0bcdac0e8a053 Signed-off-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1731209 Reviewed-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* kodama: remove macro VARIANT_KUKUI_DP_MUX_GPIOxiong2019-08-281-1/+0
| | | | | | | | | | | | | | Current Kodama DP solution includes keep FUSB42 in one direction, so remove macro VARIANT_KUKUI_DP_MUX_GPIO. BUG=b:140079487 BRANCH=master TEST=DP display normally. Change-Id: Id6258bb662125f5c9c00a221040d514db5704719 Signed-off-by: Xiong Huang <xiong.huang@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1772777 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* dratini: initial EC imageDevin Lu2019-08-277-0/+1014
| | | | | | | | | | | | | | | | | | Copy hatch for dratini EC image. Below CLs will come after this CL merged. 1. Battery configration. 2. Implement leds. 3. Fix accel direction. BUG=none BRANCH=none TEST=make BOARD=dratini Change-Id: Ia0fa6de06c36550c8a296657df7bd04f38e4726d Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1770333 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Scott Collyer <scollyer@chromium.org>
* cr50: prepare to release 0.{3,4}.21Vadim Bendebury2019-08-272-2/+2
| | | | | | | | | | | BRANCH=cr50, cr50-mp BUG=none TEST=none Change-Id: Ib94b414de9531c9ea603ba377186c90b1c9fd91c Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1769492 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* flash_ec: Add support for dartmonkey and bloonchipperCraig Hesling2019-08-271-1/+3
| | | | | | | | | | | | | | | | | | | | | | | This adds the aforementioned aliases to the flash_ec script. These aliases already exist as boards, thanks to crrev.com/c/1715638. Aliases: dartmonkey --> nocturne_fp bloonchipper --> hatch_fp BRANCH=none BUG=b:140059271,b:136678758,b:137108509 TEST=sudo servod -b dragonclaw ./util/flash_ec --board=bloonchipper --image=build/bloonchipper/ec.bin TEST=sudo servod -b dragontalon ./util/flash_ec --board=dartmonkey --image=build/dartmonkey/ec.bin Change-Id: Id4476da4cab9e72092b529c1bfc52acb4edd44cd Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1769491 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* flash_ec: npcx_uut uses "--read-flash" flag to read EC binaryNamyoon Woo2019-08-261-14/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | flash_ec used to get a flash memory size from EC UART command "flashinfo", and pass it to uartudatetool with read command. If EC is in a bad status, then it failed to read EC binary, because flashinfo wasn't responded. Thanks to the patch crrev.com/c/1763888, flash_ec doesn't need to pass the flash memory size to uartupdatetool to read binary. Instead, it just passes "--read-flash". This CL also handles the comparison between the different sized binaries. BUG=b:139752920 BRANCH=null TEST=manually ran flash_ec on platforms. $ util/flash_ec --board ${BRD} --image ${IMG} --verify - Checked on hatch with ccd and servo_v2. - Checked on liara with ccd, servo_v2 and servo_micro. - Checked on fleex with ccd and servo_micro. - Checked on scarlet with ccd. Cq-Depend:chromium:1763888 Change-Id: I196420dc29ce95c6737dbc241ba92660557d2bc5 Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1766095 Reviewed-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Mary Ruthven <mruthven@chromium.org>
* servo_v4: Be a sink without PD comm when power charge-through detachedWai-Hong Tam2019-08-261-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL changes the behavior of no charge-through happens but a user explicitly sets servo v4 as a source. It is changed from "sink with PD comm" to "sink without PD comm". BRANCH=servo BUG=b:138585164, b:135035317 TEST=Manual as the following console interaction: (Plug the power cable back to servo v4) > cc src > pd 1 state Port C1 CC1, Ena - Role: SRC-UFP State: SRC_READY, Flags: 0x415e > cc snk > pd 1 state Port C1 CC1, Dis - Role: SNK-UFP State: SNK_DISCOVERY, Flags: 0x0608 > cc pdsnk > pd 1 state Port C1 CC1, Ena - Role: SNK-UFP State: SNK_READY, Flags: 0x414e > cc src > pd 1 state Port C1 CC1, Ena - Role: SRC-UFP State: SRC_READY, Flags: 0x415e (Unplug the power cable from servo v4) > pd 1 state Port C1 CC1, Dis - Role: SNK-UFP State: SNK_DISCOVERY, Flags: 0x0608 (Plug the power cable back to servo v4) > pd 1 state Port C1 CC1, Ena - Role: SRC-UFP State: SRC_READY, Flags: 0x415e > cc pdsnk > pd 1 state Port C1 CC1, Ena - Role: SNK-UFP State: SNK_READY, Flags: 0x414e (Unplug the power cable from servo v4) > pd 1 state Port C1 CC1, Ena - Role: SNK-UFP State: SNK_READY, Flags: 0x414e (Plug the power cable back to servo v4) > pd 1 state Port C1 CC1, Ena - Role: SNK-UFP State: SNK_READY, Flags: 0x414e > cc snk > pd 1 state Port C1 CC1, Dis - Role: SNK-UFP State: SNK_DISCOVERY, Flags: 0x0608 (Unplug the power cable from servo v4) > pd 1 state Port C1 CC1, Dis - Role: SNK-UFP State: SNK_DISCOVERY, Flags: 0x0608 (Plug the power cable back to servo v4) > pd 1 state Port C1 CC1, Dis - Role: SNK-UFP State: SNK_DISCOVERY, Flags: 0x0608 Change-Id: Ia4b6f858a4b0e22d81efbff02df4d02f3dc04bc9 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1724933 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* akemi: add power led and change battery led behaviorPaul Ma2019-08-262-15/+51
| | | | | | | | | | | | | | | | | Akemi uses standalone power led and battery led behavior need be changed to agree with project led behavior definition. BUG=b:139839740 BRANCH=none TEST=flash ec to akemi board, observe led behavior to make sure it agrees with spec definition. Change-Id: Idc667f6edc7e3e04f3c852444e78cd71d38e66c7 Signed-off-by: Paul Ma <magf@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1765109 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Justin TerAvest <teravest@chromium.org>
* mtk_isp: Add the service for fd driverJerry-ch Chen2019-08-264-0/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | v2: Fix review comments Task Ready Name Events Time (s) StkUsed 5 FD_SERVICE 00000000 0.056489 568/640 v1: Add new EC task to support FD driver service. The real fd_msg_handler is implemented in the private-8183 repo. Task Ready Name Events Time (s) StkUsed 6 FD_SERVICE 00000000 0.067458 504/640 BRANCH=none BUG=b:139269434 TEST=build kukui_scp pass & check FD_SERVICE is available Change-Id: I1d1734bf9d944fc79d6bd3b170ad69a17a32aa6a Signed-off-by: Jerry-ch Chen <jerry-ch.chen@mediatek.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1577498 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Commit-Queue: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org>
* mtk_isp: Add the service for isp P1 driverJungo Lin2019-08-264-1/+108
| | | | | | | | | | | | | BRANCH=none BUG=b:139269434 TEST=build kukui_scp pass & camera test pass Change-Id: I0d3927b0ee6cc9fa738a063939bcf3d03170493e Signed-off-by: Jungo Lin <Jungo.Lin@mediatek.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1549814 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Commit-Queue: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org>
* mtk_isp: Enlarge CONFIG_ROM_SIZE for ISP EC portingJungo Lin2019-08-261-1/+1
| | | | | | | | | | | | | | | Enlarge ROM size for Camera ISP EC porting BRANCH=None TEST=make BOARD=kukui_scp BUG=b:139269434 Change-Id: Ia706992e54d1c7eb54d811805f100d1e3739414c Signed-off-by: Jungo Lin<jungo.lin@mediatek.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1569091 Commit-Queue: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Yilun Lin <yllin@chromium.org>
* mtk_vcodec: Add the service for h264 encoderYunfei Dong2019-08-264-0/+117
| | | | | | | | | | | | | | | Fix the service to support h264 encoder. BRANCH=none BUG=b:123551776 TEST=build kukui_scp pass. Change-Id: I2bc424ff577ee12246ffa73e5d73cfde388fe5cf Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1535474 Commit-Queue: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Yilun Lin <yllin@chromium.org>
* mtk_vcodec: Add the service for h264 decoderYunfei Dong2019-08-266-1/+132
| | | | | | | | | | | | | | | Fix the service to support h264 decoder. BRANCH=none BUG=b:123551776 TEST=build kukui_scp pass. Change-Id: Iccd6389a40239a6d6791543eeb522cc3e5fc3991 Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1644186 Commit-Queue: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Yilun Lin <yllin@chromium.org>
* include: Move RESET_FLAG_* into ec_commands.h as EC_RESET_FLAG_*You-Cheng Syu2019-08-2655-241/+254
| | | | | | | | | | | | | | | | | | | | | | | RESET_FLAGS_* are used when setting/reading the field ec_reset_flags of struct ec_response_uptime_info, which is defined in ec_commands.h. So it might be better to put those macros there. To be consistent with the other macros in the file, add "EC_" prefixes to them. BUG=b:109900671,b:118654976 BRANCH=none TEST=make buildall -j Cq-Depend: chrome-internal:1054910, chrome-internal:1054911, chrome-internal:1045539 Change-Id: If72ec25f1b34d8d46b74479fb4cd09252102aafa Signed-off-by: You-Cheng Syu <youcheng@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1520574 Tested-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Ready: Yu-Ping Wu <yupingso@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Krane: Override the charger_profile_override based on battery SPECLeo Zhou2019-08-261-3/+71
| | | | | | | | | | | | | | | | Based on the battery specification modify the battery_info and restructure the charger_profile_override BUG=b:139012888 BRANCH=master TEST=Do a charge Test under extreme temperature Change-Id: I2f85abe98d4e7f73f77c6ff0091fb0cb144e2769 Signed-off-by: Leo zhou <zhoubo@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1746349 Tested-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* garg360: add covertible SKU IDDevin Lu2019-08-261-2/+5
| | | | | | | | | | | BUG=b:134854577 BRANCH=octopus TEST=make buildall -j Change-Id: I27785f240da97141dd62ee011cfe1e942f803c5b Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1768495 Reviewed-by: Marco Chen <marcochen@chromium.org>
* util: UartUpdateTool: support "--read-flash" flagCHLin2019-08-263-13/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch creates a table to map the chip/device ID to the size of the internal flash. When the "--read-flash" flag is given, uut will read the device ID and chip ID registers and use them to look up the table to get the flash size. Afterward, uut will read the flash content from flash according to the size and write it to the file specified by the "--file" flag. BUG=b:139752920 BRANCH=none TEST=manually ran the following commands on yorp and grunt. dut-control --port=9999 ec_ec3po_interp_connect:off dut-control --port=9999 ccd_keepalive_en:on dut-control --port=9999 ccd_ec_boot_mode_uut:on dut-control --port=9999 cold_reset:on dut-control --port=9999 cold_reset:off dut-control --port=9999 ccd_ec_boot_mode_uut:off ./build/${BOARD}/util/uartupdatetool --port=pts/15 --baudrate=115200 --read-flash --file=<file_name> diff ./build/yorp/ec.bin <file_name> Change-Id: If802c76e1690af2d84edea950d3755fa87347159 Signed-off-by: CHLin <CHLIN56@nuvoton.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1763888 Reviewed-by: Namyoon Woo <namyoon@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: CH Lin <chlin56@nuvoton.com> Tested-by: CH Lin <chlin56@nuvoton.com>
* Kindred: remove CONFIG_SYSTEM_UNLOCKED, enable CONFIG_USB_PD_COMM_LOCKEDben.chen2@quanta.corp-partner.google.com2019-08-261-3/+1
| | | | | | | | | | | | | | | | | Remove the CONFIG_SYSTEM_UNLOCKED option from some board configurations and enable CONFIG_USB_PD_COMM_LOCKED. The main affect of this will be to prevent PD communication in RO. BRANCH=master BUG=b:138992459 TEST=flash on kindred and RO did not negotiate (when WP was asserted) but RW did. Change-Id: I10fee6005da46a1432e61e1fa79e5b8360b642cc Signed-off-by: ben.chen2@quanta.corp-partner.google.com Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1751305 Reviewed-by: Philip Chen <philipchen@chromium.org> Tested-by: David Huang <David.Huang@quantatw.com>
* Revert "it83xx/intc:message id of pd packet repeat"Yilun Lin2019-08-253-60/+1
| | | | | | | | | | | | | | | | | This reverts commit bd19b03b128db664dfb5e6582810bd177b635408. With https://crrev.com/c/1757596/ merged, one doesn't need to handle repeated MessageID in TCPC. TEST=make buildall BUG=b:134556286 BRANCH=none Change-Id: I0f97e4e574b94ecbc23e5ee97ade7cc4da7f9020 Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1763895 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* tcpm: ignore repeated MessageIDYilun Lin2019-08-253-63/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ignore repeated MessageID in TCPM rather than TCPC[1]. https://crrev.com/c/1513033 implemented the logic in TCPC, but according to spec[2], TCPC should pass repeated messages to TCPM. This CL simply moves the logic from TCPC to TCPM. [1] USB PD spec rev3.0 6.7.1.2 MessageID Counter Receiver Usage [2] USB Port Controller spec rev2.0 3.3 USB-PD Message Delivery * MessageID is not checked in the TCPC when a non-GoodCRC message is received. Retried messages that are received are passed to the TCPM via I2C BUG=b:134556286, b:129337537 BRANCH=None TEST=make buildall -j; See Krane boots; See servo_v4 boots. Ensure repeat request message triggered artificially are dropped without any side-effects. Cq-Depend: chromium:1763895 Change-Id: I362056d973a71f0940b1287511ffe9180f566fac Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1757596 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* tglrvpu_ite: Enable fan and temperature sensorVijay Hiremath2019-08-244-19/+61
| | | | | | | | | | | BUG=b:139882986 BRANCH=none TEST=Manually tested on tglrvp. Fan works as per thermal profile. Change-Id: I04b9b5b6319c484932ccdd0703b4cd56d203b9d9 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1768931 Reviewed-by: Keith Short <keithshort@chromium.org>
* hatch: Remove unused board_set_vconn functionScott Collyer2019-08-241-11/+0
| | | | | | | | | | | | | | | | This function had been incorrectly added to baseboard.c, but was never required to be there. This CL removes this unsed function. BUG=b:139761723 BRANCH=None TEST='make BOARD=hatch' Change-Id: I9025fc6c7a49742186e520fdd09525e4ba256b47 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1764709 Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org>
* akemi, hatch, helios, kindred: Add EC_PROCHOT_IN_OD to gpio.incFurquan Shaikh2019-08-244-0/+4
| | | | | | | | | | | | | | | | This is useful when debugging PROCHOT# related issues. BUG=b:139034279 BRANCH=None TEST=Verified that gpioget shows the state of PROCHOT# on helios. Change-Id: I771743b181620189263246daa424b2bdf76b59b6 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1768925 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Scott Collyer <scollyer@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Commit-Queue: Tim Wawrzynczak <twawrzynczak@chromium.org>
* nvmem: reinitialize on catastrophic errorsVadim Bendebury2019-08-233-16/+88
| | | | | | | | | | | | | | | | | | If there is an NVMEM corruption which causes a reboot, persisting corruption would cause rolling reboot of the device. It is a harsh remedy, but at least the device remains functional. Added a log entry to explicitly report NVMEM reinitialization. BRANCH=cr50, cr50-mp BUG=b:139326267 TEST=verified by erasing a flash page assigned to NVMEM and rebooting the device. Observed two new flash log entries. Change-Id: Id292d7c66b81c03bbe3cd343ae75acb62d06582d Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1758805 Reviewed-by: Andrey Pronin <apronin@chromium.org>
* nvmem: recover from failure saving object spanning flash pagesVadim Bendebury2019-08-234-7/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | In case power was lost when saving an object spanning two pages, the initialization process does not return the second flash page into the pages pool, leaving NVMEM in an inconsistent state. Proper recovery should reinitialize the second page and return it into the pool of available flash pages. If a failure like this happens, to recover the initialization sequence will have to run one extra cycle, first one bringing the NVMEM state to the previously covered state of the last object in NVMEM corrupted, but fitting into a page. A unit test added to verify proper behavior in this situation. BRANCH=cr50, cr50-mp BUG=b:139326267 TEST='make run-nvmem -j' passes. Also added temporary code cause reset when saving the second part of an object spanning two flash pages. Observed the device properly recover from this failure. Change-Id: I76ebb6fc73ffc0b07bce34370302f3787914bfb2 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1766092 Reviewed-by: Andrey Pronin <apronin@chromium.org>
* util: uartupdatetool: do not strip trailing white spaceNamyoon Woo2019-08-231-8/+2
| | | | | | | | | | | | | | | | | | | uartupdatetool won't ignore trailing white space. It will erase flash segments for sure corresponding to that part. BUG=b:139884342 BRANCH=None TEST=manually ran flash_ec on hatch through ccd with two different binaries: one ${IMG1} has less trailing 0xFF space than the other ${IMG2}. flash_ec --board hatch --image ${IMG1} --verify flash_ec --board hatch --image ${IMG2} --verify Change-Id: Id25a9e05a2d2df76255dd688f829dee48dc819cf Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1766099 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* docs: Add link in navbar to file a bug or report security issueTom Hughes2019-08-231-0/+2
| | | | | | | | | | | | BRANCH=none BUG=none TEST=View in gitiles Change-Id: Ib90270011d687e1b1fe78332d1407230776403d1 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1758540 Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org>
* common: Add CONFIG_LIBCRYPTOC to enable third_party/cryptocYicheng Li2019-08-234-15/+18
| | | | | | | | | | | | | | | | | | | Boards that have CONFIG_LIBCRYPTOC will be able to use functions in third_party/cryptoc. Functions in third_party/cryptoc that are not called will not be linked because of linker optimization. This can be verified by checking the "smap" file in the build directory for a given target (e.g. build/nocturne_fp/RW/ec.RW.smap), which contains a list of all symbols in the target. Configure CONFIG_LIBCRYPTOC in nocturne_fp and hatch_fp. This config replaces CONFIG_ALWAYS_MEMSET. BRANCH=nocturne BUG=chromium:968809,chromium:989594,b:130238794 TEST=make -j buildall Change-Id: Ia40da9fb429f9d03623bc92e25f6670e5cdbd983 Signed-off-by: Yicheng Li <yichengli@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1764835 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* g: corrected division algorithm in DCRYPTO_bn_divVadim Sukhomlinov2019-08-231-0/+1
| | | | | | | | | | | | | | | Long division algorithm computes incorrect answer in rare cases causing valid RSA signatures to be rejected. BRANCH=cr50 BUG=b:137973895 TEST=tpm_test passes Change-Id: Ie8f39eed21443978734adbbf60b72d7701154c18 Signed-off-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1766088 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org>
* USBC PD: update usb-c docDenis Brockus2019-08-231-3/+6
| | | | | | | | | | | | | | | change new state machine file references to be up to date with the current code. BUG=none BRANCH=none TEST=none Change-Id: I4182b71bea107c4b9b852b93dcf59be5f4616f4d Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1757086 Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org>
* vortininja: Re-assign sku numberWisley Chen2019-08-231-4/+4
| | | | | | | | | | | | | | | | | Re-assign sku number for vortininja from (4,5,6,7) to (49,50,51,52) BUG=b:138177049 BRANCH=octopus TEST=make buildall -j Change-Id: I1a982a0fa9503bff0a59710bb36311b1799c0ee9 Signed-off-by: Wisley Chen <wisley.chen@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1768479 Reviewed-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Marco Chen <marcochen@chromium.org> Tested-by: Devin Lu <Devin.Lu@quantatw.com> Tested-by: Marco Chen <marcochen@chromium.org> Commit-Queue: Marco Chen <marcochen@chromium.org>
* akemi: remove unsupported functionsPaul Ma2019-08-233-114/+1
| | | | | | | | | | | | | | | | | Akemi do not support ALS sensor and MST, this patch will remove what we do not need. BUG=b:139839740 BRANCH=none TEST=flash ec code to akemi board, the board boot successfully. Change-Id: I2811c26d5ecfcddc6cf906e445dd3c11069c93bc Signed-off-by: Paul Ma <magf@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1763898 Reviewed-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Scott Collyer <scollyer@chromium.org>
* Bobba: Add new LGC batterySue Chen2019-08-232-0/+30
| | | | | | | | | | | | | | | new battery: LGC KT0030G023 BUG=b:135496272 BRANCH=octopus TEST=Make sure battery can cutoff by console "cutoff" or "ectool cutoff" and resume by plug in adapter. Change-Id: I4933e570e4966b40f17bd91c2d8bcfb69f247d0b Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1761760 Reviewed-by: Jett Rink <jettrink@chromium.org> Tested-by: David Huang <David.Huang@quantatw.com>
* Hatch: add board-specific hook to disable/enable KB backlightben.chen2@quanta.corp-partner.google.com2019-08-232-7/+16
| | | | | | | | | | | | | | | | This patch add enable/disable kb backlight during suspend/resume. BUG=b:138326244 BRANCH=master TEST=None Change-Id: I8c88d63c0d6a5a425e2210b9edca91da174b7429 Signed-off-by: ben.chen2@quanta.corp-partner.google.com Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1730373 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Philip Chen <philipchen@chromium.org> Tested-by: David Huang <David.Huang@quantatw.com>
* tglrvpu_ite: Adding VCONN supportAyushee2019-08-2313-21/+71
| | | | | | | | | | | | | | | Added GPIOs pin config to support VCONN on tglrvp. Also added power switch function to enable/disable VCONN according to the cc lines. BRANCH=None BUG=b:139763031 TEST=Able to get characteristics of an E-marked cable Change-Id: Ib09307aafe68ea955f256d3f35670579072c3040 Signed-off-by: Ayushee <ayushee.shah@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1762591 Reviewed-by: Keith Short <keithshort@chromium.org>
* cr50: Delete non-volatile counter APILouis Collard2019-08-236-292/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This counter was only used by the legacy U2F implementation, which is no longer required. This change deletes the code for the counter, but does not update the flash config to make use of the pages previously occupied by the counter. Since this code is already unused, and therefore already dropped from built firmware images, this change does not have any impact on image size. A follow up change can alter the flash config to reclaim and repurpose the 2KB per partition previously used by the counter. BRANCH=none BUG=b:138459918 TEST=make buildall -j Signed-off-by: Louis Collard <louiscollard@chromium.org> Change-Id: I18892e1eb0224b96caa531293403b0b02f28a32b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1748848 Reviewed-by: Andrey Pronin <apronin@chromium.org>
* cr50: Delete legacy U2F implementationLouis Collard2019-08-234-432/+1
| | | | | | | | | | | | | | This implementation has been replaced, and is no longer needed. Removing it frees 2376 bytes in flash. BRANCH=none BUG=b:138578925 TEST=test_that ... firmware_IntegratedU2F Signed-off-by: Louis Collard <louiscollard@chromium.org> Change-Id: Id5b2009bb1b56ae25de9173acb5d5e67eaf1caa3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1748847 Reviewed-by: Andrey Pronin <apronin@chromium.org>
* treeya: disable battery leds when discharging in S0/S3lu.zhang2019-08-231-3/+2
| | | | | | | | | | | | | | | | | Battery leds would be on when discharging in S0/S3. It's not needed, so change the led behavior. BRANCH=none BUG=b:138744661 TEST=1. Power on the device and plug out the adapter to see if leds are OK then. 2. Use powerd_dbus_suspend command to see leds are OK or not. Signed-off-by: lu.zhang <lu.zhang@bitland.corp-partner.google.com> Change-Id: I7df285c3c8f19612ec17ac64dcae6830aa1f68a2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1763900 Reviewed-by: Edward Hill <ecgh@chromium.org>
* strago: Enable LTO to save flash space.Yilun Lin2019-08-231-0/+1
| | | | | | | | | | | | | | strago's flash is going to running out. This CL enable LTO to save spaces. TEST=make buildall BUG=none BRANCH=none Change-Id: Id2742c959d1d249d3c90dda1568c5f1a1cc6d187 Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1757594 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* power: Make HC host_sleep_event independent from power common.Yilun Lin2019-08-234-72/+79
| | | | | | | | | | | | | | | | | | host_sleep_event provides the AP power state information to EC, and this is not necessary bound to CONFIG_POWER_COMMON. This CL moves the HC out of CONFIG_POWER_COMMON. TEST=1. make buildall -j 2. #define CONFIG_POWER_TRACK_HOST_SLEEP_STATE kukui_scp, and see it build successfully. BUG=b:136240895 BRANCH=none Cq-Depend: chromium:1760656 Change-Id: I5555c7ba8b97547ce9fc0ff8e2bff14ef3da8fe7 Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1753563 Reviewed-by: Jett Rink <jettrink@chromium.org>
* jacuzzi: enable usb-a port power on S3Ting Shen2019-08-231-0/+14
| | | | | | | | | | | | | BUG=b:135895590 TEST=verify that usb keyboard works without manually enable EN_USBA_5V BRANCH=master Change-Id: I008936f9082e3363ea296615abdd57b8a5fb0378 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1718630 Tested-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Alexandru M Stan <amstan@chromium.org> Reviewed-by: Alexandru M Stan <amstan@chromium.org>
* battery/mm8013: fix battery present statusYilun Lin2019-08-231-1/+1
| | | | | | | | | | | | | | | | | | | | Tighter battery present status by returning BP_NO. charger task will try to charge battery when battery present status is BP_NOT_SURE, and this would put PD and charger tasks in a weird state (and keep resetting) if the battery is actually not present. TEST=boot krane w/o battery and w/ PD charger, and see it doesn't reset for over 5 mins. BUG=b:139509751 BRANCH=none Change-Id: I3e3d818b80ffcfdb12fbd83daafa792d837a0fe0 Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1765108 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>