summaryrefslogtreecommitdiff
path: root/util
Commit message (Collapse)AuthorAgeFilesLines
* util/ectool: Fix llvm compiler errorsShawn Nematbakhsh2016-12-161-3/+4
| | | | | | | | | | | | | | | | | | | BUG=chromium:668259 BRANCH=None TEST=Manual on samus (w/ gcc-built ectool). Verify 'ectool pause_in_s5 [on|off]' followed by 'ectool pause_in_s5' reflects the new updated state. Verify 'ectool --name=cros_pd flashpd 0 1 ec.RW.bin' succeeds to flash valid zinger RW image. Also verify `emerge-nyan_big ec-utils` succeeds w/ new llvm toolchain. Change-Id: Ibe83ee0fc0b2e6f535ed822603f438ed62350d29 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/419797 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cr50: prepare for releasing rw version 0.0.13Vadim Bendebury2016-12-132-2/+2
| | | | | | | | | | | | | Which is coming soon. BRANCH=none BUG=none TEST=built a new image, verified that its rw version is 0.0.13 Change-Id: I7a8b2497078f67393df93181d29cfde905d20ba6 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/419182 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* cr50: update minor versions to 12Vadim Bendebury2016-12-082-2/+2
| | | | | | | | | | | | | | | In preparation to a new release let's bump up minor versions of both prod and dev images to 12. BRANCH=none BUG=none TEST=built images and verified version number Change-Id: I55979374f5e3e21fedde128410c4861e4c2ad9c4 Reviewed-on: https://chromium-review.googlesource.com/417883 Commit-Ready: Vadim Bendebury <vbendeb@chromium.org> Tested-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org>
* cr50: add image signing scriptVadim Bendebury2016-12-081-0/+166
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a 'semi official' utility script which re-signs previously generated CR50 RW images. By default the script uses ec.RW.elf and ec.RW_B.elf in build/cr50/RW as inputs and util/signer/ec_RW-manifest-dev.json as the manifest, and places the newly signed images into build/cr50/ec.bin. The only outside dependency of this script is the signing utility itself, which is expected to be available as $HOME/bin/codesighner. The following command line options are accepted: b1 - generate signature for the b1 version of the H1 chip elves <elf1> <elf2> - sign the supplied elf files instead of the default ones. Handy if the builder generated files need to be signed help - print this message hex - generate hex output instead of binary prod - sign with prod key (no debug image will be signed) When invoked with 'hex' as a command line parameter, the script just re-signs the supplied elf files and places them in 0.signed.hex and 1.signed.hex in the current directory. This script also allows to sign dev images for running on prod RO. To do that invoke this script as follows: H1_DEVIDS='<dev id0> <dev id1>" ${progname} [other options, if any] where <dev id0> <dev id1> are values reported by sysinfo command in the DEV_ID: line when ran on the CR50 for which the image is built. BRANCH=none BUG=chrome-os-partner:57956 TEST=manual tried signing dev and prod images, including sighing a dev image to run on a prod device. All cases succeeded. Change-Id: I879c4a08503a19a0c440b141aa1fd6b29cc70bf7 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/417221 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* cr50: rename dev mode manifest fileVadim Bendebury2016-12-061-0/+0
| | | | | | | | | | | | | | | The manifest used for signing in dev mode was originally used for kevin evt 1, but now it is a common dev mode manifest. Rename the fie appropriately and modify the makefile using it. BRANCH=none BUG=chrome-os-partner:57956 TEST=verified that it is still possible to build cr50 with CR50_DEV=1 Change-Id: If744406a83a7045cd34c76c941fdef209bef51ac Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/417220 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* cr50: update both prod and dev minor RW versions to 11Vadim Bendebury2016-12-022-2/+2
| | | | | | | | | | | | | | | The latest released images are 0.0.11, let's update the manifests such that images built in dev environment can override released images. BRANCH=none BUG=none TEST=verified that new images are built with RW version 0.0.11 Change-Id: I4db82abd3eb725849b656259f675b32a8314942c Reviewed-on: https://chromium-review.googlesource.com/415601 Commit-Ready: Vadim Bendebury <vbendeb@chromium.org> Tested-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Fix EC build for latest llvmManoj Gupta2016-11-201-5/+1
| | | | | | | | | | | | | | | llvm bug: https://llvm.org/bugs/show_bug.cgi?id=31050 is now fixed So remove unnecessary pointer casts. BRANCH=none BUG=chromium:665240 TEST=Builds now Change-Id: I5695a9605b5ab47d11f7e9ecacc52f2ba53385e7 Reviewed-on: https://chromium-review.googlesource.com/412880 Commit-Ready: Manoj Gupta <manojgupta@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Yunlian Jiang <yunlian@chromium.org>
* Fix EC build for latest llvmManoj Gupta2016-11-161-1/+5
| | | | | | | | | | | | | | | | | | | | | | BRANCH=none util/ectool.c:1158 merror: taking address of packed member 'size' of class or structure 'ec_params_usb_pd_fw_update' may result in an unaligned pointer value [-Werror,-Waddress-of-packed-member] For this case, the pointer is always aligned but clang complains. Workaround using double pointer casts to char and uint. uint32_t *data = &(p->size) + 1; BUG=chromium:665240 TEST=Builds now Change-Id: Ibccf0f6e409b9724fc9e5acf28dde570e9d341e3 Reviewed-on: https://chromium-review.googlesource.com/411384 Commit-Ready: Manoj Gupta <manojgupta@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Yunlian Jiang <yunlian@chromium.org>
* util/ecst: Fix misspelling in #definesMartin Roth2016-11-152-7/+7
| | | | | | | | | | | | | | This should be 'default' BUG=None BRANCH=None TEST=make buildall passes Change-Id: I58a960ed48f8ea42529682cef4d99c98ac1aa2dc Signed-off-by: Martin Roth <martinroth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/403419 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Mulin Chao <mlchao@nuvoton.com>
* Fix various misspellings in commentsMartin Roth2016-11-153-4/+4
| | | | | | | | | | | | | No functional changes. BUG=none BRANCH=none TEST=make buildall passes Change-Id: Ie852feb8e3951975d99dce5a49c17f5f0e8bc791 Signed-off-by: Martin Roth <martinroth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/403417 Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
* flash_ec: Only check the board in the raiden list if the board not emptyWai-Hong Tam2016-11-101-1/+2
| | | | | | | | | | | | | | | | | | The firmware provision job running in the lab calls the flash_ec script with the --chip parameter, instead of the --board parameter. So only check if the board name is in the raiden list if it is a non-empty board. BRANCH=none BUG=chrome-os-partner:58039 TEST=Manually triggered the flash_ec command: $ flash_ec --chip=npcx_spi --image=${IMAGE} --port=9999 --raiden Change-Id: I25fef906d93803a94c544f7699ce494a84c46bd8 Reviewed-on: https://chromium-review.googlesource.com/410162 Commit-Ready: Wai-Hong Tam <waihong@google.com> Tested-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* hammer: Initial checkoutNicolas Boichat2016-11-081-0/+1
| | | | | | | | | | | | BRANCH=none BUG=chrome-os-partner:59083 TEST=make BOARD=hammer -j && bash flash_hammer Change-Id: I8cc11408d28677a800af58e738f47d5dcadea3e6 Reviewed-on: https://chromium-review.googlesource.com/407739 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* Add prod RW manifest and public key.Marius Schilder2016-11-032-0/+167
| | | | | | | | | Change-Id: If008b0dc388fdd81366e52aab8046af83a288e12 Reviewed-on: https://chromium-review.googlesource.com/407050 Commit-Ready: Marius Schilder <mschilder@chromium.org> Tested-by: Marius Schilder <mschilder@chromium.org> Reviewed-by: Marius Schilder <mschilder@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* cr50: bump up minor RW version field againVadim Bendebury2016-10-271-1/+1
| | | | | | | | | | | | | | | In preparation to a new CR50 image release one more bump up the minor version number is required. BRANCH=none BUG=none TEST=none Change-Id: I1ac48eb01cb9d48fb796c79b2676399e7bb57b18 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/403455 Reviewed-by: Marius Schilder <mschilder@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* eve: Add new boardDuncan Laurie2016-10-261-0/+2
| | | | | | | | | | | | | | | | | Add support for eve P0 board with: - chip: npcx - pmic: bd999992GW - charger: bd99956 - tcpc: 2x anx3429 BUG=chrome-os-partner:58666 BRANCH=none TEST=build and boot on eve board Change-Id: I69ff246e9f8197d5d50241e6a8fa4796f4c9bfda Signed-off-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/400638
* amenia: remove mainboardAndrey Petrov2016-10-251-1/+0
| | | | | | | | | | | | | | | Amenia is EOL. Remove mainboard. BUG=chrome-os-partner:57490 BRANCH=none TEST=none Change-Id: Idd453299df866c8ea6e4a4903d94bc26ff9150c6 Signed-off-by: Andrey Petrov <andrey.petrov@intel.com> Reviewed-on: https://chromium-review.googlesource.com/392231 Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* Snappy: Create initial boardBruce2016-10-201-0/+3
| | | | | | | | | | | | | | | Create initial snappy EC code, by copy from reef BUG=chrome-os-partner:58233 BRANCH=None TEST=make buildall Change-Id: Ie13491c07165988047d131404a0e759c0d40562a Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/401221 Commit-Ready: Bruce Wan <Bruce.Wan@quantatw.com> Tested-by: Bruce Wan <Bruce.Wan@quantatw.com> Reviewed-by: Shawn N <shawnn@chromium.org>
* polyberry: add initial board buildNick Sanders2016-10-181-0/+1
| | | | | | | | | | | | | This supports gpio initialization only. BUG=None TEST=Successfully checked console and available GPIO on sweetberry BRANCH=None Change-Id: Id50f66652b05c25a8c79ce2938fa161a944d93b8 Signed-off-by: Nick Sanders <nsanders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/399643 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* getversion: Fix lucid failing because of version stringsDaisuke Nojiri2016-10-141-4/+1
| | | | | | | | | | | | | | | make build=lucid fails if there is an uncommitted change in the tree because '-dirty' is appended to version strings, which causes the image to exceed the flash size limit. BUG=chromium:654549 BRANCH=none TEST=make buildall -j Change-Id: Ie4a7b4c7dc70846108aed953215f79dc30a10fca Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/396617 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Pyro: Create initial boardBruce2016-10-081-0/+3
| | | | | | | | | | | | | | | Create initial pyro EC code, by copy from reef BUG=chrome-os-partner:58062 BRANCH=None TEST=make buildall Change-Id: Iaae8db11845675421b653d4762d235229bb7c50d Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/393706 Commit-Ready: Keith Tzeng <keith.tzeng@quantatw.com> Tested-by: Keith Tzeng <keith.tzeng@quantatw.com> Reviewed-by: Shawn N <shawnn@chromium.org>
* util: ectool: Add names for new sensors.Gwendal Grignou2016-10-081-2/+13
| | | | | | | | | | | | | Match ec_commands.h, adding new type and sensors. BUG=none BRANCH=reef TEST=Check on Reef that barometer sensor info is displayed properly. Change-Id: I257f5161e5f57be562a2b3a29442b49f47f3fc89 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/394749 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* cr50: bump up minor RW version fieldVadim Bendebury2016-10-061-1/+1
| | | | | | | | | | | | | | | In preparation to the new CR50 image release one more bump up the minor version number is required. BRANCH=none BUG=none TEST=none Change-Id: I7d998fc80bd4a45cfc12c003d056a36c93dcc1d3 Reviewed-on: https://chromium-review.googlesource.com/394253 Tested-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Commit-Queue: Vadim Bendebury <vbendeb@chromium.org>
* util: Fix fifo_info when lost vectors are presentGwendal Grignou2016-10-051-3/+14
| | | | | | | | | | | | | | | | | | | Due to an error in ms_command_sizes, fifo_info command would fail when lost vectors are present: packet too long (16 bytes, expected 10) Reorder ms_command_sizes commands properly. Get the number of sensors present before printing the number of lost vectors per sensor. BUG=none BRANCH=none TEST=On cave (with broken MKBP support), check fifo_info is returning the lost vectors count. Change-Id: Ic745eb762563705372d8a670ce34eab15e188bf9 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/391887 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* cr50: bump up minor RW version fieldVadim Bendebury2016-10-041-1/+1
| | | | | | | | | | | | | In preparation to the new CR50 image release bump up the minor version number to trigger autoupdate on the devices in the field. BRANCH=none BUG=none TEST=none Change-Id: I7744b8cb8436d9134ee5900b352487a1cdddcd28 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/392447
* util/signer/gnubby.c: set home dir correctlyMartin Roth2016-09-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | If HOME is not set in the environment, the variable 'home' was getting looked up, but not set. This sets the variable. From https://scan.coverity.com/projects/chromium-ec : CID61407: Dereference after null check BUG=chromium:632768 TEST=Built all boards BRANCH=None Previously fixed in commit 4f6f505900a Change-Id: I77614ed96b5247fc7c6b08d810ea87150ff3adfd Signed-off-by: Martin Roth <martinroth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/390411 Commit-Ready: Marius Schilder <mschilder@chromium.org> Tested-by: Marius Schilder <mschilder@chromium.org> Reviewed-by: Marius Schilder <mschilder@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* flash: Add command to get SPI flash chip infoRandall Spangler2016-09-231-0/+30
| | | | | | | | | | | | | | | | | | | Previously, there was no way to identify which flash chip was used by the EC, for ECs using an external SPI flash. Now, 'ectool flashinfo' will print more information about the SPI flash chip in these cases. BUG=chrome-os-partner:56765 BRANCH=any EC with MEC1322 or NPCX still going through factory TEST=define CONFIG_HOSTCMD_FLASH_SPI_INFO, then 'ectool flashspiinfo' on samus indicates no SPI flash info, and prints additional info on chell and kevin. Without the config defined, all platforms report no spi flash info. CQ-DEPEND=CL:386368 Change-Id: I3c162f7ad12ed4b30ab951c03f24476683382114 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/385702 Reviewed-by: Shawn N <shawnn@chromium.org>
* Cr50: Remove private-cr51 from version stringBill Richardson2016-09-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We no longer depend on this directory, so there's no need to include its sha1sum in the version string. BUG=chrome-os-partner:54101 BRANCH=none TEST=make buildall; try on Cr50 hardware Before > version Chip: g cr50 B2 Board: 0 RO_A: * 0.0.9/0088a3eb RO_B: 0.0.3/8fe06b9e RW_A: * 0.0.6/DEV/cr50_v1.1.5333-cca986c RW_B: 0.0.6/DEV/cr50_v1.1.5334-115b338 Build: 0.0.6/DEV/cr50_v1.1.5333-cca986c private-cr51:v0.0.87-24457f2 tpm2:v0.0.264-5e5aaa3 cryptoc:v0.0.4-5319e83 2016-09-16 21:59:31 wfrichar@wintermute.mt > After > version Chip: g cr50 B2 Board: 0 RO_A: * 0.0.9/0088a3eb RO_B: 0.0.3/8fe06b9e RW_A: 0.0.6/DEV/cr50_v1.1.5333-cca986c RW_B: * 0.0.6/DEV/cr50_v1.1.5334-36b2cee Build: 0.0.6/DEV/cr50_v1.1.5334-36b2cee tpm2:v0.0.264-5e5aaa3 cryptoc:v0.0.4-5319e83 2016-09-19 17:48:17 wfrichar@wintermute.mtv.corp.google.com > Change-Id: I785dff86e6b970219da87c8674f2a324fa074987 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/387238 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* Cr50: Flag unofficial images in the version stringBill Richardson2016-09-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We often find it handy to build test images that are unlocked or have special powers. To avoid confusing these with production images, this adds a "DEV/" to the version string: "make BOARD=cr50" looks like this: > version Chip: g cr50 B2 Board: 0 RO_A: * 0.0.9/0088a3eb RO_B: 0.0.8/710d4375 RW_A: * 0.0.6/cr50_v1.1.5261-4848d7e RW_B: 0.0.6/cr50_v1.1.5261-4848d7e [...] "CR50_DEV=1 make BOARD=cr50" looks like this: > version Chip: g cr50 B2 Board: 0 RO_A: * 0.0.9/0088a3eb RO_B: 0.0.8/710d4375 RW_A: 0.0.6/cr50_v1.1.5261-4848d7e RW_B: * 0.0.6/DEV/cr50_v1.1.5261-4848d7e [...] BUG=chrome-os-partner:55557 BRANCH=none TEST=make buildall; also.. Build both with and without the CR50_DEV=1 environment variable. Observe that the version string differs even if nothing else does. Change-Id: Ifee9fbf922c2bbb40a1a9d0a716d2d11aa0d3ec2 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/382851 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* cr50: provide build mode for signing with fobVadim Bendebury2016-09-072-0/+2191
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't really have the ability to build the latest signer yet, but this should not stop us from being able to build a properly signed image using the ec makefiles. As a stopgap measure the suggestion is to keep the latest signer binary in ~/bin/codesigner in chroot, then with this patch applied invoking make with CR50_DEV=1 will cause the proper sighner used and proper signing procedure followed. The signed targets need to be built in series to avoid concurrent use of the signer fob, an addition dependency is being added to enforce that. BRANCH=none BUG=chrome-os-partner:55557 TEST=ran make as follows: CR50_DEV=1 make BOARD=cr50 touched the fob when requested, uploaded the generated build/cr50/ec.bin on a kevin-tpm2 using usb_updater, and observed it boot properly with the new version. Change-Id: Ia9494bdc60b4bd3b8e5e09cbcbd8b27409c739d2 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/376885 Tested-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* util: Add ec_parse_panicinfo tool to parse binary panicinfoNicolas Boichat2016-09-065-110/+173
| | | | | | | | | | | | | | | | | To be able to parse binary panicinfo from feedback reports, we need a host tool: - Move panicinfo generic parsing functions to a separate C file - Create a new host utility to parse panicinfo BRANCH=none BUG=chromium:643062 TEST=base64 -d | ec_parse_panicinfo Change-Id: Idd8560a2894f270d0ab3a9f654c333135759e57f Reviewed-on: https://chromium-review.googlesource.com/379639 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* pd: log source currentVincent Palatin2016-09-021-0/+4
| | | | | | | | | | | | | | | | | | | | Record what current limit we set when we act as a source and when we are changing it. The change should be backward-compatible as older EC will return 0 in `current_max` when their role is PD_ROLE_SOURCE while newer firmware will set the actual limit. BRANCH=none BUG=chrome-os-partner:56110 TEST=manual: on Kevin, plug and unplug various devices on the 2 ports, and dump the values with 'ectool usbpdpower'. Change-Id: I8e78663f3196b1b81c2235ed8642da0638bed649 Reviewed-on: https://chromium-review.googlesource.com/375918 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* Revert "ectool: Add ectool command to do AP force shutdown"Vijay Hiremath2016-09-011-3/+1
| | | | | | | | | | | | | | | | There are no actual use cases of this command hence reverting it. This reverts commit 2324ed47aa3b6da72a9c022a21b46a8ea9eb896c. BUG=chrome-os-partner:56681 BRANCH=none TEST=make buildall -j Change-Id: Ibfa6c99d591e7601299236d8ad56451ef5ab20f2 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/377852 Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Shawn N <shawnn@chromium.org>
* ectool: Add ectool command to do AP force shutdownVijay Hiremath2016-08-301-1/+3
| | | | | | | | | | | | | | | | | Added support to do force AP shutdown from kernel console using the ectools. BUG=chrome-os-partner:56681 BRANCH=none TEST=make buildall -j; Manually tested on reef. "ectool reboot_ec apshutdown" puts system in G3. Change-Id: I509678a67a6a54da67de99efb00e1f08a1ed1fea Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/376863 Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Shawn N <shawnn@chromium.org>
* flash_ec: Add check for servo_has_cold_reset.Kevin Cheng2016-08-221-1/+7
| | | | | | | | | | | | | | | | | | When flashing a servo v4, the function will try to initiate a cold_reset but that interface does not exist for a servo v4. Add in a check for cold_reset before trying an ec_reset to prevent printing the useless error message 'No control named "cold_reset"'. BRANCH=None BUG=None TEST=flashed and did not see error message anymore. Change-Id: I6086883f002b4961807ae0663b0ee32aea4c63d8 Reviewed-on: https://chromium-review.googlesource.com/365151 Commit-Ready: Kevin Cheng <kevcheng@chromium.org> Tested-by: Kevin Cheng <kevcheng@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Nick Sanders <nsanders@chromium.org>
* sweetberry: add build target for sweetberryNick Sanders2016-08-191-0/+1
| | | | | | | | | | | | | | sweetberry is an stm32f446 based power monitoring board, with 48 channels of INA current sense chips BUG=chromium:608039 TEST=boots BRANCH=none Change-Id: If263bcee3a648ba3605f991999d481b7a0e2a1db Signed-off-by: Nick Sanders <nsanders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/370718 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* stm32f446e-eval: add support for stm32f446Nick Sanders2016-08-171-0/+1
| | | | | | | | | | | | | | | | | | This adds basic support for the stm32f446. This consists of: * New DMA model for stm32f4 * New clock domain support. * MCO oscillator gpio export support. * Flash support for irregular blocks. BUG=chromium:608039 TEST=boots w/ correct clock, stm32f0 also boots. BRANCH=None Change-Id: I1c5cf6ddca09009c9dac60da8a3d0c5ceedfcf4d Signed-off-by: Nick Sanders <nsanders@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/363992 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* mkbp_event: Allow host to report sleep state for non-wake event skippingShawn Nematbakhsh2016-08-121-0/+29
| | | | | | | | | | | | | | | | | | | | | | Allow the host to self-report its sleep state through EC_CMD_HOST_SLEEP_EVENT, which will typically be sent with SUSPEND param when the host begins its sleep process. While the host has self-reported that it is in SUSPEND, don't assert the interrupt line, except for designated wake events. BUG=chrome-os-partner:56156 BRANCH=None TEST=On kevin, run 'ectool hostsleepstate suspend', verify that interrupt assertion is skipped for battery host event. Run 'ectool hostsleepstate resume' and verify interrupt is again asserted by the battery host event. Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I74288465587ccf7185cec717f7c1810602361b8c Reviewed-on: https://chromium-review.googlesource.com/368391 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* kevin / gru: Notify host of HPD IRQ statusShawn Nematbakhsh2016-08-101-0/+2
| | | | | | | | | | | | | | | | | | If an HPD IRQ event is seen, make note of it and keep the status set until informing the host. BUG=chrome-os-partner:55925 BRANCH=None TEST=Manual on kevin, trigger HPD event, verify that event bit is set in reply to first host command and not subsequent host commands. Change-Id: I0900a683dcb344d5d4d03a1fa6e3d8de913597b2 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/366990 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Chris Zhong <zyw@rock-chips.com> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Guenter Roeck <groeck@chromium.org>
* util: do not generate unrelated version informationVadim Bendebury2016-07-291-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | The recent addition of the multicomponent version string for cr50, requires further tweaking of the version generating script. In particular, the CROS_EC_VERSION32 variable used by the "verson" cli command is not supposed to include any information about subcomponents of the image, it should reflect the EC version only. Separating everything after the first space accomplishes that. BRANCH=none BUG=chrome-os-partner:55373 TEST=verified that RO_x and RW_x versions are printed properly: > vers Chip: g cr50 B2 Board: 0 RO_A: 0.0.1/84e2dde7 RO_B: * 0.0.3/8fe06b9e RW_A: cr50_v1.1.4992-7c9f891+ private RW_B: * cr50_v1.1.4989-52b3cc6+ ... Change-Id: I192eb29816dfa963b08aa97f749b978b1367d6b7 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/364490 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* util: collect cr50 versions from multiple git treesVadim Bendebury2016-07-281-6/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The cr50 code comes from four different repositories. This patch introduces an array of the repositories where version information is supposed to come from. For all boards but cr50 this array includes just the local repository, for cr50 the array is extended with the three other components. This patch also allows to change the 'tree dirty' marker appended to the sha1s of the 'dirty' trees, having a shorter marker helps to keep multicomponent version strings shorter. All external component's version information in the generated combined version string is prepended by the component's root directory name. BRANCH=ToT BUG=chrome-os-partner:55373 TEST=ran the script for two EC boards, kevin and cr50, verified the output: vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv $ BOARD=kevin ./util/getversion.sh /* This file is generated by util/getversion.sh */ /* Version string for use by common/version.c */ /* Version string, truncated to 31 chars (+ terminating null = 32) */ /* Sub-fields for use in Makefile.rules and to form build info string * in common/version.c. */ /* Repo is clean, use the commit date of the last commit */ $ $ BOARD=cr50 ./util/getversion.sh /* This file is generated by util/getversion.sh */ /* Version string for use by common/version.c */ /* Version string, truncated to 31 chars (+ terminating null = 32) */ /* Sub-fields for use in Makefile.rules and to form build info string * in common/version.c. */ /* Repo is clean, use the commit date of the last commit */ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ then introduced some local changes in the ec and tpm2 directories and ran the script again. Note the '+' used as the 'dirty' marker in the cr50 string: vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv $ BOARD=kevin ./util/getversion.sh /* This file is generated by util/getversion.sh */ /* Version string for use by common/version.c */ /* Version string, truncated to 31 chars (+ terminating null = 32) */ /* Sub-fields for use in Makefile.rules and to form build info string * in common/version.c. */ /* Repo is dirty, using time of last compilation */ $ $ BOARD=cr50 ./util/getversion.sh /* This file is generated by util/getversion.sh */ /* Version string for use by common/version.c */ /* Version string, truncated to 31 chars (+ terminating null = 32) */ /* Sub-fields for use in Makefile.rules and to form build info string * in common/version.c. */ /* Repo is dirty, using time of last compilation */ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Change-Id: I4b4ec23ce003970c09442e8d8aeed2306d4e5dd8 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/363917 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* util: refactor getversion.shVadim Bendebury2016-07-281-28/+60
| | | | | | | | | | | | | | | | | | | | | | | It is necessary to collect information about more then one git repositories status for the cr50 board. To facilitate this, separate the code retrieving build version information into a function, get_tree_version(). The function returns a two element string, the version information and the 'dirty' marker in case the tree has any uncommitted changes. The 0x01 character is used to join the elements of the string, which makes it easier to split the string when processing it. BRANCH=ToT BUG=chrome-os-partner:55373 TEST=ran the script before and after changes, observed that generated output is identical. Change-Id: I2c211cbda8c3cab3c8c21b4430e4b3102691e74a Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/362849 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* flash_ec: Add support for flashing using CCDMary Ruthven2016-07-221-22/+62
| | | | | | | | | | | | | | | | | | When a kevin, gru, or reef are attached to the host machine using a suzyQ, they can use CCD to update the AP or EC using flashrom. To use suzyQ you have to specify raiden_debug_spi as the flashrom programmer. This change adds support to flash_ec for using the right programmer to update with CCD over suzyQ instead of servo. BUG=chrome-os-partner:50701, chrome-os-partner:50712 BRANCH=none TEST=make sure "util/flash_ec --BOARD=kevin --raiden" updates the EC when CCD is enabled Change-Id: Ie63337b9689c68aa60163d7e54c5ebefa97b4e21 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/344427 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* ectool: Fix incorrect fan numbers from ectoolDivya Sasidharan2016-07-211-0/+8
| | | | | | | | | | | | | | | | | Return 0 if the board does not need fan indicated by EC_FEATURE_PWM_FAN. BRANCH=None BUG=chrome-os-partner:55090 TEST=make buildall -j; in reef command "ectool pwmgetnumfans" returns 0 Change-Id: I7b59d266532622607c61fe3e7dd1bd0cc8ea9766 Signed-off-by: Divya Sasidharan <divya.s.sasidharan@intel.com> Reviewed-on: https://chromium-review.googlesource.com/359069 Commit-Ready: Divya S Sasidharan <divya.s.sasidharan@intel.com> Tested-by: Divya S Sasidharan <divya.s.sasidharan@intel.com> Reviewed-by: Shawn N <shawnn@chromium.org>
* common: add EC_FEATURE_RTC to features host commandStephen Barber2016-07-091-0/+1
| | | | | | | | | | | | | | | | | | If the EC has CONFIG_HOSTCMD_RTC set to 'y', then export this via the features host command. The kernel can then use this feature to expose an RTC device under /dev/rtc*. Signed-off-by: Stephen Barber <smbarber@chromium.org> BRANCH=none BUG=chrome-os-partner:54639 TEST=`ectool inventory` shows RTC on kevin Change-Id: I644c8e61c4d9f691cc6ca94ef60bee4384c21660 Reviewed-on: https://chromium-review.googlesource.com/359414 Commit-Ready: Stephen Barber <smbarber@chromium.org> Tested-by: Stephen Barber <smbarber@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* ectool: Fix uninitialized variable warningDaisuke Nojiri2016-07-091-1/+1
| | | | | | | | | | | | | | gcc 4.8.4 warns read_buf is not initialized. This patch seizes the warning. BUG=none BRANCH=none TEST=make BOARD=stm32l476g-eval Change-Id: I07a8e01ea285e3462d6b45604350ffeab6cc00e3 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/359002 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* motion: Add ability to stop ring interrupts.Gwendal Grignou2016-06-301-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently, it is assumed the host will sooner or later retrieve the events from the sensor ring: It is only used by Android and the sensor HAL is enabling the ring buffer at boot. But if nobody processes the ring, and the ring is almost full, the EC will generate interrupt for every new events. This can happen with ARC, where events generated for ChromeOS will be in the ring but nobody will process them until Android is started. Add a command to allow sending ring MKBP events. It will be used when the IIO ring buffer is enabled / disabled. It also can be used for preventing raising interrupt when the device is about to go to sleep. BRANCH=ryu,cyan BUG=b:25425420,b:27849483 TEST=Check with fiforead that no events are queued when IIO ring buffer is disabled. Check with ectool and androsensor that interrupt generation stops. Change-Id: Ibc85eed2e0eae3a9ec07d191e692118bc2fd0dab Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/356689
* usb_mux: Add support for host-controlled 'virtual' USB muxShawn Nematbakhsh2016-06-241-1/+42
| | | | | | | | | | | | | | | | | | | | | | | | For designs where the host SOC is responsible for setting the USB-C SS mux, the EC must track the desired mux state and inform the host when the desired state changes. Then, the host must ask the EC for the new desired state and set the mux accordingly. BUG=chrome-os-partner:52639 BRANCH=None TEST=Manual on gru with subsequent commit. Attach USB dongle in port 1 and DP dongle in port 0, then verify `ectool usbpdmuxinfo` output: Port 0: DP Port 1: USB Flip DP dongle and verify output changes: Port 0: DP INV Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I6a99ce93a76c3197f9195cfaa25c5217d09aeb75 Reviewed-on: https://chromium-review.googlesource.com/355281 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
* sb_firmware: update lockfile pathDavid Hendricks2016-06-241-1/+1
| | | | | | | | | | | | | | | This updates the lockfile path for FHS 3.0 since powerd as well as other pieces of software are migrating over. BUG=chromium:616620 CQ-DEPEND=CL:351271 BRANCH=none TEST=compiled Change-Id: I6aa5fa30225e45039316e4a3af0e50cdef0fdf4e Signed-off-by: David Hendricks <dhendrix@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/351345 Reviewed-by: Dan Erat <derat@chromium.org>
* rk3399: kevin: Adding get_rtc_alarm functionality.Shelley Chen2016-06-211-4/+26
| | | | | | | | | | | | | | | | | | | | | | Adding ability to get # seconds before rtc alarm goes off. BUG=chrome-os-partner:52218 BRANCH=None TEST=ectool rtcgetalarm w/o setting returns Alarm not set. ectool rtcsetalarm 30; ectool rtcgetalarm to make sure counting down to 0. After alarm goes off, rtcgetalarm should return alarm not set again. rtcsetalarm 30; rtcgetalarm to check alarm is set. rtcsetalarm 0; should disable alarm. Use rtcgetalarm to ensure that alarm is disabled. Change-Id: I176b12fe2dda08eedd23ea33dc64785f09f1d9ae Signed-off-by: Shelley Chen <shchen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/353331 Reviewed-by: Shawn N <shawnn@chromium.org>
* ec_commands: Add new EC_CMD_PD_CONTROL commandNicolas Boichat2016-06-071-0/+33
| | | | | | | | | | | | | | | | | | | | | | | This commands makes it possible to control the PD chip (or the interaction between EC and PD), from the AP. - PD_SUSPEND: Suspends the PD chip: EC needs to stop talking to PD chip. Useful at beginning of PD FW update. - PD_RESUME: Resumes the PD chip: EC can start talking to PD chip again. Useful at end of PD FW update. - PD_RESET: Resets the PD chip (called at the end of the update). - PD_CONTROL_DISABLE: Prevents further calls to this command (for security reason, we do not want the AP to be able to call the other subcommands after the update has been performed). BRANCH=none BUG=chrome-os-partner:52433 TEST=ectool pdcontrol {suspend,resume,reset,disable} Change-Id: I7a955dd27b65086c21d195a6504aa7392eb0406d Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/342584 Reviewed-by: Randall Spangler <rspangler@google.com>