summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* common: Move fifo logic out of motion_sense.cYuval Peress2019-08-2319-436/+512
| | | | | | | | | | | | | | | | | | | | This change is needed to allow better testing of the fifo behavior. Additionally, motion_sense_fifo.c will only be compiled if CONFIG_ACCEL_FIFO is defined. This behaviour requires a few small changes to several boards and baseboards to make sure that we only define CONFIG_ACCEL_FIFO when the MOTIONSENSE task is present (some times that may be only in one section RW or RO). BUG=b:137758297 BRANCH=None TEST=buildall and ran CTS on arcada Change-Id: I2f7e4e436ba9568a35b7a0b2c8d53a73f198ba73 Signed-off-by: Yuval Peress <peress@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1704163 Reviewed-by: Alexandru M Stan <amstan@chromium.org> Commit-Queue: Alexandru M Stan <amstan@chromium.org>
* atlas: remove dead BMI160 codeCaveh Jalali2019-08-221-8/+0
| | | | | | | | | | | | | | | atlas does not have a BMI160, so remove legacy references to it. BUG=b:129078548 BRANCH=none TEST=compiles. Change-Id: Iadc3b9b885b4436f9e800110cd05d7d1f41b01cf Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1759351 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* servo_updater: enable paths to work on test images as wellRuben Rodriguez Buchillon2019-08-221-4/+34
| | | | | | | | | | | | | | | | | | | | | | | This change adds some logic to find config and firmware files on test images as well, where they end up being located at /usr/local/share instead. BUG=b:120921028 BRANCH=None TEST=manual testing // on fizz-labstation test image sudo servo_updater --board servo_v4 observe servo v4 getting updated Note: Test images right now do not have usb_updater2 yet (WIP) hence the test is done using fizz-labstation, a board that does come with usb_updater2 Change-Id: I4838424ed17bad5c3e2911cb967193863cd0b231 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1760974 Reviewed-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Todd Broch <tbroch@chromium.org>
* ectool: Update usbpdmuxinfo to latest changesVijay Hiremath2019-08-221-11/+7
| | | | | | | | | | | | BUG=b:139140865 BRANCH=none TEST=Manually tested on intelrvp, "ectool usbpdmuxinfo" command shows correct SS mux info Change-Id: Id9dc616f62cb88600c3bcb631c08423661cc32c8 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1759279 Reviewed-by: Jett Rink <jettrink@chromium.org>
* usb_updater2: fix compiler warningRuben Rodriguez Buchillon2019-08-221-1/+1
| | | | | | | | | | | | | | | | | | The compiler complained about this, noting that error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]. This seems to fix it. BUG=b:120921028 BRANCH=None TEST=manual testing sudo emerge ec-devutils -j32 // warning disappears Change-Id: I4a4392ec7e6bc7af06dc54b6382e52a1f2c91252 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1761467 Reviewed-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* power: Replace weak attr with __overridableYilun Lin2019-08-2210-25/+29
| | | | | | | | | | | | | | | | | This CL annotates __overridable to the following functions: board_system_is_idle power_chipset_handle_host_sleep_event power_board_handle_host_sleep_event TEST=make buildall BUG=none BRANCH=none Change-Id: I0168b69c49fab5672238711d4f3a6a5517cdd8b3 Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1761759 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* task: Add task_enable_task() and task_disable_task()Yilun Lin2019-08-226-0/+77
| | | | | | | | | | | | | | | Provide API to disable/enable tasks. All the tasks are marked enabled after hook_task starts. We need a way to control the tasks when it shouldn't run in some states. BUG=b:136240895 TEST=Disable the tasks and see it won't be scheudled when task_wake(). BRANCH=None Change-Id: I2662f3619b22ed28387fe3c783001ba2a745620c Signed-off-by: Yilun Lin <yllin@google.com> Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1753562
* vortininja: Add vortininja in convertible listWisley Chen2019-08-221-3/+4
| | | | | | | | | | | | | | | | | Vortininja is convertible SKU, so add Vortininja SKU id in convertible list BUG=b:138177049 BRANCH=octopus TEST=make buildall -j Change-Id: Id1040797e11320c7d67be87136d34327ceab09f4 Signed-off-by: Wisley Chen <wisley.chen@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1763889 Reviewed-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Justin TerAvest <teravest@chromium.org> Reviewed-by: Marco Chen <marcochen@chromium.org> Tested-by: Devin Lu <Devin.Lu@quantatw.com> Tested-by: Justin TerAvest <teravest@chromium.org>
* cr50: fix conflict in vendor_cmd_cc enumAndrey Pronin2019-08-221-1/+1
| | | | | | | | | | | | | | | | | | | | After CL:1740075 and CL:1748846 we had a duplicate value for two different vendor commands in tpm_vendor_cmd.h: VENDOR_CC_ENDORSEMENT_SEED = 48 VENDOR_CC_U2F_MODE = 48 This CL fixes the issue. BRANCH=none BUG=b:139809333 TEST=none Change-Id: Ic593e138c9126eb2a7e97b2e12c2daa890787d8c Signed-off-by: Andrey Pronin <apronin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1763303 Reviewed-by: Mary Ruthven <mruthven@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Commit-Queue: Louis Collard <louiscollard@chromium.org>
* blooglet: remove kbbacklight support with non-kbbacklight SKU.Devin Lu2019-08-221-1/+2
| | | | | | | | | | | | BUG=b:138180187 BRANCH=octopus TEST=make sure ectool inventory doesn't show keyboard backlight support with non-kbbacklight SKU. Change-Id: Iac1c9b19e139641b88a0407189608dcc2bbfc360 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1760659 Reviewed-by: Justin TerAvest <teravest@chromium.org>
* flash_ec: use active_v4_deviceMary Ruthven2019-08-221-4/+31
| | | | | | | | | | | | | | | | | | | | Servo may be using ccd and servo micro. Update the flash_ec servo type to reflect which device actually has control of the DUT, so flash_ec can make the correct decisions about how to flash the device. Add the device prefix to all dut-control commands. If servo is using ccd and servo_micro, ccd controls will be prefixed with 'ccd_cr50.'. Add this prefix to all dut-control commands. BUG=b:35579416 BRANCH=none TEST=flash phaser ec ec using servo_v4_with_servo_micro_and_ccd_cr50, servo_v4_with_servo_micro, and servo_v4_with_ccd_cr50 Change-Id: I3d561ceb3c0ef0d95678c8346fb9922fd44378bf Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1757272 Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* util: UartUpdateTool retries Host/Dev sync up to three timesNamyoon Woo2019-08-221-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch increases the number of device sync attempts from two to three. It is to be tolerant on the first command failure because of USB DATA PID mismatch that could happen from USB reconnection. BUG=b:135617689 BRANCH=none TEST=Tested on Hatch and Kohaku, Octopus and Grunt. $ ./util/flash_ec --board hatch --image ${IMG} ... Performing a Host/Device synchronization check... Host/Device synchronization failed, error = 1. Writing [784] bytes in [4] packets ... INFO: Flashing done. INFO: Restoring servo settings... The first attempt runs good. Disconnect Suzy-Q cable, and reconnect it, and run it again: $ ./util/flash_ec --board hatch --image ${IMG} Before this patch, it used to fail: ... Performing a Host/Device synchronization check... Host/Device synchronization failed, error = 2. Host/Device synchronization failed, error = 1. ERROR: Failed to load monitor binary. INFO: Restoring servo settings... After this patch, it succeeds: ... Performing a Host/Device synchronization check... Host/Device synchronization failed, error = 2. Host/Device synchronization failed, error = 1. Writing [784] bytes in [4] packets ... INFO: Flashing done. INFO: Restoring servo settings... Change-Id: Id8e7041a5cb08075129148ddba5e8cf12f3aae54 Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1755182 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* doc: Update EC termsKeith Short2019-08-213-13/+47
| | | | | | | | | | | | | | Add more EC definitions. Correct the named anchors in the USB-C markdown. And a link from the main EC readme. BUG=none BRANCH=none TEST=none Change-Id: Ica7e7c270373589d850166539fb1b13b1ddbd7e0 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1758826 Reviewed-by: Edward Hill <ecgh@chromium.org>
* ec_commands: Make importing ec_commands.h easier for foreign projectsYu-Ping Wu2019-08-212-7/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are many projects (e.g., kernel, coreboot, flashrom, mosys) having their own copy of the ec_commands.h header file. To reduce the effort of synchronization, this file should be maintained so that it can be copied and included without modification whenever possible. Currently ec_commands.h includes compile_time_macros.h only if __KERNEL__ is not defined. However, there are many macros defined in the latter file (e.g., ARRAY_SIZE) that are already defined in other projects, leading to a redefinition error. To resolve this issue, ec_commands.h is modified in this CL so that compile_time_macros.h is only included when inside the Chromium EC repository, which is controlled by the macro CHROMIUM_EC. Option '-DCHROMIUM_EC' is also added to CPPFLAGS to avoid redefinition error of macro 'BUILD_ASSERT'. BUG=b:109900671,b:118654976,chromium:984623 BRANCH=none TEST=make buildall -j Cq-Depend:chromium:1760656 Change-Id: I38c77f0233ff5962b6f90f25ba96802d05e706d7 Signed-off-by: Yu-Ping Wu <yupingso@chromium.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1535086 Tested-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Queue: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* baseboard/intelrvp: Avoid including "usb_pd_tcpm.h" from baseboard.hYu-Ping Wu2019-08-212-1/+1
| | | | | | | | | | | | | | | | | | | | | board/tglrvpu_ite/board.h includes baseboard.h, which includes usb_pd_tcpm.h, which includes ec_commands.h, which includes board.h again, leading to compilation failure in CL:1535086. This patch breaks the circular dependency by removing "usb_pd_tcpm.h" inclusion in baseboard.h. To make baseboard/intelrvp/retimer.c compilable, "compile_time_macros.h" is also included since it is where BUILD_ASSERT is defined. BRANCH=none BUG=b:109900671,b:118654976 TEST=make buildall -j Change-Id: Ifdf6594f4eb3a2f732bc5979c0fbb0c79ee15ddf Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1760656 Commit-Queue: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* baseboard/kukui: remove incorrectly defined flagsTing Shen2019-08-211-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | The expected usage of baseboard.h is: <in board.h> #define VARIANT_KUKUI_SOMETHING ... #include "baseboard.h" If some VARIANT_KUKUI_* flag is also defined/removed in baseboard.h, it will overwrite board's config. As a result, baseboard.h should not define any of the VARIANT_* flags. Move VARIANT_KUKUI_DP_MUX_GPIO into comment for document propose only. BUG=b:139648560 TEST=verify both direction of dp works BRANCH=master Change-Id: I0b4f6afa07657ee4cd1495d302e026a99e770640 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1761752 Tested-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* akemi: enable motion sensor driversPaul Ma2019-08-213-39/+46
| | | | | | | | | | | | | | | | | Akemi use lis2dwl as lid sensor and lsm6ds3tr-c as base sensor. This patch enable both of them. lis2dwl works in forced mode. BUG=b:138978278 BRANCH=none TEST=boot Akemi board, use command 'accelinfo on' to see sensor output, make sure the data are correct. Cq-Depend: chromium:1741598 Change-Id: I6ff19e388c74d95b8287b9899a81d2a3f866939e Signed-off-by: Paul Ma <magf@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1741106 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Justin TerAvest <teravest@chromium.org>
* driver/rt946x: check wrong bit status when ADC conversionxiong.huang2019-08-211-1/+1
| | | | | | | | | | | | | | | | Base on official MT6370 datasheet, ADC_STAT status is 0 which indicates ADC conversion complete. BUG=b:139653474 BRANCH=master TEST=Add more log information, EC will check ADC_STAT status about 6 times in one loop. Change-Id: I50a10c25cfb35a1f41c569fabf360c5e29f44be2 Signed-off-by: Xiong Huang <xiong.huang@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1760661 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Philip Chen <philipchen@chromium.org>
* driver/tcpm/it83xx: Enable TCPC receive SOP'Ruibin Chang2019-08-216-27/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | Enable TCPC receive SOP' for communication with cable, when we are Vconn source role. BUG=None BRANCH=None TEST=test on board: ampton and reef_it8320 1.SRC connects to SNK via E-mark cable, sources Vconn successfully, and receives cable's ack of discover id request. 2.SRC connects to SNK via E-mark cable, but not source Vconn to cable, and receives nothing of discover id request (this isn't effect on request SNK flow). 3.console cmd pdcable 0 2019-07-30 11:43:40 > pdcable 0 2019-07-30 11:43:45 Cable Type: Passive 2019-07-30 11:43:45 Connector Type: Type C 2019-07-30 11:43:45 Cable Current: 5A 2019-07-30 11:43:45 USB Superspeed Signaling support: Gen 1 Change-Id: Icd2e6f8481bb7a4e0b922460d46b831f36112738 Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw> Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1728669 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* treeya: enable motion sensor drivers and fix ec feature flagPaul Ma2019-08-214-3/+151
| | | | | | | | | | | | | | | | | | | | | | | | | Treeya use two sets of base/lid sensors, one is BMI160/KX022 which is supported by baseboard, another is LSM6DS3TR/LIS2DWL. This patch will enable one of them according to sku_id. This patch also remove keyboard backlight feature from ec feature flags according to sku_id since both Treeya and Treeya360 do not support keyboard backlight. BUG=b:138744661, b:137945787, b:137849739 BRANCH=none TEST=boot treeya boards which mounted BMI160/KX022 or LSM6DS3TR/LIS2DWL, use 'accelinfo on' to enable sensor output, make sure that their x/y/x value are correct. Cq-Depend: chromium:1741598, chromium:1751302 Change-Id: I213a2073c2232ef0f2f70be788f859a264e09425 Signed-off-by: Paul Ma <magf@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1746006 Tested-by: Martin Roth <martinroth@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Martin Roth <martinroth@chromium.org> Commit-Queue: Martin Roth <martinroth@chromium.org>
* Grunt/Treeya: Add ANX3447 variant for TCPC 0.Paul Ma2019-08-2113-888/+207
| | | | | | | | | | | | | | | | | | | Merge common TCPC code into baseboard, and add choice of ANX3429 or ANX3447 for port 0 TCPC. Treeya uses ANX3447, all others use ANX3429. BUG=b:138744661 BRANCH=none TEST=build -j BOARD=treeya Change-Id: I66f84ae50be0b5fe80479dfdc699717427e4457c Signed-off-by: Paul Ma <magf@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1751302 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Martin Roth <martinroth@chromium.org> Tested-by: Martin Roth <martinroth@chromium.org> Commit-Queue: Martin Roth <martinroth@chromium.org>