summaryrefslogtreecommitdiff
path: root/Makefile
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* cleanup: Rename geometry constantsShawn Nematbakhsh2015-09-161-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename and add geometry constants to match spec doc - https://goo.gl/fnzTvr. CONFIG_FLASH_BASE becomes CONFIG_PROGRAM_MEMORY_BASE CONFIG_FLASH_MAPPED becomes CONFIG_MAPPED_STORAGE Add CONFIG_INTERNAL_STORAGE, CONFIG_EXTERNAL_STORAGE and CONFIG_MAPPED_STORAGE_BASE where appropriate. This CL leaves chip/npcx in a broken state -- it's fixed in a follow-up CL. BRANCH=None BUG=chrome-os-partner:23796 TEST=With entire patch series, on both Samus and Glados: - Verify 'version' EC console command is correct - Verify 'flashrom -p ec -r read.bin' reads back EC image - Verify software sync correctly flashes both EC and PD RW images Change-Id: Idb3c4ed9f7f6edd0a6d49ad11753eba713e67a80 Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/297484 Commit-Ready: Shawn N <shawnn@chromium.org> Tested-by: Shawn N <shawnn@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Cr50: Export toolchain to child $(MAKE) processesBill Richardson2015-08-251-1/+1
| | | | | | | | | | | | | | | The external libraries need to inherit the tool chain, so they're built with the same tools. BUG=chrome-os-partner:43025 BRANCH=none CQ-DEPEND=CL:295456,CL:295409 TEST=make buildall Change-Id: I8b0b275ec77a003e07481391998961ab421066c8 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/295447 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* cr50: add plumbing for signing CR50 RO imagesVadim Bendebury2015-08-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The signer utility needs to be built and the flat image needs to be signed. The signer utility is written in C++, supporting this required adding a new make command to Makefile.rules and a build file for the utility. The signing now needs to be a part of generating the .flat file. To achieve this an alternative set of rules is defined in Makfile.rules for targets where RO image needs to be signed. Rules for converting elf to hex have been consolidated as there is no need to omit the --set-section-flags when it does not apply. BRANCH=none BUG=chrome-os-partner:43025 TEST=as follows: - ran 'rm build/cr50; make BOARD=cr50' - observed that both build/cr50/ec.bin and build/cr50/RO/ec.RO.flat have the required signature header in the first 1024 bytes. - verified that the cr50 board can be booted over SPI using the image in build/cr50/RO/ec.RO.flat Change-Id: Iacc22561de67fadfaf8e049bf9578cbd08cfad86 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/295291 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Cleanup: Remove cruft in Makefile from long agoBill Richardson2015-08-221-2/+1
| | | | | | | | | | | | | | | This removes a bit of Makefile magic left over from commit 950d507 (April 2013), when we began mocking individual functions instead of files. It hasn't be used or useful since then. BUG=none BRANCH=none TEST=buildall Change-Id: Iacbef05cb07936f873f29948715e742e1ff465fc Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/295175 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cr50: tpm2: pull in the tpm2 library sourcesVadim Bendebury2015-08-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch syncs up TPM2 sources into the build area when building cr50 image. This relies on a specific directory layout so that the ec makefile has access to the tpm2 source tree. The sources are copied using rsync, the tpm2 library is a dependency for the RO/RW elf images, and is declared to be a phony make target, which guarantees that the tpm2 make is always run when cr50 image is built. Include files in board/cr50/tpm2 are necessary to be able to build tpm2 code using the bare metal toolchain used for building ec code. memory.h is in fact empty, it is easier to add it here than to wrap it in conditional compilation at the source. Make variables CROSS_COMPILE and CFLAGS are exported for the benefit of the tpm2 makefile. ROOTDIR indicates where tpm2 library should look for .h files not available from the toolchain. CQ-DEPEND=CL:292946 BRANCH=none BUG=chrome-os-partner:43025 TEST=make buildall -j succeeds; when linked with the latest tpm2 source, the combined image starts the tmp task and reacts to the host sending the startup command (failing due to unplugged stubs). Change-Id: Ia3fd260588558c2bacd724df9583052fa4660ca3 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/292975 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* Allow for private board configurationsBill Richardson2015-08-111-13/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The public sources look for board configurations in directories named board/$BOARD/ Sometimes it's necessary to keep sensitive projects out of the public view for a bit. This CL allows board configurations to also appear in directories named private*/board/$BOARD/ BUG=none BRANCH=none TEST=manual First, ebuilds and "make buildall" seem to work just as before. Second, I copied 24 of the existing boards (those without board-specific #ifdefs in the code) into a private*/board/ directory, renamed them to something unique, and ran "make buildall" again. Both public and private boards compiled and passed their tests. Change-Id: I977c23cb8e73e40677c8f329abca8bbc51fd53df Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/292428 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* build-infr: Add support for shared RO library.Aseda Aboagye2015-07-171-14/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit introduces the build infrastructure changes needed for creating a shared RO library. (libsharedobjs). The end goal is for the library to contain various objects that can be shared with both the RO and RW EC images. Now, there are 3 make goals: ro, rw, and libsharedobjs. In order for changes that are only specific to a single image (ie: RW only) to be applied correctly, the object files are now built separately for the RO, RW, shared objects library targets. NOTE: Certain EC targets are incompatible with this model due to the fact that only one image is present within flash at a time. BRANCH=none BUG=None TEST=make -j buildall tests TEST=make -j BOARD=cr50 xrefs TEST=make BOARD=samus dis TEST=Built samus EC image and compared that the final EC image was identical to the upstream version (except for the git SHAs & version strings). CQ-DEPEND=CL:285934 Change-Id: I8e67f089710be9c6d7017718109262394bdad2f5 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/274079 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* Added private-cr51 repoBill Richardson2015-07-131-1/+4
| | | | | | | | | | | BUG=none BRANCH=none TEST=make buildall Change-Id: I3b827240bd65afae7473d1e55c4f36698a33c91f Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/284918 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cleanup: Update Makefile's .PHONY targetsBill Richardson2015-06-181-4/+3
| | | | | | | | | | | | | | This puts the .PHONY declaration next to the target, so that we don't overlook any. BUG=none BRANCH=none TEST=make buildall Signed-off-by: Bill Richardson <wfrichar@chromium.org> Change-Id: I944537fdc3a90691a7f2de0bff9d7f9df4898cf8 Reviewed-on: https://chromium-review.googlesource.com/278019 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cleanup: Rename image geometry CONFIGsShawn Nematbakhsh2015-05-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Rename image geometry configs with a uniform naming scheme to make their purposes more clear. CONFIG_RO_MEM_OFF (was CONFIG_FW_RO_OFF) - RO image offset in program memory CONFIG_RO_STORAGE_OFF (was CONFIG_RO_SPI_OFF) - RO image offset on storage CONFIG_RO_SIZE (was CONFIG_FW_RO_SIZE) - Size of RO image CONFIG_RW_MEM_OFF (was CONFIG_FW_RW_OFF) - RW image offset in program memory CONFIG_RW_STORAGE_OFF (was CONFIG_RW_SPI_OFF) - RW image offset on storage CONFIG_RW_SIZE (was CONFIG_FW_RW_SIZE) - Size of RW image CONFIG_WP_OFF (was CONFIG_FW_WP_RO_OFF) - Offset of WP region on storage CONFIG_WP_SIZE (was CONFIG_FW_WP_RO_SIZE) - Size of WP region on storage BUG=chrome-os-partner:39741,chrome-os-partner:23796 TEST=Set date / version strings to constants then `make buildall -j`. Verify that each ec.bin image is identical pre- and post-change. BRANCH=None Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org> Change-Id: I6ea0a4e456dae71c266fa917a309b9f6fa4b50cd Reviewed-on: https://chromium-review.googlesource.com/270189 Reviewed-by: Anton Staaf <robotboy@chromium.org>