summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* stm32uart: add delay after readingstabilize-quickfix-13597.30.B-masterstabilize-13597.97.B-masterstabilize-13597.95.B-masterstabilize-13597.94.B-masterstabilize-13597.90.B-masterstabilize-13597.85.B-masterstabilize-13597.84.B-masterstabilize-13597.71.B-masterstabilize-13597.70.B-masterstabilize-13597.69.B-masterstabilize-13597.68.B-masterstabilize-13597.67.B-masterstabilize-13597.66.B-masterstabilize-13597.105.B-masterstabilize-13597.103.B-masterrelease-R88-13597.B-masterRuben Rodriguez Buchillon2020-12-111-0/+3
| | | | | | | | | | | | | | | | | | | This implementation of the uart reading code lacks the fix inside hdctools that adds a delay here. Amend the code. BUG=chromium:1152838 BRANCH=None TEST=sudo servo_updater --board servo_micro TEST=sudo servo_updater --board sweetberry TEST=sudo servo_updater --board servo_micro --force Change-Id: I28f62f4553c726f1e63c7404508a5e59ce098990 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2580853 Reviewed-by: Garry Wang <xianuowang@chromium.org> Reviewed-by: Otabek Kasimov <otabek@google.com> (cherry picked from commit 315bc0f14ddab736e06d26a9c2f3cb2828910658) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2585856
* Delbin: Add delbin_npcx796fc to support npcx796fcZhuohao Lee2020-12-113-0/+15
| | | | | | | | | | | | | | | | | | | | BUG=b:174106425 BRANCH=firmware-volteer-13521.B TEST=make BOARD=delbin make BOARD=delbin_npcx796fc Manually merged to resolve conflict. Change-Id: I516994793db07f544ac64065aa05e7adacf6a39d Signed-off-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2567067 Reviewed-by: YH Lin <yueherngl@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> (cherry picked from commit 7e0d430378247d7960699d5c91dc47def536c2f6) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2585854 Commit-Queue: YH Lin <yueherngl@chromium.org> Tested-by: YH Lin <yueherngl@chromium.org>
* servo_updater: make more robust on resetsRuben Rodriguez Buchillon2020-12-112-48/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | long-term, we need to pull this into hdctools, rather than reimplement everything twice. Short term, this is a fine solution. It essentially makes sure that 1. we only keep one pty/stm32uart/stm32usb object around for communication 2. we always reset it properly when it could need a reset e.g. when the stm32 is rebooting, or a new firmware was flashed 3. it expands the timeout for the chip to come back to 2s the tiny_servod will eventually also land in hdctools, though for now it just ensures that we can reset the pyusb communication without larger issues and a larger refactor. BUG=chromium:1152838 BRANCH=None // Timeout before change, runs after change TEST=sudo servo_updater --board servo_micro // Timeout before change, runs after change TEST=sudo servo_updater --board sweetberry // Timeout before change, runs after change TEST=sudo servo_updater --board servo_micro --force // to show the serialname support. This is a fake serial, and it gets stuck waiting TEST=sudo servo_updater -s MICRO-S-2009020022 --board servo_micro // to show the serialname support. This is a real serial and it proceeds TEST=sudo servo_updater -s MICRO-S-2009020022 --board servo_micro Change-Id: I747ca69881c13c1aadd8e90a35badecbf4e6a09e Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2580854 Reviewed-by: Otabek Kasimov <otabek@google.com> Reviewed-by: Garry Wang <xianuowang@chromium.org> (cherry picked from commit c1ff0aed409b5ddf03538448e2e4c773b97986f4) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2585855
* eldrid: add npcx7m7fc support and backward support npcx7m6fc.Scott Chao2020-12-083-0/+13
| | | | | | | | | | | | | | | BUG=b:173754312 BRANCH=firmware-volteer-13521.B-master TEST=make buildall Signed-off-by: Scott Chao <scott_chao@wistron.corp-partner.google.com> Change-Id: I7ce77a6813a977612b5c804cb335add419ac80b1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2550117 Reviewed-by: Keith Short <keithshort@chromium.org> (cherry picked from commit dcdd0522d12ec52790f73963d6845b5da2b49308) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2576455 Commit-Queue: YH Lin <yueherngl@chromium.org> Tested-by: YH Lin <yueherngl@chromium.org>
* fw_update: fix python3 incompatibilityRuben Rodriguez Buchillon2020-12-031-1/+1
| | | | | | | | | | | | | | | | | In py3 bytearrays are real, so we need to use 'encode' to make sure the right command is being sent BRANCH=None BUG=chromium:1152838 TEST=None Change-Id: I28e6390d99563731f07e42a161065469aa009b11 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2548685 Reviewed-by: Dossym Nurmukhanov <dossym@chromium.org> (cherry picked from commit 6e0750fda26606378b1c6e3c4ca0457fa93b5a5b) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2569998 Reviewed-by: Garry Wang <xianuowang@chromium.org>
* boten: add motion sensor interrupt config and matricesjerry2.huang2020-11-132-3/+18
| | | | | | | | | | | | | | | Add config for boten motion sensor's interrupt and matrices for rotate BUG=b:172290264 BRANCH=none TEST=buildall, flash ec to dut and boot to check the ectool command motionsense work normally. Signed-off-by: jerry2.huang <jerry2.huang@lcfc.corp-partner.google.com> Change-Id: I89e3f5d1c5e460ed26126c5d0489afde7c7843f6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2515430 Reviewed-by: Henry Sun <henrysun@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
* dirinboz: enable keyboard factory scanZick Wei2020-11-132-0/+24
| | | | | | | | | | | | | | This patch add for factory keyboard connector test. BUG=none BRANCH=zork TEST=short keyboard pins and make sure "ectool kbfactorytest" works. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: Ia05e19d43205e3dae01898ef8a46f2d6266014bf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2525251 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* common: motion_sense: Add spoofing activityChing-Kang Yen2020-11-136-34/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | make spoof command able to spoof activity state: ectool motionsense spoof -- NUM activity ACT [EN] [0/1] This commit also remove unused parameter |sensor_num| from list_activities, set_activity, get_activity in ectool. BRANCH=None BUG=b:123434029 TEST=buildall TEST=ectool motionsense spoof 4 activity 4 1 0 ectool motionsense spoof 4 activity 4 ectool motionsense get_activity 4 ectool motionsense spoof 4 activity 4 1 1 ectool motionsense get_activity 4 ectool motionsense spoof 4 activity 4 0 ectool motionsense get_activity 4 ectool motionsense spoof 4 activity 4 1 ectool motionsense get_activity 4 Signed-off-by: Ching-Kang Yen <chingkang@chromium.org> Change-Id: I819c156ae7fe50c5cf6216d0f44012d192fb528e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2477393 Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
* dooly: update accel sensor matrixZick Wei2020-11-131-1/+7
| | | | | | | | | | | | | | | | This patch update accel sensor matrix for dooly. BUG=b:169636434 BRANCH=puff TEST=verify "ectool motionsense" in VT2, sensor value as intended. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: If957f7387b3c830b1f4a71e9490f677761ebd336 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2534233 Tested-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Reviewed-by: Andrew McRae <amcrae@chromium.org> Commit-Queue: Andrew McRae <amcrae@chromium.org>
* zephyr: forward cros_crc8 to zephyrs crc8 implJett Rink2020-11-137-0/+86
| | | | | | | | | | | | | | | Shim in support for crc8 used in CBI, I2C, and other applications within platform/ec BRANCH=none BUG=b:168032589 TEST=add unit test for platform/ec and zephyr based CRC8 approaches and verify they both pass. Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: I9b6112cb83dab81a44a1ac020d4efb1b7bb1df5f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2532692 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* crc8: rename crc8 to cros_crc8 to to avoid zephyr conflictJett Rink2020-11-139-33/+35
| | | | | | | | | | | | | | | | | Zephyr already provides a robust implementation for crc8, but it conflicts with platform/ec's name of crc8. Rename platform/ec to use cros_crc8 instead since it is a special case of zephyr crc8 implementation. BRANCH=none BUG=b:168032589 TEST=builds. Just a rename Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: I2dc509fe1c1d8c2a4cdec3943b63f29429919137 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2532691 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* crc32: rename test crc32->crc to allow for crc8Jett Rink2020-11-1310-10/+10
| | | | | | | | | | | | | | | Instead of creating a new test for crc8, just make the existing crc32 test more generic. BRANCH=none BUG=none TEST=none Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: Ie630d4991d4e2c7dc441842c39d63fc0281ac809 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2532690 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* firmware_builder: add hardware test buildsJett Rink2020-11-131-2/+13
| | | | | | | | | | | | | | | | | We were not building the hardware test images as part for the test step. This replicate functionality in the chromeos-ec ebuid (via cros-ec eclass). I put a note in that ebuild to update this script if there are any changes in the future. BRANCH=none BUG=chromium:1147953 TEST=verify that firmware_builder.py --metrics /tmp/m test failed the same was the cq-orchestrator failed Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: I20937381da41d933261926d02d45b80d3920443b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2535310 Reviewed-by: LaMont Jones <lamontjones@chromium.org>
* genvif: add genvif.h to dependsDenis Brockus2020-11-121-1/+1
| | | | | | | | | | | | | | | BUG=b:172293518 BRANCH=none TEST=make buildall Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: Ib2d1443f19667beadca36b3ce726f02e4d0084b6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2535671 Commit-Queue: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* TCPMv2: Print VID/PID only when presentDiana Z2020-11-121-1/+4
| | | | | | | | | | | | | | | | Not all partners will reply to DiscoverIdentity, so only print out their VID/PID combination when the VID is non-zero. BRANCH=None BUG=None TEST=on drawcia, plug in a charger which does not reply to DiscoverIdentity and verify it doesn't print Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I1ea114794ada20b68cb6f902b085a2fd02650912 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2535216 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* voxel: Enabling sourcing of 4.5A on type-C portsKeith Short2020-11-121-0/+6
| | | | | | | | | | | | | | | To support USB4, source a total of 4.5A on the type-C ports. This ensures that if the first device requests 3A (15W), the chromebook continues to source 3A even after a second device is connected. BUG=none BRANCH=firmware-volteer-13521.B-master TEST=make buildall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I5e3e81defa3ef62cd0735481e6efbc0b41f4261e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2533518 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* voema: Enabling sourcing of 4.5A on type-C portsKeith Short2020-11-121-0/+6
| | | | | | | | | | | | | | | | To support USB4, source a total of 4.5A on the type-C ports. This ensures that if the first device requests 3A (15W), the chromebook continues to source 3A even after a second device is connected. BUG=none BRANCH=firmware-volteer-13521.B-master TEST=make buildall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I86cf35fd46d8188636da65ade3894f3d0bbe9ae0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2533517 Reviewed-by: YH Lin <yueherngl@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* trondo: Enabling sourcing of 4.5A on type-C portsKeith Short2020-11-121-0/+6
| | | | | | | | | | | | | | | To support USB4, source a total of 4.5A on the type-C ports. This ensures that if the first device requests 3A (15W), the chromebook continues to source 3A even after a second device is connected. BUG=none BRANCH=firmware-volteer-13521.B-master TEST=make buildall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Iba57c18d9d2bbbb647740cae39af3df74d10ea76 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2533516 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* todor: Enabling sourcing of 4.5A on type-C portsKeith Short2020-11-121-0/+6
| | | | | | | | | | | | | | | To support USB4, source a total of 4.5A on the type-C ports. This ensures that if the first device requests 3A (15W), the chromebook continues to source 3A even after a second device is connected. BUG=none BRANCH=firmware-volteer-13521.B-master TEST=make buildall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I9504cfbd5f48573638a784784019a4f808c17041 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2533515 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* tglrvu_ite: Enabling sourcing of 4.5A on type-C portsKeith Short2020-11-121-0/+6
| | | | | | | | | | | | | | | | To support USB4, source a total of 4.5A on the type-C ports. This ensures that if the first device requests 3A (15W), the chromebook continues to source 3A even after a second device is connected. BUG=none BRANCH=firmware-volteer-13521.B-master TEST=make buildall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I208b13b257980303d2be14dd5cc67905586fde73 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2533514 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
* terrador: Enabling sourcing of 4.5A on type-C portsKeith Short2020-11-121-0/+6
| | | | | | | | | | | | | | | To support USB4, source a total of 4.5A on the type-C ports. This ensures that if the first device requests 3A (15W), the chromebook continues to source 3A even after a second device is connected. BUG=b:172710638 BRANCH=firmware-volteer-13521.B-master TEST=make buildall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I9ca2314ca18d298e9dd6158eff7b7e1e2d673cf4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2533513 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* halvor: Enabling sourcing of 6A on type-C portsKeith Short2020-11-121-0/+6
| | | | | | | | | | | | | | | To support USB4, source a total of 6A on the type-C ports. This ensures that if the first device requests 3A (15W), the chromebook continues to source 3A even after a second device is connected. BUG=none BRANCH=firmware-volteer-13521.B-master TEST=make buildall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I22bd1f0cd645b74587479ee4b18181ef82ffcb87 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2533492 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* drobit: Enabling sourcing of 4.5A on type-C portsKeith Short2020-11-121-0/+6
| | | | | | | | | | | | | | | | To support USB4, source a total of 4.5A on the type-C ports. This ensures that if the first device requests 3A (15W), the chromebook continues to source 3A even after a second device is connected. BUG=none BRANCH=firmware-volteer-13521.B-master TEST=make buildall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Idccb74d5634cb07f0339be603d9b497e3a527fbe Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2533491 Reviewed-by: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* adlrvpp_ite: Enabling sourcing of 7.5A on type-C portsKeith Short2020-11-121-0/+6
| | | | | | | | | | | | | | | | | To support USB4, source a total of 7.5A on the type-C ports. This ensures that if the first device requests 3A (15W), the chromebook continues to source 3A even after a second device is connected. BUG=none BRANCH=firmware-volteer-13521.B-master TEST=make buildall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I14b5412602aaa0e8671e76a45eb0090a4d3e148c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2533490 Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Poornima Tom <poornima.tom@intel.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* boldar: Enabling sourcing of 4.5A on type-C portsKeith Short2020-11-121-0/+6
| | | | | | | | | | | | | | | | | To support USB4, source a total of 4.5A on the type-C ports. This ensures that if the first device requests 3A (15W), the chromebook continues to source 3A even after a second device is connected. BUG=none BRANCH=firmware-volteer-13521.B-master TEST=make buildall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I0d0b003297994cb7a6fc877278ec20d9858a52e4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2533489 Reviewed-by: Sooraj Govindan <sooraj.govindan@intel.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
* volteer: Enabling sourcing of 4.5A on type-C portsKeith Short2020-11-121-0/+6
| | | | | | | | | | | | | | | | | | To support USB4, source a total of 4.5A on the type-C ports. This ensures that if the first device requests 3A (15W), the chromebook continues to source 3A even after a second device is connected. BUG=none BRANCH=firmware-volteer-13521.B-master TEST=make buildall TEST=connect device that sinks 15W (5V, 3A), connect a second device and verify PD contract remains at 15W on the first device. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ibc28a9ce4b445b43ceb55151fb64540a40045798 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2533488 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
* i2c_master: Add i2cxfer raw commandJan Dabros2020-11-123-1/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GL3590 USB3.1 hub has i2c interface, which behaves different from majority of i2c slaves. While write operation is the same, this chip doesn't support repeated-start sequence for reads. New command allows to create i2c frames in a more flexible way. User may specify how many (if any) bytes to write and then how many bytes to read. Since the raw option is for debugging and won't be commonly used, do not include it by default to save space on flash - use #define CONFIG_CMD_I2C_XFER_RAW built with the raw option. For now, it will be defined only for servo_v4p1. BUG=b:150323106 BRANCH=master TEST=buildall. Verify that reading i2c data from non-gl3590 devices is not affected by this change. For usual write16 (0x0201) at offset 0x4 from device 0x24: i2cxfer raw 1 0x24 0 0x4 0x1 0x2. When reading from GL3590 device, two operations will be required: i2cxfer raw 1 0x50 0 0x10 i2cxfer raw 1 0x50 8 Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: Ifd9ee5184490eb8de383c9468b0152e6f993d7c9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2505780 Reviewed-by: Brian Nemec <bnemec@chromium.org> Commit-Queue: Brian Nemec <bnemec@chromium.org> Tested-by: Brian Nemec <bnemec@chromium.org>
* servo_v4p1: Exclude i2cxfer command from RWJan Dabros2020-11-121-0/+1
| | | | | | | | | | | | In order to save space on RW section, I2C transactions, which are unnecessary for firmware update process, are removed from build of RW. Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: Ia80d5f3799743aaa65a01223f1864706a10d3c68 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2528649 Reviewed-by: Brian Nemec <bnemec@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Brian Nemec <bnemec@chromium.org>
* ioexpander: Fix type error in command_ioex_getRob Barnes2020-11-121-13/+14
| | | | | | | | | | | | | | | | | | | | enum ioex_signal is a uint16. It gets cast to an int32 in command_ioex_get. When find_ioex_by_name returns -1, it gets interpreted as 65535, not -1. Return IOEX_SIGNAL_END from find_ioex_by_name instead of -1. Minor cleanup to make it more clear that enum ioex_signal is not an int. BUG=b:172599383 BRANCH=Zork TEST='ioexget foo' does not crash Change-Id: I92922591b6a657a1d2a0840c3d361a8a909895fb Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2533671 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* Kakadu: Add new battery support for gauge bq27542wen zhang2020-11-125-5/+306
| | | | | | | | | | | | | | Configure battery parameter and driver for gauge bq27542 on kakadu. BUG=b:172197008, b:171456201 BRANCH=master TEST=1.make -j BOARD=kakadu 2.verified the battery parameter and the result is OK. Change-Id: I4c2cc11df1e13cb7313280afca717a7f1e2461ff Signed-off-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2531765 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* willow: add CONFIG_LID_ANGLE_UPDATEDavid Huang2020-11-122-0/+22
| | | | | | | | | | | | | | | | Add CONFIG_LID_ABGLE_UPDATE to control the touchpad and keyboard wakeup function. BUG=b:172034762 BRANCH=master TEST=Test the keyboard and touchpad wakeup when lid angle < 180 or lid angle > 180. Change-Id: I1909393222e040b375365d38a7a6f253cb150ea2 Signed-off-by: David Huang <david.huang@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2531770 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* asurada: allow vconn swapTing Shen2020-11-121-2/+2
| | | | | | | | | | | | | BUG=b:171539818 TEST=none BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I7606abe8adb3ab3d3a6aee876e47305e7c6a6d43 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2532194 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* ucpd: Fix merge error with clock constantsScott Collyer2020-11-121-3/+3
| | | | | | | | | | | | | | | | | This CL fixes an issue with a rebase merge, UCPD_IFRGAP_HBIT_CNT had been changed to UCPD_IFRGAP_CNT in a previous CL. This CL removes HBIT. BUG=b:167601672 BRANCH=None TEST=make BOARD=quiche Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: Ideff65872d744bc7e3b3cdfa8c5af37f4725be36 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2522649 Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org>
* usb_mux: Remove ec host command dependencyScott Collyer2020-11-121-1/+2
| | | | | | | | | | | | | | | This CL removes EC host command dependency for the virtual type-c mux. BUG=None BRANCH=None TEST=make BOARD=quiche Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: I7d5107b60310456cb23393a443fb4f303106954b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2441390 Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org>
* drawcia: Enable hardware charge rampDevin Lu2020-11-121-0/+1
| | | | | | | | | | | | | | BUG=b:172173517 BRANCH=none TEST=On drawcia. Plug in CDP, SDP, DCP, type-C and PD charger: 1. EC console chgsup to make sure voltage/current is indeed. 2. PDtrace to make sure we ramp current to a reasonable value. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: Ie8f2816cb1df1f6c885fe1d6c6d8bb8f0db84570 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2512628 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* sm5803: Add hardware charging rampingDevin Lu2020-11-122-26/+69
| | | | | | | | | | | | | | | | | | This patch add support hardware charging ramp. The hw ramp is implemented by enabling DPM (Dynamic Power Management). Once a DPM Voltage loop regulation is set and the DPM loop is enabled, the DPM guarantees that the Vbus will not go below the threshold voltage limiting the power that can be delivered to the load. BUG=b:172173517 BRANCH=none TEST=On drawcia, i2ctrace to make sure DPM is enabled with 5V source. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I0622da35bf57f367b21e97c5e39cb157ef911521 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2521551 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* drobit: Remove G-sensor/Hall-sensor/Volume button functionMichael5 Chen2020-11-126-182/+18
| | | | | | | | | | | | | | Base on schematic, remove G-sensor/hall-sensor/volume button function. BUG=b:172309606 BRANCH=firmware-volteer-13521.B TEST=make BOARD=drobit Signed-off-by: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com> Change-Id: Iafed86fb81a727632c374320681984cf32ea0e3f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2517259 Reviewed-by: Jacky Wang <jacky5_wang@pegatron.corp-partner.google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* eldrid: add FW_CONFIG support for different keyboard layoutScott Chao2020-11-123-1/+26
| | | | | | | | | | | | | | BUG=b:172133632 BRANCH=firmware-volteer-13521.B-master TEST=make buildall TEST= ectool cbi get = 0x14902 ectool cbi set 0x114902 4 Signed-off-by: Scott Chao <scott_chao@wistron.corp-partner.google.com> Change-Id: I0decd978bf6c21dddd315857bb1a29ac20dbf276 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2528732 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr/test/base32: change test to depend on lessJett Rink2020-11-122-2/+16
| | | | | | | | | | | | | | | As we add more shim code and configs, we don't want to remove the functionality in all of the tests. Convert this test to only include the files it needs to link to perform the shim test. BRANCH=none BUG=b:172512307 TEST=base32 test builds and passes Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: I4a7232c98397600d578e18b67935924b088f377b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2532687 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr/test/hooks: change test to depend on lessJett Rink2020-11-122-6/+18
| | | | | | | | | | | | | | | As we add more shim code and configs, we don't want to remove the functionality in all of the tests. Convert this hooks test to only include the two files it needs to link to perform the shim test. BRANCH=none BUG=b:172512307 TEST=hooks test builds and passes Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: I0613670fe3cc056e33035ccc5ad1418e5e3d6db0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2532686 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* motion_sense: Make change in range permanentGwendal Grignou2020-11-1238-316/+136
| | | | | | | | | | | | | | | | | | | | | | | | | When AP changes range, unlike offset or ODR, it was not surviving init() call. If the sensor is powered off in S3, at resume the range would be back to the default. To make it consistent with other attributes, remember range change until EC powers down. - remove get_range - add current_range to store the range currently used. This is modifiable by the AP - when the AP shutdown, revert current_range to default_range - Remove const attribute for sensor structure when init and set_range is called. BUG=chromium:1083791 BRANCH=none TEST=One eve branch, check range is preserved even after 'shutdown -h 0' Change-Id: Ia7126ac0cc9c3fef60b4464d95d6dd15e64b0fc4 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2215751 Reviewed-by: Yuval Peress <peress@chromium.org>
* dalboz: enable thermal controlPeter Marheine2020-11-122-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | Dalboz (and variants) has temperature sensors, but they weren't used. Enable CONFIG_THROTTLE_AP for dalboz as well as trembyle, and define some default thermal parameters (the same as the trembyle reference board, but without fan options because dalboz devices are fanless) to have the EC do platform thermal control. Devices may override the default thermal options by defining a non-__overridable thermal_params in their own board files: struct ec_thermal_config thermal_params[TEMP_SENSOR_COUNT] = { /* Copy defaults, modify as desired. */ } BUG=b:172025135 TEST=Setting temperature thresholds with `thermalset` on dirinboz EC console causes AP throttling as expected, `temps` reports reasonable actual temperature measurements. BRANCH=zork Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: I641bb8cae3b416bf8a76b4853e2053fad14aed1c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2530817 Reviewed-by: Edward Hill <ecgh@chromium.org>
* tcpmv2: Don't trigger BC1.2 detect if role doesn't changeKeith Short2020-11-121-12/+29
| | | | | | | | | | | | | | | | | | | Don't trigger BC12 client detect or BC1.2 host mode if the data role hasn't changed. This fixes issues seen with some CDP hosts that drop VBUS if BC1.2 client detect is restarted. BUG=b:158708115 BRANCH=firmware-volteer-13521.B-master TEST=Connect laptop CDP to Volteer. CDP falls back to SDP but remains stable instead of looping on BC1.2 detect. TEST=Connect desktop CDP to Volteer, verify 7.5W charging. TEST=Connect DCP to Volteer, verify 7.5W charging. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ifd0ee379a0d5894894d13fb1a64b4dec2e77ec9e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2529809 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Revert "crc8: rename crc8 to cros_crc8 to to avoid zephyr conflict"Jett Rink2020-11-119-35/+33
| | | | | | | | | | | | | | | Something slipped through CQ coverage. Need to figure out, but in the mean time, revert the 3 CLs that seemed to have caused the issue. BRANCH=none BUG=chromium:1147953 TEST=none This reverts commit befe5a9c78ff4e75db7c5cda801688c8976e95f3. Change-Id: I14e82f33646b6574b1b3da13783143e3a29d417b Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2533357
* Revert "crc32: rename test crc32->crc to allow for crc8"Jett Rink2020-11-1110-10/+10
| | | | | | | | | | | | | | | | | Something slipped through CQ coverage. Need to figure out, but in the mean time, revert the 3 CLs that seemed to have caused the issue. BRANCH=none BUG=chromium:1147953 TEST=none This reverts commit 5ec269c5a71643c955fe45191ed9f06794c6113a. Change-Id: I90f812cd4d4f83ea05d34740541db0076abce392 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2533356 Tested-by: Rajat Jain <rajatja@google.com> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* Revert "zephyr: forward cros_crc8 to zephyrs crc8 impl"Jett Rink2020-11-116-85/+0
| | | | | | | | | | | | | | | Something slipped through CQ coverage. Need to figure out, but in the mean time, revert the 3 CLs that seemed to have caused the issue. BRANCH=none BUG=chromium:1147953 TEST=none This reverts commit 22ee9a346718a9a07955fd81b0d03c4dde5b2ec8. Change-Id: I5617e39204a7c05001363d5780fa2f52e3e1ea05 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2533355
* ec_command: don't assume BUILD_ASSERT is undefinedJett Rink2020-11-111-0/+3
| | | | | | | | | | | | | | | | In the scenario where we are not building from platform/ec, we define BUILD_ASSERT to a no-op. We should only do that if the BUILD_ASSERT macro is undefined; otherwise we should just leave the definition. BRANCH=none BUG=none TEST=build EC and zephyr code without issue Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: I6d51106f51217279acb2dcf252ee8ac3383f9959 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2532684 Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: bounds check remaining gpio shim functionsJett Rink2020-11-111-0/+6
| | | | | | | | | | | | | | | I missed a few bound checks in the gpio shim. Add a bound check to all remaining gpio shim functions that need it. BRANCH=none BUG=b:172512307 TEST=volteer, posix-ec, and test/app/ec all build without warnings Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: Id915532b83e1621c86253fe86137034751a4da6d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2532683 Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* ps8xxx: Fix a typo of product ID, PS8751 vs PS8705Wai-Hong Tam2020-11-111-1/+1
| | | | | | | | | | | | | | Should be PS8751 instead of PS8705. BRANCH=None BUG=b:171446429, b:173004739 TEST=Built a Trogdor image successfully. Change-Id: Id99f2b424038327346a7b6ef995fa35c7d4723fd Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2532680 Commit-Queue: Stephen Boyd <swboyd@chromium.org> Reviewed-by: Stephen Boyd <swboyd@chromium.org>
* zephyr: add strtoull function for 64-bit inputJett Rink2020-11-112-3/+50
| | | | | | | | | | | | | | | We do need a true 64-bit input function for common platform/ec code, and zephyr doesn't have this. Add the support to the shim BRANCH=none BUG=b:172592963,b:172512307 TEST=build EC and volteer and posix_ec Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: I81f69fdbe03916f3a54091ce6c077db32ed3a73c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2532679 Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>