summaryrefslogtreecommitdiff
path: root/extra
Commit message (Collapse)AuthorAgeFilesLines
* trng: Rename rand to trng_randTom Hughes2022-07-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | The declaration for rand conflicts with the standard library declaration so rename it from "rand" to "trng_rand". This has the benefit of making it obvious when we're using the true random number generator. For consistency, this also renames init_trng/exit_trng to trng_init/trng_exit. This is a reland of commit a6b0b3554f59cc9b0c4aae9bff7dff075f2089a9. BRANCH=none BUG=b:234181908, b:237344361 TEST=./util/compare_build.sh -b all -j 120 => MATCH TEST=emerge-hatch ec-utils-test Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ic26890572cb9865275c866b65b0532c5ab029865 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3738978 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Bobby Casey <bobbycasey@google.com>
* extra/ftdi_hostcmd/test_cmds.c: Format with clang-formatJack Rosenthal2022-07-061-159/+137
| | | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Tricium: disable Change-Id: Idbf9e30205e384c290cef42d8cd9bf45f7cda89d Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3730178 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* extra/usb_gpio/usb_gpio.c: Format with clang-formatJack Rosenthal2022-07-011-57/+37
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I00976ca4b072d2b63fc123b9aa28859caa6412b3 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3730188 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* extra/rma_reset/rma_reset.c: Format with clang-formatJack Rosenthal2022-07-011-75/+65
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: Ibb3b2bf57de9fa67b68c13d1111caa9ba2d7cb60 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3730184 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* extra/lightbar/input.c: Format with clang-formatJack Rosenthal2022-06-301-1/+1
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I545833c2b5c8c25b0f34da5277375729c9836a43 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3730180 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* extra/sps_errs/prog.c: Format with clang-formatJack Rosenthal2022-06-291-40/+22
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: Iec0464940c67062c7ac8f2df08ef7e5b2e058e8b Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3730185 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* extra/lightbar/simulation.h: Format with clang-formatJack Rosenthal2022-06-291-17/+23
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I725be1b8c902f477705d1dc3663121c115716fdd Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3730182 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* extra/usb_updater/desc_parser.c: Format with clang-formatJack Rosenthal2022-06-291-7/+4
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I85737cb5b016e830d8b96b962b82ec4a276dc03e Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3730190 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* extra/i2c_pseudo/i2c-pseudo.c: Format with clang-formatJack Rosenthal2022-06-291-227/+263
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I350401a185e27bc976cfbf4d3c1d8e53cdc55927 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3730179 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* extra/usb_serial/raiden.c: Format with clang-formatJack Rosenthal2022-06-291-14/+11
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: Icb5b66f4000902a76ebd4209af3008b2c83ca53f Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3730189 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* extra/lightbar/windows.c: Format with clang-formatJack Rosenthal2022-06-291-28/+21
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I0545f6f73077099ebe5d7a777561772ef3ccfddb Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3730183 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* extra/usb_updater/usb_updater2.c: Format with clang-formatJack Rosenthal2022-06-281-145/+125
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I08be6faa208b3cf6c62feaf9b4342c2e360943eb Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3730191 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* extra/lightbar/main.c: Format with clang-formatJack Rosenthal2022-06-281-48/+62
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: I1c49fd1d51d8ea32d570ad51149116ad7e512d73 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3730181 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* extra/touchpad_updater/touchpad_updater.c: Format with clang-formatJack Rosenthal2022-06-281-87/+77
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: Ie427e3ee7843883b0b4c9337980ad1074da2a630 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3730186 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* extra/usb_console/usb_console.c: Format with clang-formatJack Rosenthal2022-06-281-29/+26
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: Idfbb6dea2a0516fd93b74a7b4bc038dfe84561ec Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3730187 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* ec_commands: Drop VBNV read/write supportYu-Ping Wu2022-06-281-1/+0
| | | | | | | | | | | | | | | All devices using EC to store VBNV (Vboot nvdata) have reached their AUE. Remove all VBNV-related code. BUG=b:178689388 TEST=make build_cros_ec_commands BRANCH=none Cq-Depend: chromium:3725376 Change-Id: I85851b1404e3b6279ed4588e19db21738ad2f07c Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3724971 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* tigertool: cleanupNick Sanders2022-06-234-123/+117
| | | | | | | | | | | | | | | Fix serial number detect new python3.9 incompatibilities. cros lint to the extent possible BUG=b:216199797 TEST=./tigertest.py -c 10; servo_updater -b servo_v4 BRANCH=none Signed-off-by: Nick Sanders <nsanders@chromium.org> Change-Id: I2ec628389f63711a540223fc9004c9fff7155c1e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3615478 Reviewed-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
* servo_updater: Add retries for flash2Yi Chou2022-06-031-2/+2
| | | | | | | | | | | | | A workaround for the remaining character in the USB buffer. BRANCH=None BUG=b:232156962 TEST=servo_updater -b servo_micro Signed-off-by: Yi Chou <yich@google.com> Change-Id: I0334172c0bc10d16201ff9c4d54d66c02ea283f6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3688769 Reviewed-by: Brian Nemec <bnemec@google.com>
* task: change task_set_event return type to voidFabio Baltieri2022-06-022-3/+2
| | | | | | | | | | | | | | | No implementation does nothing other than return 0 on task_set_event(), change the return type to void so that the API is clear. BRANCH=none BUG=none TEST=cq dry run Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I88b20f53aa6dffa291ce78f4776888b21985f57f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3683769 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* ec console: Move from tostring to tobytes.Keith Haddow2022-05-311-1/+1
| | | | | | | | | | | | | | | | | | | | To string has been an alias for tobytes since python 3.2, in later version of python ( 3.9 and beyond ) this alias is removed. https://bugs.python.org/issue38916 This is a save change as all of chrome dev is on 3.6 or better. The error goes away but when using usb_console inside of a container I get device busy errors as the servod is running. BUG=b:234176994 TEST=built a servod with python 3.10 and tested usb_console. Change-Id: I1b00b0dd96413490936e20aa28067324c9d8e9a5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3674943 Reviewed-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Auto-Submit: Keith Haddow <haddowk@chromium.org> Tested-by: Keith Haddow <haddowk@chromium.org> Commit-Queue: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
* i2c-pseudo: build for kernels >5.15Peter Marheine2022-05-171-1/+1
| | | | | | | | | | | | | | | Linux 5.15 moved stdarg.h to linux/stdarg.h, and removed the old stdarg.h in commit c0891ac15f0428ffa81b2e818d416bdf3cb74ab6. Update the i2c-pseudo module to build on these newer kernels. BUG=none TEST=now builds on Linux 5.16.18 BRANCH=none Change-Id: I331cfc3c2bb7300b5f2c19d595214bfb1e9a8622 Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3650292 Reviewed-by: Shou-Chieh Hsu <shouchieh@chromium.org>
* tigertool: fix rebootNick Sanders2022-04-225-30/+228
| | | | | | | | | | | | | | Fix command truncation issue and change reboot detection mechanism. Fix lint. BUG=b:216199797 TEST=./tigertest.py -c 10 BRANCH=none Signed-off-by: Nick Sanders <nsanders@chromium.org> Change-Id: I2a3f962c2bcc1d87a2c3e8ac7da89e99997f3b40 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3419581 Reviewed-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
* usb_updater2: Read bInterfaceNumber correctly.Daisuke Nojiri2022-04-131-1/+1
| | | | | | | | | | | | | | | This patch makes find_interface use bInterfaceNumber explicitly instead of the i iterator, which could be different from the discovered interface number if there is no interface at index 0. BUG=b:229012657 BRANCH=None TEST=Run 'usb_updater2 -f' on Vell. Change-Id: I7e156eefad6729b5d568fb0e0308b93cdb78a2ea Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3584693 Reviewed-by: Parth Malkan <parthmalkan@google.com>
* Sweetberry: Update the powerlog command to use sudo.Michael Pishchagin2022-01-191-1/+1
| | | | | | | | | | | | | | | | | | Without sudo powerlog failed with "Access denied (insufficient permissions)". BRANCH=None BUG=None TEST=None Signed-off-by: Michael Pishchagin <mblsha@chromium.org> Change-Id: I1aeaf20f13179f49814a6b74074dcf9dd1103c45 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3400760 Tested-by: Michael Pishchagin <mblsha@google.com> Auto-Submit: Michael Pishchagin <mblsha@google.com> Reviewed-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Commit-Queue: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Tested-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
* servo_updater: Add clean reboot at the end of updating procedureLukasz Hajec2021-08-261-0/+3
| | | | | | | | | | | | | | | | | | | | In current state after firmware is updated we perform reboot and check if servo is in RO. Due to this check we need to reinitialize uart connection. This procedure takes resources from kernel driver and makes it impossible to use servo console from OS just after servo_updater. This patch adds additional reboot, it allows kernel driver to reconnect to servo console and use it. BRANCH=None BUG=b:196021317 TEST=run servo_updater.py, after the tool finishes job check if we can access servo EC via serial terminal using e.g. picocom /dev/ttyUSB0. Signed-off-by: Lukasz Hajec <lha@semihalf.com> Change-Id: Icebb1a2faa8803d13736ea241b894adaf146b433 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3111367 Reviewed-by: Matthew Blecker <matthewb@chromium.org> Commit-Queue: Matthew Blecker <matthewb@chromium.org>
* pylintrc: Copy Chromium OS platform2's configCraig Hesling2021-08-0218-0/+73
| | | | | | | | | | | | | | | | | | | | This requests that cros lint (and repo upload hook) use the new Chromium OS 4 space indent policy. Since legacy python scripts still use 2 space, I added pylint ignore statements to the individual files to disable indentation checking. Note: There are still valid pylint errors in some of these legacy scripts. BRANCH=none BUG=none TEST=cros lint util/*.py Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I439f5a87bc50f1f43a4996e574bbc0626922a88e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3064761 Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* extra/stack_analyzer: EC stack analyzer for Risc-v architecturetim2021-03-101-0/+100
| | | | | | | | | | | | | | | | Add the related stack instructions analysis for Risc-v architecture to calculate stack frame sizes of functions and find the maximum calling path with maximum stack usage in stack analyzer tool. BUG=b:181291750 BRANCH=none TEST=make BOARD=icarus analyzestack Signed-off-by: tim <tim2.lin@ite.corp-partner.google.com> Change-Id: Ieb1ccc3c1631f990adf7dd556f3e876b1a142a71 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2731176 Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
* extra/util: replace deprecated sys_siglist with strsignalAdrian Ratiu2021-02-172-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Starting with Glibc 2.32: * The deprecated arrays sys_siglist, _sys_siglist, and sys_sigabbrev are no longer available to newly linked binaries, and their declarations have been removed from <string.h>. They are exported solely as compatibility symbols to support old binaries. All programs should use strsignal instead. https://sourceware.org/pipermail/libc-announce/2020/000029.html BUG=chromium:1171287 BRANCH=none TEST=Local builds on x86_64 / eve and arm / kevin. Sent SIGINT to iteflash and verified output. Signed-off-by: Adrian Ratiu <adrian.ratiu@collabora.corp-partner.google.com> Change-Id: I8b4deaf8743c806a9610863648b345be3b35e1b5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2698188 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Commit-Queue: Manoj Gupta <manojgupta@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org>
* servo_updater: print available versionRuben Rodriguez Buchillon2021-02-121-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | This change introduces -p/--print to servo_updater. Rather than performing an update, it will print for the chosen board/channel what firmware is available. See TEST below for output. BRANCH=None BUG=b:179310743 TEST=servo_updater -b servo_micro -c alpha -p board: servo_micro channel: alpha firmware: servo_micro_v2.4.35-f1113c92b // showing py2 compatibility TEST=python2 /usr/lib64/python2.7/site-packages/servo_updater.py -b \ servo_micro --print -c alpha board: servo_micro channel: alpha firmware: servo_micro_v2.4.0-dc38d9bbb Change-Id: I9899e1cacc0496a46a41e94cc9355438a5abe491 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2674381 Reviewed-by: Brian Nemec <bnemec@chromium.org>
* servo_updater: firmware channel retrieval as a library serviceRuben Rodriguez Buchillon2021-02-121-1/+19
| | | | | | | | | | | | | | | | | | | | | This change introduces the ability of using servo_updater as a library to check whether a firmware string (e.g. the one currently read out from the servo device) belongs to a known channel. If so, the channel will be returned. If not, None is returned to indicate this is an unknown firmware string. This can then be used to warn the user to update, or inform them what channel they are currently running. BRANCH=None BUG=b:179310743 // This is performed with the CL that uses this: chromium:2661015 TEST=sudo servod -b soraka dut-control servo_micro_firmware_channel servo_micro_firmware_channel:stable Change-Id: I49e920c7c7977b7c05828f8464af973f538f7aeb Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2661021 Reviewed-by: Brian Nemec <bnemec@chromium.org>
* servo_updater: consolidate common code-pathRuben Rodriguez Buchillon2021-02-121-31/+41
| | | | | | | | | | | | | | | | | | | | | Commonly the users of servo_updater (as a script, or a file) care about the firmware version string in addition to knowing what the filename is, and the configuration is. These are used to print informational messages, or check whether an update is needed among other things. This change consolidates that logic by making sure that the version string is always extracted when possible. BRANCH=None BUG=b:179310743 TEST=sudo servod -b soraka // observe logs print the servo firmware version information TEST=sudo servo_updater --board servo_micro // observe no errors Change-Id: Id7cb8f53e5fc3e1f557d74445d49fcafbda851ad Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2661020 Reviewed-by: Brian Nemec <bnemec@chromium.org>
* servo_updater: introduce channelsRuben Rodriguez Buchillon2021-02-121-3/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change introduces the ability to pull an update from a specific channel (i.e. a specific file). See the bug for details on this project, but basically the `servo-firmware` package now bundles multiple firmware in the system, all of which are tagged to belong to a 'channel'. The name of those files is then [board_name].[channel].bin. The updater then now supports the notion of requesting a specific channel to update, if the default (stable) is not desired. Like the previous CL it also leverages choices for argparse to ensure no unknown channels are requested. BRANCH=None BUG=b:179310743 TEST=servo_updater --help | grep channel -c {alpha,dev,prev,stable}, --channel {alpha,dev,prev,stable} TEST=sudo servo_updater --board servo_micro -c alpha Current servo_micro version is servo_micro_v2.4.35-f1113c92b Available servo_micro version is servo_micro_v2.4.35-f1113c92b No version update needed Cq-Depend: chromium:2674405 Change-Id: I88c301cc4ff0ac246cbfda6498c27a1fd23f722f Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2661019 Reviewed-by: Brian Nemec <bnemec@chromium.org>
* servo_updater: cleanup and choicesRuben Rodriguez Buchillon2021-02-041-7/+14
| | | | | | | | | | | | | | | This change has some minor cleanup and introduces the usage of 'choices' to the board argument, to stop errors on argument parsing already. BRANCH=None BUG=b:179310743 TEST=servo_updater --help | grep board -b {c2d2,servo_micro,servo_v4,servo_v4p1,sweetberry}, --board [...] Change-Id: I676a5250d4721a309eec4a50a585a5ed719095b6 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2661018 Reviewed-by: Brian Nemec <bnemec@chromium.org>
* docs: Run mdformat on all .md filesTom Hughes2021-01-284-129/+138
| | | | | | | | | | | BRANCH=none BUG=b:178648877 TEST=view in gitiles Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I0ac5581ba7bc512234d40dbf34222422afa9c725 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2650551 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* servo_updater.py: Make script more reliable and improve error reportingMichał Barnaś2021-01-211-10/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | Add verifying if jump to region was successful by executing sysinfo after every jump. Add retries if no response to command from servo was received. BUG=b:177673664 BRANCH=main TEST=Prepare a few firmware builds from different commits, to be able to verify if they were successfully flashed. Flash firmware using modified script from extra/usb_updater: sudo ./servo_updater.py -b servo_v4p1 -f <fw> Run servod to connect to servo console and execute command: version Check if both RO and RW sections have the same FW version. TEST=To check error handling, run servod in one terminal, and in another one try flashing firmware. There should be retries due to no response received. After 2-3 retries, close servod and flashing should automatically continue without errors. Signed-off-by: Michał Barnaś <mb@semihalf.com> Change-Id: Ic73e50592fdc5f0f8e2cd9cd2ab4f034ef17e4ec Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2633993 Reviewed-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Commit-Queue: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
* stats_manager: formatting fix for md file outputRuben Rodriguez Buchillon2021-01-211-2/+3
| | | | | | | | | | | | | | | | | Minor formatting fix to make sure that .md files are \n terminated. Also a small change in the way we name the logger so that it derives the name directly from the class. BUG=b:174800621 BRANCH=None TEST=sudo servod -c kohaku_rev2_loc0.xml dut-power -t 3 // normal output Change-Id: I3e49068a7b0f3e8908fbcce6a13e083ce8e9216a Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2594689 Reviewed-by: Mengqi Guo <mqg@chromium.org>
* touchpad_updater: implement 512 byte transferTing Shen2021-01-191-32/+76
| | | | | | | | | | | | | | | | | | | Migrate the touchpad probe/update logic from CL:2551939 to touchpad_updater. Also adjust the memory allocation on Zed to allow 512 byte packet. BUG=b:177250972 TEST=On coachz, update detachable fw and run `ec_touchpad_updater -p 504c -f 282.0_2.bin` BRANCH=master Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: Icc7cec1f500dca04d6cdec5b66c10bcce05b67bd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2637304 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* usb_updater2: fix incorrect console outputTing Shen2021-01-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | argv[optind] is the index of next arg to be processed, what we want to print here is actually argv[optind - 1]. BUG=None TEST=Run `usb_updater2 -d 18d1:503c -p 208.0_2.0.bin` on Krane and check console output. Before this CL: read 65536(0x10000) bytes from (null) After: read 65536(0x10000) bytes from 208.0_2.0.bin BRANCH=main Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I45f584672f9c264d350374b43a3dd074b4a4ff7f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2623990 Tested-by: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@chromium.org>
* task_set_event: remove the wait argumentDawid Niedzwiecki2020-12-142-4/+3
| | | | | | | | | | | | | | | | | | | | There is an option in the task_set_event function which force the calling task to wait for an event. However, the option is never used thus remove it. This also will help in the Zephyr migration process. BUG=b:172360521 BRANCH=none TEST=make buildall Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: Ic152fd3d6862d487bcc0024c48d136556c0b81bc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2521599 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* servo_updater: make more robust on resetsRuben Rodriguez Buchillon2020-12-102-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>
* stm32uart: add delay after readingRuben Rodriguez Buchillon2020-12-091-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>
* stats_manager: add export to b/ friendly .mdRuben Rodriguez Buchillon2020-12-071-18/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change in addition to our copy/paste friendly textfile also outputs a buganizer markdown friendly .md summary of the results, to paste into bugs. BUG=b:174800621 BRANCH=None TEST=dut-power -t 3 Storing .md summaries at: [...]/S?_20201204-104756/onboard_summary.md cat [...]/S?_20201204-104756/onboard_summary.md **Onboard INA** |NAME|COUNT|MEAN|STDDEV|MAX|MIN| |-|-:|-:|-:|-:|-:| |LCD_BL_VOUT_mw|3|0.00|0.00|0.00|0.00| |PP1200_BRIJ_mw|3|0.00|0.00|0.00|0.00| |PP1200_TCPC_C0_mw|3|0.00|0.00|0.00|0.00| |PP1800_EC_mw|3|0.00|0.00|0.00|0.00| |PP1800_SENSORS_mw|3|0.00|0.00|0.00|0.00| |PP1800_VR_mw|3|0.00|0.00|0.00|0.00| |PP3300_A_R_mw|3|0.00|0.00|0.00|0.00| |PP3300_EC_STBY_mw|3|0.00|0.00|0.00|0.00| |PP3300_EC_mw|3|0.00|0.00|0.00|0.00| |PP3300_H1_mw|3|0.00|0.00|0.00|0.00| |PP3300_HUB_mw|3|0.00|0.00|0.00|0.00| |PP3300_PD_A_mw|3|0.00|0.00|0.00|0.00| |PP3300_PD_EC_mw|3|0.00|0.00|0.00|0.00| |PP3300_TCPC_C0_mw|3|0.00|0.00|0.00|0.00| |PP5000_A_mw|3|0.00|0.00|0.00|0.00| |PPVAR_BAT_R_mw|3|0.00|0.00|0.00|0.00| |PPVAR_BAT_mw|3|0.00|0.00|0.00|0.00| TEST=pytest stats_manager_unittest.py 21 passed TEST=python2 -m py.test stats_manager_unittest.py 21 passed Change-Id: I94e2d00721e744614838992604cd7a3124c0e39f Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2573736 Reviewed-by: Puthikorn Voravootivat <puthik@chromium.org>
* fw_update: fix python3 incompatibilityRuben Rodriguez Buchillon2020-11-191-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=None 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>
* fw_update: Pass bytes into `wr_command` functionYilin Yang2020-11-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | In `wr_command` function, we use `bytearray` to wrap the bytes argument. However, if we pass a `str` type to `bytearray` constructor, we need to specify the encoding. In this case, we need to use `bytes` here. BUG=b:172978731 BRANCH=master TEST=1. cros_workon --host start hdctools ec-devutils 2. sudo emerge hdctools ec-devutils 3. The fix applies into chroot TEST=ODM verifies in their side Signed-off-by: kerker <kerker@chromium.org> Change-Id: I57609c36e639cd6bd116b6f2f3a1baff02312070 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2543567 Tested-by: Henry Sun <henrysun@google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Henry Sun <henrysun@google.com>
* tree: rename strtoul to strtoull since it is 64-bitJett Rink2020-11-114-10/+10
| | | | | | | | | | | | | | | A long is 32-bit, but a long long is 64-bit. The function name should be strtoull if it is returning 64 bits of data. BRANCH=none BUG=b:172592963 TEST=builds Signed-off-by: Jett Rink <jettrink@chromium.org> Change-Id: I04c40f9256ed37eb1cf9b6bd1b0ef0320fe49b0c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2530874 Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* servo_updater: Add timeout on the pty flushBrian J. Nemec2020-10-211-2/+8
| | | | | | | | | | | | | | | | | | | If the servo is in a loop where it sends output on a continuous basis, the flush operation needs to eventually timeout. If the servo sends commands out faster than the timeout provided to the expects() call, it would never advance. This blocked the servo_updater from advancing. BUG=b:162628581 TEST=Connect Servo_v4p1 to DUT validate servo_updater works TEST=Modify Servo firmware to generate many console messages in a loop. Validate that the flush operation succeeds and servo updater still works. Change-Id: I8c0e65a0733b4d4ee25a9f9c866aa2b863cb0e5a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2487256 Reviewed-by: Matthew Blecker <matthewb@chromium.org> Tested-by: Brian Nemec <bnemec@chromium.org> Commit-Queue: Brian Nemec <bnemec@chromium.org>
* tigertool: Migrate tigertool.py to python2/3 compatibleYilin Yang2020-09-291-2/+4
| | | | | | | | | | | | BUG=chromium:1031705 BRANCH=master TEST=None Signed-off-by: kerker <kerker@chromium.org> Change-Id: I50b9aa6724bc6d9db5c7f743909d81c0b2dfc849 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2431319 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* ecusb: Fix subprocess argument to make it py2/3 compatibleYilin Yang2020-09-262-8/+13
| | | | | | | | | | | BUG=chromium:1031705 BRANCH=master TEST=None Signed-off-by: kerker <kerker@chromium.org> Change-Id: I78713f635e00cf01e1df641436b3a6d2f5c3c00b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2431318 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* usb_serial: Migrate console.py to python2/3 compatibleYilin Yang2020-09-261-15/+26
| | | | | | | | | | | | | | | Trace pyusb source code to make sure the correct interface, and change them properly. BUG=chromium:1031705 BRANCH=master TEST=None Signed-off-by: kerker <kerker@chromium.org> Change-Id: I185bf8a7d47f641f6554ba2d36a11d56967661b0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2422929 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* usb_updater: Migrate fw_update.py to python2/3 compatibleYilin Yang2020-09-261-3/+4
| | | | | | | | | | | | BUG=chromium:1031705 BRANCH=master TEST=None Signed-off-by: kerker <kerker@chromium.org> Change-Id: I00a1c0868980e9b8a03ad13ea000fbe94ef3192f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2425791 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>