summaryrefslogtreecommitdiff
path: root/extra
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* usb_updater: Migrate servo_updater.py to python2/3 compatibleYilin Yang2020-09-264-7/+22
| | | | | | | | | | | | | | | BUG=chromium:1031705 BRANCH=master TEST=`sudo python3 ./extra/usb_updater/servo_updater.py -b servo_v4 --force` shows "update complete". TEST=`sudo python2 ./extra/usb_updater/servo_updater.py -b servo_v4 --force` shows "update complete". Signed-off-by: kerker <kerker@chromium.org> Change-Id: I632203b9eca4aa99dc63063c37f0ab5fc2e54dbb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2425784 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* usb_power: Migrate convert_servo_ina.py to python2/3 compatibleYilin Yang2020-09-251-4/+6
| | | | | | | | | | | | | | | BUG=chromium:1031705 BRANCH=master TEST=` python2 convert_servo_ina.py kevin_r0_loc.py` can produce the same output as before TEST=` python3 convert_servo_ina.py kevin_r0_loc.py` can produce the same output as before Signed-off-by: kerker <kerker@chromium.org> Change-Id: Ieb162902cb00b3ece5d70921ed806ba204136221 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2422065 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* usb_power: Migrate convert_power_log_board.py to python2/3 compatibleYilin Yang2020-09-251-6/+9
| | | | | | | | | | | | | | | BUG=chromium:1031705 BRANCH=master TEST=`python3 convert_power_log_board.py board/kevin/kevin.board` can produce the same output as before TEST=`python2 convert_power_log_board.py board/kevin/kevin.board` can produce the same output as before Signed-off-by: kerker <kerker@chromium.org> Change-Id: I681c4ff2d7c98ad25f516982a5bc4ebb1b8caee4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2422064 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* stack_analyzer: Migrate to python3Yilin Yang2020-09-253-38/+47
| | | | | | | | | | | | | BUG=chromium:1031705 BRANCH=master TEST=stack_analyzer_unittest.py TEST=`make BOARD=kukui SECTION=RO analyzestack` runs successfully Signed-off-by: kerker <kerker@chromium.org> Change-Id: I4027c9c21bdf5fb456430231f1e9bfefed3e8fdb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2419737 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org>
* usb_spi: Remove stm32spi.py since no one uses itYilin Yang2020-09-241-140/+0
| | | | | | | | | | | | BUG=chromium:1031705 BRANCH=master TEST=None Signed-off-by: kerker <kerker@chromium.org> Change-Id: Idf4f5342da6b3f3307e1948c165d44b83031543a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2425983 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* usb_power: Migrate powerlog.py to python2/3 compatibleYilin Yang2020-09-241-5/+7
| | | | | | | | | | | | BUG=chromium:1031705 BRANCH=master TEST=`python3 powerlog_unittest.py` pass TEST=`python2 powerlog_unittest.py` pass Signed-off-by: kerker <kerker@chromium.org> Change-Id: I8507a1a5dd4ad06c6311a7d9259a23b8a6377f6a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2422063 Reviewed-by: Hung-Te Lin <hungte@chromium.org>
* usb_power: Migrate stats_manager.py to python2/3 compatibleYilin Yang2020-09-241-7/+9
| | | | | | | | | | | | BUG=chromium:1031705 BRANCH=master TEST=`python3 stats_manager_unittest.py` pass TEST=`python2 stats_manager_unittest.py` pass Signed-off-by: kerker <kerker@chromium.org> Change-Id: I4414eb99519ae43b1d94cebaea849a9b98beeb5d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2422062 Reviewed-by: Hung-Te Lin <hungte@chromium.org>
* COIL: change usage of sanityDaisuke Nojiri2020-08-141-4/+2
| | | | | | | | | | | | | | | | Google is working to change its source code to use more inclusive language. To that end, replace the term "sanity" with inclusive alternatives. BUG=b:163885307 BRANCH=None TEST=make -j buildall TEST=grep -ir sanity Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Change-Id: I487a50999d506a0337f1d3fbe173f193e5e4098a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2353516 Reviewed-by: Sam Hurst <shurst@google.com>
* ec: change usage of dummySam Hurst2020-08-051-13/+13
| | | | | | | | | | | | | | | | | | Google is working to change its source code to use more inclusive language. To that end, replace the term "dummy" with inclusive alternatives. BUG=b:162781382 BRANCH=None TEST=make -j buildall `grep -ir dummy *` The only results are in "private/nordic_keyboard/sdk8.0.0" which is not our code. Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I6a42183d998e4db4bb61625f962867fda10722e2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2335737 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* powerlog: fix "SusbError is not defined"David Herrig2020-07-311-1/+1
| | | | | | | | | | | | | | | | SusbError is not defined in powerlog.py This change raises Exception type instead. BUG=none BRANCH=none TEST=powerlog [..] -A=garbage => raises Exception: ('Power', 'USB device(garbage) not found') Change-Id: I8167a50796fec81f0fdf84d58e2e565f574c4f51 Signed-off-by: David Herrig <dherrig@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2324868 Reviewed-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Mengqi Guo <mqg@chromium.org>
* ec: change usage of whitelist/blacklistPaul Fagerburg2020-07-281-1/+1
| | | | | | | | | | | | | | | | | | | Google is working to change its source code to use more inclusive language. To that end, replace the terms "whitelist", "blacklist", and similar with inclusive alternatives. BUG=b:162262297 BRANCH=None TEST=`grep -Eirl "(white|black)[ _\-]*list" .` The only results are in "private/nordic_keyboard/sdk8.0.0" which is not our code. Signed-off-by: Paul Fagerburg <pfagerburg@google.com> Change-Id: Ie5210b98e1096c22d0e9284c101a42820bd3d79d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2321549 Tested-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org>
* ec: change usage of "sane" per inclusive languagePaul Fagerburg2020-07-221-4/+4
| | | | | | | | | | | | | | | | Google is working to change its source code to use more inclusive language. To that end, replace the terms "sane", "sanity check", and similar with inclusive/non-stigmatizing alternatives. BUG=b:161832469 BRANCH=None TEST=`make buildall -j` succeeds. `grep -Eir "sane|sanity" .` shows results only in third-party code or documentation. Signed-off-by: Paul Fagerburg <pfagerburg@chromium.org> Change-Id: I29e78ab27f84f17b1ded75cfa10868fa4e5ae88c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2311169 Reviewed-by: Jett Rink <jettrink@chromium.org>
* docs: update CCD docs locationsVadim Bendebury2020-07-101-1/+3
| | | | | | | | | | | | | BRANCH=none BUG=none TEST=verified that gitfiles points at the correct documents. Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Change-Id: I6123e74449d6dbda1645f4293dd24914ccaf0d37 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2276330 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Commit-Queue: Tom Hughes <tomhughes@chromium.org>
* servo_updater: Updates the Servo V4.1 nameBrian J. Nemec2020-06-022-1/+3
| | | | | | | | | | | | | | | | | | | | | | Updates the Servo V4.1 name from 'servo_v41' to 'servo_v4p1' and the corresponding files and fields. As the VID:PID is used to identify the device, no other changes are required. BUG=b:157059356 BRANCH=servod TEST=Updated the ServoV4.1 from 'servo_v41_v2.0.3735+440cf71e0' to 'servo_v4p1_v2.0.4232-514cb4e92' to verify the servo_updater supports renames. TEST=Verified servo_v4p1 manually: Validated console, firmware update, and servod can connect to the device. Signed-off-by: Brian Nemec <bnemec@chromium.org> Depends-On: Ia05134179fab4ff118355ba9b3b1b92cdf0748f2 Change-Id: Ie470469bf9115bbfef14a08c02b156dcd5aed849 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2219124 Tested-by: Brian Nemec <bnemec@chromium.org> Reviewed-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org>
* i2c-pseudo: Bring in FROMLIST v4 changes.Matthew Blecker2020-05-211-3/+4
| | | | | | | | | | | | | | | | | | | | Changes in this diff: - Documentation: I2C addresses on the controller streams are right-aligned without any read/write bit. - Documentation: fix "transacton" -> "transaction" typo Patch v4 on linux-i2c: https://lore.kernel.org/linux-i2c/20200521002907.176922-1-matthewb@chromium.org/ https://patchwork.ozlabs.org/project/linux-i2c/patch/20200521002907.176922-1-matthewb@chromium.org/ BRANCH=none BUG=none TEST=none (only documentation changes) Change-Id: I1673e8bbd4135e7905342fc2cbcb9fb415a77256 Signed-off-by: Matthew Blecker <matthewb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2210834 Reviewed-by: Harry Cutts <hcutts@chromium.org>
* i2c-pseudo: Fall back on nonseekable_open when stream_open is unavailable.Matthew Blecker2020-05-193-1/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The FROMLIST revision of i2c-pseudo is targeted at the newest Linux versions, which have new stream_open function and it is preferred for a pure I/O stream device. However updating to the FROMLIST i2c-pseudo broke compilation with older kernels that lack stream_open. Since Linux kernel versions as old as 4.18 are still in common use among Chrome OS developers, this fixes compatibility by checking for nonseekable_open and stream_open symbols. nonseekable_open is only used when stream_open is not found and nonseekable_open is found. Otherwise stream_open is used. BRANCH=none BUG=none TEST=With Linux 4.18 and Linux 5.2: $ make $ # With 4.18 matches nonseekable_open, with 5.2 matches stream_open. $ strings i2c-pseudo.ko | grep -E -m1 '^(nonseekable_open|stream_open)$' $ make clean $ ./install Signed-off-by: Matthew Blecker <matthewb@chromium.org> Change-Id: I62c44b1b63e7c4c6a9683be547baa341747f5efa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2205294 Reviewed-by: Harry Cutts <hcutts@chromium.org>
* i2c-pseudo: Bring in FROMLIST v3 revision.Matthew Blecker2020-05-192-158/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | This is mostly a copy of: https://lore.kernel.org/linux-i2c/20200511234817.59365-1-matthewb@google.com/ https://patchwork.ozlabs.org/project/linux-i2c/patch/20200511234817.59365-1-matthewb@google.com/ Changes in this diff: - Move anprintf() into i2c-pseudo.c. - Use sizeof_field() instead of FIELD_SIZEOF(). - Add CONST_STRLEN macro for i2cp_cmds[].cmd_size values, because on some architectures strlen("literal") is not a compile-time constant. - Use stream_open() instead of nonseekable_open(). - When copy_from_user() returns non-zero, return -EFAULT instead of 0. BRANCH=none BUG=none TEST=With Linux 5.2: $ make $ make clean $ ./install Signed-off-by: Matthew Blecker <matthewb@chromium.org> Change-Id: Idd2b7a2c5630e95de3021c1920ded4cf303db721 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2205293 Reviewed-by: Harry Cutts <hcutts@chromium.org>
* cr50_rma_open: raise an error if cr50 is too oldMary Ruthven2020-05-181-2/+2
| | | | | | | | | | | | | | At this point images with testlab support are available. Fail if cr50 is running a prod image that is too old. BUG=none BRANCH=none TEST=none Change-Id: I096502417c4a44b4a2f458a2a5601de2d154d5cf Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2207572 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* cr50_rma_open: fix version checkMary Ruthven2020-05-181-6/+6
| | | | | | | | | | | BUG=none BRANCH=none TEST=script works with a cr50 running 0.6.2 Change-Id: I14cfd8d90bff40843493d22576307421524d3350 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2207571 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* servo_updater: Re-add board name's to servo_updaterBrian J. Nemec2020-05-081-1/+5
| | | | | | | | | | | | | | | | | | | | Adds the board names back into servo_updater. These are used by manufacturing scripts in hdctools to identify which strings to pass to servo_updater. BUG=b:154527792 TEST=sudo emerge chromeos-base/ec-devutils Verified that emerge was successful TEST=sudo servo_updater Verified that the ServoV4 configuration is default TEST=sudo mfg_c2d2 Verified that C2D2 is used as target Change-Id: I75f7a8bcdd2c87951917f7ea3ec57f9288fda862 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2157570 Tested-by: Brian Nemec <bnemec@chromium.org> Reviewed-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Commit-Queue: Brian Nemec <bnemec@chromium.org>
* i2c-pseudo: Fix wrong word in ADAPTER_START documentationMatthew Blecker2020-05-021-1/+1
| | | | | | | | | | | BRANCH=none BUG=none TEST=none Change-Id: Ia8c99a4d68ba350f03cafa6457e673b8ca66a737 Signed-off-by: Matthew Blecker <matthewb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2176179 Reviewed-by: Harry Cutts <hcutts@chromium.org>
* servo_updater: Add Servo V4.1 to flash and servo updaterBrian J. Nemec2020-04-082-17/+30
| | | | | | | | | | | | | | | | | | | | | | | | | Adds the Servo V4.1 to the servo updater as the target 'servo_v41'. Some minor cleanup was done on the servo_updater logic to make it clearer which issue is occurring and to address common substrings in 'servo_v4' and 'servo_v41' by extracting the binary name from the config files directly rather than inferring from the name. BUG=b:153391164 TEST=sudo emerge chromeos-base/ec-devutils TEST=flash_ec --board=servo_v41 --image ec.bin Verify the flash_ec using the STM32 DFU to flash the image on reworked board with compatible BC1.2 change TEST=sudo servo_updater -b servo_v41 Verify the servo_updater finds the latest servo_v4.1 version and flashes it TEST=Attempted to flash V4 and V41 devices with each other's images verified that the checks prevent flashing the other version. Change-Id: I77d94ce9a641f39b7ee446af05e52441b7762c96 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2138638 Tested-by: Brian Nemec <bnemec@chromium.org> Reviewed-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Commit-Queue: Brian Nemec <bnemec@chromium.org>
* i2c-pseudo: Add udev ruleDavid Schneider2020-04-072-0/+9
| | | | | | | | | | | | | | | | This removes the need for servod and iteflash to run as root when run from outside the chroot. BRANCH=none BUG=b:153196340 TEST=ran script outside chroot and confirmed permissions Change-Id: I4bb9230eb4f581ddb3a095fc5fec0f56c7c573eb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2136338 Reviewed-by: Matthew Blecker <matthewb@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> Commit-Queue: David Schneider <dnschneid@chromium.org> Tested-by: David Schneider <dnschneid@chromium.org>
* servo_updater: Do not raise ServoUpdaterException on module importstabilize-12997.B-masterYu-Ping Wu2020-03-211-25/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | External tools such as platform/dev/contrib/dut-console may import servo_updater as a module. On import time, this module will check the existence of FIRMWARE_PATH and potentially raise ServoUpdaterException, which is unnecessary if the function the importing program calls does not have reference to the global variable FIRMWARE_PATH (for example, find_available_version()). In addition, there is only one function, findfiles(), that is currently using FIRMWARE_PATH and other similar global variables. Therefore, move the check for path existence inside findfiles(), so that ServoUpdaterException will not be raised on module import time. Also add servo board name constants to servo_updater to reduce duplicate string literals. BRANCH=none BUG=chromium:1061354 TEST=Run 'sudo servod -b kukui -m jacuzzi' and make sure findfiles() is called without exceptions Cq-Depend: chromium:2102179 Change-Id: I0179c44ba2a3947cb26035d97cd1ebeb453ef67a Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2102247 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* remove cr50 related filesNamyoon Woo2020-03-095-3560/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BUG=b:149350081 BRANCH=none TEST=build all, and emerged ec related packages for host and octopus. $ make buildall -j $ cros_workon --host list chromeos-base/chromeos-cr50-dev chromeos-base/chromeos-ec chromeos-base/chromeos-ec-headers chromeos-base/ec-devutils chromeos-base/ec-utils chromeos-base/ec-utils-test dev-util/hdctools $ sudo emerge chromeos-cr50-dev -j $ sudo emerge chromeos-ec -j $ sudo emerge chromeos-ec-headers -j $ sudo emerge ec-devutils -j $ sudo emerge ec-utils -j $ sudo emerge ec-utils-test -j $ sudo emerge hdctools -j $ cros_workon-octopus list chromeos-base/chromeos-ec chromeos-base/chromeos-ec-headers chromeos-base/ec-devutils chromeos-base/ec-utils chromeos-base/ec-utils-test dev-util/hdctools $ sudo emerge-octopus chromeos-ec -j $ sudo emerge-octopus chromeos-ec-headers -j $ sudo emerge-octopus ec-devutils -j $ sudo emerge-octopus ec-utils -j $ sudo emerge-octopus ec-utils-test -j $ sudo emerge-octopus hdctools -j Signed-off-by: Namyoon Woo <namyoon@chromium.org> Change-Id: If751b26b0635b0021c077338e96eaa8e8dcf17a5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2080631 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* cr50_rma_open: fix linter errorsMary Ruthven2020-02-141-193/+178
| | | | | | | | | | | | | | Fix errors from pylint. Use logging to print messages instead of print. BUG=b:149405690 BRANCH=none TEST=RMA open a device and enable testlab mode. Change-Id: I63a8b108b0f436291659f2f787ebcf72e8f4a523 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2052269 Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* cr50_rma_open: port to python 3Mary Ruthven2020-02-141-43/+50
| | | | | | | | | | | | BUG=b:149405690 BRANCH=none TEST=run with python3 Change-Id: I42bcccec83c7c582450c0b599f46b3fbf0ab3f80 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2052268 Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* c2d2: initial c2d2 addJett Rink2020-01-302-1/+16
| | | | | | | | | | | | | | | | | C2D2 is a debug board bring that uses an 8-pin debug header that is pin compatible with the em100 flash emulator. BRANCH=none BUG=b:145314772 TEST=UART communication for EC and H1 TEST=UART flashing of EC TEST=SPI reading and writing TEST=Automatic Vref detection for UART upon connect and disconnect Change-Id: I023994ed78942f2307e4adb802b5cc96afdf7e24 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1991849 Reviewed-by: Diana Z <dzigterman@chromium.org>
* tigertool: fix regexNick Sanders2020-01-181-1/+1
| | | | | | | | | | | | | | Change $ to \s in regex. BUG=None (tigertail serserialno fail TEST=./tigertool.py --setserialno test BRANCH=none Change-Id: I006ff8e70b3d20be44590c2050f9e341f10a2d53 Signed-off-by: Nick Sanders <nsanders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2008450 Reviewed-by: YH Lin <yueherngl@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* i2c-pseudo: Fix data byte separator in multi-byte I2C_XFER_REPLY example.Matthew Blecker2020-01-111-1/+1
| | | | | | | | | | | | BRANCH=none BUG=none TEST=none Change-Id: Ibe34f5cb4e0dfe3a2aed70dec9de12d4b064ca89 Signed-off-by: Matthew Blecker <matthewb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1995607 Reviewed-by: Harry Cutts <hcutts@chromium.org> Commit-Queue: Harry Cutts <hcutts@chromium.org>
* i2c-pseudo: Fix second example I2C transaction in Documentation.txtMatthew Blecker2019-12-171-2/+2
| | | | | | | | | | | | BRANCH=none BUG=none TEST=none Change-Id: I3fcdfb065e5d2534e6ebcfb7cdd7d60401c8cce1 Signed-off-by: Matthew Blecker <matthewb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1968205 Reviewed-by: Harry Cutts <hcutts@chromium.org> Commit-Queue: Harry Cutts <hcutts@chromium.org>
* cr50_rma_open: only disable timestamps with servodMary Ruthven2019-12-101-2/+5
| | | | | | | | | | | | | | | | cr50_rma_open can be run without servod. dut-control cr50_uart_timestamp:off fails if the script isn't running through servod. This change moves disabling timestamps, so it's only done on servod. BUG=none BRANCH=none TEST=run with and withoout servod Change-Id: Icc80d021dd7cbad8ae3632625b32b30368e5a94c Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1960919 Reviewed-by: Evan Green <evgreen@chromium.org>
* gsctool: add 'force_ro' optionVadim Bendebury2019-12-072-2/+12
| | | | | | | | | | | | | | | | | | | | | | By design gsctool does not update the inactive RO unless the running RO version is lower than the version in the Cr50 image being transferred. With transition to the new RO version, keys and rollback map state, there is a need to enforce that both ROs on the device are updated. This patch adds a command line option which allows to update the inactive RO to the contents of the Cr50 image. BRANCH=none BUG=b:136284186 TEST=running 'gsctool -q cr50.bin' updates the inactive RO section. Change-Id: I79c21fc2cd41c40070352d8fbce0b71dd3ae2b1f Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1949547 Reviewed-by: Namyoon Woo <namyoon@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org>
* cr50_rma_open: Disable UART timestampsEvan Green2019-12-071-1/+2
| | | | | | | | | | | | | | | | | The log timestamps are unexpected by the script, and cause issues. Send a dut-control command to disable UART timestamps. Also fix the regex in the board ID portion to accept a colon as well as a comma, whichever comes first. BUG=None TEST=Try cr50_rma_unlock.py BRANCH=None Change-Id: Ie9e54e65b86c52aef120fa3249453bfc090cf6f0 Signed-off-by: Evan Green <evgreen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1921703 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* ec: remove entering_mode host commandJoel Kitching2019-12-061-1/+0
| | | | | | | | | | | | | | | | | After this host command is called, the value is stored in g_vboot_mode and never accessed again. BUG=b:124141368, chromium:1014379 TEST=make buildall -j BRANCH=none Change-Id: I7923658139d15394c1c3c07baca7168e34c111e9 Signed-off-by: Joel Kitching <kitching@google.com> Cq-Depend: chromium:1830239, chromium:1864533 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1865050 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
* gsctool: delay RO update for old cr50 imagesMary Ruthven2019-11-221-0/+35
| | | | | | | | | | | | | | | | If Cr50 is running older than 0.3.20, delay the RO update 1 minute after the RW update, so Cr50 doesn't reject the RO blocks because their offsets are less than the RW offsets. BUG=b:144873413 BRANCH=none TEST=update board running RO 0.0.10 RW 0.3.18 to the RO 0.0.11 RW 0.3.22 image. Change-Id: I0179cc235c692133b08cd3430d71069b2f94bf69 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1929481 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* extra/touchpad_updater: Various fixups (cross-compile, new chip)Nicolas Boichat2019-11-152-12/+22
| | | | | | | | | | | | | | | | | | | | | | | | This fixes a few issues in touchpad_updater, that is used only for early bringup by Elan: - Fix Makefile to correctly cross-compile - Add support for 0x10 IC - Improve debugging - Remove manual fragmentation of USB bulk packets (this is not required and actually breaks large transactions) - Add timeout to libusb_bulk_transfer calls. BRANCH=kukui BUG=b:142333653 TEST=emerge-kukui -v ec-devutils && \ scp /build/kukui/usr/sbin/ec_touchpad_updater $IP:/usr/local/sbin Ping-pong between 2 images: ec_touchpad_updater -p 0x503c -f S8648A-15H0_FW01.bin ec_touchpad_updater -p 0x503c -f S8648A-15H0_FWB1.bin Change-Id: I78a8064002504ba4db15e202e516e7a2399bf648 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1906393 Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
* board/hammer: Fix masterball touchpad settingsNicolas Boichat2019-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Fix the dimensions, and also the size, and make sure that updating the FW actually works (it seems like increasing the timeout to 2000ms is needed). BRANCH=kukui BUG=b:140596094 TEST=Flash masterball, no warning in console on start TEST= Host: make TOUCHPAD_FW=S8648A-15H0_FW01.bin BOARD=masterball -j USE=updater_utils emerge-kukui -av ec-utils cros deploy $IP ec-utils DUT: usb_updater2 -d 18d1:503c -r; sleep 0.5; \ usb_updater2 -d 18d1:503c -s; usb_updater2 -d 18d1:503c ec.bin usb_updater2 -d 18d1:503c -p S8648A-15H0_FW01.bin Change-Id: Ia473ac420b42f52ad1639f950a3f08ff5d32df09 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1847512 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org>
* printf: Enable compile-time format checkingEvan Green2019-10-051-0/+1
| | | | | | | | | | | | | | | Add annotations to allow the compiler to check printf-style format strings in the EC. BUG=chromium:984041 TEST=make -j buildall BRANCH=None Change-Id: Ic39f37f8362372de7d289becea684d9da535599a Signed-off-by: Evan Green <evgreen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1733101 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* host_command: Change host command return value to enum ec_statusTom Hughes2019-10-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the host command handler callback function returns an int, it's easy to accidentally mix up the enum ec_error_list and enum ec_status types. The host commands always expect an enum ec_status type, so we change the return value to be of that explicit type. Compilation will then fail if you accidentally try to return an enum ec_error_list value. Ran the following commands and then manually fixed up a few remaining instances that were not caught: git grep --name-only 'static int .*(struct host_cmd_handler_args \*args)' |\ xargs sed -i 's#static int \(.*\)(struct host_cmd_handler_args \*args)#\ static enum ec_status \1(struct host_cmd_handler_args \*args)##' git grep --name-only 'int .*(struct host_cmd_handler_args \*args)' |\ xargs sed -i 's#int \(.*\)(struct host_cmd_handler_args \*args)#\ enum ec_status \1(struct host_cmd_handler_args \*args)##' BRANCH=none BUG=chromium:1004831 TEST=make buildall -j Cq-Depend: chrome-internal:1872675 Change-Id: Id93df9387ac53d016a1594dba86c6642babbfd1e Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1816865 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* Unify #! use in python scriptsStefan Reinauer2019-10-019-9/+9
| | | | | | | | | | | | | | | | | | Right now we have several different versions of #! in our python scripts. Unify them all and specify that we are using python2. Signed-off-by: Stefan Reinauer <reinauer@chromium.org> BUG=none BRANCH=none TEST=make buildall Change-Id: Iab33a3f5d4b827451a55542bcee8837b00da7867 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1817948 Commit-Queue: Stefan Reinauer <reinauer@chromium.org> Tested-by: Stefan Reinauer <reinauer@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* i2c-pseudo: Minor documentation fixes and clarifications.Matthew Blecker2019-09-271-8/+12
| | | | | | | | | | | BRANCH=none BUG=none TEST=Viewed the updated file in Gitiles. Change-Id: Icd10a54500a2521e4d598997385916d59dd38ab3 Signed-off-by: Matthew Blecker <matthewb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1827239 Reviewed-by: Justin TerAvest <teravest@chromium.org>
* servo_updater: enable paths to work on test images as wellRuben Rodriguez Buchillon2019-08-221-4/+34
| | | | | | | | | | | | | | | | | | | | | | | This change adds some logic to find config and firmware files on test images as well, where they end up being located at /usr/local/share instead. BUG=b:120921028 BRANCH=None TEST=manual testing // on fizz-labstation test image sudo servo_updater --board servo_v4 observe servo v4 getting updated Note: Test images right now do not have usb_updater2 yet (WIP) hence the test is done using fizz-labstation, a board that does come with usb_updater2 Change-Id: I4838424ed17bad5c3e2911cb967193863cd0b231 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1760974 Reviewed-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Todd Broch <tbroch@chromium.org>
* usb_updater2: fix compiler warningRuben Rodriguez Buchillon2019-08-221-1/+1
| | | | | | | | | | | | | | | | | | The compiler complained about this, noting that error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]. This seems to fix it. BUG=b:120921028 BRANCH=None TEST=manual testing sudo emerge ec-devutils -j32 // warning disappears Change-Id: I4a4392ec7e6bc7af06dc54b6382e52a1f2c91252 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1761467 Reviewed-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>