summaryrefslogtreecommitdiff
path: root/Makefile.rules
Commit message (Collapse)AuthorAgeFilesLines
* makefile: use separate directory for code coveragePaul Fagerburg2020-06-121-4/+18
| | | | | | | | | | | | | | | | | | | | | | | When building host-based unit tests for code coverage, put the build outputs in a different directory. Because the code coverage build has calls into gcov library functions, a partial rebuild without code coverage will result in undefined linker errors. The previous solution was an inefficient cycle of `make clobber` and full rebuild when switching between building with and without code coverage. BUG=b:157091606 BRANCH=None TEST=`make buildall -j ; make coverage -j` Verify that build/host and build/coverage both exist, and that code coverage data (*.gcno, *.gcda, *.info) is only in build/coverage. Signed-off-by: Paul Fagerburg <pfagerburg@google.com> Change-Id: Iac0b18068082d34546aa15b174f86efb6a7f41a7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2242351 Tested-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org>
* ec: fix `make coverage` code coverage reportingPaul Fagerburg2020-05-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | | Fixed problems that were preventing us from building the unit tests with code coverage testing via `make coverage`. * Changed test_util so that programs will cleanly exit on SIGTERM. * Changed run_host_test to wait for the child process to exit, and only proc.kill() if it times out, so the child process will generate code coverage output files on exit. * Changed Makefile.toolchain to use the --coverage flag for both compile and link. * Changed build.mk and Makefile.rules to exclude certain tests from code coverage because they were causing failures either during the individual stage of code coverage, or generating the overall report. BUG=b:143065231 BRANCH=none TEST=`make coverage` produces results Signed-off-by: Paul Fagerburg <pfagerburg@chromium.org> Change-Id: I8575013551ce1dba3fd249cd933a3cf6d110db8d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2186853 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* make: Force --no-print-directoriesCraig Hesling2020-04-041-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | Before this fix, some sub-make invocations did not use the --no-print-directories and some did. So, you would still see the build output contaminated by make's "Entering directory .../ec" and "Leaving directory .../ec" messages. They are pretty much useless, since they all mention the same ec directory. This fix * once and for all, kills all of those messages. * simplifies the make file by removing the need to specify the flag * cleans up the build output by removing the specified flag BRANCH=none BUG=none TEST=make buildall -j # Ensure that no "Entering dir ..." or "Leaving dir ..." # messages were emitted. Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I5cd7ac8fd2fcf1cde3b03485c17f5fd6969ee7aa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2132615 Reviewed-by: Jett Rink <jettrink@chromium.org>
* Makefile: recompile cros_ec_commands.sh on script changeGwendal Grignou2020-03-091-2/+5
| | | | | | | | | | | | | | Add the script that generates cros_ec_commands.sh to the rule. BUG=none BRANCH=none TEST=Check cros_ec_commands.h is re-generated by 'make build_cros_ec_commands' when make_linux_ec_commands_h.sh changes. Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: Ieb0fbc0a7340e618d2c75df674d33365c36c944f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2092494 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* remove cr50 related filesNamyoon Woo2020-03-091-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BUG=b:149350081 BRANCH=none TEST=build all, and emerged ec related packages for host and octopus. $ make buildall -j $ cros_workon --host list chromeos-base/chromeos-cr50-dev chromeos-base/chromeos-ec chromeos-base/chromeos-ec-headers chromeos-base/ec-devutils chromeos-base/ec-utils chromeos-base/ec-utils-test dev-util/hdctools $ sudo emerge chromeos-cr50-dev -j $ sudo emerge chromeos-ec -j $ sudo emerge chromeos-ec-headers -j $ sudo emerge ec-devutils -j $ sudo emerge ec-utils -j $ sudo emerge ec-utils-test -j $ sudo emerge hdctools -j $ cros_workon-octopus list chromeos-base/chromeos-ec chromeos-base/chromeos-ec-headers chromeos-base/ec-devutils chromeos-base/ec-utils chromeos-base/ec-utils-test dev-util/hdctools $ sudo emerge-octopus chromeos-ec -j $ sudo emerge-octopus chromeos-ec-headers -j $ sudo emerge-octopus ec-devutils -j $ sudo emerge-octopus ec-utils -j $ sudo emerge-octopus ec-utils-test -j $ sudo emerge-octopus hdctools -j Signed-off-by: Namyoon Woo <namyoon@chromium.org> Change-Id: If751b26b0635b0021c077338e96eaa8e8dcf17a5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2080631 Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* skip cr50 from buildallNamyoon Woo2020-02-211-1/+1
| | | | | | | | | | | | | | | | | This patch adds cr50 to skip-board in Makefile.rules. The intention is to keep platform/ec independent from TPM2 library change. Cr50 development has been shifted to cr50-stab branch. Cr50 is maintained in that branch, but not in master(platform/ec) branch. This is a band-aid fix to prevent chromeos-ec package emake error, until we can remove board/cr50 completely from the master branch. BUG=b:149350081 BRANCH=none TEST=ran 'make buildall -j' and 'emerge-eve chromeos-ec' Change-Id: I078ec4616158fefb3bfc0bea5c670632a7b97163 Signed-off-by: Namyoon Woo <namyoon@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2067157
* make: Add print-defines and print-includesCraig Hesling2020-02-141-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows for automated IDE toolchain setup. Note, print-defines simply assumes you want to work on the RW section, thus it sets BLD=RW. If you want the defines for RO, simply set BLD=RO. Unfortunately, I needed to use CFLAGS, since some people abuse other compilation flags to add -D and -I flags. This should be cleaned up. BRANCH=none BUG=none TEST=make help TEST=make print-tests TEST=make print-host-tests TEST=make print-host-fuzzers TEST=make print-host-fuzzers | cat TEST=make print-boards TEST=make print-boards | cat TEST=make BOARD=nocturne_fp print-defines TEST=make BOARD=nocturne_fp print-includes TEST=make BOARD=nocturne print-defines TEST=make BOARD=nocturne BLD=RO print-defines TEST=make BOARD=nocturne print-includes TEST=make BOARD=nocturne print-defines | cat TEST=make BOARD=nocturne print-includes | cat TEST=make buildall -j Change-Id: I8ca729781201bad241f978407bfef54cad79ae80 Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2051450 Reviewed-by: Jett Rink <jettrink@chromium.org>
* libcryptoc: Cleanup build messagesCraig Hesling2020-02-121-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch cleans up all of the nonformatted make output generated from calling out to libcryptoc's make script. This makes no functional change. # WITHOUT this fix, we see the following when libcryptoc.a is dirty: > VERSION ec_version.h > make obj=/mnt/host/source/src/platform/ec/build/hatch_fp/cryptoc SUPPORT_UNALIGNED=1 \ > CONFIG_UPTO_SHA512= -C /mnt/host/source/src/third_party/cryptoc > MKDIR /mnt/host/source/src/platform/ec/build/hatch_fp/cryptoc > CC util.c # WITHOUT this fix, we see the following when libcryptoc.a is clean: > CC RW/common/version.o > make obj=/mnt/host/source/src/platform/ec/build/hatch_fp/cryptoc SUPPORT_UNALIGNED=1 \ > CONFIG_UPTO_SHA512= -C /mnt/host/source/src/third_party/cryptoc > make[2]: '/mnt/host/source/src/platform/ec/build/hatch_fp/cryptoc/libcryptoc.a' is up to date. > LD RW/ec.RW.elf # WITH this fix, we see the following when libcryptoc.a is dirty: > MAKE cryptoc/libcryptoc.a > MKDIR /mnt/host/source/src/platform/ec/build/hatch_fp/cryptoc > CC util.c > ... > AR libcryptoc.a # WITH this fix, we see the following when libcryptoc.a is clean: > CC RW/common/version.o > MAKE cryptoc/libcryptoc.a > LD RW/ec.RW.elf This also fixes the following error: warning: jobserver unavailable: using -j1. Add '+' to parent make rule. BRANCH=none BUG=none TEST=rm -rf build/ make proj-cr50 proj-nocturne_fp proj-hatch_fp # We should see a "MAKE cryptoc/libcryptoc.a" followed by the # MKDIR, CC, and AR lines for each libcryptoc object. # No spurious make output relacted to libcryptoc should be generated. make proj-cr50 proj-nocturne_fp proj-hatch_fp # We should see a "MAKE ... libcryptoc" followed by no # additional libcrypto specific make steps. # Unfortunately, with libcryptoc being a PHONY target, we can't avoid # rebuilding other downstream objects. This should be fixed. touch ../../third_party/cryptoc/*.c make proj-cr50 proj-nocturne_fp proj-hatch_fp # We should see a "MAKE cryptoc/libcryptoc.a" followed by the # CC and AR lines for each libcryptoc object. # No spurious make output relacted to libcryptoc should be generated. # We should see a "MAKE ... libcryptoc" followed by no # additional libcrypto specific make steps TEST=rm -rf build/ make BOARD=hatch_fp V=1 build/hatch_fp/cryptoc/libcryptoc.a # Ensure that verbose mode is passed to sub-make TEST=rm -rf build/ make BOARD=hatch_fp build/hatch_fp/cryptoc/libcryptoc.a # Ensure that verbose is disabled TEST=make proj-grunt # No mention of libcryptoc Change-Id: I8afde8b5981861647b3eee0044fd3fd3e8fafaec Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2042784 Reviewed-by: Jett Rink <jettrink@chromium.org>
* cleanup: add comments for MT flag useJett Rink2020-02-111-0/+7
| | | | | | | | | | | | | Document why we need the MT flag as a compiler option BRANCH=none BUG=none TEST=builds Change-Id: Id6bceacc3b0af110f79d9f727ded595950fa2afb Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2044358 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* Makefile: enforce target name in generated dependenciesVadim Bendebury2020-02-071-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There seems to be some odd interaction between ccache version 3.7.6 and the set of command line options passed to gcc by the EC makefile, as a result the generated dependency files are wrong, the target file name is missing the path. The -MT command line option makes sure that the correct target file name is generated. Had to make similar changes in ../../third_party/{cryptoc,tpm2} Makefiles. No need to change extra/usb_updater/Makefile as it puts .o files in the same directory where .c files are. BRANCH=all BUG=b:148943341 TEST=verified that relevant object files are rebuilt when an .h file is touched. Also, with companion changes in cryptoc and tpm2 trees verified that all generated my 'make buildall' .d files have proper target values (including path), apart froom files in extra/usb_udater, which place .o files in the same directory with .c files. Change-Id: I22dfad94c112582230a2b6b60289e029a382d822 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2039988 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* get_version.sh: add an option for non-changing version fileJack Rosenthal2020-01-131-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | I've made a hack similar to this a few times when I needed to test that applying commit(s) did not change a certain ec.bin file. get_version.sh already had a REPRODUCIBLE_BUILD option, which is useful for testing that compiling under a different user/host would not change the build, but did not allow testing compiling under a different commit. This adds another option, STATIC_VERSION, which allows different user, host, and commit/repository state. Usage: make BOARD=foo STATIC_VERSION=1 BUG=none BRANCH=none TEST=compile at different commits, observe ec.bin file does not change. Change-Id: I5fc277791cb272317fac2471f763b40290118e1d Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1997735 Reviewed-by: Jett Rink <jettrink@chromium.org>
* Makefile: Add print-make-vars ruleJack Rosenthal2020-01-091-0/+12
| | | | | | | | | | | | | | | | | | | | | The Bash-based flash_ec script uses print-baseboard to identify if a board has a baseboard. The newer Python version I'm working on not only uses that information, but reduces the number of board-specific quirks we have encoded in the script by using the CHIP, CHIP_FAMILY, CHIP_VARIANT, and CORE variables to discover quirks. Introduce a print-make-vars rule to be used by the new flash_ec script which is extensible to many variables. BUG=b:145292630 BRANCH=none TEST=make BOARD=... print-make-vars for a few different boards Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ib91123d2b0b36c584db563e192f72a3ac001f330 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1992791 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* kukui: include a dummy bootblock if BOOTBLOCK variable not setTing Shen2019-12-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* glados/chell: Stop building these boardsAseda Aboagye2019-12-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | GLaDOS and chell are out of space, so stop building these boards now. Deleting the boards is problematic since the ec-utils ebuild still expects the board directory to exist, but only builds the utils-host target. In order to prevent that, the 'cros_ec' USE flag needs to be removed from their bsp as well. BUG=None BRANCH=None TEST=`make -j buildall` TEST=`cros_workon --board chell start ec-utils && emerge-chell ec-utils` Cq-Depend: chrome-internal:2296525, chrome-internal:2295865 Change-Id: I249bb2b3957d2f237a63207c91f0bd2e973d5dca Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1959962 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* make: Add check for flash supportCraig Hesling2019-12-061-1/+4
| | | | | | | | | | | | | | | | | BRANCH=none BUG=none TEST=make buildall -j TEST=make BOARD=hatch flash # Should emit error that board isn't supported TEST=make BOARD=nucleo-f072rb flash # Should start openocd or error that command not found Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: Id13847d51392cc098ff7b289d120978202019aaf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1952198 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* make: Add help messages for flash variantsCraig Hesling2019-12-061-0/+4
| | | | | | | | | | | | BRANCH=none BUG=none TEST=make help Change-Id: Ic32777ec1c92fd79b803f8d20591ce47685af784 Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1952197 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* Use actual utilities dependency, not phony targetStefan Reinauer2019-10-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | This prevents the EC binaries unnecessarily being recreated every time you run make on the target. BUG=none TEST= make BOARD=scarlet [..] make BOARD=scarlet *** 11460 bytes in flash and 10252 bytes in RAM still available on scarlet RO **** *** 24140 bytes in flash and 10252 bytes in RAM still available on scarlet RW **** BRANCH=none Change-Id: I6cabb7d1b7512162c8b24c7664bafc7d98c5eda5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1851106 Reviewed-by: Stefan Reinauer <reinauer@google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Patrick Georgi <pgeorgi@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org> Tested-by: Stefan Reinauer <reinauer@google.com>
* make: Add utils to help messageCraig Hesling2019-10-291-0/+1
| | | | | | | | | | | BRANCH=none BUG=none TEST=make help Change-Id: I912e54927e3e307180e8d80e78105fdfdd6c9dfb Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1880322 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Fix race condition in spiflashfw.Allen Webb2019-10-151-7/+10
| | | | | | | | | | | | BRANCH=None BUG=chromium:1011870 TEST=make -j buildall Change-Id: Ifa0241cf9ea02ecf989fc7257f37c24efb17c3a7 Signed-off-by: Allen Webb <allenwebb@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1860720 Reviewed-by: LaMont Jones <lamontjones@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* util: add build include for private host toolsHarry Cutts2019-10-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | We have provision for private host commands (see the `EC_PRIVATE_HOST_COMMAND_VALUE` macro), but no way to make a private host-side tool that can share the host command protocol implementation in util/. This CL allows a private directory to be symlinked as util/private and have its build.mk file included in the build. For an (internal-only) example of what you might put in private, see https://crrev.com/i/1914158. BRANCH=none BUG=chromium:1008568 TEST=Patch https://crrev.com/i/1914158 in the private repo (or add a util directory there with a build.mk), then from the ec directory, run `ln -s ../private/util util/private`. Run a build and verify that the private build.mk gets run. Change-Id: Ie1ad00cb454ba9ed57e4e9b24d4f5d397ca0d7a5 Signed-off-by: Harry Cutts <hcutts@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1836757 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Revert "Temporarily disable jerry due to CQ outages"Jack Rosenthal2019-10-081-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 437e7346ab38a1eca1bb8526ae03b120635f03e9. Reason for revert: jerry RO space issue resolved BUG=chromium:1011621 Original change's description: > Temporarily disable jerry due to CQ outages > > jerry is out of RO flash space and causing CQ outages. disable from > buildall until it gets a proper fix. > > BUG=chromium:1011621 > TEST=buildall > > Change-Id: I09c6d2729660d94c0462b0ed5795b977ace90a3a > Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1844145 > Reviewed-by: Jason Clinton <jclinton@chromium.org> > Reviewed-by: Mike Frysinger <vapier@chromium.org> > Commit-Queue: Jason Clinton <jclinton@chromium.org> Bug: chromium:1011621 Change-Id: I52bd1c661684da39192e82ea801e7998bb07bbd0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1847773 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jason Clinton <jclinton@chromium.org> Tested-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* Temporarily disable jerry due to CQ outagesJack Rosenthal2019-10-061-0/+4
| | | | | | | | | | | | | | | jerry is out of RO flash space and causing CQ outages. disable from buildall until it gets a proper fix. BUG=chromium:1011621 TEST=buildall Change-Id: I09c6d2729660d94c0462b0ed5795b977ace90a3a Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1844145 Reviewed-by: Jason Clinton <jclinton@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> Commit-Queue: Jason Clinton <jclinton@chromium.org>
* Fix non-tty output of make print-boardsStefan Reinauer2019-10-021-4/+4
| | | | | | | | | | | | | | | | | | dash does not support &> so non-tty output on ubuntu was broken. Signed-off-by: Stefan Reinauer <reinauer@chromium.org> BRANCH=none BUG=none TEST=make print-boards TEST=make print-boards | cat Change-Id: If27c55ecfcaac30b24205aef5e1fd67f8a73aae0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1817947 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Stefan Reinauer <reinauer@google.com> Tested-by: Stefan Reinauer <reinauer@google.com>
* Makefile.rules: LDFLAGS comes lastStefan Reinauer2019-10-011-2/+2
| | | | | | | | | | | | | | When compiling host utilities on standard Ubuntu 19.04, linking will fail if LDFLAGS is not specified after the object files. Signed-off-by: Stefan Reinauer <reinauer@chromium.org> BUG=none BRANCH=none TEST=Run make outside of chroot and see it succeed. Change-Id: I3330edf247aa109d5fbaa0e08cb7b4cfefc96a09 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1818149 Reviewed-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Makefile.rules: use patsubst instead of substCaveh Jalali2019-09-271-1/+1
| | | | | | | | | | | | | | | | | | | | the patsubst function is a better function for removing a path prefix as it is anchored at the beginning of the search space. the original "subst" function can match everywhere in the path which leads to weird transformations. patsubst is anchored at the beginning of the string which better suits the intent here. BRANCH=none BUG=none TEST=make buildall passes, $(out) now only removed at beginning of output paths. Change-Id: Ic5fe7aeb5eb8c87aa8bb49ea0865dc07327cb3e5 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1803178 Commit-Queue: Caveh Jalali <caveh@google.com> Reviewed-by: Caveh Jalali <caveh@google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Makefile.rules: fix jobserver handlingstabilize-12515.BCaveh Jalali2019-09-141-2/+4
| | | | | | | | | | | | | | | | | | | | | looks like make isn't smart enough to detect a recursive make invocation when the $(MAKE) command is buried inside a $(call ...) function resulting in: make[2]: warning: jobserver unavailable: using -j1. Add '+' to parent make rule. adding a '+' to give make the appropriate hint. BUG=none BRANCH=none TEST=make buildall -j still works, make no longer complains about jobserver Change-Id: Ia923a653e1ebf9cae7dae24a5b16f821b53e70b2 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1803179 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Makefile.rules: do not ignore compilation errorsCaveh Jalali2019-09-131-8/+8
| | | | | | | | | | | | | | | | | for some reason, Makefile.rules is set up to ignore compilation errors on npcx_monitor. this seems very wrong. BRANCH=none BUG=none TEST=make proj-atlas now fails - an existing compilation now fails the build Cq-Depend: chromium:1799293 Change-Id: I8ba9b8bc05d9b11df6a4f79bbcc2bbf7e48b224d Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1799294 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Caveh Jalali <caveh@google.com>
* fpsensor: replace memset() with always_memset()Yicheng Li2019-09-041-1/+1
| | | | | | | | | | | | | | In fpsensor code, use always_memset() in place of memset(). BRANCH=nocturne BUG=chromium:968809,chromium:989594,b:130238794 TEST=make -j buildall TEST=tested enrollment, matching and multifinger on nocturne DUT Change-Id: I29e32bd2838c1f240607799e61f29759aaee7600 Signed-off-by: Yicheng Li <yichengli@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1737206 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* makefile: support PORT for flash_ecYilun Lin2019-08-291-1/+1
| | | | | | | | | | | | | | 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>
* makefile: remove print-chip-variantJack Rosenthal2019-08-071-5/+0
| | | | | | | | | | | | | | | We ended up deciding on a different design for the location of ISH firmware in the filesystem (long ago), and the chip variant is no longer needed in the ebuild. Remove this target. BUG=b:122371717 BRANCH=none TEST=buildall Change-Id: I9d5152537c9f4e86296546b86c98f581534d379f Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1742418 Reviewed-by: Raul E Rangel <rrangel@chromium.org>
* Improve unit test and fuzzer documentation storyCraig Hesling2019-07-201-2/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update **test** directory description to README.md. * Add ** fuzz** directory description to README.md. * Add unit test and fuzzer make targets to `make help` * Change showboards to print-boards to be more consistent * Change showboards to use auto pretty print * Add print-tests, print-host-tests, and print-host-fuzzers This is necessary to remove the ambiguity about what a special name is for a given unit test. Documentation Story: The idea is to give a brief overview of what the test and fuzz directories are in README.md. README.md also mentions you should see `make help` for more detail. Running `make help` shows you more general test/fuzz commands, including the print-* commands. Running the print-* commands show you exact target names for all possible unit/fuzz test (both the build-only and run target names). BRANCH=none BUG=none TEST=make help TEST=make print-tests TEST=make print-host-tests TEST=make print-host-fuzzers TEST=make print-host-fuzzers | cat TEST=make print-boards TEST=make print-boards | cat TEST=make buildall -j Change-Id: I34b68196ac635ba71a1d45ceb5d35a3b36fd129f Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1684714 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* ish: fix aon task not auto rebuild issue in increment buildHu, Hebo2019-07-121-16/+1
| | | | | | | | | | | | | | | | | | | | | aon task image build rules are lack of dependent rules of source code, so can't track the source code changes and trigger auto build. Refactor build rules for aon task to make sure always auto rebuild when aon task's source code and dependent header files update BUG=b:136691893 BRANCH=none TEST= ish aon task should always rebuild when it's code and dependent header files update Change-Id: I0d8c7c6a4a2b7e99d724b88b233e09a29b8facea Signed-off-by: Hu, Hebo <hebo.hu@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1688701 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Hebo Hu <hebo.hu@intel.corp-partner.google.com> Tested-by: Hebo Hu <hebo.hu@intel.corp-partner.google.com> Commit-Queue: Jack Rosenthal <jrosenth@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.rules: Fix silencing of libec.a related warnings.Allen Webb2019-06-131-3/+3
| | | | | | | | | | | | | | | When sanitizers are enabled, the libec.a related steps print a very large amount of warnings that polute the build log and make it hard to troubleshoot. BRANCH=none BUG=chromium:950310 TEST=USE="asan fuzzer" emerge-${BOARD} chromeos-ec Change-Id: Ica06322291c95595b01941cffcfc297f2368ca02 Signed-off-by: Allen Webb <allenwebb@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1566655 Reviewed-by: Andrey Pronin <apronin@chromium.org>
* Makefile.rules: use CFLAGS instead of CPPFLAGSTom Hughes2019-06-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CPPFLAGS are flags for the preprocessor, not the C compiler. clang warns when linking that we don't have the blx instruction: lld.real: warning: lld uses blx instruction, no object with architecture supporting feature detected but this is because the linker command was not being passed the correct architecture because it was missing the CFLAGS that specified them: Before: "/usr/bin/clang-8" -cc1as -triple armv4t-none-unknown-eabi After: "/usr/bin/clang-8" -cc1as -triple thumbv7em-none-unknown-eabi BRANCH=nocturne,nami BUG=chromium:931797 TEST=make buildall -j TEST=revert change rm -rf build && make buildall -j | grep 'bytes in flash and' | \ | sort > build.before => apply change rm -rf build && make buildall -j | grep 'bytes in flash and' | \ | sort > build.after diff build.before build.after => no difference Change-Id: I6401b60fa3721c441df126f69634a13d6c7c06fe Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1470781 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* Makefile: create new rules for host and fuzz testsJack Rosenthal2019-06-061-2/+4
| | | | | | | | | | | | | | | | | | | | In order for chromeos-ish ebuild to run tests, it must run the fuzz tests, which are not related to ISH features, and introduce a lot of library dependencies into the ebuild. Provide two new targets: runhosttests and runfuzztests to allow the host tests to be run separately. runtests (and buildall) remain the same. BUG=b:134446400 BRANCH=none TEST=ran new targets, they functioned as intended Change-Id: Idba7fcfe707caeb0e51ce0c38caeac9da87e3baf Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1642887 Reviewed-by: Jett Rink <jettrink@chromium.org> Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
* Makefile: Replace flag -DX with -DX= to be supported by IS_ENABLED().Yilun Lin2019-06-031-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Revert "Makefiles.rules: Do not attempt to run fuzzing tests"Nicolas Boichat2019-06-011-2/+1
| | | | | | | | | | | | | | | | This reverts commit 5c986c3bbf1c414ada67f785f602418fd29e0132. Presumably the previous CL fixes the flakiness. BRANCH=none BUG=chromium:963768 TEST=make buildall -j Change-Id: I972ce5c20586410773a78afe21a1b0c02d9c5f0b Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1623051 Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org> Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
* Makefiles.rules: Do not attempt to run fuzzing testsNicolas Boichat2019-05-211-1/+2
| | | | | | | | | | | | | | | | There is a currently a frequent race when running fuzzing tests, let's not run them to avoid continuously breaking the CQ. BRANCH=none BUG=chromium:963768 TEST=make buildall -j => no fuzzing tests are run Change-Id: Ic789dc207ecb064d0918ab04fd8644d0b77f7c0f Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1621447 Reviewed-by: John L Chen <zuan@chromium.org> Commit-Queue: John L Chen <zuan@chromium.org> Tested-by: John L Chen <zuan@chromium.org>
* ec: common: Make IS_ENABLED fail on unknown valuesRaul E Rangel2019-05-151-1/+8
| | | | | | | | | | | | | | | | | 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>
* mt_scp: Generate IPI tables with util gen_ipi_table.Yilun Lin2019-04-301-0/+2
| | | | | | | | | | | | | | | | | | | | IPI table is board-specific. This CL removes the original IPI table in chip layer, and uses gen_ipi_table to generate the table for each board to reduce the maintenance effort. TEST=make BOARD=kukui_scp, and see build/kukui_scp/ipi_table_gen.inc exists. Push to Kukui, and see SCP boots. TEST=modify IPI_COUNT in board.h and see it generates a new ipi_table_gen.inc BUG=b:130508869 BRANCH=None Change-Id: I0c05319447d15917e8833aa80d61166c4e396370 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1568890 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* makefile: fix image stats reporting problemsVadim Bendebury2019-04-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | Recently merged patch (34cc1f91c) introduced printing of free space stats for both RO and RW images, without actually describing which image the message applies to. This change adds this additional description. BRANCH=none BUG=none TEST=built a cr50 image: $ make BOARD=cr50 -j ... *** 8148 bytes in flash ... still available on cr50 RO **** *** 8880 bytes in flash ... still available on cr50 RW **** Change-Id: Ib7d5890c94ea93906d8f6a7a7c95819c47ffab8a Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1582456 Reviewed-by: Mary Ruthven <mruthven@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* util: Add tool to generate cros_ec_commands.hGwendal Grignou2019-04-261-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add a rule to generate a new cros_ec_commands.h when ec_commands.h is modified. The rule is checked when buildall is invoked. At Presubmit stage, check a cros_ec_commands.h exists if ec_commands.h is modified. The CL author is responsible to upstream that file. BUG=chromium:945948 BRANCH=none Cq-Depend: chromium:1558853 TEST=Check manually cros_ec_commands.h is generated with make build_cros_ec_commands Check no bread crumbs are left-over when the rule fails. Check checkpatch triggers when it finds an invalid syntax in the output file. Check ../../repohooks/pre-upload.py returns a meaningful error when cros_ec_commands.h file is not present. Change-Id: Ibc8ed7165914d39b5f0bd41643932a8514768925 Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1559380 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Brian Norris <briannorris@chromium.org>
* Makefile: Add 'stats:' targetDaisuke Nojiri2019-04-181-0/+5
| | | | | | | | | | | | | | | | | | | | | Currently, only buildall can print flash space stats. This patch adds 'stats:' target, which prints the smallest flash spaces. This target can print flash stats without running other recipes associated with buildall. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=none BRANCH=none TEST=make stats Change-Id: I30e0cb7cda60c4309212024a7b842f6b37d836ff Reviewed-on: https://chromium-review.googlesource.com/1554842 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
* Makefile: Print free spaces in RO flashDaisuke Nojiri2019-04-131-10/+21
| | | | | | | | | | | | | | | | | | | | Currently, buildall prints only free spaces in RW flash. This patch makes it print smallest free spaces in RO flash as well. If the board doesn't have RO (i.e. #undef CONFIG_FW_INCLUDE_RO), it'll be ignored. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b/129746223 BRANCH=none TEST=buildall Change-Id: I953cb6fd998c3868e54be2ea3c2ce0ab51275b64 Reviewed-on: https://chromium-review.googlesource.com/1554841 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* ish/ish5: implement AON low power mode (D0i1-3)Hu, Hebo2019-04-081-1/+3
| | | | | | | | | | | | | | | | | 1: D0i1(TCG) and D0i2(TCG + SRAM retention) implemented 2: D0i3 (TCG + SRAM power off) implemented BUG=b:122364080 BRANCH=none TEST=tested on arcada Change-Id: I851d7c138b056a92d1616622e7cbfdfb94d86e5c Signed-off-by: Hu, Hebo <hebo.hu@intel.com> Reviewed-on: https://chromium-review.googlesource.com/1531772 Commit-Ready: Hebo Hu <hebo.hu@intel.corp-partner.google.com> Tested-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Hebo Hu <hebo.hu@intel.corp-partner.google.com>
* ish/ish5: implement AON low power management frameworkHu, Hebo2019-04-081-0/+14
| | | | | | | | | | | | | | | | | | | | | AON PM framework including: 1: AON task skeleton 2: task switching between main FW and AON task 3: 'idlestats' console command for D0ix statistic information 4: D0ix entrance in idle task BUG=b:122364080 BRANCH=none TEST=tested on arcada Change-Id: Iefa9e067892d5c42d9f0c795275fe88e5a36115b Signed-off-by: Hu, Hebo <hebo.hu@intel.com> Reviewed-on: https://chromium-review.googlesource.com/1510518 Commit-Ready: Rushikesh S Kadam <rushikesh.s.kadam@intel.com> Commit-Ready: Hebo Hu <hebo.hu@intel.corp-partner.google.com> Tested-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Hebo Hu <hebo.hu@intel.corp-partner.google.com>
* Makefile: fix compatibility with Protobuf 3.7.0Allen Webb2019-03-211-0/+2
| | | | | | | | | | | | | | | | This defines PROTOBUF_MIN_PROTOC_VERSION so protobuf headers don't fail with -Wundef and sets -Wno-unreachable-code to allow for maps to be used in protocol buffers. BRANCH=None BUG=chromium:937442 TEST=make -j buildall Change-Id: Id595825c224e34df1034c26d49bb4f6263358470 Signed-off-by: Allen Webb <allenwebb@google.com> Reviewed-on: https://chromium-review.googlesource.com/1531336 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Makefiles.rules: Add rule to create static libraries (.a)factory-atlas-11907.11.BNicolas Boichat2019-03-101-0/+6
| | | | | | | | | | | | | This will be useful for some targets (which will still need to fixup the dependencies themselves). BRANCH=none BUG=b:124804731 TEST=With follow-up TEST CLs, libprivate.a can be created Change-Id: I5a1f4726794b308824275530b08f327e679eb904 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1475108
* build: Fix print configs when _tsk_cfg_rw is not emptyPi-Hsun Shih2019-03-071-1/+1
| | | | | | | | | | | | | | | | | | | The _tsk_cfg_rw is a series of flags like HAS_TASK_MOTIONSENSE, which doesn't make sense to be used as a command. BRANCH=none BUG=b:126308353 TEST=make BOARD=kukui print-configs works TEST=print-configs on all boards, and check that output is not changed except for boards that RW Config can't be printed due to this bug. Change-Id: I513e88032abb8a418b22179d9e9c92a1dd8fbf3a Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1498954 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>