summaryrefslogtreecommitdiff
path: root/util
Commit message (Collapse)AuthorAgeFilesLines
* CBI: Add cbi-utilDaisuke Nojiri2018-01-182-0/+344
| | | | | | | | | | | | | | | | | | | | | | | | | | | | cbi-util is a build command line tool, which creates a blob containing board information. When invoked with '--show' option, it prints the information stored in a blob and validates the data. BUG=b:70294260 BRANCH=none TEST=Run the command as follows: $ cbi-util --create /path/to/cbi.bin \ --board_version 0xabcd --oem_id 2 --sku_id 3 --size 256 $ cbi-util --show /path/to/cbi.bin CBI blob: /path/to/cbi.bin BOARD_VERSION: 0.1 (0xab.cd) OEM_ID: 2 (0x02) SKU_ID: 3 (0x03) Data validated successfully $ cbi-util --create /path/to/cbi.bin \ --board_version 0xabcd --oem_id 2 --sku_id 3 Missing required arguments $ cbi-util --create /path/to/cbi.bin --board_version 0xabcde Invalid --board_version Change-Id: I7e7b439c50943523039c3cafda3bdf7d08962c61 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/860961 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* ectool: battery: Allow negative present currentNicolas Boichat2018-01-171-3/+2
| | | | | | | | | | | | | | | Battery interface over host command is different, as it allows negative current values to indicate discharge, let's not fail in that case. BRANCH=none BUG=b:65697620 TEST=ectool battery 1 does not fail when battery is discharging. Change-Id: I89ca750e24706f55a0589201aeaf9fea50f3132f Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/869552 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* ectool: add servo v2 spi supportVincent Palatin2018-01-175-0/+371
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new transport for ectool to send host command V3 over the Servo v2 SPI interface using libftdi. Build this new communication mechanism only for the 'build' architecture as it has a dependency on libftdi, the new ectool binary is called ectool_servo. Fix the 'build' tools build if they don't have a source file matching their binary name. The serial number of the servo board can be passed in the 'name' parameter, e.g. : sudo ectool_servo --name=905537-00474 version Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=b:70320279 TEST=with ZerbleBarn connected to a servo V2, run: sudo ectool_servo version Change-Id: Ia7067d465a42f76695fed5932f32fac9a6d0988e Reviewed-on: https://chromium-review.googlesource.com/864164 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* battery: Add support for reading base battery through host commandNicolas Boichat2018-01-141-12/+122
| | | | | | | | | | | | | | | | | | | | This adds support for EC_CMD_BATTERY_GET_STATIC and EC_CMD_BATTERY_GET_DYNAMIC host commands, that can currently only fetch the base battery information using index = 1. In the future, all battery information can be passed to AP using these host commands (i.e. lid could provide its own battery information on index = 0). BRANCH=none BUG=b:65697620 TEST=ectool battery shows lid battery information (no change) TEST=ectool battery 1 shows base battery information Change-Id: Ib819e4917b3acc337348764f6cc2aa7380bed700 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/863863 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* stm32mon: do not write trailing empty spaceVincent Palatin2018-01-101-0/+6
| | | | | | | | | | | | | | | | | | | | | Add a tweak to get faster flashing: skip writing the empty trailing space at the end of the firmware image. On the STM32H7x3, flashing 2MB of useless bytes over UART can be really slow... Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=b:67081508 TEST=flash_ec --board=meowth_fp Change-Id: Ie396ee7d5b5771e0f6249e38da37ef8329c84ae3 Reviewed-on: https://chromium-review.googlesource.com/856978 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* stm32mon: add STM32H7 identifierVincent Palatin2018-01-101-0/+1
| | | | | | | | | | | | | | | | Add a new chip ID to support the STM32H7x3 parts. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=b:67081508 TEST=flash_ec --board=meowth_fp Change-Id: I3897a74f5414e0e6b13890291706134c2d916af9 Reviewed-on: https://chromium-review.googlesource.com/856977 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
* stm32mon: change erase timeoutVincent Palatin2018-01-101-3/+12
| | | | | | | | | | | | | | | | | | | | | On some chips, the full erase operation can take really long: e.g 13s for 2MB mass-erase on the STM32H7x3 family. Add a new mechanism retrying the ACK detection rather than extending the default timeout which would imply very slow behavior in other cases (e.g. connection). Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=b:67081508 TEST=flash_ec --board=meowth_fp Change-Id: I428f56341c31c327debb9a3d2eba9b12c768ba86 Reviewed-on: https://chromium-review.googlesource.com/856976 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* lux: Add lux boardNicolas Boichat2018-01-101-0/+1
| | | | | | | | | | | | | lux is a dual-battery poppy derivative. BRANCH=none BUG=b:67029560 TEST=make BOARD=lux -j Change-Id: I01fdb1e5e2b4803cdf7f03f9e6ee73603f84a7b8 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/845542 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* util: ecst: Add 2 CHIP_VARIANTs to support npcx7m6xb/npcx7m7wCHLin2018-01-091-117/+115
| | | | | | | | | | | | | | | | | | | | This CL adds support for chip variant npcx7m6xb and npcx7m7w in the ecst utility. It also fixed the coding style by replacing some inapproiate tab characters with white space characters. BRANCH=none BUG=none TEST=No build errors for make buildall. TEST=Change CHIP_VARIANT to npcx7m7w/npcx7m6xb in board/npcx7_evb/build.mk; "BOARD=npcx7_evb make"; Check ec image can be built and image header is correct. Change-Id: I44bae48dcb4fa3bc8984184d8f43744e54bcf8e7 Signed-off-by: CHLin <CHLIN56@nuvoton.com> Reviewed-on: https://chromium-review.googlesource.com/851935 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* ectool: Correct reporting fan numbers on fanless device.Hung-Te Lin2018-01-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | `get_num_fans` tries to determine if fans are available according to feature list, retrieved from an ec_command. The ec_command today returns received output size on success, so to we should not check the result by "rv == EC_SUCCESS". Instead, we should check if rv returns a negative number, just like the cmd_inventory. BRANCH=none BUG=b:71690953 TEST=(on fanless Eve) ectool pwmgetnumfans # see Fans=0 ectool pwmgetfanrpm # see empty output, $?=0 Change-Id: Id748b70cec0afb0715febbda8883cd5ed53f7e3d Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/853755 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* ec_commands: Add sync sensorGwendal Grignou2018-01-081-0/+9
| | | | | | | | | | | | | | | | | | | SYNC motion sensor are use to count event. It sends an event to the AP each time a GPIO goes low/high, the datum contains a 16 bit counter. The location indicates the source of the event, as Android sensor hal will use this information (via sysfs location attribute) to link the sensor with other subsystem. BUG=b:67743747 BRANCH=none TEST=Unit tests. Change-Id: Ia808b25730ad4100efa216c6a86b7b090197c5a3 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/848496 Reviewed-by: Alexandru M Stan <amstan@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* stm32: add meowth_fp boardVincent Palatin2018-01-081-1/+2
| | | | | | | | | | | | | | | | | | | Configure it as a fingerprint MCU. Currently use ZerbleBarn as a proxy for it. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=b:67081508 TEST=flash and run the image on ZerbleBarn, do a finger image acquisition with the 'fptest' console command. Change-Id: I6e060c2d1e950ec81092088e1793b186fc0a5fa0 Reviewed-on: https://chromium-review.googlesource.com/806169 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* util/openocd: modify the openocd srcipts for npcx UUTCHLin2018-01-031-4/+8
| | | | | | | | | | | | | | | | | | | | In the CL:826909, the name and the restore address of ec_spiflash lfw are modified becaue of introducing the UUT. This CL modified the openocd scripts to follow the changes of the lfw. BRANCH=none BUG=none TEST=Apply CL:826906 and "BOARD=npcx7_evb make"; Run cmd "./util/flash_ec --board=npcx7_evb" to flash ec image; Make sure the ec firmware can be updated with the new npcx_minotor lfw + this CL via JTAG on Servo v2. Change-Id: If622f83e2d2132d66b390bcee30c77e7a9d5f7bd Signed-off-by: CHLin <CHLIN56@nuvoton.com> Reviewed-on: https://chromium-review.googlesource.com/828341 Commit-Ready: CH Lin <chlin56@nuvoton.com> Tested-by: CH Lin <chlin56@nuvoton.com> Reviewed-by: Shawn N <shawnn@chromium.org>
* util/flash_ec: npcx7 supports programming SPI flash via UARTCHLin2018-01-021-0/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL adds scripts to support updating ec image to the SPI flash by UUT(UART Update Tool) for npcx ec. A new array BOARDS_NPCX_UUT is introduced to include the board name which will use the UUT mechanism. The detail of test setup/procedure is listed below: 1. Connect the following singals between npcx7 evb and Servo board v2. NPCX7 EVB Servo V2 --------------------------------------- GPIO64/CR_SIN <--> UART1_SERVO_DUT_TX GPIO65/CR_SOUT <--> UART1_DUT_SERVO_TX VDD_3.3V <--> PPDUT_UART1_VREF 2. Manually pull the UUT mode strap pin(GPIO65/CR_SOUT) to ground with a 10 KOhm resistor. 3. Assert a EC VCC1_RST reset or issue a Power-Up reset. 4. Remove the pull-down in step 2. 5. Move npcx7_evb from array BOARDS_NPCX_7M6X_JTAG to BOARDS_NPCX_UUT in flash_ec. 6. ./util/flash_ec --board=npcx7_evb. BRANCH=none BUG=none TEST=Follow the steps above. Dump the SPI flash content to a file via JTAG. Compare the file and ec image. Make sure their content is all the same. Check the ec can reboot after programming. Run "sysjump rw"; make sure RW image works well. Change-Id: Iada5acb53179bdb78459c4fea7488fd2691575b6 Signed-off-by: CHLin <CHLIN56@nuvoton.com> Reviewed-on: https://chromium-review.googlesource.com/826763 Commit-Ready: CH Lin <chlin56@nuvoton.com> Tested-by: CH Lin <chlin56@nuvoton.com> Reviewed-by: Shawn N <shawnn@chromium.org>
* cleanup: Remove Nefario boardPhilip Chen2017-12-201-3/+0
| | | | | | | | | | | It's a dead board. BUG=none BRANCH=none TEST=make buildall -j Change-Id: I9f5530afdea07bb5787fa2b674984147f8425fba Signed-off-by: Philip Chen <philipchen@google.com>
* wand: Add wand boardNicolas Boichat2017-12-201-0/+1
| | | | | | | | | | | | | | hammer derivative, with a battery. BRANCH=none BUG=b:66575472 TEST=make BOARD=wand -j, flash to reworked hammer board, battery charging works. Change-Id: I42366f4738b35c352b9be0c44a17ebeb323adfd1 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/678756 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* ec_commands: Remove zero-size structsRandall Spangler2017-12-131-88/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The size of empty structs (and unions) varies between C and C++. When including in C++ code our external API in ec_commands.h header with extern "C". clang will complain (correctly) for all empty structs: error: empty struct has size 0 in C, size 1 in C++ [-Werror,-Wextern-c-compat] Remove them from the ec_commands.h header file. ectool.c has some ugly macros which assume subcommands have both requests and responses. Change those macros so they only reference the non-empty sub-structs. The macros are still ugly, but generate identical output, and don't rely upon zero-length structs. BUG=chromium:792408 BRANCH=none TEST=manual 1) Compile the following using 'clang -Wall -Werror': #include <stdint.h> extern "C" { #include "include/ec_commands.h" } int main(void) { return 0; } It compiles without error. 2) Copy the lb_command_paramcount, ms_command_sizes, and cs_paramcount globals from ectool.c to a dummy .c file and compile with 'gcc -S' to generate assembly. Do the same after applying this patch. Confirm the arrays have the same contents. Change-Id: Iad76f10315b97205b42118ce070463071fe97128 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/820649 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* cr50: move major version number component to 1Vadim Bendebury2017-12-112-4/+4
| | | | | | | | | | | | | | | | It is beneficial to have the 'major' version number component advanced with every major Cr50 code release: this will allow to use the 'minor' version number component when it is necessary to release a bug fix or a small addition to the current release. BRANCH=cr50 BUG=none TEST=verified proper version number reported by 'version' command Change-Id: Ie87a2b676b59b46be243fa6367571a1d0877f13d Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/820270 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* util: do not run host command check unless neededVadim Bendebury2017-12-081-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | With the recent addition of the presubmit check progress display it became obvious that hook2 from ./PRESUBMIT.cfg takes quite a bit of time on each check. A closer examination has shown that this script scans the entire codebase on each patch to see if there have been some inconsistencies wrt EC host command definitions. Let's limit running this check only to patches which actually touch EC host commands in any way. BRANCH=none BUG=none TEST=verified that the check runs only when the 'EC_.*CMD' string is present in the diffs output of the patch Change-Id: I128dba48332142b8835cf36747ab290190e6bcef Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/815951 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Sam Hurst <shurst@google.com>
* motion: Add bh1730 as a motion sensorYB.Ha2017-12-081-0/+3
| | | | | | | | | | | | | | | | - Add ROHM ambient light sensor driver - Add als sensor to motion sensors BRANCH=glados BUG=b:67022366 TEST=This driver is tested in caroline Signed-off-by: yb.ha <ybha@samsung.com> Change-Id: Ic73c50e17b412975f7850b7348ce310180f7a6eb Reviewed-on: https://chromium-review.googlesource.com/784659 Commit-Ready: YongBeum Ha <ybha@samsung.com> Tested-by: YongBeum Ha <ybha@samsung.com> Reviewed-by: Gwendal Grignou <gwendal@google.com>
* flash_ec: add --verbose argNick Sanders2017-12-061-5/+25
| | | | | | | | | | | | | | | | Add the option to dump all dut-control and flashrom commands and their arguments. BUG=b:37513705 BRANCH=None TEST=./util/flash_ec --board fizz --verbose Change-Id: Ie57c270a925a00f76d25e52831aa11e23ab9a524 Signed-off-by: Nick Sanders <nsanders@google.com> Reviewed-on: https://chromium-review.googlesource.com/807485 Commit-Ready: Nick Sanders <nsanders@chromium.org> Tested-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* Update genvif to create Rev 1.22 Vendor Info FilesSam Hurst2017-12-061-115/+259
| | | | | | | | | | | | | | | | | | Update genvif so that it can create Rev 1.22 Vendor Info Files. Also format the VIF so that it matches VIFs generated with the USB VIF generator. BUG=b:69972352 BRANCH=None TEST=`make -j buildall` Used generated VIF for nasher on GRL Test Equipment Signed-off-by: Sam Hurst <shurst@chromium.org> Change-Id: I35bc940c0c65c89be9a40ff9228e51123f136e7b Reviewed-on: https://chromium-review.googlesource.com/801874 Commit-Ready: Sam Hurst <shurst@google.com> Tested-by: Sam Hurst <shurst@google.com> Reviewed-by: Shawn N <shawnn@chromium.org>
* ec: Create lockfile in /run/lock/power_override.Daniel Erat2017-12-061-1/+2
| | | | | | | | | | | | | | | | | | Create a lockfile at /run/lock/power_override/battery_tool.lock rather than /run/lock/battery_tool_powerd.lock so that powerd doesn't need to special-case the file's path. BUG=chromium:784651 BRANCH=None TEST=None Change-Id: I151cf26d635dc969d113e9d80c93177985a7ab2f Signed-off-by: Daniel Erat <derat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/809921 Commit-Ready: Dan Erat <derat@chromium.org> Tested-by: Dan Erat <derat@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* ectool: Add switch-slot option to reboot_ec commandDaisuke Nojiri2017-12-061-3/+6
| | | | | | | | | | | | | | | | This patch adds switch-slot option to reboot_ec command. When the option is specified, it'll make EC switch the active RW slot before reboot. BUG=b:69921268 BRANCH=none TEST=Run ectool reboot_ec cold switch-slot and verify the active slot is switched. Change-Id: Iec568be36e6010ed9a51aa768a7f35e4a63f0fc0 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/809944 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cleanup: Remove honeybuns boardShawn Nematbakhsh2017-12-041-1/+0
| | | | | | | | | | | | | BUG=None TEST=`make buildall -j` BRANCH=None Change-Id: Ieeb98eee02eabdf03413975ecf286ca69550ddfc Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/803946 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* coffeecake: initial commitRong Chang2017-11-291-0/+1
| | | | | | | | | | | | | Clone HoHo board to CoffeeCake. BRANCH=none BUG=none TEST=make BOARD=coffeecake -j Signed-off-by: Rong Chang <rongchang@chromium.org> Change-Id: I62b4bf92a2eaffbc145197c7f36cfb7a29722bf5 Reviewed-on: https://chromium-review.googlesource.com/673963 Reviewed-by: Benson Leung <bleung@chromium.org>
* util: Remove duplicate 'const' in export_taskinfo.cMartin Roth2017-11-201-1/+1
| | | | | | | | | | | | | | | | | | This is causing an error in the latest coreboot toolchain: util/export_taskinfo.c:33:30: error: duplicate 'const' declaration specifier [-Werror=duplicate-decl-specifier] BUG=None TEST=Build now passes with latest coreboot toolchain and cros Ztoolchain BRANCH=None Change-Id: I069d08128e264310d25a09ada2276f92796294b7 Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: https://chromium-review.googlesource.com/679939 Commit-Ready: Martin Roth <martinroth@chromium.org> Tested-by: Martin Roth <martinroth@chromium.org> Reviewed-by: Stefan Reinauer <reinauer@google.com>
* flash_ec: Add support for meowth.Aseda Aboagye2017-11-161-1/+2
| | | | | | | | | | | | | BUG=None BRANCH=None TEST=None Change-Id: Ib0c6b029c608ac361ed661249138589c99ea68b6 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/772910 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* cr50: prepare to release 0.0.26Vadim Bendebury2017-11-152-2/+2
| | | | | | | | | | | | | | The new release will include fixes for SPI problems discovered when debugging Fizz. BRANCH=cr50 BUG=none TEST=none Change-Id: I4ac2ab762ec86957a7555b0aaa41235f44a54d47 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/772738 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* grunt: Initial GPIO setup for gruntEdward Hill2017-11-141-1/+1
| | | | | | | | | | | | | | | | Configure GPIOs to match grunt proto v1.1 schematic. Change EC chip to npcx7m6f. Minimal board.c/h, just enough to build. BUG=b:64935726 BRANCH=none TEST=make BOARD=grunt Change-Id: I1a1f581c7ee7b80808c0dde179bc3ee0d69f960e Signed-off-by: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/754302 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* rainier: add rainier support for flash_ecEge Mihmanli2017-11-141-0/+1
| | | | | | | | | | | | | BUG=chromium:776441 BRANCH=none TEST=Run "./flash_ec --board=rainier" from ec/util directory and make sure there is no error "board rainier not supported" on stderr. Signed-off-by: egemih@chromium.org Change-Id: I4b4b714962685d0b33d3b9aa4c96b5a89eb566c5 Reviewed-on: https://chromium-review.googlesource.com/767589 Commit-Ready: Ege Mihmanli <egemih@google.com> Tested-by: Ege Mihmanli <egemih@google.com> Reviewed-by: Shawn N <shawnn@chromium.org>
* ectool: Print temperature unit in ectool temps outputNicolas Boichat2017-11-111-2/+2
| | | | | | | | | | | | | | | | | Currently, 'ectool temps all|<n>' just prints "300". This may easily be mistakenly read as tenth of degree C (30.0 C), as the value appears to make sense (close to room temperature). However, the value is actually 300 K (27 C). CQ-DEPEND=CL:763578 BRANCH=none BUG=chromium:783845 TEST=ectool temps all shows temperature unit (K) Change-Id: I70f7f04d061cb1d4f741d59f8b48c7963dd8280f Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/763996 Reviewed-by: Shawn N <shawnn@chromium.org>
* cleanup: Remove llama boardShawn Nematbakhsh2017-11-091-1/+0
| | | | | | | | | | | | | | | | | The llama is a South American relative of the camel, though the llama does not have a hump. These sturdy creatures are domestic animals used by the peoples of the Andes Mountains. BUG=None TEST=`make buildall -j` BRANCH=None Change-Id: I55dbd8d5b0b14c41e27c4ef473833563f38878c3 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/761298 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* board: Add support for whiskers boardNicolas Boichat2017-11-091-0/+1
| | | | | | | | | | | | | A hammer derivative. BRANCH=none BUG=b:68934906 TEST=make BOARD=whiskers -j Change-Id: I8df5156d622bf518f647addf2fcea6342b2d6f2b Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/754078 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* flash_ec: Set NEED_SERVO according to chip name instead of board nameWai-Hong Tam2017-11-061-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | One can pass either a board name (e.g. hammer) or a chip name (stm32) to the flash_ec command. If given a board name, will map to a proper chip name and then call its chip-flashing method. The NEED_SERVO variable ("no" if servo not needed) was set according to the board name. It was broken if only given a chip name. It should be set according to the chip name. BUG=b:68943874 BRANCH=None TEST=Flashed the Staff firmware SERVO $ dut-control ec_boot_mode:on DUT $ ectool gpioset PP3300_DX_BASE 0 DUT $ ectool gpioset PP3300_DX_BASE 1 DUT $ flash_ec --chip stm32_dfu --image staff_ec.bin SERVO $ dut-control ec_boot_mode:off DUT $ ectool gpioset PP3300_DX_BASE 0 DUT $ ectool gpioset PP3300_DX_BASE 1 Change-Id: I1799f083115bfdf203a405733c5baefadbe3fe3e Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/755614 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* flash_ec: Get the path of EC UART PTY only in flash_stm32Wai-Hong Tam2017-10-301-3/+2
| | | | | | | | | | | | | | | | | | Flashing STM32 requires the EC UART. The path of EC UART PTY was originally set under some conditions which didn't reflect the case. Instead of fixing these conditions, this change simply moves it inside flash_stm32() as other flash functions don't need EC UART PTY. BRANCH=none BUG=b:67010776 TEST=Used servo-micro to flash_ec a STM32 EC, no error on getting EC UART PTY. Change-Id: I20c31de8e6c7a99fde259f4f397e53325ee80b07 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/745101 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Nick Sanders <nsanders@chromium.org>
* cr50: prepare to release 0.0.25Vadim Bendebury2017-10-242-2/+2
| | | | | | | | | | | | | Let's make CCD and RMA auth features available on pre-PVT decvices. BRANCH=cr50 BUG=b:68161393 TEST=none Change-Id: Ic4ced2ba0e44b620bfeef9aa11f4676667c3176f Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/734762 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* ec: add initial nautilus boardChris Wang2017-10-231-0/+2
| | | | | | | | | | | | | | For now use the files from poppy. To be changed later on. BUG=b:66458931 TEST=emerge-nautilus chromeos-ec/make buildall -j Change-Id: If829d7307f834f1f30878934623c0e9ee77b907d Signed-off-by: Chris Wang <chriswang@ami.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/701996 Commit-Ready: Grace Kao <grace.kao@intel.com> Tested-by: Grace Kao <grace.kao@intel.com> Reviewed-by: Philip Chen <philipchen@chromium.org>
* pd: Add "freeze" dual-role policyShawn Nematbakhsh2017-10-191-1/+2
| | | | | | | | | | | | | | | | | Add a new DRP policy to "freeze" the power role of each port, never toggling automatically, though manual role swaps may still occur. BUG=chromium:769895 BRANCH=servo TEST=On servo_v4, verify DUT port stays in SRC role and POWER port stays in SNK role while disconnected. Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: Ibff3cd1ffaf0e884b030c231003763a57acbe02e Reviewed-on: https://chromium-review.googlesource.com/715276 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* util/misc_util: Fix unchecked errorPatrick Georgi2017-10-191-2/+5
| | | | | | | | | | | | | | | | It's unlikely, but let's check for ftell() errors. BUG=b:64477774 BRANCH=none TEST=none Change-Id: I3690da60f756ab056e852e9f485b3c439c82e67b Signed-off-by: Patrick Georgi <pgeorgi@google.com> Found-by: Coverity Scan #58158 Reviewed-on: https://chromium-review.googlesource.com/719196 Commit-Ready: Patrick Georgi <pgeorgi@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Martin Roth <martinroth@chromium.org>
* flash_ec: Add 1s delay after turning on SPI VREF.Aseda Aboagye2017-10-181-0/+7
| | | | | | | | | | | | | | | | | On zoombini, we were taking enough power that the voltage dipped for a little bit. This commit adds a 1 second delay after applying SPI VREF but before actually flashing the EC. BUG=b:65694390 BRANCH=None TEST=`./util/flash_ec --board zoombini` still works. Change-Id: I431cbfcc569fd5369971b06dedb85e8d5fdb9a32 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/722354 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* util: let cr50 signer use chroot version of gsctoolVadim Bendebury2017-10-161-2/+3
| | | | | | | | | | | | | | | | | | | Requiring installation of the gsctool locally in the EC tree could collide with debug versions or executables built for wrong architectures. Let's use the version installed in chroot and give user instructions how to install it if it is not there. BRANCH=cr50 BUG=none TEST=verified that create_released_image.sh still works with the chroot version of the tool Change-Id: Ib155e166297d28c1660f7f33bb000b3bb8fe7a15 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/709739 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* util/iteflash.c: make sure that the file is closedPatrick Georgi2017-10-141-1/+1
| | | | | | | | | | | | | | | | | An insignificant bug, but Coverity complains about it. Reduce the cognitive load by making sure that file is closed in time. BUG=none BRANCH=none TEST=none Change-Id: I2efbe136f4991cf829b95568eef22eb7b2d1a8c6 Found-by: Coverity Scan #141758 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/702304 Commit-Ready: Patrick Georgi <pgeorgi@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Chris Ching <chingcodes@chromium.org>
* util/iteflash.c: Handle potential resource leaksPatrick Georgi2017-10-141-0/+2
| | | | | | | | | | | | | | | | | | | They're of really little consequence right now since an error in verify_flash() is only followed by resource tear down and process exit. verify_flash could gain other call-sites though, so better be safe than sorry. BUG=none BRANCH=none TEST=none Change-Id: I5fa8276dc3b3e124dacceca1ea857430982f7567 Found-by: Coverity Scan #141761, #141762 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/702482 Commit-Ready: Patrick Georgi <pgeorgi@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Chris Ching <chingcodes@chromium.org>
* cleanup: Use CONFIG_BATTERY to indicate whether a board has a batteryShawn Nematbakhsh2017-10-131-3/+1
| | | | | | | | | | | | | BUG=b:35528297 BRANCH=None TEST=`make buildall -j` Change-Id: I9e4814b4172f20711f7edd691c9569f9130aec8e Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/713395 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* flash_ec: Save more variables.Aseda Aboagye2017-10-121-3/+6
| | | | | | | | | | | | | | | | | | | It was found on zoombini, when flashing via flash_ec failed, it would prevent the board from booting as certain controls were left in their "flashing" state. This was because these controls were missing from the variables list which is what was used to restore the controls. BUG=b:65694294 BRANCH=None TEST=Attempt to flash zoombini without the flex connected. Attach the servo flex, apply power, verify DUT boots up. Change-Id: Ic2bc74ef1a61d4f10da6d3ceac77fbd373697838 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/714023 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* grunt: initial setup for ecYH Lin2017-10-111-0/+1
| | | | | | | | | | | | | | Initial files for grunt, to be revised later. BUG=b:67187149 TEST=None BRANCH=None Change-Id: I392bb4982fea0c9374ba8d262f8f4288522207d5 Signed-off-by: YH Lin <yueherngl@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/699554 Reviewed-by: Jason Clinton <jclinton@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* g: rename usb_updater into gsctoolVadim Bendebury2017-10-101-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The usb_updater utility has long been not just an updater, and has long been using other interfaces in addition to USB. gsctool is a much more suitable name. CQ-DEPEND=CL:709776 BRANCH=cr50 BUG=b:67007500 TEST=verified that make -C ./extra/usb_updater generates ./extra/usb_updater/gsctool: $ ./extra/usb_updater/gsctool --help Usage: gsctool [options] <binary image> This updates the Cr50 RW firmware over USB. The required argument is the full RO+RW image. Options: [...] $ Change-Id: I3ab70c28acf3664ddefaa923a87ba1fd5c3c437b Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/709738 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* util/ectool.c: Make sure device_name is NUL terminatedPatrick Georgi2017-10-091-1/+2
| | | | | | | | | | | | | | BRANCH=none BUG=none TEST=none Found-by: Coverity Scan #144116 Change-Id: I9ec030c1a3820af7d08c2a83e3c1f4c3ee7a3f0a Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/702302 Commit-Ready: Patrick Georgi <pgeorgi@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Chris Ching <chingcodes@chromium.org>
* vboot: Modify the parameter offsetJagadish Krishnamoorthy2017-09-271-0/+1
| | | | | | | | | | | | | | | | | For the Host Command vboot hash EC_VBOOT_HASH_GET case, if the input parameter offset and size is 0 then change offset to data_offset to obtain the latest hash value. Else retain the offset to get the hash value at offset. BUG=b:66957716 BRANCH=NONE TEST=On Soraka, ectool echash commands (RO, RW) should result in hash information. Change-Id: Ife17d35b0dfeecb5ec799c9ed722ae48dbec5b5b Signed-off-by: Jagadish Krishnamoorthy <jagadish.krishnamoorthy@intel.com> Reviewed-on: https://chromium-review.googlesource.com/685738 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>