summaryrefslogtreecommitdiff
path: root/util
Commit message (Collapse)AuthorAgeFilesLines
...
* ec: Fix kconfig_check.pyJeremy Bettis2023-04-033-63/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The kconfig_check.py tool was reporting all symbols in the Kconfigs as configs, including things like ``` config PLATFORM_EC_PREINIT_HW_CYCLES_PER_SEC default 100000000 ``` would return CONFIG_PLATFORM_EC_PREINIT_HW_CYCLES_PER_SEC and CONFIG_100000000 as valid configs. Read only Symbol node names instead. Include Kconfigs in platform/ec but outside of platform/ec/zephyr also. Also include Kconfig.zephyr from third_party/zephyr/main, which was previously omitted. This requires setting some environment variables. BRANCH=None BUG=b:272518464 TEST=make buildall Change-Id: I02e86f5c96f1e9943386d1610af1b2ab07550754 Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4383371 Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* Revert "battery: Finish past cleanup of sb fw update"Aaron Massey2023-04-033-1/+933
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 33885596426b7f419709d81529f3e4d02f960ddf. Reason for revert: http://b/276733475 Original change's description: > battery: Finish past cleanup of sb fw update > > We removed the SB_FW_UPDATE host command code in CL:792013 without > cleaning up all now dead references. > > Remove all dead code that references the SB_FW_UPDATE command and > associated sources. > > BRANCH=none > BUG=b:276458241 > TEST=CQ > > Change-Id: I66a79eb42508aaa7ba3a64f6022df777608a497b > Signed-off-by: Aaron Massey <aaronmassey@google.com> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4388382 > Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Bug: b:276458241 Change-Id: I06eb724e597e7c3a6e05faa346f84a635a57aea1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4391204 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Tested-by: Aaron Massey <aaronmassey@google.com> Commit-Queue: Aaron Massey <aaronmassey@google.com> Owners-Override: Aaron Massey <aaronmassey@google.com>
* battery: Finish past cleanup of sb fw updateAaron Massey2023-03-313-933/+1
| | | | | | | | | | | | | | | | | We removed the SB_FW_UPDATE host command code in CL:792013 without cleaning up all now dead references. Remove all dead code that references the SB_FW_UPDATE command and associated sources. BRANCH=none BUG=b:276458241 TEST=CQ Change-Id: I66a79eb42508aaa7ba3a64f6022df777608a497b Signed-off-by: Aaron Massey <aaronmassey@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4388382 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* battery: Remove dead sbs_passthrough host cmdsAaron Massey2023-03-311-1/+0
| | | | | | | | | | | | | | | | | | | | The SBS_READ/WRITE_WORD/BLOCK host commands have been dead without use for quite some time. There is not a single board making use of them. If there was actual usage, then CL:2136527 would've broken clients for three years. Remove the dead host commands and their associated unused config. BRANCH=none BUG=b:276458241 TEST=make buildall -j TEST=make build_cros_ec_commands TEST=zmake build -a Change-Id: Ic62465c862440c9d423c3359a79f0ff440941ffb Signed-off-by: Aaron Massey <aaronmassey@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4388381 Reviewed-by: Keith Short <keithshort@chromium.org>
* util: Use ParseFlags to print valid flags and FP enc statusFiras Sammoura2023-03-291-12/+11
| | | | | | | | | | | BRANCH=none BUG=b:144959033 TEST=rm -rf build && make BOARD=host utils Change-Id: Ia8406672ffffd4c304cb939d4fc843081f94549e Signed-off-by: Firas Sammoura <fsammoura@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4344033 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* chip/stm32: Eliminate run-time flags to usb_spi.cJes B. Klinke2023-03-281-0/+1
| | | | | | | | | | | | | | | | | | | | | The USB_SPI_CONFIG() macro allowed a set of "run-time" flags to be given by board.c. However, these flags have to be known at compile time, and always are. They can more conveniently be given through a CONFIG_ define. With the above, and a little tweak in hammer/board.h (mimicking what was already done for I2C), then every invocation of the USB_SPI_CONFIG() across the codebase is identical, setting the stage for moving the declarations into usb_spi.c, and eliminating the macro altogether. BUG=b:273601311 TEST=none Change-Id: Id565338238a7c21f7e2c6c24b7c4e3d7648482f6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4368551 Tested-by: Jes Klinke <jbk@chromium.org> Reviewed-by: Brian Nemec <bnemec@google.com> Commit-Queue: Jes Klinke <jbk@chromium.org>
* ec/util: add python script to load fpmcu imageJosie Nordrum2023-03-281-0/+331
| | | | | | | | | | | | | | | Add python script to upload PNG file from host to fpsensor buffer on fpmcu. BUG=b:267312024 TEST=./util/fpmcu_upload.py -i /tmp/img1.png -b $BOARD--echo TEST=python -m unittest util/fpmcu_upload.py BRANCH=None Signed-off-by: Josie Nordrum <josienordrum@google.com> Change-Id: I6477a68727b19abced7ca676eef1558897c9937d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4356905 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* dedede: Update util/dedede-relevant-paths.txtRob Barnes2023-03-241-0/+2
| | | | | | | | | | | | | | Add it83xx and fpsensor/build.mk to picked up required fixes. BUG=None BRANCH=None TEST=Build all on merge commit Change-Id: I8af5069241f3f26945acff8b7e71ef171da541a9 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4370602 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* util/flash_ec: Fix incorrect bitbang_rate definitionJakub Czapiga2023-03-221-1/+1
| | | | | | | | | | | | | | | | Excessive space in the definition of bitbang_rate caused this option's second line of its help string to be used as short opt. This made help output incorrect and potentially could introduce incorrect flags parsing behavior. BUG=None TEST=./util/flash_ec --help # displays correctly now BRANCH=None Change-Id: I4c9645339d84fdaec19c0cc33358883c8fddf4be Signed-off-by: Jakub Czapiga <czapiga@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4355420 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* util/check_clang_format: Format C++ filesTom Hughes2023-03-211-4/+8
| | | | | | | | | | | BRANCH=none BUG=b:236386294 TEST=./util/check_clang_format.py Change-Id: Ie0cafe0db519bbaca700917435a8b0e93a6e2678 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4356906 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* twister: Move `suite` and `builder_name` to tagsAllen Xie2023-03-212-5/+3
| | | | | | | | | | | | Context: https://crrev.com/c/4349593 Bug: b:274025225 Test: Unit test Change-Id: Ie0eb5f504f063c7f8595e826a8e2f44b562f0ecb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4349672 Tested-by: Zhihui Xie <zhihuixie@google.com> Reviewed-by: Al Semjonovs <asemjonovs@google.com> Commit-Queue: Zhihui Xie <zhihuixie@google.com>
* third_party: Add option to build and link googletestTom Hughes2023-03-211-0/+1
| | | | | | | | | | | | | | | When CONFIG_GOOGLETEST is enabled, the googletest library will be built and linked into the test images. BRANCH=none BUG=b:254530679 TEST=make BOARD=bloonchipper test-fpsensor_hw -j Cq-Depend: chrome-internal:5548068 Change-Id: I969599ed441415fd809b08396aefcfa92275fbcd Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4348152 Reviewed-by: Andrea Grandi <agrandi@google.com>
* ec: Add missing #includesJeremy Bettis2023-03-203-0/+5
| | | | | | | | | | | | | | | | | | | There were several headers broken by sorting includes, because they didn't include what they use. Add missing #includes to fix build. BRANCH=None BUG=None TEST=cq Change-Id: I1b7c6d8fc62ace8cb2cbb12df83c0edf81c7dfde Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4350990 Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
* Geralt: Enable CONFIG_IT83XX_TUNE_CC_PHYmike2023-03-201-1/+0
| | | | | | | | | | | | | | | Enable cc tune function to pass cc eye test BUG=b:270906647 BRANCH=none TEST=test geralt proto board C0 & C1 port cc eye test pass. Change-Id: Ie35517ba3e1fac95cd193eed64241972824c64da Signed-off-by: mike <mike5@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4339656 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Ganxiang Wang <wangganxiang@huaqin.corp-partner.google.com>
* util: Use libec for EC_VER_FLASH_PROTECTFiras Sammoura2023-03-191-56/+37
| | | | | | | | | | | | | | | | | | This is a reland of https://crrev.com/c/4261963 now that the formatting was fixed in https://crrev.com/c/4335705. BRANCH=none BUG=b:116396469 TEST=rm -rf build && make BOARD=host utils TEST=tast run localhost:2200 firmware.Fp{AddEntropy,BioWash, CheckWriteProtect,RDP0,ROOnlyBootsValidRW,RWNoUpdateRO, ReadFlash,RebootToRO,SoftwareWriteProtect} TEST=TEST=test_that --board hatch <IP> suite:fingerprint Change-Id: I8bede5aa8431686e505153fd96a0b9065f37a213 Signed-off-by: Firas Sammoura <fsammoura@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4344032 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* Revert "util/check_clang_format: Format C++ files"caveh jalali2023-03-171-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 6aaca42c18798471313f2e5d9c2c9327fba6133b. Reason for revert: previous patch "tree: Run clang-format on C++ files" needs to be rolled back due to build breakage. and this patch is preventing rollback. Original change's description: > util/check_clang_format: Format C++ files > > BRANCH=none > BUG=none > TEST=./util/check_clang_format.py > > Change-Id: Ie270a1683ff62b7cb7d95e972b2fe51119be9885 > Signed-off-by: Tom Hughes <tomhughes@chromium.org> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4338477 > Reviewed-by: Jeremy Bettis <jbettis@chromium.org> > Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Bug: none Change-Id: I8db08278f0b87cbe8a24205efaefa5f77310f3e8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4348007 Tested-by: caveh jalali <caveh@chromium.org> Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: caveh jalali <caveh@chromium.org>
* util/ectool: Remove unnecessary headerTom Hughes2023-03-161-1/+0
| | | | | | | | | | | | | This header was accidentally added in https://crrev.com/c/4338476. BRANCH=none BUG=none TEST=CQ passes Change-Id: If2ab5ef82ffd840571d2e6f93fc9e54f75dbf441 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4346514 Reviewed-by: Diana Z <dzigterman@chromium.org>
* board/terrador: Free up more flash spaceTom Hughes2023-03-161-1/+1
| | | | | | | | | | | BRANCH=none BUG=b:172020503 TEST=CC=clang make BOARD=terrador Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I3f360891e9f005120b3f7d7a0f84f81467630327 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4024567 Reviewed-by: Diana Z <dzigterman@chromium.org>
* board/mushu: Free up flash spaceTom Hughes2023-03-161-1/+1
| | | | | | | | | | | | BRANCH=none BUG=b:172020503 TEST=CC=clang make BOARD=mushu Cq-Depend: Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I093b8ea5090aef6be47bc38289d199eb52453145 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4024566 Reviewed-by: Eric Yilun Lin <yllin@google.com>
* board/garg: Free up more flashTom Hughes2023-03-161-1/+1
| | | | | | | | | | | BRANCH=none BUG=b:172020503 TEST=CC=clang make BOARD=garg Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I68f8396fad4025901b85235c1281942db312bae8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4024565 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* baseboard/dedede: Free up more flash spaceTom Hughes2023-03-161-1/+1
| | | | | | | | | | | BRANCH=none BUG=b:172020503, b:256193799 TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Iaa06710e9d83f240252c0fe07de88c29280a79bb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4033070 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* util/check_clang_format: Format C++ filesfactory-skyrim-15384.B-mainTom Hughes2023-03-161-4/+8
| | | | | | | | | | | | BRANCH=none BUG=none TEST=./util/check_clang_format.py Change-Id: Ie270a1683ff62b7cb7d95e972b2fe51119be9885 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4338477 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* tree: Run clang-format on C++ filesTom Hughes2023-03-1623-129/+146
| | | | | | | | | | | BRANCH=none BUG=none TEST=CQ passes Change-Id: I4e359ebbfacfa10239e991ee89da82db5161ef20 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4338476 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* util: Use libec for FP_ENCRYPTION_STATUSFiras Sammoura2023-03-151-9/+14
| | | | | | | | | | | BRANCH=none BUG=b:144959033 TEST=rm -rf build && make BOARD=host utils Change-Id: Iade517026ef7c36846a5ce58629777ee9746db0f Signed-off-by: Firas Sammoura <fsammoura@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4336841 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* util: Use libec for RAND_NUMFiras Sammoura2023-03-141-18/+15
| | | | | | | | | | | BRANCH=none BUG=b:144959033 TEST=rm -rf build && make BOARD=host utils Change-Id: I02110dbdd9068e71e564cc37b2e78f9d055673fe Signed-off-by: Firas Sammoura <fsammoura@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4336838 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* util: Remove ec_panicinfoHsin-Yi Wang2023-03-146-288/+33
| | | | | | | | | | | | | | | ec_panicinfo is moved to libec. BUG=b:172222556 BRANCH=None TEST=`BOARD=host make utils-host` TEST=test with CL:4322820 and parse a sample eccrash and check result Cq-Depend: chromium:4318210 Change-Id: Ib9770932f4555600bd3487757809bfb046f0bad8 Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4318306 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* etool: Allow "ectool motionsense info" to dump all sensorsDouglas Anderson2023-03-131-161/+203
| | | | | | | | | | | | | | | | | | Previously if you wanted to dump all motionsense info then you needed to go one-by-one through all of the sensors, calling ectool each time. There's no reason why we can't just have the tool be able to loop through all the sensors to make this easier. We'll make it so that if a sensor number isn't provided that we'll just dump all of them. BUG=b:267680317 TEST=Run "ectool motionsense info" BRANCH=none Change-Id: Iebbe44cf20bca4470369147acebcd2ef237ca479 Signed-off-by: Douglas Anderson <dianders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4324364 Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
* util: Use check_patch from Zephyr not repohooksGwendal Grignou2023-03-132-10/+4
| | | | | | | | | | | | | | | | | | | | | | | Zephyr code base is more integrated to cros_ec codebase than repohooks. Do not depend on scripts deep inside repohooks. BUG=b:272119670 BRANCH=none TEST= - Touch make_linux_ec_commands_h.sh Make sure check triggers an error as before - Add a #if 0 in ec_commands.h, commit code locally + make build_cros_ec_commands + repo upload --verify report a warning, check_patch wants the code removed. + Check repo upload works both in and outside chroot + Check repo works in any platform/ec/ subdirectory. Change-Id: Ifb0f232460d85c708cafab65c2551e6992036e25 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4322620 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* util: Clean the dependency of ec_panicinfoHsin-Yi Wang2023-03-113-18/+46
| | | | | | | | | | | | | | | | Remove the dependency of "compile_time_macros.h" and "panic.h". Only use the macros and headers the files need. Also move the input parsing to a function. BUG=b:172222556 BRANCH=None TEST=`BOARD=host make utils-host` Change-Id: Ic6d35c1cbfbc0f53916ede6dd839481fd84e65b8 Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4318612 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* Revert "util: Use libec for EC_VER_FLASH_PROTECT"Josie Nordrum2023-03-111-36/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit b03820fc23e64a4141283ae198415a918d50ba5f. Reason for revert: http://b/272648081 Original change's description: > util: Use libec for EC_VER_FLASH_PROTECT > > BRANCH=none > BUG=b:116396469 > TEST=rm -rf build && make BOARD=host utils > TEST=tast run localhost:2200 firmware.Fp{AddEntropy,BioWash, > CheckWriteProtect,RDP0,ROOnlyBootsValidRW,RWNoUpdateRO, > ReadFlash,RebootToRO,SoftwareWriteProtect} > > Change-Id: I1a2da399af50ed70d06d407da76de78f0cc25e1f > Signed-off-by: Firas Sammoura <fsammoura@google.com> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4261963 > Reviewed-by: Tom Hughes <tomhughes@chromium.org> Bug: b:116396469 Change-Id: I6637a85a5ed7c179d34075ea029a4b4060cdde6d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4329102 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Commit-Queue: Josie Nordrum <josienordrum@google.com> Tested-by: Josie Nordrum <josienordrum@google.com>
* zephyr/Kconfig: add detachable base supportTing Shen2023-03-101-2/+0
| | | | | | | | | | | | | BUG=b:272439221 TEST=enable these config on geralt and build ec BRANCH=none Change-Id: I2acbd499ff26ef38ea8e0919cab2e95f8a5450b4 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4327718 Commit-Queue: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@google.com> Tested-by: Ting Shen <phoenixshen@chromium.org>
* utils: Hotfix make_linux_ec_h.sh to fix cqAaron Massey2023-03-071-1/+2
| | | | | | | | | | | | | | | | | The make_linux_ec_commands_h.sh command directly calls a repo hook. This leaves us open to breakages. One such breakage has just occurred. Change the called path to checkpatch.pl to unblock CQ until a permenant term solution is implemented. BRANCH=none BUG=b:272119670 TEST=CQ Change-Id: Ic43f9a37277012ca3043bc5a1ecb80dc71e73162 Signed-off-by: Aaron Massey <aaronmassey@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4315265 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* ectool: Add memory_dump commandRob Barnes2023-03-071-0/+254
| | | | | | | | | | | | | | | | The memory_dump command fetches and prints memory from the EC that is available for dumping. EC must enable HOST_COMMAND_MEMORY_DUMP and register memory for dumping. BUG=b:263250131 BRANCH=None TEST=Dump memory on skyrim Change-Id: I611245388a47434a73554353f09ddc9956d42632 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4304660 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* util: Add hexdump_canonical utility functionRob Barnes2023-03-072-0/+49
| | | | | | | | | | | | | | | Add hexdump_canonical utility function for printing a buffer in hexdump canonical (-C) format. Includes an argument for increasing the displayed offset, which is useful when dumping a partial buffer copied from a remote. BUG=None TEST=Build and test with memory_dump command Change-Id: Ic0d67b1b1e17348a0739adf765f4487ec708a24c Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4304659 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* zephyr: enable elan touchpad driverTing Shen2023-03-031-4/+0
| | | | | | | | | | | | | | | | This CL enables the Elan touchpad driver and touchpad task on zephyr EC, with minimal changes to make the code compilable. BUG=b:269989432 TEST=Add a touchpad node on krabby and verify it buildable. BRANCH=none Change-Id: I4b723ed2230f54d3dc597cdc30605fcfa4d4e0a3 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4149991 Tested-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@google.com>
* ectool: remove unused variableHsin-Yi Wang2023-03-031-1/+0
| | | | | | | | | | | | | To avoid compile error. BUG=None BRANCH=None TEST=Compile ectool Change-Id: I0f7d3e0de549d84cd9517cd9cf37220c39eb05be Signed-off-by: Hsin-Yi Wang <hsinyi@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4306043 Reviewed-by: Eric Yilun Lin <yllin@google.com>
* chgstv2: Separate v0 and v1 param struct for EC_CMD_CHARGE_CURRENT_LIMITDaisuke Nojiri2023-03-031-22/+31
| | | | | | | | | | | | | | This CL separates param struct for v0 and v1 of EC_CMD_CHARGE_CURRENT_LIMIT. BUG=b:265372046 BRANCH=None TEST=buildall Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I836f15fade7f1660475af7ceeebadb9082b45e84 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4292617 Reviewed-by: caveh jalali <caveh@chromium.org>
* migrated_files.sh: Add fp driver folder to ignored listBobby Casey2023-03-021-1/+2
| | | | | | | | | | | | | | Add driver/fingerprint/* to the list of files to ignore in migrated_files.sh BRANCH=none BUG=b:264457390 TEST=./util/migrated_files.sh driver/fingerprint/fpc/fpc_sensor.c Change-Id: I6d413f47be072dd18699fbaf429d372d07287cac Signed-off-by: Bobby Casey <bobbycasey@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4289875 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* util: Use libec for EC_VER_FLASH_PROTECTFiras Sammoura2023-03-021-56/+36
| | | | | | | | | | | | | | BRANCH=none BUG=b:116396469 TEST=rm -rf build && make BOARD=host utils TEST=tast run localhost:2200 firmware.Fp{AddEntropy,BioWash, CheckWriteProtect,RDP0,ROOnlyBootsValidRW,RWNoUpdateRO, ReadFlash,RebootToRO,SoftwareWriteProtect} Change-Id: I1a2da399af50ed70d06d407da76de78f0cc25e1f Signed-off-by: Firas Sammoura <fsammoura@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4261963 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* USB-PD: Use VDO_MAX_OBJECTS to define max VDO objectsDaisuke Nojiri2023-03-021-2/+2
| | | | | | | | | | | | | | | | | | | Currently, VDO buffers are defined literally or by PDO_MAX_OBJECTS. This isn't applicable for EPR since it extends PDO_MAX_OBJECTS to 11. This CL redefines VDO buffers using VDO_MAX_OBJECTS, which is set to 6. This allows VOD buffers and PDO buffers to be defined in different sizes. BUG=b:257320026 BRANCH=None TEST=buildall LOW_COVERAGE_REASON=This patch doesn't contain new execution lines. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I760c10eb604733f2f8cc1a643d3ba77e036255c6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4290368 Reviewed-by: Diana Z <dzigterman@chromium.org>
* util: Switch MIN/MAX from inline to macroRob Barnes2023-03-021-9/+20
| | | | | | | | | | | | | | | | | The MIN/MAX in util/misc_util.h is an inline function with signed int arguments. This fails when the arguments are unsigned or larger than an int. Switch the implementation to a MACRO. Borrowed the implementation from include/util.h. BUG=None TEST=Run ectool Change-Id: I06f478bec09dcafb3e20189dc43b21165ee109c9 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4299570 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Replace CONFIG_DMA with CONFIG_DMA_CROS in EC codebasePatryk Duda2023-03-011-0/+1
| | | | | | | | | | | | | | | | The config from EC collides with the same config from Zephyr. BUG=b:239712345 BRANCH=none TEST=make runhosttests buildall Change-Id: Ic6e63ea6dd9e745e82feb2af04b77069c2d78af1 Signed-off-by: Patryk Duda <pdk@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4295699 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Commit-Queue: Patryk Duda <patrykd@google.com> Tested-by: Patryk Duda <patrykd@google.com>
* hades: Initial ECDavid Huang2023-03-011-1/+1
| | | | | | | | | | | | | | | | | Create the initial EC for hades by copying the agah reference board EC files. BUG=b:269387225 BRANCH=None TEST=make BOARD=hades Change-Id: Icfca9f64654f8683aaa6851b823463c740501b3d Signed-off-by: David Huang <david.huang@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4286378 Tested-by: YH Lin <yueherngl@chromium.org> Code-Coverage: YH Lin <yueherngl@chromium.org> Commit-Queue: YH Lin <yueherngl@chromium.org> Reviewed-by: Boris Mittelberg <bmbm@google.com>
* flash_fp_mcu: Remove any numbers from board namestabilize-15364.B-mainPatryk Duda2023-02-241-1/+5
| | | | | | | | | | | | | | | | | | | | Strongbad64 is a variant of strongbad board, so flash_fp_mcu should recognise it as strongbad similar to e.g. strongbad-kernelnext. BUG=b:270542279 BRANCH=none TEST=tast run <IP> firmware.Fp{FlashFpMcuHello,UpdaterSucceeded,\ AddEntropy,BioWash,CheckWriteProtect,RDP0,RDP1,ROCanUpdateRW,\ ObeysRollback,ROOnlyBootsValidRW,RWNoUpdateRO,ReadFlash,\ RebootPowerCycle,RebootToRO,SoftwareWriteProtect,SystemIsLocked,\ TpmSeed,Updater} Change-Id: Ifc69a1f3dd58d7f01d0da1439bebf9def7f52ee3 Signed-off-by: Patryk Duda <pdk@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4287435 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Tested-by: Patryk Duda <patrykd@google.com> Commit-Queue: Patryk Duda <patrykd@google.com>
* zephyr: Handle scenario where an assert is not found in the logAl Semjonovs2023-02-231-1/+7
| | | | | | | | | | | | | | | | | Sometimes the assert occurs in the setup of a test which is outside of the `START` and `FAIL` markers of a test leaving the test with no valid assertion marker. BUG=None BRANCH=NONE TEST=Add failing assert in setup, ./twister -T zephyr/test Change-Id: I96999fe2eb40b33390df8c7ac24a48f8050b5767 Signed-off-by: Al Semjonovs <asemjonovs@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4287588 Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org>
* Increase supported host events to 64Tim Van Patten2023-02-221-2/+7
| | | | | | | | | | | | | | | | | | | | | | ectool is hard-coded to support 32 host events even though the EC supports 64 host events. Add an enum value to indicate what the current count of the host events is, so it can used by ectool in place of magic numbers. Also add an assert to enforce the 64 host event limit. BRANCH=none BUG=b:261141172 TEST=Manually build and flash, verify device boots TEST=ectool version Change-Id: If9724cf905a7d2eb42a2ad67c5e1da784ca05e8e Signed-off-by: Tim Van Patten <timvp@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4261961 Reviewed-by: Rob Barnes <robbarnes@google.com> Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* flash_ec: delay cold_reset releasing timeEric Yilun Lin2023-02-221-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using cold_reset (which was EC reset, and now changes to GSC reset), and not enough sleep time would cause a race condition of FW_UP_L and EC_RST. The booting sequence would be: 1. GSC_RESET on 2. EC_RESET on 2. FW_UP_L on 3. GSC_REST off 4. EC_RESET off 5. FW_UP_L off The race condition happens at the step 4 and step 5 if the EC reset released too lade. This causes an issue entering the EC flashing mode on the new Ti50 platforms. We extend the sleep time between FW_UP_L release and COLD_RESET release to 0.2, which should be sufficient by the data we measured. BUG=b:269182955 TEST=flash over ccd and servo_micro on hayato (cr50,ite), kingler (ti50, npcx), geralt (ti50, ite) BRANCH=none Change-Id: I5a8b5c30bc44779f03ec4ed95cb505e7aaf1a0f0 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4259125 Reviewed-by: Mary Ruthven <mruthven@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@google.com> Tested-by: Eric Yilun Lin <yllin@google.com>
* Remove CONFIG_HOST_EVENT64Tim Van Patten2023-02-211-1/+0
| | | | | | | | | | | | | | | | | | | The config option CONFIG_HOST_EVENT64 has been unconditionally enabled since 2017. This CL removes the option entirely, to clarify that 64 bit host event support is enabled by default. BRANCH=none BUG=b:261141172 TEST=Manually build and flash, verify device boots TEST=ectool version Change-Id: I806c12b8e69955dd19d32ad96587050fd189bea4 Signed-off-by: Tim Van Patten <timvp@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4255275 Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Raul Rangel <rrangel@chromium.org> Reviewed-by: Rob Barnes <robbarnes@google.com>
* Fan: print 'stalled' for rpm == 0xfffeDaisuke Nojiri2023-02-211-0/+3
| | | | | | | | | | | | | | | | | This patch makes 'ectool pwmgetfanrpm' print 'stalled' in case the EC returns 0xfffe. This value used to be used for the EC to indicate a stalled fan but has been deprecated. ectool needs to continue to support old ECs. BUG=b:269241655 BRANCH=None TEST=buildall Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I252f35880859847b524857b6c2c44adb4b118b88 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4275601 Commit-Queue: Diana Z <dzigterman@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* common/button.c: Support configuring recovery buttons as active high.Sam McNally2023-02-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | Dedicated recovery buttons may be active high rather than the current default of active low. Add config options for specifying flags for dedicated recovery buttons following the style of power button flags. Since neither the power button flags config this is following, nor the dedicated recovery button configs themselves are surfaced to zephyr, add these dedicated recovery button flags configs to config_allowed.txt. While possible to add now, it would likely result in a non-functional implementation to be largely or entirely replaced when the first zephyr platform actually requires this functionality. BUG=b:268309238 TEST=none BRANCH=none Change-Id: Iba658735e87c20ace140a783c2a2242897baf8c1 Signed-off-by: Sam McNally <sammc@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4240910 Reviewed-by: Peter Marheine <pmarheine@chromium.org>