summaryrefslogtreecommitdiff
path: root/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* test/run_device_tests.py: Add private testsAndrea Grandi2022-04-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the list of tests is hard-coded in the Python script. Add ability to fetch additional tests from the private folder, if available. This is a reland of commit b97ba790690d1ee86c001ef0a82be5897645ae2f BRANCH=none BUG=b:226385185 TEST=cros lint test/run_device_tests.py TEST=make V=1 run-<private_test> TEST=test/run_device_tests.py --flasher=jtrace --remote=localhost --board=dartmonkey TEST=test/run_device_tests.py --flasher=jtrace --remote=localhost --board=dartmonkey --tests=<private_test> Cq-Depend: chrome-internal:4650299, chrome-internal:4650281, chrome-internal:4650279 Signed-off-by: Andrea Grandi <agrandi@google.com> Change-Id: I67866ced27414d495bfad5eff9825cf68c8c22cf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3562041 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Feels: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Bobby Casey <bobbycasey@google.com> Feels: Bobby Casey <bobbycasey@google.com>
* Revert "test/run_device_tests.py: Add private tests"Hsu Wei-Cheng2022-03-301-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit b97ba790690d1ee86c001ef0a82be5897645ae2f. Reason for revert: failed chromeos-fpmcu-unittests Original change's description: > test/run_device_tests.py: Add private tests > > Currently, the list of tests is hard-coded in the Python script. > Add ability to fetch additional tests from the private folder, if > available. > > BRANCH=none > BUG=b:226385185 > TEST=cros lint test/run_device_tests.py > TEST=make V=1 run-<private_test> > TEST=test/run_device_tests.py --flasher=jtrace --remote=localhost > --board=dartmonkey > TEST=test/run_device_tests.py --flasher=jtrace --remote=localhost > --board=dartmonkey --tests=<private_test> > > Cq-Depend: chrome-internal:4633118, chrome-internal:4639001 > Signed-off-by: Andrea Grandi <agrandi@google.com> > Change-Id: I6d84b652d8f0e3d479bb227cbcc25d0b6f8f274b > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3544427 > Reviewed-by: Tom Hughes <tomhughes@chromium.org> Bug: b:227414670, b:226385185 Cq-Depend: chrome-internal:4647165, chrome-internal:4647014 Change-Id: I751a8e0953f6d61a14ff9065ec930bdb774b5364 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3559970 Reviewed-by: David Stevens <stevensd@chromium.org> Reviewed-by: Morg <morg@chromium.org> Owners-Override: Morg <morg@chromium.org> Tested-by: Hsu Wei-Cheng <mojahsu@chromium.org> Commit-Queue: Hsu Wei-Cheng <mojahsu@chromium.org>
* test/run_device_tests.py: Add private testsAndrea Grandi2022-03-301-0/+1
| | | | | | | | | | | | | | | | | | | | | Currently, the list of tests is hard-coded in the Python script. Add ability to fetch additional tests from the private folder, if available. BRANCH=none BUG=b:226385185 TEST=cros lint test/run_device_tests.py TEST=make V=1 run-<private_test> TEST=test/run_device_tests.py --flasher=jtrace --remote=localhost --board=dartmonkey TEST=test/run_device_tests.py --flasher=jtrace --remote=localhost --board=dartmonkey --tests=<private_test> Cq-Depend: chrome-internal:4633118, chrome-internal:4639001 Signed-off-by: Andrea Grandi <agrandi@google.com> Change-Id: I6d84b652d8f0e3d479bb227cbcc25d0b6f8f274b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3544427 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* stm32: Add the DFU Boot ManagerBrian J. Nemec2022-02-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added the DFU Boot Manager to control the switch between the DFU and main application region. The DFU Bootmanager performs self checks when the application boots. If any of the following conditions are true it will jump into DFU: * The system backup registers contain a 'Jump to DFU' request. * The start of the RW region is erased indicating the prior firmware update has failed. * An optional check can be enabled to record the number of consecutive unexpected reboots which will be useful for developer test images to avoid locked systems. Testing requires enabling multiple configuration settings set in the follower CL which enables it on Servo_v4. dfu-util version 0.9 lacks the 'leave' parameter required to automatically jump out, systems using this would need to be power cycled to leave DFU. BRANCH=servo BUG=b:217955677 TEST=Enabled the DFU configuration on a Servo_v4. Verified that the runtime identifier is correctly recognized by dfu-util and pydfu.py implementations of the DFU host protocol. Verified firmware updates via the DFU protocol function correctly. TEST=sudo dfu-util -a 0 -s 0x08000000:leave -e -D ec.bin Verified that dfu-util can program the application region. Signed-off-by: Brian Nemec <bnemec@chromium.org> Change-Id: Ie535efc91318244574949542c03efa0b5973cbe5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3443960 Tested-by: Brian Nemec <bnemec@google.com> Reviewed-by: Sam Hurst <shurst@google.com> Commit-Queue: Brian Nemec <bnemec@google.com>
* tree: Delete chip/lm4 and board/bdsTom Hughes2022-01-221-1/+1
| | | | | | | | | | | | | | | | | | While working on https://crrev.com/c/3373621, I noticed that either the comment or code was wrong in chip/lm4/clock.c. chip/lm4 is only used by the "bds" board, which doesn't appear to be used anymore, so just delete it. BRANCH=none BUG=b:200828093 TEST=make buildall -j Cq-Depend: chromium:3378222 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I444a9a6e2c853dc4f9f3d799182daaeb110b1277 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3373622 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* ec: Improve coverage report.Jeremy Bettis2021-04-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | Exclude the test directories from ec coverage report. Include the test name into the coverage data. Show the test name details in the coverage report. Build several boards with coverage enabled, and use that to make sure all used files are in the coverage report. This lowers the coverage to 38.4% which seems much more realistic than the old value. BRANCH=none BUG=b:156895937 TEST=make -j coverage Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I91fc5bc7ce676943d34e91e16662e680628d1b7e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2811939 Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* make/util: Modularize util make var buildingCraig Hesling2021-02-031-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The key objectives are to * allow util targets to be added from outside of util/build.mk (for adding tools per board, like ectool_servo) * allow for easier conditioning of tool inclusion (for auto adding tools based on characteristic, like CHIP_NPCX) * reduce the number of tools being built (we can remove irrelevant tools for some boards, like removing stm32mon for npcx boards or iteflash for stm32 boards) We have tons of boards in EC now. This takes a significant amount of time to build, so we should be a bit more careful when adding utils for all boards. This and subsequent changes sets the precedent for selectivity. This shifts the initialization/control to the board and baseboard's build.mk and allows the util/build.mk to add items to these variables. Ideally, we would use multiple variables to aggregate the utils selection from the three sources (baseboard/build.mk, board/build.mk, and util/build.mk), but I don't think the addition complexity is currently warranted. BRANCH=none BUG=b:176500425 TEST=# Check all output artifacts from before and after this CL. make clobber make buildall STATIC_VERSION=1 -j mv build build-orig # Apply the change make clobber make buildall STATIC_VERSION=1 -j diff <(find build-orig | sed 's/build-orig//' | sort) <(find build | sed 's/build//' | sort) # Nothing should be different Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I23153850eda10fc1c88d386b9f3cd8296df9c6f1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2606511 Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* No init.rom section support in ZephyrHyungwoo Yang2021-01-221-1/+1
| | | | | | | | | | | | | | | | | Building zephyr generates a warning on init.rom section. This change removes init.rom section declaration in Zephyr build. The change also added third_party into include folders so files in third_party now can be included in Zephyr build. BUG=b:173508071 BRANCH=none TEST=make BOARD=volteer -j8 build volteer on zephyr Change-Id: Ic86866e41d87d83c00a06a207a352a25fe57054b Signed-off-by: Hyungwoo Yang <hyungwoo.yang@intel.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2638135 Reviewed-by: Keith Short <keithshort@chromium.org>
* tcpm: Move tcpm.h into an include directorySimon Glass2020-12-221-1/+1
| | | | | | | | | | | | | | | | | | This header file is used from quite a few files, relying on the EC build system to find includes in the driver/tcpm directory. For Zephyr we don't want to add that as an include. It makes more sense for header files to be in an include directory, so move it and fix up the users. BUG=b:175434113 BRANCH=none TEST=build Zephyr and ECOS on volteer Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I5851914b1a7d3fdc1ba911c0fbe9046afbaf6f5d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2597985 Reviewed-by: Keith Short <keithshort@chromium.org>
* Makefile: add support for private-kandou directoryKeith Short2020-09-221-1/+3
| | | | | | | | | | | BUG=b:168930682 BRANCH=none TEST=make buildall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I658f309644cdbeb050523cab722de71bb052bf25 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2421301 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* kukui: include a dummy bootblock if BOOTBLOCK variable not setTing Shen2019-12-191-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a dummy bootblock to make sure size check is accurate during `make buildall`. The default size is picked from build 12769.0: $ ls -al */coreboot/bootblock.bin -rw-r--r-- 1 21504 Dec 19 02:20 kodama/coreboot/bootblock.bin -rw-r--r-- 1 21504 Dec 19 02:20 krane/coreboot/bootblock.bin -rw-r--r-- 1 21504 Dec 19 02:20 kukui/coreboot/bootblock.bin -rw-r--r-- 1 21504 Dec 19 02:33 damu/coreboot/bootblock.bin -rw-r--r-- 1 21504 Dec 19 02:33 jacuzzi/coreboot/bootblock.bin -rw-r--r-- 1 21504 Dec 19 02:33 juniper/coreboot/bootblock.bin -rw-r--r-- 1 21504 Dec 19 02:33 kappa/coreboot/bootblock.bin -rw-r--r-- 1 21504 Dec 19 02:21 flapjack/coreboot/bootblock.bin BUG=chromium:1034518 TEST=1) make buildall # use dummy bootblock 2) make BOARD=kukui # same as above, ~1.7k bytes left 3) make BOARD=kukui BOOTBLOCK=/dev/null # empty bootblock, 23k bytes left 4) make BOARD=kukui BOOTBLOCK=a-large-file # fail early before linking BRANCH=kukui Change-Id: I65c18f567dce0cb315e0cdc4f30ada5e83275d72 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1973550 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Tested-by: Jack Rosenthal <jrosenth@chromium.org>
* makefile: support PORT for flash_ecYilun Lin2019-08-291-0/+3
| | | | | | | | | | | | | | Add variable PORT to select the flashing port. TEST=make BOARD=kukui flash_ec PORT=9998, and flash success BUG=none BRANCH=none Change-Id: Ic9ba318ffee70ec1f7789f2dcccc6025263e5436 Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1770330 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* mock: Add mock structure for fuzzers and testsCraig Hesling2019-07-311-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces the common/mock and include/mock directories which hold mock implementations of other common libraries. The general idea it to create mocks which can be used in simple scenarios, by providing meaningful default return values and functionality, and more complicated scenarios like fuzzers, where the return values need to continuously change. The build system has been adapted to allow the inclusion of a new .mocklist file for tests and fuzzers. This file specifies exactly which mocks will be pulled into the build for a given test/fuzz. In order to maintain cleanliness, this file is optional. Examples: * http://crrev.com/c/1682945/17 makes use of three different mocks, one of which is the rollback mock. * An upcoming rollback unit test ( http://crrev.com/c/1686460 ), needs to pull in mocks that support the rollback interface, but explicitly cannot pull in the rollback mock. BRANCH=none BUG=b:116065496 TEST=make buildall -j Change-Id: Ib87b1a93b6d73309afaf7115276ead49218598ff Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1719569 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* LICENSE: remove unnecessary (c) after CopyrightTom Hughes2019-06-191-1/+1
| | | | | | | | | | | | | | | | Ran the following command: git grep -l 'Copyright (c)' | \ xargs sed -i 's/Copyright (c)/Copyright/g' BRANCH=none BUG=none TEST=make buildall -j Change-Id: I6cc4a0f7e8b30d5b5f97d53c031c299f3e164ca7 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1663262 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Makefile: Replace flag -DX with -DX= to be supported by IS_ENABLED().Yilun Lin2019-06-031-16/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | IS_ENABLED works for an empty-string-defined macro. However, -D options default to define the macro to 1. This CL forces those macros, such as BOARD_* CHIP_*, CORE_*, CHIP_VARIANT_* and CHIP_FAMILIY_*, to be defined as an empty string, so that it can be supported by IS_ENABLED macro. TEST=use if(IS_ENABLED(BOARD_KRANE)) and see compilation success. TEST=compares build directory w/ and w/o this CL, and see the .smap are the same: ls build/*/*/ec.*.smap | sed -e 's|build/||' | \ xargs -I{} diff -u -a build/{} build.new/{} BUG=none BRANCH=None Change-Id: I96e2aa1cb5f3369e5e445a674595a9234f26707a Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1627840 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* ec: common: Make IS_ENABLED fail on unknown valuesRaul E Rangel2019-05-151-2/+3
| | | | | | | | | | | | | | | | | If IS_ENABLED is called with any unknown values, a compiler error will be thrown. This change requires that the optimizer always be enabled, otherwise errors will be thrown when a value is not defined. BUG=none BRANCH=none TEST=make runtests TEST_LIST_HOST="is_enabled_error is_enabled" Change-Id: I1b166311f81d07e48b3665f4bc0e9502d2ccc4c6 Signed-off-by: Raul E Rangel <rrangel@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1592728 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* cr50: rebuild board image if essential make variables changeVadim Bendebury2019-05-101-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When building Cr50 board image, some make variables get converted into compilation flags, which affect image composition. Changes of these variables go unnoticed as they do not directly affect make dependencies. Let's define the set of essential variables in ENV_VARS, and save the state of these variables at build time in a generated .h file, updating it only if any of the variables' values changed since the previous make run. The generated .h file is included in board.h, which guarantees that files dependent on board.h are recompiled if the generated .h file changes. BRANCH=cr50 BUG=none TEST=verified that changing of CR50_DEV and/or H1_RED_BOARD or CR50_SQA values triggers full rebuild of the Cr50 image. Verified that 'emerge-atlas ec-utils' also succeeds. Change-Id: Id0589a3b6a66fe4da90a9aea894bc83eb6337c8c Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/707915 Reviewed-by: Keith Short <keithshort@chromium.org>
* makefile: don't build ro if EC_INCLUDE_RO not setTing Shen2019-05-081-1/+4
| | | | | | | | | | | | | | BUG=b:121406695 TEST=make BRANCH=None Change-Id: Ib678678330837fefffd12a7ac445038661639e8c Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/1595929 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Makefile: Clarify/fix PDIR assignementNicolas Boichat2019-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous version has this: PDIR=$(subst /board/$(BOARD),,$(BDIR)) which is a little confusing as, when no public board overlay is set, BDIR is only set to PBDIR _after_ this statement (but the logic works as Makefile = recursively expands). Also, this does not set PDIR correctly if both PBDIR and BDIR are set (board overlay in both public and private). It is much simpler to just use, as PBDIR is set correctly in both cases, at that point in the function: PDIR:=$(subst /board/$(BOARD),,$(PBDIR)) BRANCH=none BUG=b:124804731 TEST=On m/master make buildall -j; mv build build.old After this CL: make buildall -j ls build/*/*/ec.*.smap | sed -e 's|build/||' | \ xargs -I{} diff build/{} build.old/{} => no difference Change-Id: I0a7a0c631b9b72dfcbf11d7cfd78bbaf3e21f1d5 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1485035 Reviewed-by: Yilun Lin <yllin@chromium.org>
* Makefile: Allow board to be both in public and private foldersNicolas Boichat2019-02-211-7/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | All current boards only exist in either board/$BOARD, or in private-*/board/$BOARD. However, for kukui_scp, we want to be able to use the same target for public and private builds, extending functions by adding some files in private-mt8183/board/kukui_scp. Change the Makefile inclusion logic to make this possible. BRANCH=none BUG=b:124804731 TEST=On m/master make buildall -j; mv build build.old After this CL: make buildall -j ls build/*/*/ec.*.smap | sed -e 's|build/||' | \ xargs -I{} diff build/{} build.old/{} => no difference Change-Id: I595a7b9159d5c9a54f25a8e7d09437ab47d3dbcd Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1475107 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* Makefile: Drop warning about using ASAN by defaultNicolas Boichat2018-12-281-1/+0
| | | | | | | | | | | | | | | | The warning is distracting in build output. If TEST_FUZZ is set, it is sensible to use TEST_ASAN by default, let's not print any warning. BRANCH=none BUG=none TEST=make buildall -j >/dev/null => No more warnings. Change-Id: I8875b7f63154a4e051a5bb29f6640d4ee2923c19 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1389990 Tested-by: Allen Webb <allenwebb@google.com> Reviewed-by: Allen Webb <allenwebb@google.com>
* Makefile.rules: Add buildfuzztests to buildall.Allen Webb2018-12-191-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This incorporates the fuzz targets into buildall and adds a quick sanity check to each fuzz target to make sure it exits successfully for an empty input. This adds roughly 5.88 seconds to "make -j buildall" (This includes an addtionally target that will be enabled in a later CL). time make -j buildall # BEFORE real 1m19.519s user 23m9.220s sys 5m1.690s time make -j buildall # AFTER real 1m25.399s user 23m35.753s sys 5m12.609s BRANCH=None BUG=None TEST=make -j buildall Change-Id: Ib77a57297ee896569c509d0c8c998552d2a3a76c Signed-off-by: Allen Webb <allenwebb@google.com> Reviewed-on: https://chromium-review.googlesource.com/1370934 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* Makefiles: Add support for MSAN and UBSAN.Allen Webb2018-12-111-0/+6
| | | | | | | | | | | | | | | | | | This adds support for building fuzz targets with memory and undefined behavior sanitizers. BRANCH=None BUG=chromium:911310 TEST=USE="ubsan fuzzer" ./build_packages \ --board=amd64-generic --skip_chroot_upgrade chromeos-ec && (cd ../platform/ec && unset BOARD && make -j buildall buildfuzztests) Change-Id: Ic7f4c1d7fcc1f6347f091b98567167066787cb9c Signed-off-by: Allen Webb <allenwebb@google.com> Reviewed-on: https://chromium-review.googlesource.com/1364326 Reviewed-by: Manoj Gupta <manojgupta@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Add rules for building protocol buffers.Allen Webb2018-09-071-1/+1
| | | | | | | | | | | | | | | | | To facilitate using libprotobuf-mutator in fuzzing targets, rules for generating sources from proto files and compiling those to object files were added. BRANCH=none BUG=chromium:876582 TEST=rm -rf build && make -j buildfuzztests && ./build/host/cr50_fuzz/cr50_fuzz.exe (after cr50_fuzz.proto is added) Change-Id: Id645d0b60397bfeb71d60d601c4f65eefcbdf228 Signed-off-by: Allen Webb <allenwebb@google.com> Reviewed-on: https://chromium-review.googlesource.com/1184106 Reviewed-by: Mattias Nissler <mnissler@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* Move fuzzing tests into a fuzz subfolder.Allen Webb2018-08-221-3/+9
| | | | | | | | | | | | | BRANCH=none CQ-DEPEND=CL:*664115 BUG=chromium:876582 TEST=make -j buildall && make -j buildfuzztests Change-Id: Iade5e5138f495e6b3b99ec16f1a467861ade5537 Signed-off-by: Allen Webb <allenwebb@google.com> Reviewed-on: https://chromium-review.googlesource.com/1180179 Reviewed-by: Mattias Nissler <mnissler@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* common/bootblock: Pack bootblock in EC image.Yilun Lin2018-07-021-0/+4
| | | | | | | | | | | | | | | | | | | Packs a bootblock into EC image. The bootblock content will be firstly tranlated to eMMC emulated data, and then been packed to the RO image. Getting idear from: CL:1039105(which generates eMMC data as a header file). BRANCH=none BUG=b:80159522 TEST=BOOTBLOCK=xyz make BOARD=kukui -j BOOTBLOCK=xyz make BOARD=kukui -j # check it doesn't repack. BOOTBLOCK=abc make BOARD=kukui -j # check it repacks the bootblock. Change-Id: Ia1564d6c54aed7a91fc42210d6247bdecfd82f4e Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1075907 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* Makefile.toolchain: Switch from cpp to $(CC) -ENicolas Boichat2018-06-281-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes it more straightforward to switch to clang preprocessor later on. This requires a few other modifications in the Makefiles (gcc -E does not read from stdin by default, and does not process files that do not end in .c/.h). BRANCH=none BUG=chromium:854924 TEST=make buildall -j TEST=Before and after the change, all ec.bin binaries are identical: git checkout m/master make REAL_SIGNER=dummy buildall -j mv build build-master find build-master -type d | sed -e 's/-master//' | \ xargs -I{} mkdir -p {} find build-master -name ec_version.h | sed -e 's|build-master/||' | \ xargs -I{} cp build-master/{} build/{} git checkout this-cl => comment out .PHONY: $(out)/ec_version.h in Makefiles.rules make REAL_SIGNER=dummy buildall -j find build-master -name ec.bin | sed -e 's|build-master/||' | \ xargs -I{} diff build-master/{} build/{} => No difference Change-Id: If07f033dc7e9a73245499c656562bb906dcd4130 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1117721 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* make: add size calculationsVadim Bendebury2018-05-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Room remaining in flash is an ever important property of many EC images. This patch adds a makefile rule with will calculate how much free room is left in the RW partition with the current image. The calculation uses two variables set by the linker: 'FLASH' which shows how much room is allocated to the image and '__image_size' which shows how much room is actually taken. The difference is how much room is still available. Wnen building with V=0, size is not reported. BRANCH=cr50, cr50-mp BUG=b:65253310 TEST=observed reported values: $ make BOARD=cr50 -j ... *** 7864 bytes still available in flash on cr50 **** $ rm -rf build/cr50/ $ make BOARD=cr50 CR50_DEV=1 -j *** 4488 bytes still available in flash on cr50 **** Change-Id: I66e23dc72905988b21666c5dc9608d92e3fead50 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1030909 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* octopus: move more implementation to baseboardJett Rink2018-05-041-2/+4
| | | | | | | | | | | | | | Move driver configuration to baseboard in preparation for phaser board BRANCH=none BUG=none TEST=yorp still works Change-Id: Ifeb434d2d4103160acd6eb9f784533d1ae0ae35a Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1042729 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* g: fix signer to always use the manifestVadim Bendebury2018-04-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Since the proper signer utility has been introduced in the chroot, there is no need in generating reduced command option set when building a self signed image. Also, the same manifest can be used for all images, self signed or signed using a fob. The manifest needs to be tweaked for the self signed images to match the test Key ID. Since the same base manifest is used for all signings, there is no need to support the "poor man's json parser" any more. Rearranged build.mk to accommodate new logic, and added some comments. BRANCH=cr50, cr50-mp BUG=b:78212718 TEST=verified that images with proper header version are created when both self signed and signed with a private key coming from the signing fob. Change-Id: I5a1f8a223098b0a6c830ef24ffe380fc0badcafa Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1017238 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* makefile: fix build time warningsVadim Bendebury2018-03-231-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Recently, when building images for Cr50 the following warnings started being generated by make: board/cr50/build.mk:98: warning: overriding recipe for target \ 'build/cr50/tpm2/libtpm2.a' board/cr50/build.mk:98: warning: ignoring old recipe for target \ 'build/cr50/tpm2/libtpm2.a' The reason for this turned out to be changes under https://chromium-review.googlesource.com/954444 Let's make sure specific make file is not included in the build twice. BRANCH=cr50, cr50-mp BUG=none TEST='make buildall -j' succeeded. Verified that there is no warnings reported in the make output. Change-Id: I96924752eb91669957d2b514d8926ac843b2bf93 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/977021 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* ec: Add /baseboard to EC projectScott Collyer2018-03-151-11/+30
| | | | | | | | | | | | | | | | | | | | | | This CL introduces /baseboard to the EC project which can contain config options and code which is specific to certain family, but can be shared among the board derivatives of that family. Only the infrastructure changes are included with an empty baseboard.c/.h for octopus. BRANCH=none BUG=b:74358864 TEST='make buildall' and ensure that all boards build successfully. In addition, temporarily moved config options for USB-C and charger to baseboard.h and tested that 'make BOARD=yorp' is successful. Change-Id: I16656574f835c56598a9d2bf49bc1e946d71fe76 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/954444 Commit-Ready: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* make EC_FEATURE_RWSIG definition more usefulVincent Palatin2018-03-011-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also define the EC_FEATURE_RWSIG feature bit if the RO firmware contains the RWSIG task but not the RW. Given the RWSIG verification task is not terribly useful in RW (where it is never executed), it can be skipped there but the host program trying to detect RWSIG usage (e.g. flashrom) still wants to be able to detect it. In order to be able to do so, add the HAS_TASK_xXx_RO and HAS_TASK_xXx_RW flags which define the tasks defined in the other partition (at compilation-time you might still run a frankeinstein combo). Fix ectool 'inventory' to avoid segfaulting on missing feature string definition. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=b:36125319 TEST=on ZerbleBarn, run 'ectool inventory', also uses flashrom to re-flash the RW partition. Change-Id: I224a6cc4aef956204792a2cc04ad12aaed5abf47 Reviewed-on: https://chromium-review.googlesource.com/937262 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Make CONFIG_MALLOC partition-specificVincent Palatin2018-01-261-0/+8
| | | | | | | | | | | | | | | | | | | Allow to have CONFIG_MALLOC defined for one partition and not the other. The typical use-case is asymetric firmware whose small RO is typically just an updater/verifier (and RW signature verification currently doesn't like malloc as the memory initialization is done too late). Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=b:72360575 TEST=make buildall Change-Id: I67cc04cd11385d4c05556ea41ef674cb7a232e65 Reviewed-on: https://chromium-review.googlesource.com/885820 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Makefile: Generate hashes for the touchpad FWNicolas Boichat2017-09-151-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on the passed TOUCHPAD_FW parameter to the make command, the build system generates hashes for the touchpad FW. To generate the hashes, gen_touchpad_hash splits the touchpad FW in blocks of CONFIG_UPDATE_PDU_SIZE, that are hashed individually (SHA-256), and then stored in the EC image. This will allow the USB updater code to verify the integrity of the touchpad firmware being flashed. When no FW is provided, zeros are output, which do not match any valid data. BRANCH=none BUG=b:63993173 TEST=make TOUCHPAD_FW=SA459C-1211_ForGoogleHammer_3.0.bin \ BOARD=hammer -j TEST=Using variations of make TOUCHPAD_FW=SA459C-1211_ForGoogleHammer_3.0.bin \ BOARD=hammer -j make TOUCHPAD_FW=SA459C-1211_ForGoogleHammer_4.0.bin \ BOARD=hammer -j make BOARD=hammer -j Check that TPHASH touchpad_fw_hash.h is only regenerated when the parameter changes. Change-Id: Ie347270aa9c00342de13489c9422e45e681b94c2 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/615321 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* ec: Fix missing Makefile dependencies.Che-yu Wu2017-09-051-1/+1
| | | | | | | | | | | | | | | Add the extra dependencies to "deps-y" and include it in "deps". BUG=chromium:761922 BRANCH=none TEST=Add "$(info $(deps))" before "-include $(deps)" in Makefile.rules make BOARD=eve utils | grep "build/eve/util/usb_pd_policy.o.d" There is "build/eve/util/usb_pd_policy.o.d" Change-Id: I77670a8e90a1a913943fcba143402318aaf7d274 Signed-off-by: Che-yu Wu <cheyuw@google.com> Reviewed-on: https://chromium-review.googlesource.com/649455 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
* vboot: Move common code under common/vbootDaisuke Nojiri2017-07-131-0/+1
| | | | | | | | | | | | | | | This patch moves the code which can be shared with other data verification schemes (e.g. RWSIG) under common/vboot. It also adds unit tests for it. BUG=b:38462249 BRANCH=none TEST=make run-vboot. Verify verification succeeds on Fizz. Change-Id: Icab4d96dd2c154a12b01c41ebe9b46286b4b590e Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/563463 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Makefile: Allow different task list for RO and RWNicolas Boichat2017-04-251-24/+31
| | | | | | | | | | | | | | | | | | | | | | | This adds new macros for tasks (_RO and _RW), which allows to enable a task only for RO or RW section. We also create a new task_filter.h include file, that helps pre-filter those tasks, and can be used either from Makefile, or included from task_id.h. BRANCH=none BUG=b:35582031 TEST=make buildall -j; make savesizes Apply this CL make buildall -j; make newsizes => No size change Change-Id: I472bc6d4ab250a0a0e1fa6aeb4b748ba6968bedf Reviewed-on: https://chromium-review.googlesource.com/479491 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Nick Sanders <nsanders@google.com>
* makefile: allow different RO and RW CONFIGNick Sanders2017-01-261-17/+45
| | | | | | | | | | | | | | | | | | | | | This adds a separate CONFIG check for RO and RW. Each section is built with the objects generated based on it's own calculated CONFIGs, so that the object list may be different for RO and RW. The intent is to allow for differnt sized RO and RW partitions to allow for a small RO and lager code space for RW, for servo_v4 and hammer. BRANCH=none BUG=chrome-os-partner:61170 TEST=builds successfully Change-Id: I5549cc7ac218e0c7681108074ecfd3b80d4af545 Reviewed-on: https://chromium-review.googlesource.com/433079 Commit-Ready: Nick Sanders <nsanders@chromium.org> Tested-by: Nick Sanders <nsanders@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* Makefile: Drop the extra whitespace in the 'export' lineSimon Glass2017-01-131-1/+1
| | | | | | | | | | | | | | | Fix this little nit. BUG=chromium:680243 BRANCH=none TEST=emerge-reef chromeos-ec Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I932553a8b7f8e5519abc813c09caae8d8d3d2790 Reviewed-on: https://chromium-review.googlesource.com/427362 Commit-Ready: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* common: Add BOARD variable when listing the tasks.Gwendal Grignou2016-12-281-2/+4
| | | | | | | | | | | | | | | | | | Some board (kevin), use BOARD_KEVIN variable to specify the task list. We need this variable to be provided to CPP when generating _tsk_lst. BUG=chrome-os-partner:59423 TEST=Check with echo "CONFIG_TASK_LIST" | arm-none-eabi-cpp -P -Iboard/kevin \ -D"TASK_NOTEST(n, r, d, s)=n" -D"TASK_ALWAYS(n, r, d, s)=n" \ -DBOARD_KEVIN=y -imacros ec.tasklist That the proper task list is generated. BRANCH=kevin,reef Change-Id: I40fbe3040c98c2698221b52aaadaf5519da13312 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/424219 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cts: Fix back-to-back buildDaisuke Nojiri2016-10-141-0/+5
| | | | | | | | | | | | | | | | | | | Currently eCTS suites share the same directory (e.g. build/stm32l476g -eval) to put build artifacts even though some files (e.g. board.c) compile differently suite to suite. So, if cts-i2c-stm32l476g-eval is built, followed by cts-gpio-stm32l476g-eval, build fails or produces incorrect binary. This patch makes eCTS create different directories for each suite. As a bonus, we can now builds eCTS suites in parallel. BUG=chromium:654549 BRANCH=none TEST=make buildall -j (with uncommitted change) Change-Id: I4abedc917787be5f79b97e0e50d0d08e01bd5f9d Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/398281
* Add cts.tasklistDaisuke Nojiri2016-07-111-5/+11
| | | | | | | | | | | | | | | | | | | | | | cts.tasklist contains tasks run only for CTS. These tasks are added to the tasks registered in ec.tasklist with higher priority. This design allows board directories to be free from CTS stuff. cts.tasklist can be placed in each suite directory (cts/suite/cts.tasklist). If a suite does not define its own cts.tasklist, the common list is used (i.e. cts/cts.tasklist). BUG=chromium:624520 BRANCH=none TEST=Ran the followings: make buildall make CTS_MODULE=gpio BOARD=nucleo-f072rb make CTS_MODULE=gpio BOARD=stm32l476g-eval Change-Id: Ibb242297ee10a397a8fcb6ff73d8cbc560daa885 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/359445 Reviewed-by: Chris Chen <twothreecc@google.com>
* cts: First patch flashes blank testsChris Chen2016-07-091-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | The first time you use this with a particular th, connect only th and run ./cts.py --th Then connect both boards and you can run ./cts.py to build/flash both boards. BRANCH=None BUG=None TEST=manual - Enter chroot - Navigate to ec/cts - Connect only th - 'sudo ./cts.py --th' - './cts.py -b' - Exit chroot - Connect both boards - './cts.py -f' Each board should flash successfully Change-Id: Ib14fccabcd9fdad04f9b92817da597bc0dcb3d89 Reviewed-on: https://chromium-review.googlesource.com/358100 Commit-Ready: Chris Chen <twothreecc@google.com> Tested-by: Chris Chen <twothreecc@google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Remove Makefile symlinks under board directoryDaisuke Nojiri2016-07-091-18/+0
| | | | | | | | | | | | | | | | | | | | | | | | This feature is inconsistent. Not all boards have such a symlink (for a obvious reason). This feature is fragile. It's most likely not tested and going to be broken if not already. Developers won't like it if they have to test two different ways to build boards before submitting patches. This feature is not necessary. If you build EC in the standard way (e.g. make BOARD=samus), these symlinks are not needed. This feature is wasteful. Extra disk spaces are used and extra lines are added to Makefile (increasing code complexity slightly). BUG=chromium:626776 BRANCH=none TEST=make buildall Change-Id: Id5444284d773cb0e9225f39abd877441b8f61440 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/359321 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Ignore unused private board directoriesBill Richardson2016-05-131-5/+13
| | | | | | | | | | | | | | If we're not building a board from a private subdirectory, there's no need to include all the private build.mk files. BUG=none BRANCH=none TEST=make buildall (with private subdirectories) Signed-off-by: Bill Richardson <wfrichar@chromium.org> Change-Id: I39b61d9b26978702717bf463b47979290cadc8dc Reviewed-on: https://chromium-review.googlesource.com/344662 Reviewed-by: Dominic Rizzo <domrizzo@google.com>
* console: Add support for using EC-3PO console.Aseda Aboagye2015-11-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces a new CONFIG_* option. To utilise the experimental console, simply define the following config option in the board's board.h file. #define CONFIG_EXPERIMENTAL_CONSOLE This is a temporary option which allows the EC console to be work with the EC-3PO interactive console interface. When this option is enabled, the EC expects commands to packed in a particular format. This is for command integrity and allows the interpreter to perform automatic command retrying in the event that a character is dropped from the sent command. It also removes a lot of the console editing methods since they are now being served by EC-3PO. Once the EC-3PO interpreter is pulled into servod, we can enable this feature by default and the config option can go away. BUG=chrome-os-partner:46054 BRANCH=None TEST=make -j buildall tests TEST=Enable CONFIG_EXPERIMENTAL_CONSOLE on GLaDOS; Flash EC and verify that console works via the EC-3PO interactive console interface. TEST=Build and flash on GLaDOS and verify normal console operation on standard EC UART. CQ-DEPEND=CL:308615 Change-Id: I5e66eb94e31299b27ce029b7f7ce6ba0a7fb6816 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/309991 Commit-Ready: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cr50: introduce RO image skeletonVadim Bendebury2015-11-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The CR50 board will have to have a very different RO image, let's make it possible to override the default list of objects compiled by the top level makefile with a board/chip specific list compiled in the appropriate build.mk file. The CR50 RO will never run on its own for long time, it will always load an RW and go straight to it, so there is no need in running under the OS control, using sophisticated console channel controls, etc. The gist of the functionality is verifying the RW image to run and setting up the hardware to allow the picked image to execute, it will be added in the following patches. This change just provides the plumbing and shows the 'hello world' implementation for the customized RO image. A better solution could be the ability to create distinct sets of make variables for RO and RW, a tracker item was created to look into this. BRANCH=None BUG=chrome-os-partner:43025, chromium:551151 TEST=built and started ec.RO.hex on cr50, observed the 'hello world' message on the console. Change-Id: Ie67ff28bec3a9788898e99483eedb0ef77de38cd Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/310410 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* make: decouple rw and ro object file setsVadim Bendebury2015-11-041-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | When building EC image, in the majority of cases the RW and RO images are built from exactly the same set of object files, and the RO set of objects is used as a template to derive the RW set of objects. This is not necessarily correct in all cases, let's just create an abstract set of object files and use it to derive the sets for RO, RW and sharedlib as appropriate. BRANCH=None BUG=chrome-os-partner:43025 TEST=tested as follows: - changed the Makefile to sort all object files in a single list (instead of sorting them by directory, with the directory list unchanged). Built all targets, saved all .smap files. Then applied this change and again built all targets. Compare all smap files, there were no differences. - modified board/samus/board.h to trigger building sharedlib objects, verified that build/samus/sharedlib built fine. Change-Id: Ie563aca62028cae9e16f067ba20b5e2930355cf5 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/310389 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Let private repos define their own subdirectoriesBill Richardson2015-09-191-3/+4
| | | | | | | | | | | | | | | Private repos should be as independent as possible. This change makes it easier for them to declare their own subdirectories. BUG=none BRANCH=none TEST=make buildall Change-Id: I590e8c035f05ab157eb63c552ced5995f25cabc9 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/300609 Commit-Ready: Bill Richardson <wfrichar@google.com> Reviewed-by: Randall Spangler <rspangler@chromium.org>