summaryrefslogtreecommitdiff
path: root/Makefile.rules
Commit message (Collapse)AuthorAgeFilesLines
* ec: Prevent #undef or #define of zephyr KconfigsJeremy Bettis2023-04-041-1/+9
| | | | | | | | | | | | | | | | | | | | Block all #undef or #define of Kconfigs in include/config.h. This will allow removing the #include <autoconf.h> from zephyr/shim/include/config_chip.h, which will in turn allow removing all of the #line directives we've sprinkled throughout the headers. BRANCH=None BUG=b:272518464 TEST=make buildall_only -j$(nproc), fails before crrev/c/4396143 TEST=CQ, fails before crrev/c/4396143, passes after Change-Id: I09649cf778e339fb45dc05c6ebdffc9aaa5778d2 Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4396142 Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org>
* ec: Fix kconfig_check.pyJeremy Bettis2023-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The kconfig_check.py tool was reporting all symbols in the Kconfigs as configs, including things like ``` config PLATFORM_EC_PREINIT_HW_CYCLES_PER_SEC default 100000000 ``` would return CONFIG_PLATFORM_EC_PREINIT_HW_CYCLES_PER_SEC and CONFIG_100000000 as valid configs. Read only Symbol node names instead. Include Kconfigs in platform/ec but outside of platform/ec/zephyr also. Also include Kconfig.zephyr from third_party/zephyr/main, which was previously omitted. This requires setting some environment variables. BRANCH=None BUG=b:272518464 TEST=make buildall Change-Id: I02e86f5c96f1e9943386d1610af1b2ab07550754 Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4383371 Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* kconfig_check: ignore CONFIG_SMBUSPeter Marheine2023-03-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | This configuration symbol was added to zephyr in https://crrev.com/c/4365433 and causes EC build failures because the new option in Zephyr shadows an option with different meaning in ECOS: > The following options are now in Kconfig: > > CONFIG_SMBUS > > Please run this to update the list of allowed ad-hoc CONFIGs and > include this update in your CL BUG=None BRANCH=None TEST=make buildall Change-Id: I1c507356f8a73eb80d4f58b65aaf2c04bc60d7f3 Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4369802 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* cq: Also build host utils in buildallJeremy Bettis2023-03-211-0/+1
| | | | | | | | | | | | | | | | | | There was a recent breakage that escaped the CQ. crrev/c/4338476. Build the host utils also when doing a buildall_only. (Also things that depend on it like make buildall). BRANCH=None BUG=None TEST=Ran make, and also dry in cq Change-Id: I31305111259f7cf5041af5318e3321282c0ab397 Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4350989 Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
* cq: Export a few boards in binary_sizesJeremy Bettis2022-12-101-0/+8
| | | | | | | | | | | | | | | | | | | | For some boards that have been added or edited recently, and for just 2 regions, set the track_in_gerrit option on the metric. Also extract the baseboard from make and use that as the platform name instead of "ec". BRANCH=None BUG=b:261622866 TEST=./firmware_builder.py --metrics /tmp/metrics_build build Change-Id: Iac325778370e606901d1e372b735e0531c530323 Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4086970 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
* Add ability to get struct offsets for use in assemblyTom Hughes2022-10-211-0/+7
| | | | | | | | | | | | | | BRANCH=none BUG=b:172020503 TEST=Using https://crrev.com/c/3299275: make BOARD=discovery-stm32f072 -j manually inspect generated file: build/discovery-stm32f072/RW/core/cortex-m0/asm_offsets.h Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I6c5a982a88ed1e77f8e98b9a0a451d52d5c03a87 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3299274 Reviewed-by: Diana Z <dzigterman@chromium.org>
* Makefile.rules: Always use C++ compiler to link host testsTom Hughes2022-10-141-1/+1
| | | | | | | | | | | | | | | Host tests that use C++ need to link against the C++ standard library. Using the C++ compiler when linking will include the C++ standard library automatically (-lc++ for clang and lstdc++ for g++). BRANCH=none BUG=b:234181908 TEST=CQ passes Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I690eb8b14b0bd73085a3da1b8c9f97f948ccd63b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3953261 Reviewed-by: Andrea Grandi <agrandi@google.com>
* Makefile: Only build host-utils for BOARD=hostTom Hughes2022-10-121-1/+9
| | | | | | | | | | | | | | | | In EC terminology, "host" refers to the target platform on top of the EC. It only makes sense to build the host utilities for the host board, not the board running the EC firmware. BRANCH=none BUG=b:252817153 TEST=make buildall Force-Relevant-Builds: all Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I255024c6b2fa8cababdfbed6501730d5dd6308a4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3943248 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Makefile: Add option to link with C++Tom Hughes2022-09-291-3/+3
| | | | | | | | | | | | | | | | | Boards that compile C++ files should link with the C++ compiler so that the C++ standard library is included when linking (-lc++ for clang and -lstdc++ for g++). BRANCH=none BUG=b:234181908 TEST=make buildall Force-Relevant-Builds: all Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I84d7ea44c7f3b3c9f17ca6308521e7041f7e5e8f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3857942 Reviewed-by: Bobby Casey <bobbycasey@google.com> Reviewed-by: Andrea Grandi <agrandi@google.com>
* util: Compile ectool (and other utils) with C++Tom Hughes2022-09-221-1/+4
| | | | | | | | | | | | | | | | The utils only run on the host, so we have no restrictions on compiler. Use C++ so that ectool can use "libec". BRANCH=none BUG=b:144959033 TEST=make buildall Force-Relevant-Builds: all Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I44b9bb25b2659b678bc4b71e203a1901eff51b13 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2556757 Reviewed-by: Yuval Peress <peress@google.com> Code-Coverage: Yuval Peress <peress@google.com>
* Makefile.toolchain: Need to specify full path to compiler for ebuildTom Hughes2022-09-171-0/+2
| | | | | | | | | | | | | | | | When building with portage, the build fails if we use the "unprefixed" compiler (e.g., "g++"). Explicitly use the prefixed compiler when building for the host. BRANCH=none BUG=b:246424843 TEST=emerge-hatch chromeos-ec Force-Relevant-Builds: all Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Idd40d76fd0d1d32e55947898f98b6ef1f0ca628a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3901254 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* Makefile: Set prefixed toolchain for hostTom Hughes2022-09-161-1/+1
| | | | | | | | | | | | | | | | When building with portage, the build fails if we use the "unprefixed" compiler (e.g., "g++"). Explicitly use the prefixed compiler when building for the host. BRANCH=none BUG=b:246424843 TEST=emerge-hatch chromeos-ec Force-Relevant-Builds: all Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I50d2b437374bf6857b19151edb5eaea24a7330c3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3894407 Reviewed-by: Eric Yilun Lin <yllin@google.com>
* Update license boilerplate text in source code filesMike Frysinger2022-09-121-1/+1
| | | | | | | | | | | | | | | Normally we don't do this, but enough changes have accumulated that we're doing a tree-wide one-off update of the name & style. BRANCH=none BUG=chromium:1098010 TEST=`repo upload` works Change-Id: Icd3a1723c20595356af83d190b2c6a9078b3013b Signed-off-by: Mike Frysinger <vapier@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3891203 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* make: Add ide-compile-cmds targets suiteCraig Hesling2022-08-261-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This suite of targets generates compile_commands.json for specific boards/images. It places the output file under build/$BOARD/{RO,RW}/compile_commands.json. Targets: * all-ide-compile-cmds Generates the compile_commands for all boards * ide-compile-cmds BOARD=$BOARD Generates the compile_commands for BOARD * ide-compile-cmds-$BOARD Generates the compile_commands for BOARD Cons: * Doesn't include commands for any tests or utils * Can't easily capture build commands for cryptoc, since it invokes cryptoc's makefile. BRANCH=none BUG=b:236389226,b:176500425 TEST=make all-ide-compile-cmds -j TEST=make ide-compile-cmds-bloonchipper -j less build/bloonchipper/RW/compile_commands.json TEST=make BOARD=bloonchipper ide-compile-cmds TEST=# Board kukui_scp only has an RW image. make BOARD=kukui_scp ide-compile-cmds # Only an RW compile_commands.json should be created. TEST=make BOARD=hatch build/hatch/RO/compile_commands.json clangd --check=build/hatch/RO/compile_commands.json Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I008648e84da70149425f8a36f818b3953c7fa36d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3826375 Reviewed-by: Andrea Grandi <agrandi@google.com>
* zephyr: Delete CONFIG_PLATFORM_EC_MPUKeith Short2022-08-011-0/+1
| | | | | | | | | | | | | | CONFIG_PLATFORM_EC_MPU is redundant with the Zephyr Kconfig option, CONFIG_MPU. Use the Zephyr option directly. BUG=none BRANCH=none TEST=zmake testall --static; compare binaries Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Iff92c7e9fe3a003366d153e618d2450b367fd169 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3791660 Reviewed-by: Aaron Massey <aaronmassey@google.com>
* zephyr: Delete CONFIG_PLATFORM_EC_ADCKeith Short2022-08-011-0/+1
| | | | | | | | | | | | | | | | | | | CONFIG_PLATFORM_EC_ADC is redundant with the Zephyr Kconfig option, CONFIG_ADC. Use the Zephyr option directly. Note - projects based on the "minimal" config do not compare. The minimal config disabled CONFIG_ADC, but the CONFIG_PLATFORM_EC_ADC_CMD was still enabled. With this CL, CONFIG_PLATFORM_EC_ADC_CMD now depends on CONFIG_ADC. BUG=none BRANCH=none TEST=zmake testall --static; compare binaries Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I129a3f490abd5c8234bc06ed6f86f2d7ff8a13b0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3791659 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* ec: Fix kconfig_check usage in makefileJeremy Bettis2022-07-201-4/+7
| | | | | | | | | | | | | | | | | | BRANCH=None BUG=b:239199935 TEST=make -j$(nproc) buildall && echo SUCCESS TEST=git commit --allow-empty ./util/compare_build.sh -b dartmonkey ./util/compare_build.sh -b all Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I845ca84920af1ca33457b79fe2a3892867ed693c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3767853 Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* ec: Fix kconfig_check and run unit test in cqJeremy Bettis2022-07-131-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Changed the unit test to fail if it can't find zephyr or the kconfiglib instead of skipping, and make it pass. Run the unit test in the CQ. In the process, I discovered that it never used kconfiglib because of errors with ZEPHYR_BASE not being set. Changed kconfig_check to output the error when it falls back to no kconfiglib. This exposed that there were missing configs in util/config_allowed.txt BRANCH=None BUG=b:238773780,b:181253613 TEST=make -j40 buildall && util/run_tests.sh Change-Id: I28a050d448a40df034dd9f2305a2d17cd0797468 Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3759263 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org>
* ec: Don't convert coverage paths to relativeJeremy Bettis2022-07-071-3/+0
| | | | | | | | | | | | | | | | The build_firmware recipe will take care of converting paths to absolute or relative as necessary, so leave the paths alone. BRANCH=None BUG=b:231639771 TEST=Ran locally Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I2588f55fd3bcca81459846be8ae6228404f5e3f0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3749799 Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
* ec: Don't use grep to get cross compile valueJeremy Bettis2022-06-301-2/+1
| | | | | | | | | | | | | | | | | | | | | | Instead of extracting the host's cross compile value from HOSTCC, just get it from HOST_CROSS_COMPILE, which is where HOSTCC gets it from in the first place. This allows overriding CCACHE to something other than ccache. BRANCH=None BUG=b:214323409 TEST=make clobber ; make -j8 test-coverage TEST=make clobber ; make -j1024 CCACHE=/mnt/host/depot_tools/.cipd_bin/gomacc test-coverage Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I390d9dd15b5bd070030ecd8396bb8e07d23c9efd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3739304 Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
* Makefile.rules: Set C++ standard to gnu++17Tom Hughes2022-06-271-1/+1
| | | | | | | | | | | | | | | | "-std=gnu++17" is the C++ standard we currently use for the rest of ChromeOS. cmd_cxx_to_host was already updated to gnu++17 in https://crrev.com/c/2872429, but cmd_cxx_to_o was not. BRANCH=none BUG=b:234181908 TEST=./util/compare_build.sh -b all -j 120 => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Iab8adacaa8673bda7b6427745b85fd3b7550eb4e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3712036 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* ec: Write memory usage report to fileJeremy Bettis2022-03-161-0/+4
| | | | | | | | | | | | | | | | | | Change the linker command for all board builds to pass the --print-memory-usage flag and save the results to a file. BRANCH=None BUG=b:223846977 TEST=make buildall_only -j16 Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I63733ce205a5453e7dc16809f7fd033873d67d07 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3530150 Tested-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Yuval Peress <peress@google.com> Commit-Queue: Yuval Peress <peress@google.com>
* Makefile: set the default C standard to gnu11Jack Rosenthal2022-02-281-1/+1
| | | | | | | | | | | | | | | | | Similar to cmd_cxx_to_o, set the default C standard to gnu11. Right now we are relying on compiler defaults, which uses pre-C99 standards in some cases. Let's be explicit and ask for gnu11. BUG=b:221860687,b:147769405 BRANCH=none TEST=buildall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I0371a6efaa71c0972394f90fa879f250ae921647 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3495875 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* Add CONFIG_INA219 to config_allowedSimon Glass2022-02-111-0/+1
| | | | | | | | | | | | | | | | | | | | This option is defined by Zephyr, but the Zephyr source tree is not always accessible to the script. Add it to the list to avoid any errors. BUG=b:181323955 BRANCH=none TEST=try CQ Build for plankton then check (without a Zephyr tree): ./util/kconfig_check.py -c build/plankton/.config -a util/config_allowed.txt -p PLATFORM_EC_ -s zephyr/ check See that it now succeeds Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I473ab291cee6074792124c6db5e44bfdaaa0c973 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3453164 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* Add PS2 to the config checkerSimon Glass2022-02-091-0/+1
| | | | | | | | | | | | | | | This is defined in Zephyr and is used by a board in Chrome OS too. Add it to the exception list. BUG=b:181323955 BRANCH=none TEST=try CQ Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I77ed52e88fd14b3c4b3b891e191b52629196c041 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3449668 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* Makefile: Switch to the Python script for CONFIG checkingSimon Glass2022-02-091-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the second attempt, fixing the problem with CONFIG_DAC and other options. These must be left in config_allowed but ignored if they show up as present in Kconfig. Leave the following in config_allowed since they are defined both as CONFIG options in ECOS and Kconfig options in Zephyr: AUDIO_CODEC DAC DMA EEPROM I2C_BITBANG PECI SPI UART_CONSOLE BUG=b:181323955 BRANCH=none TEST=./util/kconfig_check.py -c build/blipper/.config -a util/config_allowed.txt -p PLATFORM_EC_ -s zephyr/ -I ~/cosarm/src/third_party/zephyr/main -i DAC check See that this does not cause an error now Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I1fc7ac9cde106c61dd28b30673830407aa8c1a29 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3425452 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* Revert "Makefile: Switch to the Python script for CONFIG checking"David Stevens2022-01-301-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 5b4c6473a341ebbd88463c908b39bb2820e5c43b. Reason for revert: b:216919905 - breaks chromeos CQ Original change's description: > Makefile: Switch to the Python script for CONFIG checking > > Now that the Python script seems to do what we need, switch over to > use that for checking for allowed ad-hoc CONFIGs. > > Sadly we need a work-around for the very old Python 3 version used in > the chroot. > > The new script is better at finding Kconfig options, so this allows some > reductions in the config_allowed.txt file. > > Delete the now-unused shell scripts. > > BUG=b:181323955 > BRANCH=none > TEST=python3 util/test_kconfig_check.py > > Signed-off-by: Simon Glass <sjg@chromium.org> > Change-Id: I2dafc9dfe9d9020638f4e49b5c5ee0fc0b10000b > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2923233 > Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Bug: b:181323955 Change-Id: I9b5514f9d2df43033cfd95555612e2e89e6ce724 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3426237 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Nicolas Norvez <norvez@chromium.org> Tested-by: Nicolas Norvez <norvez@chromium.org>
* Makefile: Switch to the Python script for CONFIG checkingSimon Glass2022-01-281-1/+3
| | | | | | | | | | | | | | | | | | | | | | Now that the Python script seems to do what we need, switch over to use that for checking for allowed ad-hoc CONFIGs. Sadly we need a work-around for the very old Python 3 version used in the chroot. The new script is better at finding Kconfig options, so this allows some reductions in the config_allowed.txt file. Delete the now-unused shell scripts. BUG=b:181323955 BRANCH=none TEST=python3 util/test_kconfig_check.py Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I2dafc9dfe9d9020638f4e49b5c5ee0fc0b10000b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2923233 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* Revert "Reland "make: disable kconfig option check""Simon Glass2022-01-261-4/+1
| | | | | | | | | | | | | | | | The root cause of this has been fixed. This reverts commit dfd949d5bb781f23c1160ec9ca412d6be4cea1bd. BUG=b:216217781 BRANCH=none TEST=cq since I'm not sure how to test it otherwise, since cros_workon must be disabled Change-Id: I38de1617687db73ead4eb91c2c67459600a523a2 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3415373 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* Reland "make: disable kconfig option check"caveh jalali2022-01-251-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 71efe4989c253562b555c00b92cbe37487a8dacc. Reason for revert: b/216217781 Original change's description: > Revert "make: disable kconfig option check" > > Unfortunately this was disabled but never restarted. We have a number > of CONFIG options that are missing Kconfigs: > > For volteer the list is: > > CONFIG_BATTERY_LOW_VOLTAGE_TIMEOUT > CONFIG_HOSTCMD_DEBUG_MODE > CONFIG_LED_PWM_COUNT > CONFIG_POWER_S4_RESIDENCY > CONFIG_STEINHART_HART_3V3_30K9_47K_4050B > CONFIG_USB_PD_FLAGS > > This cannot be applied until the above are fixed. Possibly this is not a > big problem anymore, since we are likely not adding much new > functionality to ECOS. > > This reverts commit b3f5db5be78e15290dc7d80eaeecbb0f1b754a2c > > BUG=b:195718112 > BRANCH=none > TEST=make buildall -j32 > > Change-Id: I4b148caa04509721db83d001eb65dc061b2f21a6 > Signed-off-by: Simon Glass <sjg@chromium.org> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3388360 > Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Bug: b:195718112 Change-Id: I67f07b9136168554f3459bab5b2fcc879230b774 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3414570 Auto-Submit: caveh jalali <caveh@chromium.org> Tested-by: caveh jalali <caveh@chromium.org> Reviewed-by: Nick Vaccaro <nvaccaro@google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* Revert "make: disable kconfig option check"Simon Glass2022-01-211-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfortunately this was disabled but never restarted. We have a number of CONFIG options that are missing Kconfigs: For volteer the list is: CONFIG_BATTERY_LOW_VOLTAGE_TIMEOUT CONFIG_HOSTCMD_DEBUG_MODE CONFIG_LED_PWM_COUNT CONFIG_POWER_S4_RESIDENCY CONFIG_STEINHART_HART_3V3_30K9_47K_4050B CONFIG_USB_PD_FLAGS This cannot be applied until the above are fixed. Possibly this is not a big problem anymore, since we are likely not adding much new functionality to ECOS. This reverts commit b3f5db5be78e15290dc7d80eaeecbb0f1b754a2c BUG=b:195718112 BRANCH=none TEST=make buildall -j32 Change-Id: I4b148caa04509721db83d001eb65dc061b2f21a6 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3388360 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* gitlab: Generate html reports with branch coverageJeremy Bettis2022-01-191-1/+1
| | | | | | | | | | | | | | | | | Lcov was already being run with branch coverage, but include that in the html reports also. BRANCH=None BUG=None TEST=Ran commands locally Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: Ia64d120ec13ef7e741ba78bc6d05621f1b045215 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3399900 Tested-by: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Yuval Peress <peress@google.com> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
* zephyr: Add branch coverage to all lcov cmdsJeremy Bettis2022-01-141-3/+4
| | | | | | | | | | | | | | | | | | | If you don't include --rc lcov_branch_coverage=1 on every lcov command, lcov will drop the branch information at that stage of processing. Add --rc lcov_branch_coverage=1 to all lcov commands. BRANCH=None BUG=None TEST=None Change-Id: I3fd2a036f9f2fcfaeec60bdc55cfcba28e6c8228 Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3381536 Tested-by: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Aaron Massey <aaronmassey@google.com> Commit-Queue: Aaron Massey <aaronmassey@google.com>
* chip/npcx: Fix monitor compilation with clangTom Hughes2021-11-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Disable LTO when compiling the monitor header since clang will generate an LLVM IR bitcode file instead of an ARM object file. objcopy then fails since it doesn't recognize the file type. This shouldn't result in any loss of optimization since these are single .c files that are not being linked. Also add a DISCARD section in the linker script to fix the clang (lld) warning: ld.lld: error: no memory region specified for section '.ARM.exidx' This should be safe since there is no ".ARM.exidx" section in npcx_monitor.elf generated by gcc before this change as shown by arm-none-eabi-objdump -h build/brya/chip/npcx/spiflashfw/npcx_monitor.elf Go ahead and discard any other ".ARM.*" sections as well since we do that in our other EC linker scripts. Details on these sections can be found in https://developer.arm.com/documentation/ihi0044/h/?lang=en#sections under the "Sections" section. BRANCH=none BUG=b:172020503 TEST=./util/compare_build.sh -b all -j 120 => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I784d7a9e69989b330f58f89ae3a901d459e7cd21 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3243010 Reviewed-by: Edward Hill <ecgh@chromium.org>
* Add support for building dartmonkey firmware with clangTom Hughes2021-10-251-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default all builds will use gcc. To build with clang, set the environment variable CC=clang. At this point only dartmonkey has been tested with clang. BRANCH=none BUG=b:172020503 TEST=Using icetower, Segger J-Trace, and servo micro: make BOARD=dartmonkey -j ./flash_jlink.py -b dartmonkey -i ./build/dartmonkey/ec.bin --remote 127.0.0.1:2551 => console on icetower works TEST=CC=clang make BOARD=dartmonkey -j ./flash_jlink.py -b dartmonkey -i ./build/dartmonkey/ec.bin --remote 127.0.0.1:2551 => console on icetower works TEST=make buildall -j TEST=CC=clang make BOARD=dartmonkey tests -j TEST=make BOARD=dartmonkey tests -j TEST=./util/compare_build.sh -b all -j 120 => MATCH Change-Id: Ib7c067d0ebe0561becfd70373216adb445501f94 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1474577 Reviewed-by: Eric Yilun Lin <yllin@google.com>
* core: Fix flash size calculation when linking with lld (clang)Tom Hughes2021-10-111-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The map file generated by lld has a different format than the gnu linker (ld). (We save this map file into build/<board>/<image>/ec.<image>.map during the build.) Instead of trying to parse the different formats in the .map file, use the .smap file (the output of "nm"), which has the values of the symbols and has the same format whether using lld or ld. We need to add a new "__flash_size" symbol so that we can use that symbol to get the size from the .smap. This add flash sizes to a few boards that previously didn't have it: asurada_scp, cherry_scp, and kukui_scp, since the previous logic was always looking for FLASH and these use IROM. BRANCH=none BUG=b:172020503 TEST=make buildall -j TEST=make CC=arm-none-eabi-clang BOARD=elemi TEST=bcompare build_before_change build_after_change => only difference between space_free_flash.txt and space_free_ram.txt files in the two builds is that this change adds the space_free_flash.txt files for asurada_scp, cherry_scp, and kukui_scp. Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I7c64b6ba9bceeeb4044559188c1c1bebbf60471d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3179314 Reviewed-by: Keith Short <keithshort@chromium.org>
* gitlab: Disable interrupt test in coverage buildJeremy Bettis2021-10-061-1/+1
| | | | | | | | | | | | | | | | | | | | The interrupt seems to be very sensitive to cpu load and when running for coverage in gitlab, it often times out. Change to skip this test in coverage builds, since it is unlikely to add any coverage for zephyr used code anyway. BRANCH=None BUG=None TEST=None Change-Id: Iefe0da6b925cc820f764c1ad5a79187b8f09885f Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3208910 Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* gitlab: Many changes to get coverage build workingJeremy Bettis2021-09-291-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch to updated docker container. Make shallow git clones for speed. Don't install anytree or pyelftools, since they are in the docker container now. Set explicit `needs` attributes on each job. Split coverage build into ec_coverage, zephyr_coverage, and merged_coverage. Run make -j8 instead of make -j. Run make test-coverage instead of make coverage. For this situation we don't need the base board coverage, nor the report. Stop using flock to prevent parallel calls to lcov. I don't know if it was ever unsafe, but it seems safe today. BUG=None BRANCH=None TEST=Pushed to gitlab coverage branch: https://gitlab.com/zephyr-ec/ec/-/pipelines/379672379 Change-Id: I90ed7bb947d96062042959aee957bc6728c22ea7 Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3194977 Tested-by: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* ec: Set GCOV tool for cross compileJeremy Bettis2021-09-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | Use the right gcov tool for cross compile and host builds. The llvm-cov tool is sort of magical and can handle both llvm and gcc output, but that is only in the chroot, and so on gitlab we need to pick the right gcov for each platform. BRANCH=None BUG=None TEST=in docker: make -j CRYPTOC_DIR="${MODULES_DIR}/cryptoc" \ FTDIVERSION=1 HOSTGCOV='gcov' \ CROSS_COMPILE_arm=/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi- \ coverage Change-Id: Ie95032a4c0706b2bd49574df03e93dcbec7c3eed Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3171942 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
* make: disable kconfig option checkJack Rosenthal2021-08-061-1/+4
| | | | | | | | | | | | | | This check is currently suspected to be causing widespread commit queue failures. Disable for now. BUG=b:195718112 BRANCH=none TEST=make buildall -j32 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I58ff77eb4ff8a8fae4f856c116cb592aede634ee Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3078400 Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
* Revert "make: Compile host tests in 32-bit mode"Evan Green2021-08-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 1821e9423af84c7a126a4a15303c6492dd44e94b. Reason for revert: This change broke the build. BUG=b:195332627 TEST=None BRANCH=None Original change's description: > make: Compile host tests in 32-bit mode > > Compile the host tests in 32-bit mode instead of 64-bit mode as it's > more likely to match the actual environments our ECs run on. For > instance, in 32-bit mode the tests might actually have a prayer of > finding a torn read or write bug, whereas in 64-bit mode 64-bit integers > are always operated on atomically. > > BUG=b:179062230 > BRANCH=none > TEST=make -j runhosttests BOARD=host on x86_64 and i686 > > Signed-off-by: Evan Green <evgreen@chromium.org> > Change-Id: I02517066337ec08c311c1f7daae5d3de84b1f4c2 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3059231 > Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Bug: b:179062230 Change-Id: I35bcac77deeb1d031a31b32d911781f5fed4ab13 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3067826 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Reviewed-by: Allen Webb <allenwebb@google.com> Tested-by: Evan Green <evgreen@chromium.org>
* make: Compile host tests in 32-bit modeEvan Green2021-08-021-1/+1
| | | | | | | | | | | | | | | | | Compile the host tests in 32-bit mode instead of 64-bit mode as it's more likely to match the actual environments our ECs run on. For instance, in 32-bit mode the tests might actually have a prayer of finding a torn read or write bug, whereas in 64-bit mode 64-bit integers are always operated on atomically. BUG=b:179062230 BRANCH=none TEST=make -j runhosttests BOARD=host on x86_64 and i686 Signed-off-by: Evan Green <evgreen@chromium.org> Change-Id: I02517066337ec08c311c1f7daae5d3de84b1f4c2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3059231 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* build system: Link with LTO partitioning strategy "one"Patrick Georgi2021-06-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | By putting all object files in a single LTO partition there's less room to optimize the build time using multi-threading. On the upside, the build becomes more reproducible and the build result tends to be smaller thanks to better optimization opportunities. This is needed on gcc 11 for now build kodama: without it, the code grows beyond the bounds it needs to fit in (that gcc 8 manages to hold, so a regression). BUG=none BRANCH=none TEST=one class of error less with gcc 11 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Change-Id: I86b2c70cb5a2e85024630e7217cf8bd24d349910 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2959922 Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Patrick Georgi <pgeorgi@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org>
* Makefile.rules: make LCOV paths relative to repoPaul Fagerburg2021-06-101-0/+3
| | | | | | | | | | | | | | | | | | The code coverage plugin requires that the paths are relative to the repo, so we need to strip off the path above the repo's top level. BRANCH=None BUG=b:156895937 TEST=`make coverage ; grep SF: build/coverage/lcov.info` and observe that the source paths are now relative to the repo, instead of starting with /mnt/source Signed-off-by: Paul Fagerburg <pfagerburg@google.com> Change-Id: Iba86badeefd7359b72cb7e04cf97b0e51eed6789 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2950569 Tested-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org>
* Makefile: Update C++ compile commandTom Hughes2021-05-051-2/+3
| | | | | | | | | | | | | | | | | | Update cmd_cxx_to_host to match current cmd_c_to_host. Switch HOSTCXX to clang++ to match "CXX" in Makefile.toolchain (and the toolchain that we use in the rest of Chrome OS). Add "-std=gnu++17" to match the C++ standard that we use in the rest of Chrome OS. Followup commits will make use of these changes. BRANCH=none BUG=b:144959033 TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I5878ae64dc5ac76db22b3c331915b191a00f4257 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2872429 Reviewed-by: Eric Yilun Lin <yllin@google.com>
* Makefile.rules: Make check_allowed invocation less obscureCaveh Jalali2021-04-141-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally, the util/check_allowed.sh was completely hidden which made it hard to track, specially since it often flags a change that needs further analysis. With this change, make reports the util/check_allowed.sh invocation as "CHECK_ALLOWED". Also, when building with V=1, the actual command invocation is reported: (brya-shared-image) [brya] $ make -j ... CHECK_ALLOWED build/brya/.config ... OR: (brya-shared-image) [brya] $ make V=1 -j ... ./util/check_allowed.sh build/brya/.config util/config_allowed.txt . ... BRANCH=none BUG=b:181253613 TEST=verified check_allowed is reporte as "CHECK_ALLOWED" during a normal build and as a full command invocation with V=1. Change-Id: Ie1132221ee9b8d5d381adb5413b96ae2a2f71db9 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2803974 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* Makefile.rules: add quiet_cmd...Caveh Jalali2021-04-141-1/+4
| | | | | | | | | | | | | | | | | | | This enhances the quiet function to optionally print a command specific terse representation of the make command being invoked. If no custom command string is specified, the original behavior is preserved: the terse command string is printed followed by the computed target name. Now, if quiet_cmd_<CMD> has a non-empty value, its value is printed instead. BRANCH=none BUG=b:181253613 TEST=buildall passes Change-Id: I8ff13678307a3fe4f2ecd1a4cf89ed550e5702bb Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2803973 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* ec: Improve coverage report.Jeremy Bettis2021-04-081-2/+13
| | | | | | | | | | | | | | | | | | | | | | 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>
* genvif: Use VIF overrides by defaultAbe Levkoy2021-03-301-2/+3
| | | | | | | | | | | | | | Use board-specific override files when generating VIFs for boards. BUG=b:172276715 TEST=make buildall BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I197365018ceb8197c22d631cebf4cbce1c0119f7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2785506 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* firmware_builder: bundle code coverage informationPaul Fagerburg2021-03-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a rule to the makefile to merge code coverage into a single LCOV file, which firmware_builder.py will bundle as a build artifact. BUG=b:156895937 BRANCH=None TEST=Verify code coverage builds: ``` make clobber make coverage ls build/coverage/lcov.info ``` Verify firmware_builder tests (generate code coverage) and bundles the code coverage information with the correct metadata: ``` make clobber firmware_builder.py --code-coverage --metrics metrics.json test firmware_builder.py --code-coverage --metrics metrics.json bundle ls /tmp/artifact_bundles/coverage.tbz2 cat /tmp/artifact_bundle_metadata ``` Cq-Depend: chromium:2770601 Signed-off-by: Paul Fagerburg <pfagerburg@chromium.org> Change-Id: I355ea76cc774f566bf552741c1a1bdc94cd21bda Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2749421 Reviewed-by: LaMont Jones <lamontjones@chromium.org>