Commit Graph

473 Commits

Author SHA1 Message Date
Marc Herbert a8c333b606 xtensa-build-zephyr: add deterministic sha256sum of final .ri file
Checksumming the final binary is useful to compare before/after some
configuration change or to compare builds across different people /
systems.

Because rimage is not deterministic, ask sof_ri_info to do this.

Sample output:

Firmware file size 0x55000 page count 79
 pkcs_v1_5_sign_man_v1_8: signing with key
               'modules/audio/sof/keys/otc_private_key.pem'
 pkcs: RSA private key is valid.
 pkcs: digest for manifest is 5b52ac0b8809503c817a96dac7c5124dba5a90d...
Firmware manifest and signing completed !
Extended manifest found module, type: 0x0001 size: 0x01A0 ( 416) offset:
Extended manifest found module, type: 0x0005 size: 0x0020 (  32) offset:
Extended manifest found module, type: 0x0004 size: 0x0020 (  32) offset:
Extended manifest found module, type: 0x0003 size: 0x0030 (  48) offset:
Extended manifest found module, type: 0x0002 size: 0x0070 ( 112) offset:
Extended manifest found module, type: 0x0000 size: 0x0050 (  80) offset:
Extended manifest saved zephyr/zephyr.ri.xman size 0x02E0 (736) bytes

SOF Binary build-apl/zephyr/zephyr.ri size 0x4f2e0

  Extended Manifest ver 1.0.0 length 736

  cavs0015 (ADSP Manifest) file offset 0x22e0 name ADSPFW build ver
             0.0.0.0 feature mask 0xffff image flags 0x0
    HW buffers base address 0x0 length 0x0
    Load offset 0x2000

sha256sum build-apl/zephyr/reproducible.ri
46f3404e3b674ed....120c2173d6050bde35b build-apl/zephyr/reproducible.ri

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-12-20 22:35:09 +00:00
Marc Herbert 60be65b567 check patch: allow C99 comments
This is a logical revert of eb45907

Based on recently merged #4941, C99 comments are now OK. I never found
any rationale or even written down coding style for excluding them in
the first place.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-12-06 09:58:32 +00:00
Marc Herbert ae36fa5c91 xtensa-build-zephyr: build ICL by default again
ICL linking overlap issue has been fixed by
https://github.com/zephyrproject-rtos/zephyr/pull/39603

This is a logical revert of commit d4b8a01f20 ("xtensa-build-zephyr:
temporarily exclude ICL")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-11-25 09:59:56 +00:00
Marc Herbert 9f13849fa3 xtensa-build-zephyr: fix error message "not a zephyr project"
Echo the user argument instead of $WEST_TOP which is typically empty at
this point.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-11-25 09:59:56 +00:00
Marc Herbert 4c6ecb2172 xtensa-build-zephyr: guess CMake successes and failures better
Recent commit b9fcc4156e ("xtensa-build-zephyr: fix incremental build,
pass CMAKE_ARGS only once") fixed incremental builds. For this it first
needs to guess whether the most recent CMake configuration step failed
or succeeded so it knows what is the current "checkpoint" and what is
the next west command to run. Merely testing whether the build directory
already exists is a very bad guess because that directory could have
been created by some other person or script, or - much worse - it could
have been created by a failed CMake configuration step!

The latter situation makes debugging CMake failures very tedious because
it requires manually deleting the build directory after each CMake
configuration failure.

Fix this by not merely looking for a build directory but by looking
whether there is either a build.ninja or a Makefile is found in that
directory. This is a much better indication that the CMake configuration
succeeded.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-11-21 22:35:22 +00:00
Marc Herbert b9fcc4156e xtensa-build-zephyr: fix incremental build, pass CMAKE_ARGS only once
As documented in
https://docs.zephyrproject.org/latest/guides/west/build-flash-debug.html#one-time-cmake-arguments
and accidentally found when testing rimage cleanup
https://github.com/zephyrproject-rtos/zephyr/pull/40431

Fixes commit 88327f618c ("xtensa-build-zephyr: support passing through
CMake arguments"); ccache is too good and hid this regression from me.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-11-18 14:29:16 +00:00
Marc Herbert d4b8a01f20 xtensa-build-zephyr: temporarily exclude ICL
Because ICL fails to build, .noinit/.cached section overlap since
revert https://github.com/zephyrproject-rtos/zephyr/pull/40319

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-11-18 14:27:46 +00:00
Marc Herbert bccbfcc404 xtensa-build-zephyr: add new DEFAULT_PLATFORMS variable for -a
Sometimes we don't want to build all SUPPORTED_PLATFORMS by default.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-11-18 14:27:46 +00:00
Peter Ujfalusi 81c8279590 checkpatch: get default codespell dictionary path from package location
The standard location of dictionary.txt is under codespell's package, on
my machine atm (codespell 2.1, Artix Linux):

  /usr/lib/python3.9/site-packages/codespell_lib/data/dictionary.txt

Since we enable the codespell by default for SOF I have constant:

  No codespell typos will be found - file '/usr/share/codespell/dictionary.txt': No such file or directory

The patch proposes to try to fix up the path following the
recommendation found here:

  https://github.com/codespell-project/codespell/issues/1540

Mainline commit:
0ee3e7b8893e ("checkpatch: get default codespell dictionary path from package location")

Link: https://lkml.kernel.org/r/29e25d1364c8ad7f7657cc0660f60c568074d438.camel@perches.com
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Acked-by: Joe Perches <joe@perches.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2021-11-11 17:09:30 +00:00
Marc Herbert d1b264c3f0 xtensa-build-zephyr: add new -z option to clone any Zephyr version
Default behavior is still to clone the default Zephyr branch (main) but
this could be changed with just one line.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-11-11 10:33:18 +00:00
Marc Herbert fa0888991c xtensa-build-zephyr: cosmetic rename of two functions
Zero functional change.

Rename clone() to west_init_update() and build_all() to
build_platforms(). Also expand description of the west_init_update()
feature in the usage message and add a direct SHA1 fetch example.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-11-11 10:33:18 +00:00
Iuliana Prodan 71e4500349 xtensa-build-zephyr: add imx8m as supported platform
Add imx8m platform to be tested with Zephyr.
imx8m refers to i.MX8MP target.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-11-02 22:34:21 +00:00
Marc Herbert 6254ff5b08 version.cmake: fix message to show why source hash fails with Zephyr
When compiling with Zephyr, SOF_ROOT_SOURCE_DIRECTORY is changed to
sof/zephyr/ and sof/zephyr/.git does not exist. Change error message to
show SOF_ROOT_SOURCE_DIRECTORY/.git

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-11-02 22:33:15 +00:00
Marc Herbert 9818410347 cmake: use new --erase_vars feature and test new 'reproducible.ri'
Update the scripts/test-repro-build.sh test accordingly.

Finally, different people and CI systems can make sure they're building
the same firmware.

reproducible.ri is sof.ri with variable parts removed.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-10-21 13:59:46 +01:00
Marc Herbert a780519e3f test-repro-build.sh: exclude two more .ninja_ files
Also convert 'differ' to all caps 'DIFFER' to highlight different files.
No other functional change.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-10-21 13:59:46 +01:00
Marc Herbert 33c13e8c17 xtensa-build-zephyr: download rimage later, just before needed
This helps catch hidden rimage dependencies.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-10-15 12:22:00 +01:00
Marc Herbert 7c0f032266 xtensa-build-zephyr: extract new download_missing_submodules() function
This makes testing submodule issues easier.

Absolutely zero functional change.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-10-15 12:22:00 +01:00
Guennadi Liakhovetski 6ce3237509 zephyr: apl: re-enable building with XCC
Zephyr XCC builds for Apollolake can be re-enabled now after the RAM
footprint has been reduced.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-10-14 14:01:57 +01:00
Marc Herbert 5e17731290 .github: run new test-repro-build.sh
... in Github Actions.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-30 15:56:44 +01:00
Marc Herbert 41d244c48c Add new scripts/test-repro-build.sh
See https://reproducible-builds.org/

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-30 15:56:44 +01:00
Marc Herbert 45a6d1fb87 Fix docker-run.sh so it can be invoked from anywhere
$(pwd) was not a very good idea.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-30 15:56:44 +01:00
Marc Herbert 9b03553d1d docker-run.sh: log the docker image version
Especially useful when forgetting to update the 'sof' tag

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-30 15:56:44 +01:00
Marc Herbert 83c10268f1 cmake: add EXTRA_CFLAGS support
Example:

  EXTRA_CFLAGS="-Werror -g0" ./scripts/xtensa-build-all.sh

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-30 15:56:44 +01:00
Marc Herbert 868e00bdd0 xtensa-build-zephyr: download rimage whether we clone zephyr or not
... because there's no reason to make one depend on the other.

Same for the opportunistic creation of the sof symbolic link.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-29 17:00:49 +01:00
Marc Herbert d80d70bf47 xtensa-build-zephyr: fix submodules download hack when starting from west
By adding the missing remote to thesofproject

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-29 17:00:49 +01:00
Marc Herbert a0793de4be xtensa-build-zephry: add more WEST_TOP asserts and heuristics
Do not define a default WEST_TOP at the very start because we may not
have one. Define WEST_TOP only when the user gives one or when we
actually find one. And search harder.

Do not trust optional WEST_TOP user input blindly either. This was
leading mkdir -p to create a bogus modules/audio/ directory.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-29 17:00:49 +01:00
Iuliana Prodan 4b80be18e5 xtensa-build-zephyr: add imx8x as supported platform
Add imx8x platform to be tested with Zephyr.
imx8x refers to i.MX8QXP target.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-09-29 17:50:15 +03:00
Marc Herbert df376963df cmake/github: do not download rimage when CONFIG_LIBRARY/testbench
Faster CI and will catch any accidental dependency sneaking in.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-17 17:15:50 +01:00
Marc Herbert fd1f631352 cmake: do not download submodules when BUILD_UNIT_TESTS
Faster CI.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-17 17:15:50 +01:00
Curtis Malainey 66234f02c3 docker: add renoir to docker build
In order to support AMD as part of the docker image and CI we need to
include it in the build list as the overlays are already added to the
overlay repo.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-09-14 11:03:43 +01:00
Marc Herbert e3494f5662 xtensa-build-zephyr: make "tree" optional
"tree" is very useful but it's not critical, not worth failing the build
for.

Also remove a single quote from the help message as it breaks parsing
in one simple editor I use (jed) and possibly others.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-13 22:28:09 +01:00
Curtis Malainey a0acad3414 CMake: require version 3.13
Without CMP0079 we cannot conditionally include libraries against SOF in
sub directories without seriously restructuring the project. This is
because the old policy requires the link target must be created in the
same folder. This does not work well from a configuration standpoint for
3P audio libraries trying to keep their config in src/audio/*. Rather
than enable the policy, lets simply upgrade since 3.13 is widely
available.

With this upgrade we can also remove the two version dependent checks at
the top of our scripts.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-09-10 17:19:29 +01:00
Allen-KH Cheng 9a09b97c28 scripts: Add mt8195 to build script
Add mt8195 to build script.

Signed-off-by: YC Hung <yc.hung@mediatek.com>
Signed-off-by: Allen-KH Cheng <allen-kh.cheng@mediatek.com>
2021-09-10 17:13:06 +01:00
Marc Herbert 9452af0a5e xtensa-build-zephyr: add zephyr_fetch_and_switch() example
Add example that shows how to submit any Zephyr commit to SOF PR
testing.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-10 13:35:36 +01:00
Marc Herbert 4d3192c266 xtensa-build-zephyr: add option to stop after cloning Zephyr
This is needed by CI to clone only once and then take control of the
iteration over platform builds. CI already does all that but by
copy/paste/diverge of this clone() function.

Once cloning Zephyr in CI code is de-duplicated and uses this new
clone-only feature instead, it will be possible to submit any Zephyr
commit to SOF testing.  In other words it will make failed attempt
https://github.com/thesofproject/sof/pull/4728 possible

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-10 13:35:36 +01:00
Marc Herbert 88327f618c xtensa-build-zephyr: support passing through CMake arguments
Like this:

  xtensa-build-zephyr.sh -a -- -DEXTRA_CFLAGS='-Werror -Wextra'

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-09 15:48:18 +01:00
Marc Herbert aec08eaf7e xtensa-build-zephyr: extract new parse_args() function from main()
main() was growing too big. Zero functional change.

Also rename the too generic "build()" to build_all()

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-09 15:48:18 +01:00
Kai Vehmanen d3faab3d16 xtensa-build-zephyr: re-enable XCC build for Intel cAVS hw
The regression in Zephyr mainline is fixed with
https://github.com/zephyrproject-rtos/zephyr/pull/38374 , so
the XCC build can be renabled for cAVS targets.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-09-08 18:35:05 +01:00
Marc Herbert 6bedd8e742 xtensa-build-zephyr: fix RIMAGE_KEY when building multiple platforms
RIMAGE_KEY was global and leaking from one platform to the next

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-07 20:22:39 +01:00
Kai Vehmanen e963aa0e4a xtensa-build-zephyr: disable XCC build for Intel cAVS hw
Recently merged rework of multicore support in Zephyr has
broken builds with XCC. Disable XCC based builds in CI until
issue is resolved in Zephyr mainline. Issue tracked as:
https://github.com/zephyrproject-rtos/zephyr/issues/38349

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-09-06 22:55:12 +01:00
Marc Herbert c5ac4a44b9 xtensa-build-zephyr: add tgl
Almost no difference with tgl-h for now but will grow later.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-03 11:25:53 +03:00
Marc Herbert d910206bcf xtensa-build-zephyr: split SUPPORTED_PLATFORMS on multiple lines
... to minimize future conflicts.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-09-03 11:25:53 +03:00
Iuliana Prodan 6b650bd95f xtensa-build-zephyr: add imx8 as supported platform
Add imx8 platform to be tested with Zephyr.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-08-30 13:22:33 +01:00
Marc Herbert 4d4fd8c426 xtensa-build-zephyr.sh: build rimage later, just before it's needed.
We care about other build errors more.

This also makes it easier to test locally that "west build" does not
depend on rimage to create zephyr.elf

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-08-26 09:46:28 +03:00
Marc Herbert 177d9bd073 cmake: defer the rimage build until it's actually needed.
This is motivated by the zephyr.elf build that does not need rimage at
all.

Also build smex later, only when it's needed.

After building and deleting the rimage/ clone, a plain SOF clean +
RE-build now fails much later: it now fails AFTER successfully building
the sof binary, only when it tries to build either bootloader,
boot_module or base_module that actually need rimage:

[ 87%] Performing configure step for 'rimage_ep'
CMake Error: The source directory "/home/SOF/sof/rimage" does not appear
to contain CMakeLists.txt.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-08-26 09:46:28 +03:00
Kai Vehmanen 0d9a0c112c xtensa-build-zephyr: disable XCC build for Intel APL
The BSS usage exceeds available memory when building for
APL/cavs15 hardware with XCC, so disable it for now. Issue
tracked as https://github.com/thesofproject/sof/issues/4645

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-08-18 13:54:17 +01:00
balapati 7453e3d571 scripts: add renoir support
Add renoir build support.

Signed-off-by: Basavaraj Hiregoudar <basavaraj.hiregoudar@amd.com>
Signed-off-by: Anup Kulkarni <anup.kulkarni@amd.com>
Signed-off-by: balapati <balakishore.pati@amd.com>
2021-08-17 16:12:59 +01:00
Kai Vehmanen 997972c558 xtensa-build-zephyr: clean up XTENSA_TOOLS_ROOT parsing
Remove the unnecessary assumption that Xtensa tools are installed under
'XtDevTools'.

Align indentation to use tabs as is used elsewhere in this file.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-08-17 08:57:43 +01:00
Kai Vehmanen 4b86f2429b xtensa-build-zephyr: add support to build with xtensa XCC
Add support to build with XCC compiler by setting XTENSA_TOOLS_ROOT
env variable. The interface follows xtensa-build-all.sh, so existing
CI scripts for SOF builds can easily update to build with XCC.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-08-16 09:25:32 +01:00
Bud Liviu-Alexandru b40a2f7d36 docker: Add support for i.MX8ULP platform
This commit adds support for building i.MX8ULP toolchain support.

Signed-off-by: Bud Liviu-Alexandru <budliviu@gmail.com>
2021-08-06 14:39:52 +01:00
Zhang Peng 45ec1de686 platform: Add build support for i.MX8ULP
This integrates i.MX8ULP build into SOF.

Signed-off-by: Zhang Peng <peng.zhang_8@nxp.com>
2021-07-28 14:36:32 +03:00
Iuliana Prodan 6556933e83 xtensa-build-zephyr: add imx8 platform
Add imx8 platform for local testing.

TODO: Update xtensa-build-zephyr.sh when Zephyr repo
is updated with imx8 support.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-07-27 14:43:44 +01:00
Marc Herbert a7c1c52420 scripts/run-mocks.sh: major refactor
Adds --error-exitcode=1 to valgrind options (otherwise what's the point
of using valgrind?)

Skip alloc test that does not pass on HOST (passes with xt-run)

Add help message.

Runnable from anywhere.

Use shell functions
https://github.com/thesofproject/sof-test/issues/740

Fix all quoting issues and other shellcheck warnings.

Add comments.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-07-26 09:19:50 +01:00
Marc Herbert f51a95b90d xtensa-build-all.sh: link to cmake docs on sof-docs
Link to the CMake section in sof-docs which documents a lot of what this
script does and is probably out of date now. It would be less out of
date if this link had been there and more people had been aware that
this documentation even existed.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-07-26 09:19:50 +01:00
Marc Herbert 0ea32291ae qemu-check: document magic values, better logging and err. handling
Thanks Ranjani for finding most of these magic values.

Also move READY_MSG closer to the only place where it's used so it does
not look like a "global" anymore.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-07-26 09:17:46 +01:00
Marc Herbert 8059b8f9fd xtensa-build-zephyr: better help and error message when -p is required
-p is required when the real (not symbolic) directories are not nested
in one another.

The documentation gap was clearly demonstrated by me getting confused
even though _I_ implemented this logic some time back.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-07-22 17:01:19 +01:00
Marc Herbert bdae0ee127 xtensa-build-zephyr: run smex and install to new staging area
Ready to be transferred to the remote system. Sample output:

build-sof-staging
├── sof
│   ├── community
│   │   ├── sof-apl.ri
│   │   └── sof-tgl-h.ri
│   ├── sof-apl.ldc
│   └── sof-tgl-h.ldc
└── tools
    └── sof-logger

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-07-13 15:56:49 +01:00
Marc Herbert a0743971c9 check patch: turn off printk warnings
Zephyr's printk does not work like Linuxs printk

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-06-29 23:11:41 +01:00
Liam Girdwood 1ab68bfc00 mocks: enable allocator tests in host mocks with valgrind
This enables support for running the allocator mocks with valgrind by
building the allocator for the host library target using a similar
heap map to Intel CAVS targets (memory.c is almost identical copy of CAVS
version).

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-06-29 11:05:02 +01:00
Zhang Keqiao d750055a69 zephyr: switch to use 3k private key for tgl-h
TGL-H should be used the 3k otc private key for build.

Signed-off-by: Zhang Keqiao <keqiao.zhang@intel.com>
2021-06-25 11:10:33 +01:00
Marc Herbert 9c1d103520 xtensa-build-zephyr.sh: remove west --pristine option
Zephyr's incremental build works and saves time. I have been using it
with SOF for a long time. Slowly rebuilding from scratch is as simple as
deleting the build-$platform/ build directory. Quickly building not from
scratch is not possible without this commit.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-06-10 12:29:03 +01:00
Marc Herbert 7d37ca6fa1 xtensa-build-zephyr.sh: use west long options
Zero functional change.

Makes the code and the build logs clearer, especially for SOF people new
to west. Short options are for saving repetitive typing; no reason to
use them in a script.

Also show the real /bin/pwd which can help when west gets lost in
complex symbolic link situations.
https://github.com/zephyrproject-rtos/west/issues/419

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-06-10 12:29:03 +01:00
Marc Herbert fa5cc118b5 fuzzer: add deprecation README.md
As discussed in https://github.com/thesofproject/sof/pull/4132

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-05-24 15:27:18 -07:00
Marc Herbert e69e1c7eeb scripts/build-tools: some usage and other clarifications
Fixes #4141. I got tired of repeatedly having to read CMakeLists.txt
files.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-05-24 15:27:18 -07:00
Fred Oh 5083b2b73a docker: upgrade base ubuntu image to 20.04
Catching up latest LTS Ubuntu image, 20.04. It is supposed to be minor
upgrade but alsa-lib need to be set default library path,
/usr/lib/x86_64-linux-gnu/. Otherwise topology library loading error
is found for SOF tool build. This is typical error message,

alsatplg: error while loading shared libraries: libatopology.so.2:
cannot open shared object file: No such file or directory.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2021-05-12 20:29:37 +01:00
Fred Oh c7a527e4bd Dockerfile: remove apt.conf dependency
There was a assumption /etc/apt/apt.conf has apt proxy settings for
the system. This workaround is not required.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2021-05-12 20:29:37 +01:00
Fred Oh cbef494ee6 Dockerfile: add vim and jed to apt install list
Can't imagine editing files without vim or jed.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2021-05-12 20:29:37 +01:00
Fred Oh 4b9fbaf24b docker-run.sh: minor alignment fix
Removed extra spaces.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2021-05-12 20:29:37 +01:00
Fred Oh 77ef08a951 docker-run.sh: set http/https proxy when docker run
Use http/https proxys setting from the host.

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2021-05-12 20:29:37 +01:00
Marc Herbert 55e292ee85 xtensa-build-zephyr: add mkdir -p modules/audio
More robust support for "manual" installations.

Also rephrase usage string to remove a single quote breaking
the shell parser in one editor I use (sorry).

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-05-06 14:36:25 +01:00
Marc Herbert 0f989b10e9 xtensa-build-zephyr.sh: show zephyr short git log / version after clone
By default, the Zephyr build does not log its version. The fix has
already been submitted at
https://github.com/zephyrproject-rtos/zephyr/pull/34842 however:

- 34842 may take some time. Zephyr reviewers are even busier than the
  SOF reviewer.
- 34842 could even be rejected
- 34842 will at best log the SHA1 and no context. This is more verbose
  and future-proof because it supports more complex situations like
  testing a pull/12345/merge

As seen in (unrelated) PR #4123, we need Zephyr git versions NOW.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-05-05 09:45:55 +01:00
Marc Herbert 61f286c8a9 build-zephyr.sh: don't update rimage every time we run
Fixes 33c5f5d38e ("xtensa-build-zephyr: do not clone a second version of
sof.git")

The very first version of this test was checking whether the rimage/
directory exists, which proves nothing. So I switched to
rimage/CMakelists.txt but forgot change the `test` flag.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-05-05 09:43:54 +01:00
Marc Herbert 33c5f5d38e xtensa-build-zephyr: do not clone a second version of sof.git
This script lives in a sof.git/ clone yet it was systematically cloning
a second sof.git/. Besides the obvious confusion and risk of editing the
wrong files, this meant it was not possible to build code that has not
been merged yet! This was a problem for both CI and developers. Fixed by
using symbolic links to ourselves instead.

Note it is _still_ possible to build from another sof.git clone if
desired, however this script will never git re-clone a second sof.git
itself, that second clone has to be created (e.g.: by west) before this
script runs.

When cloning a brand new zephyrproject, use a shallow zephyr clone and
download only the two zephyr modules we actually use. This speeds up
automation considerably and makes it much faster for non-Zephyr
developers to reproduce Zephyr issues. Developers can always git
unshallow and west update once if they want to.

Rename the default west top to "zephyrproject" to not just match the
zephyr documentation but to also avoid creating a double zephyr/zephyr/
directory.

See the new print_usage() for a few more implementation details.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-04-30 11:12:29 +01:00
Marc Herbert 831bb3755b xtensa-build-zephyr: fix "die()" function
It still looks smart but the \n addition compared to the original
version in xtensa-build-all.sh broke it for more advanced cases:

die '%s %d' str 5
-bash ERROR: -bash: printf: 5\n: invalid number

As reported by shellcheck. shellcheck saves lives.

In scripts/xtensa-build-zephyr.sh line 22:
	>&2 printf "$@\n"
                       ^-- SC2145: Argument mixes string and array.
                        Use * or separate argument.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-04-30 11:12:29 +01:00
Marc Herbert 80c482815b xtensa-build-all.sh: replace "type xtensa-bxt-elf-gcc" with "command -v"
... because the latter does not print on stderr when not found; so IDEs
and CIs don't display this as a warning.

Also remove the "... and ignore set -e" comment that made sense at the
time of commit cad86dc340 ("scripts: xtensa-build: fix alias detection
for bxt/apl gcc") but not anymore.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-04-30 11:11:22 +01:00
Guennadi Liakhovetski c73ec9f981 zephyr: add a build script
Add a script to build Zephyr with the SOF main branch.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-04-22 12:18:38 +01:00
Liam Girdwood 4d6da60931 cmocka: add support to run mocks on host architecture
Allows the mocks to be quickly run on the host with full access to host
debug and development tooling.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-04-20 15:35:18 +01:00
Marc Herbert a5899812b7 version.cmake: don't trust CI to record time and versions and log ourselves
In an ideal world, every CI engine records and shares the most important
CI information:
- current date and time in a well identified timezone
- git version of the pull request
- git version of the moving branch the PR is being merged with

In the real world we have multiple CI solutions and they unfortunately
cannot not all be trusted to perform their most basic job
correctly. Fortunately, they all make at least build logs available so
these very few lines of code adding very few lines of output cost near
zero extra build time and solve the problem once for all. I feel stupid
I didn't do this sooner, this would have saved me hours and hours in
vain requests and discussions and in trying to puzzle that information
together.

Sample output:

-- Preparing Xtensa toolchain
version.cmake starting SOF build at 2021-03-31T18:09:46Z UTC
Building git commit with parent(s):
150fd1e4c968 4249bdb1b305 [other parent if merge] (HEAD -> main) cmake: ...
-- GIT_TAG / GIT_LOG_HASH : v1.7-rc1-174-g150fd1e4c968-dirty / 150fd1e4c968

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-04-01 16:39:20 +01:00
Marc Herbert b5219d844c version.cmake: do not discard stderr from git commands
Never discard stderr.

Also fix my older, misleading comment and add a warning.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-04-01 16:39:20 +01:00
Marc Herbert eb459078f3 checkpatch: --ignore C99_COMMENT_TOLERANCE
Let's not waste considerable time in code reviews with silly problems
computers can solve.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-03-31 16:26:03 +01:00
Marc Herbert fa38c34a7a docker: apt-get install python3-elftools
Required by #3459 / #3975 "elfsize" proof of concept and probably by
other things too in the future - we use both ELF and Python
everywhere; it's surprising they haven't met each other yet.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-03-31 15:19:14 +01:00
Marc Herbert 7c08aabbe7 topology/cmake: add missing .m4 dependency, fixes incremental build
There was no [MAIN_]DEPENDS on the .m4 source file, so changes were not
triggering any rebuild.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-03-26 14:51:33 +00:00
Marc Herbert 041c2ef6de version.cmake: add --dirty to git describe command
For at least two reasons:
  - exposes sneaky change(s) performed by automation if/when any
  - solves the mystery of the Source content hash (printed on the next
    line) changing while the git version does not.

Example, at https://sof-ci.01.org/sofpr/PR3941/build8429/build/bdw_gcc.txt

 -- Found Git: /usr/bin/git (found version "2.17.1")
 -- GIT_TAG / GIT_LOG_HASH : v1.7-rc1-151-g023c4abacde1 / 023c4abac
 -- Source content hash: 91f261ea

whereas at https://github.com/thesofproject/sof/runs/2166298087,
  xtensa-build-all:

 -- Found Git: /usr/bin/git (found version "2.17.1")
 -- GIT_TAG / GIT_LOG_HASH : v1.7-rc1-151-g023c4abacde1 / 023c4abac
 -- Source content hash: 67f31697

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-03-23 12:17:22 +00:00
Paul Olaru 5ed64a7fe4 scripts: xtensa_build_all: Fix configuration names for i.MX
The configuration names with _2017 are a consequence of the way I did
the internal configuration update. To keep it simple I update these
build scripts.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2021-03-22 20:24:49 +02:00
Marc Herbert e995bbb575 Dockerfile: apt-get install tree
Required to remove the copy hack introduced in
commit eb4373cb61 (".github: new installer.yml")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-03-15 21:23:32 +00:00
Marc Herbert 732c75259d scripts: remove XTOBJDUMP and XTOBJCOPY unused since CMake / Jan 2019
XTOBJCOPY and XTOBJDUMP were added in June 2018 by
commit 27795ece0f ("scripts: fix xt-xcc build with wrong config") for
`./configure CC=$XCC OBJCOPY=$XTOBJCOPY OBJDUMP=$XTOBJDUMP ...` that was
used at the time.

The build system was switched to CMake in January 2019, notably with
commit 9840ecbbfe ("cmake: update xtensa-build-all.sh") and
commit 0fd97adfb0 ("cmake: add utility scripts") that defined
CMAKE_OBJCOPY and CMAKE_OBJDUMP)

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-03-11 13:15:31 +02:00
Marc Herbert e6c3dda61a xtensa-build-all.sh: remove $ARCH unused since CMake / January 2019
$ARCH was introduced in 2018 by commit b5af84deaa ("scripts: add smp
builds to xtensa-build-all.sh"). At the time used autotools and
`./configure --with-arch=$ARCH` were used.

In January 2019 the build system was migrated to CMake over several
commits, notably commit 9840ecbbfe ("cmake: update
xtensa-build-all.sh") that switched xtensa-build-all.sh to CMake and
removed its only use of ARCH. Also note commit 82b4da291b ("cmake:
defconfigs support") which added a few CONFIG_SMP defconfigs and
commit 905bad4252 ("scripts: xtensa-build-all: Add support to force
build UP Arch") using override.config.

Much more recently in June 2020: commit fd506970cc ("zephyr: kconfig:
rename CONFIG_SMP -> CONFIG_MULTICORE")

Zawinski's Law of Software Envelopment: adding lines of code is much
easier than removing the same amount and would be very impractical
without git. This one was easy enough.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-03-11 13:15:31 +02:00
Marc Herbert 716efc00bc xtensa-build-all.sh: 3 times more xcc threads than gcc threads
As CMake forks one compiler process for each source file, the XTensa
compiler spends much more time idle waiting for the license server over
the network than actually using CPU or disk.

On my VM with 16 virtual cores, rebuilding one platform from scratch
with this commit goes down from 12s to less than 9s: more than 25%
faster. With Ninja it goes down from 11s to less than 8s. My license
server is 25ms away: a closer server does not need as many threads while
a more distant server would obviously benefit for even more
threads... while already getting an even better improvement than 25%
from just 3 times more threads! It's complicated and we probably don't
want to start the build by measuring latency to the license server.

The entire, purely local _gcc_ build is so fast (~ 1s) that observing any
the difference between -j nproc and -j nproc*N is practically impossible
so let's not waste RAM when building with gcc.

Also: log the $XTENSA_SYSTEM variable as it is required for incremental
builds; remove one apostrophe in the here-doc usage as it breaks the
parser of some editor (jed).

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-03-11 10:24:09 +02:00
Marc Herbert 4c1f41a91b cmake: add some MEU-related comments
Notably:
- Log error and default MEU_OFFSET when meu -ver is not found.
- Explain rimage -s option

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-03-09 20:14:09 +00:00
Marc Herbert f57de5957c cmake: print some error messages when XTENSA_TOOLS_ROOT is wrong
Notably: xt-xcc --show-config failed with: No such file or directory

... when the directory exists but is wrong.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-03-08 12:05:08 +00:00
Marc Herbert 6468490d8d xtensa-build-all.sh: show supported XtensaTools installation in usage
Add this to the -h usage message:

This script supports XtensaTools but only when installed in a specific
directory structure, example:

myXtensa/
└── install/
    ├── builds/
    │   ├── RD-2012.5-linux/
    │   │   └── Intel_HiFiEP/
    │   └── RG-2017.8-linux/
    │       ├── LX4_langwell_audio_17_8/
    │       └── X4H3I16w2D48w3a_2017_8/
    └── tools/
        ├── RD-2012.5-linux/
        │   └── XtensaTools/
        └── RG-2017.8-linux/
            └── XtensaTools/

$ XTENSA_TOOLS_ROOT=/path/to/myXtensa ./scripts/xtensa-build-all.sh ...

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-03-05 11:41:35 +00:00
Marc Herbert 5b34b81cb1 xtensa-buid-all.sh: prepends $OVERRIDE_CONFIG with $SOF_TOP
commit e31afb3651 ("xtensa-build-all.sh: make it runnable from
anywhere") missed this.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-03-05 11:37:11 +00:00
Paul Olaru cc5e1d0468 scripts: xtensa-build-all: imx: Fixup Xtensa compiler
There is no such compiler as RF-2017.8 that is in use. The correct
compiler is RG-2017.8 for all i.MX platforms.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2021-03-04 19:04:05 +02:00
Marc Herbert 288e228c67 cmake: generate the complete .config at configuration time.
Add cmake -DINIT_CONFIG= option that can point at any initial file.

"make clean" does not delete .config any more.

Note reconfiguration does NOT causes recompilation because -imacros
hides the generated .h from CMake's dependency scan. This is not a
regression, that problems exists since -imacros was introduced. At least
it's now possible to "make clean" and rebuild without losing the .config
file.

Fix for #3617

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-03-03 22:33:53 +00:00
Marc Herbert ffaeaaafdd build-tools.sh: build in any directory
Take $BUILD_TOOLS_DIR from the environment if present.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-02-26 16:17:41 +00:00
Marc Herbert e31afb3651 xtensa-build-all.sh: make it runnable from anywhere
Fix $pwd confusion and remove bogus ../local/bin PATH that does not
exist.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-02-26 16:17:41 +00:00
Daniel Baluta bd604d06e3 xtensa-build-all.sh: Bump IMX xtensa toolchain version
Lets use the same version of Xtensa toolchain as Intel in order
to avoid compilation problems.

It is difficult to support multiple toolchain versions because specific
headers needs to be updated, so lets have the same version supported
between IMX and Intel.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-02-26 16:14:28 +02:00
Liam Girdwood e28b6a7cf6 docker: toolchain: update docker to GCC 10.2 and GDB 9.2
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-02-18 13:59:26 +00:00
Marc Herbert 419806fb1c xtensa-build-all.sh: add PATH to build log
The script already logs the full CMake command that is re-usable outside
this script... except for the PATH change. Expose that sneaky PATH
change.

Debugging every build issue starts with peeling the too many layers of
indirection.

Also fix some minor issue in the help message.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-02-09 13:43:54 +00:00
Marc Herbert 9938a66db4 docker-run.sh: use --tty only when we have one
--tty is not compatible with github actions, fails with "the input
device is not a TTY"

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-01-22 13:42:03 +00:00
Marc Herbert e17b90d9b2 scripts: replace "make" with "cmake --build"
This makes it possible to switch to Ninja with a single line change
which can be useful to test build changes and issues.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-01-18 16:11:46 +00:00
Pan Xiuli c46ed5df30 scripts: add tgl-h support
Add tgl-h build support.
It will generate sof-tgl-h.ri

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-12-09 11:06:31 +00:00
Jaska Uimonen 6f0829b2a6 scripts: remove restriction for tgl rimage signing
Currently xtensa-build-all.sh has restriction to use rimage for tgl
signing, because rimage didn't support tgl. As rimage now has support
for tgl signing let's remove this limitation.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2020-11-18 12:07:23 +00:00
Keyon Jie b20d86f2ce host-testbench.sh: update comment for testbench building
The host-build-all.sh is deprecated, update to the recommended
'rebuild-testbench.sh'.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2020-11-09 22:08:30 +00:00
Marc Herbert 2aa62e1e65 rebuild-testbench.sh: don't build twice with combined "make install"
"make + make install" duplicates many steps, probably because of the
fatal combination of build timestamps + source hash, see PR #3353 for a
similar example.

A single, combined "make install" generates the exact same binary
outputs 30% faster and prints 30% shorter build logs.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-11-03 16:48:02 +00:00
Marc Herbert ec3ccab1b0 xtensa-build-all: document PRIVATE_KEY_OPTION and deprecate -k
Following commit 88b69cc2e5 ("scripts: xtensa-build-all: Add support
for building TGL and signing with MEU") we now have an unified and
flexible PRIVATE_KEY_OPTION that can do anything with very little code.

The -k option was never a good idea in the first place because it
already required an environment variable anyway (RIMAGE_PRIVATE_KEY)
instead of a command line argument so the code should have just checked
whether RIMAGE_PRIVATE_KEY was defined, that would have been
enough. Requiring the user to "double-confirm" with -k has been adding
extra complication for both the user interface and the implementation.

xtensa-build-all is effectively a "CMake configuration convenience"
script, however it shouldn't become an additional layer of indirection
and complexity and its interface should expose CMake (which is already a
layer of indirection!) as directly as possible.

See longer discussion in PR #3187

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-10-19 15:15:52 +01:00
Janusz Jankowski 15e03fd297 config: intel: use PCH name for tigerlake
We switch to PCH-based names instead of CPU config names for tigerlake+
platforms, because we need to support multiple variants of PCHs based
on one CPU famile - for example TGL-H & TGL-LP.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-09-30 12:03:54 +01:00
Marc Herbert d9eb16aa66 cmake: add warning when git submodule changes are found
As incredible as it sounds, some people run neither "git status" nor
"git diff" every few minutes and not even when their build fails. There
has been reports that they're puzzled when they miss a required
submodule update. This is an attempt to draw their attention based on
the assumption that they pay more attention to the CMake logs.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-29 11:19:25 +01:00
Jaska Uimonen 89acc5e4f0 docker-run.sh: pass-through PRIVATE_KEY_OPTION
Pass PRIVATE_KEY_OPTION environment variable to docker to be able to
define external key for signing.

Suggested-by: Marc Herbert <marc.herbert@intel.com>
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2020-09-25 13:41:33 +01:00
Ranjani Sridharan 88b69cc2e5 scripts: xtensa-build-all: Add support for building TGL and signing with MEU
Add support for building TGL FW and signing with MEU tool. Signing
with rimage is not supported atm.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2020-09-18 10:45:28 +01:00
Ranjani Sridharan 9956f6bb55 scripts: xtensa-build-all: add support for override config files
Some platforms needs platform-specific configuration
that override the default config. For example, chrome platforms
need the LPS to be enabled by default for maximizing the
power savings for the WoV feature. Add a -o switch to allow
specifying the override config file.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2020-09-18 10:45:28 +01:00
Ranjani Sridharan 26ca41b55e scripts: xtensa-build-all: print usage when no args passed
Print usage when no arguments are passed to the script.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2020-09-18 10:45:28 +01:00
Marc Herbert 0f4a0e2907 build-tools.sh: remove all the "Entering directory..." noise
This gets rid of about 600 lines of noisy "Entering directory..."
messages which cuts the size of the output of the script in half leaving
only useful stuff on the screen. This (and other changes before it) may
finally avoid bugs like 'commit f430addec7 ("Tools: Fuzzer: Do not use
illegal BUILD_COMMAND in CMakeLists.txt") evading scrutiny for months.

After so many years enjoying the convenience of make's '-C' option, I
finally did some research and realized it is the cause of this very
serious noise issue with no other easy way out :-(

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-17 09:56:19 +01:00
Marc Herbert 2b9206231c docker-run.sh: pass-through CMAKE_BUILD_TYPE
... thanks to the docker --env option which is smart enough not to pass
anything when there is nothing to pass.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-16 15:21:18 +01:00
Marc Herbert 1c6930e29f docker-run.sh: fix quoting issues
As reported by shellcheck

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-16 15:21:18 +01:00
Marc Herbert f7f9d5f42e tools: support standard CMAKE_BUILD_TYPE and default to Debug
To produce the exact same binaries than before this commit:

  CMAKE_BUILD_TYPE='  ' ./scripts/build-tools.sh

To observe which CFLAGS are being used:

   CMAKE_BUILD_TYPE=Release VERBOSE=1 ./scripts/build-tools.sh

Off topic: the logger fails to build with: -O3 -DNDEBUG -Wall -Werror
(all other tools build fine with these flags)

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-14 10:41:14 +01:00
Marc Herbert 6be9315596 rebuild-testbench.sh: remove CMAKE_VERBOSE_MAKEFILE
Default is verbose enough. VERBOSE=1 can still be used later at make
time.

Also change nproc to nproc --all because we don't care about offline
processors.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-01 16:26:15 +01:00
Marc Herbert 37b5893ee6 host-testbench.sh: clean up output files when tests are successful
Make git status great again.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-01 16:26:15 +01:00
Marc Herbert 55eecdd1d4 host-build-all.sh: print deprecation warning
Use newer rebuild-testbench.sh instead, added by
commit 46578cb103 ("scripts: Add a new script to rebuild testbench")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-09-01 10:42:56 +01:00
Karol Trzcinski b2a325a3b7 cmake: Handle empty SOF_SRC_HASH_LONG
SOF_SRC_HASH always must have integer value, because of usage
them to initialize global variable in source code.
Variables, which may be empty should be used inside quotation
to prevent cmake incorect number of arguments error.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-09-01 10:01:08 +01:00
Karol Trzcinski 67e41d21c3 cmake: Keep temporary files used to compute source hash
Temporary files are useful to understand and debug the build.
Moving output to another directory, keeps binary directory clean.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-09-01 10:01:08 +01:00
Karol Trzcinski 97e2a3c583 cmake: Look for .git folder in SOF_ROOT_SOURCE_DIRECTORY directory
This is possible location of .git folder, instead of CMAKE_SOURCE_DIR.
Without this patch, checked condition always return false and
GIT_LOG_HASH is used instead source code hash.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-09-01 10:01:08 +01:00
Karol Trzcinski 3a21088444 cmake: Rephrase message about git absence during source hash computing
This message shoulddn't be in imperative mode, to follow rules.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-09-01 10:01:08 +01:00
Marc Herbert 35d9034090 build-tools.sh: fix misnamed locals DO_BUILD_topology and _test
Easier to spot once all other shellcheck warnings have been fixed.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-08-31 14:43:11 +01:00
Marc Herbert f30d11072a build-tools.sh: fix minor shellcheck warnings
Missing quotes mostly, also some disable=SC2034 because "eval".

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-08-31 14:43:11 +01:00
Mohana Datta Yelugoti 46578cb103 scripts: Add a new script to rebuild testbench
Currently, the testbench is built using the script named
'host-build-all.sh' under scripts directory. But the name of
the script, it's git history doesn't refer to what the script
is currently doing now.

The newly written script adds option to build the testbench.
This script was written in mind to remove the old script
used to build the testbench (i.e host-build-all.sh).

The script also adds an option to build the testbench with
AFL instrumentation. AFL fuzzer works well when the code
it's trying to fuzz is instrumented properly. The instrumentation
helps the fuzzer in generating unique inputs which cover
different paths in the code graph. When the option is set,
testbench is built using a compiler AFL provides, which does
the instrumentation work.

Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
2020-08-28 13:38:04 +01:00
Liam Girdwood 7a10da097c cmake: set git hash to 8 digit
GIT_LOG_HASH can be more than 8 digits. Limit hash value up to
first 8 digits.

fixes: #3322

Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
2020-08-24 09:37:46 +01:00
Karol Trzcinski 2263a8bc62 cmake: Include GIT_TAG in generated version.h file
GIT_TAG is user readable form of used source code version with
commit identifier, what is important for bugs reproducibility,
so it will be convenient to have this information in output logs.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-08-18 10:35:29 +01:00
Karol Trzcinski 60b737a7a1 sof: Calculate source code hash
It may be used to check FW compatibility with ldc file.
It's much better than comparing DBG_ABI because logs content
may be updated without any DBG_ABI change in opposite to source
code hash value.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-08-18 10:35:29 +01:00
Liam Girdwood b521bb1256 docker: alsa: allow alsa development in container
Build ALSA locally under /home/sof/work and don't delete it. This will
allow ALSA development within the container.
Change the folder owner to sof to avoid permission issue.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-08-10 13:51:40 +01:00
Liam Girdwood f52350ef3a docker: update toolchains to GCC 9.3 and GDB 8.3
Use the later toolchains for docker.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2020-08-10 13:51:40 +01:00
Andy Ross fd506970cc zephyr: kconfig: rename CONFIG_SMP -> CONFIG_MULTICORE
This kconfig collides with one of the same name in Zephyr.  Rename it
for clarity ("MULTICORE" was picked for symmetry with the existing
"CORE_COUNT", though it's admittedly a little long...).

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
2020-07-24 19:55:05 +01:00
Shreeya Patel d434dbc8e1 xtensa-build-all: fix gcc _defconfig for byt|cht|cnl|sue
In renaming of $j -> $platform one instance of variable was missed which
has led to wrong configs being used.

Fixes: 941dfcccb0 ("use switch case")

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-07-14 12:12:15 +01:00
Marc Herbert 5564a9029a xtensa-build-all.sh: add missing double quotes
Fixes most shellcheck warnings, now down to just 4.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-07-13 17:35:50 +03:00
Marc Herbert 318dc9f7e1 check patch: ABI warning only once per file, not once per line
Stop drowning and missing other warnings.

Example:

 ./scripts/checkpatch.pl -g eaf49e26b4bb~0

- 40 "Please update ABI..." warnings
- 2 other warnings including a spelling mistake that were missed.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-07-10 15:48:57 +01:00
Marc Herbert b70b13cc1a dist.cmake: add 'rebuild_cache' warning.
dist.cmake is (for now) the only .cmake file that uses GIT_TAG at _cmake
configure time_. This means even "make clean" is not enough for
dist.cmake to take into account some git tag or version change. It's
very confusing because on the other hand "make check_version_h" and
everything else always shows up-to-date git information.

"make rebuild_cache" addresses this situation so mention it in a
warning.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-07-10 15:41:18 +01:00
Marc Herbert e9c83cf009 version.cmake: add "--match v*" to fix git describe
Before this fix, any random, later git tag like for instance
"releases/jsl/v3.0-rc1" would be picked up and then immediately
discarded and replaced with v0000 because it didn't start with 'v*'

Also log all the versions always and not just when there is already a
.tarball-version file.

Increase --abbrev=12 because --abbrev=4 doesn't seem to make sense.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-07-09 10:45:13 +01:00
Marc Herbert 123081c34f xtensa-build-all.sh: log the main cmake and defconfig commands
The main build script has a fairly verbose output by default but not the
most important things it does yet. These commands are useful to "peel"
the layer of indirection and debug cmake issues; either locally or when
wondering what CI does.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-07-08 13:44:27 +01:00
Marc Herbert a107cfabab dist.cmake: add --prefix to git archive to stop creating a "tarbomb"
A "tarbomb" is an archive file that has more than one directory at the
top level, which is (fortunately) unusual for .tar files. By default,
tar extracts archive members "as is" in the current directory. If the
archive has many top level members then it becomes very hard to make the
difference between what was just extracted versus what was already
there. As extraction is recursive this gets much worse because the
problem can repeat itself in subdirectories. As the last but not least
nail in the coffin, tar silently overwrites existing files by default.

This commit is admittedly an "incompatible build API change" meaning any
higher level build or packaging script that was consuming source release
tarballs (as opposed to git cloning the source) will require a small
change. Consumers of release tarballs must be rare though because the
output of "make dist" has already been broken by commit
c00d39c71b ("Add rimage as a git submodule") anyway yet no one noticed
yet.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-07-08 13:40:36 +01:00
Shreeya Patel 8a90be118c scripts: build-tools.sh: Make tools individually buildable
More control over which tools should be built, instead of building
everything every time.

Note: All the build files will be removed every time this script is ran
since tools are not independent of each other.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-07-06 17:19:04 +01:00
Marc Herbert 1c4d14a5fb qemu-check.sh: restore error messages when test fails
Fixes 428804e1c ("scripts/qemu-check.sh: add set -e") which failed to
consider the case of an empty $IPC_REG or $IPC_MSG.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-30 11:30:19 +01:00
Marc Herbert 8ceef9d460 qemu-check.sh: make $ROM a quoted bash array "${ROM[@]}"
Removes shellcheck warning and could allow directory names with
whitespace in a very distant future.

Silence printf "$@" shellcheck warning in die() function.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-30 11:30:19 +01:00
Daniel Baluta 259a98ed4c scripts: checkpatch: deprecate 80-column warning
Yes, staying withing 80 columns is certainly still _preferred_.  But
it's not the hard limit that the checkpatch warnings imply, and other
concerns can most certainly dominate.

Increase the default limit to 100 characters.  Not because 100
characters is some hard limit either, but that's certainly a "what are
you doing" kind of value and less likely to be about the occasional
slightly longer lines.

Miscellanea:

 - to avoid unnecessary whitespace changes in files, checkpatch will no
   longer emit a warning about line length when scanning files unless
   --strict is also used

 - Add a bit to coding-style about alignment to open parenthesis

dbaluta: This patch is taken and manually applied from Linux kernel
tree. See commit, in Linux kernel tree:

bdc48fa11e46 ("checkpatch/coding-style: deprecate 80-column warning")

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-06-29 20:57:55 +01:00
Marc Herbert 4a87d8c967 xtensa-build-all.sh: add tgl with xtensa-cnl-elf. No rimage yet.
Copy the icl and cnl configurations.

This build with the gcc toolchain has NOT been tested on tgl. The
purpose is purely to add the gcc build to CI, avoid future gcc bitrot
and catch more warnings and bugs.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-22 13:00:56 +01:00
Marc Herbert e76ccbad59 scripts/xtensa-build-all.sh: clarify help of -c option
"Configure defconfig" misses the most important, interactive difference.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-16 09:04:05 +01:00
Marc Herbert 2afbbd0ef1 cmake/git-submodules: don't throw away work in progress at build time
- Add a simple test in cmake to download submodules only when rimage is
  missing. This stops randomly changing the source code from one build
  to the next and overwriting any submodule work in progress.

- Remove the GIT_SUBMODULE option which is now useless because rimage is
  not optional for sof

- Add a --merge option for safety. It makes zero difference right now
  but could save work in progress if we ever add more
  submodules (hopefully not) and someone struggles with submodules and
  ends up in a partially initialized state.

Git submodules are rarely ever the answer; these few changes make them a
bit more usable.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-15 21:23:30 +01:00
Marc Herbert 428804e1cb scripts/qemu-check.sh: add set -e
qemu always times out and fails, ignore that.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-05 15:38:55 +01:00
Marc Herbert 454b2b1f43 scripts/qemu-check.sh: add find_qemu_extensa()
qemu-check.sh can now be invoked from more places: not just the qemu
directory but also from sof/ and from their parent.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-05 15:38:55 +01:00
Marc Herbert de8b043371 scripts/qemu-check.sh: unhardcode ../sof.git/
Find it with dirname "$0" instead. Can also be overridden with
SOF_BUILDS from now on.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-05 15:38:55 +01:00
Marc Herbert 7c0ab36ac3 scripts/qemu-check.sh: double-quote "$vars" expansion. Zero-change.
As reported by shellcheck SC2086.

Minor usage() fix.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-06-05 15:38:55 +01:00
Pan Xiuli 4ce5ed477a cmake: use SOF_ROOT_SOURCE_DIRECTORY for git submodule
In SOF, there is another project in tools folder. It also need riamge
submodule support.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-05-18 14:39:40 +01:00
Marc Herbert 3606629f7e scripts/build-tools.sh: let user override NO_PROCESSORS
When there's a failure like for instance SOF issue #2543, fixed in
alsa-utils commit caf77a93cef5 ("topology: add back asrc to widget_map
in dapm.c"), it's finally possible to remove all the noise around the
failure and see the failed command:

   NO_PROCESSORS=1 VEBOSE=1 ./scripts/build-tools.sh

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-18 13:43:29 +01:00
Marc Herbert 19745de6e3 scripts/testbench: add set -e
Let's stop ignoring build and test failures. Start gradually with the
scripts involved in testbench, more files later.

Follow-up to to bug #2752 "host-testbench.sh ignores errors" and commit
ab421466af ("CI: Travis: enable host testbnech again") and
ab421466aff826~1

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-05-18 13:41:01 +01:00
Pan Xiuli 1fbdc7f788 scripts: fix testbench with more check
add status check for the host testbench
also fix file size check

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-05-13 10:38:12 +01:00
Daniel Leung d53778f372 cmake: update git submodules when cmake is run
This adds the necessary bits to update git submodules when
cmake is run, with the option to turn this behavior off if
needed. This is in preparation to use fw.h and manifest.h
from the rimage repo to prevent having two copies of each
file in two different repos. Obviously, the files in
the submodules must exist before building the firmware,
so run git submodule update to checkout the files.

Signed-off-by: Daniel Leung <daniel.leung@intel.com>
2020-05-13 10:16:04 +01:00
Shreeya Patel 782066e0aa docker_build: Use shallow clones
We don't need history for building qemu or sof. Using shallow clones
will save time spent on downloading unnecessary history which is
significant for bigger repos like qemu.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-05-08 11:39:48 +01:00
Shreeya Patel 0f4141a367 scripts: qemu-check.sh: Exit if unknown platform specified
Exits if an unknown platform is specified. Currently, there are no
warnings or errors.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-04-21 14:59:27 +01:00
Shreeya Patel 5f640a4d3f scripts: qemu-check.sh: Use switch case
Use switch case for testing strings instead of if statements for each
case.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-04-21 14:59:27 +01:00
Shreeya Patel 729ab7e5f6 scripts: qemu-check.sh: Use getopts
Use getopts to parse the arguments instead of manual parsing to leave no
room for errors, bugs, and inconsistent conventions introduced by custom
implementation.

The script uses no options as of now, so current implementation just
exits if any option is provided.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-04-21 14:59:27 +01:00
Shreeya Patel 4f288b2c4d scripts: qemu-check.sh: Make PLATFORMS a proper array
"PLATFORMS" variable was used as an array while it is actually a string
used incorrectly making it work accidentally.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-04-21 14:59:27 +01:00
Shreeya Patel 6925c940ba scripts: xtensa-build-all.sh: Derive $ROOT from $HOST
Derive $ROOT from $HOST instead of explicit assignments.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-04-21 14:55:53 +01:00
Shreeya Patel 941dfcccb0 scripts: xtensa-build-all.sh: Use switch case
Use switch case for testing strings instead of if statements for each
case.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-04-21 14:55:53 +01:00
Shreeya Patel d0cd2e0eac scripts: xtensa-build-all.sh: Ignore set -e the right way
Currently, "set -e" is being ignored for type command using redirections
and "A && true". "A && true" is a no-op and a peculiar case where
"set -e" ignores the exit code of A.

Exit code of the "type" command is used in an if statement which is
exactly what the function of "if" command is. Also, "set -e" ignores
exit codes of commands used in if statements.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-04-21 14:55:53 +01:00
Shreeya Patel 50d8646a64 scripts: xtensa-build-all.sh: Exit if unknown platform specified
Exits if an unknown platform is specified. Currently, there are no
warnings or errors.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-04-21 14:55:53 +01:00
Shreeya Patel b0690f121b scripts: xtensa-build-all.sh: Use getopts
Use getopts to parse the arguments instead of manual parsing to leave no
room for errors, bugs, and inconsistent conventions introduced by custom
implementation.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-04-21 14:55:53 +01:00
Shreeya Patel 39d508b199 scripts: xtensa-build-all.sh: Make PLATFORMS a proper array
`PLATFORMS` variable was used as an array while it is actually a string
used incorrectly making it work accidentally.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-04-21 14:55:53 +01:00
Liam Girdwood 36114685aa scripts: cmake: set command dir for git commands
The git commands to get version strings need to run in the SOF source
directory. This is not automatically set when building for Zephyr so
fix it.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2020-04-16 21:01:43 +01:00
Janusz Jankowski 99d03de968 cmake: add *_overridedefconfig targets
Add targets that are meant to be used after defconfig,
to apply configs from <arch>/configs/override on top of defconfigs.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-04-03 20:20:43 +01:00
Janusz Jankowski 22e4e7bff6 cmake: fix defconfigs dependency
CMake regeneration condition should depend on directory to automatically
update when new defconfigs are added.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-04-03 20:20:43 +01:00
Pan Xiuli a2ac3c3197 sripts: update host-testbench to work with latest code
Enable 3 simple test with host-testbench:
volume, src and eqiir
Usage:
./scripts/build-tools.sh -t
./scripts/host-build-all.sh
./scripts/host-testbench.sh

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-04-03 09:13:03 +01:00
Shreeya Patel db1bf13597 scripts: build-tools.sh: Use getopts, breakdown script to functions
Breakdown script to functions, use local variables, and a main function.

Use getopts to parse the arguments instead of manual parsing to leave no
room for errors, bugs, and inconsistent conventions introduced by custom
implementation.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-04-02 10:06:33 +01:00
Shreeya Patel 79b39ccc9b gen-doc.sh: Use getopts for parsing arguments
Use getopts to parse the arguments instead of manual parsing to leave no
room for errors, bugs, and inconsistent conventions introduced by custom
implementation.

Signed-off-by: Shreeya Patel <shreeya.patel23498@gmail.com>
2020-03-31 15:10:34 +01:00
Karol Trzcinski d1b02d4ec8 logger: Make CC_DESC string length indivisible by four
When variable length array, filled with string will be
placed in sucha manner that null terminator address will
be divisible by four, then it will be lost in output
binary file. It leads to troubles during scanning content
of such a section. Such a problem occur in firmware
and produce logger and FW debug ABI mismatch and it's why
logger output is broken.
After change length of XCC_TOOLS_VERSION to be none of
number four multiplication problem with logger disappear.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-03-30 14:44:52 +01:00
Janusz Jankowski e5a910d21b xtensa: cmake: use xt-ranlib
CMake should use ranlib that comes with toolchain.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-03-28 12:07:33 +01:00
Marc Herbert e73344a736 scripts: build-all: warn when ignoring unknown arguments
Example:

 $ ./scripts/xtensa-build-all.sh -j3
 ./scripts/xtensa-build-all.sh: WARN: ignoring arg -j3

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-03-26 16:51:29 +00:00
Marc Herbert ffedf5be56 scripts: build-all: postpone VERBOSE decision to "make" time
CMAKE_VERBOSE_MAKE was sometimes "hardcoding" the decision in CMake's
cache. Move that decision to the make invocation.

After running xtensa-build-all.sh [-v], it's now possible to choose
again whether "make -C build_apl_gcc/" should be VERBOSE or not without
starting from scratch and with the exact same configuration.

Before this commit it was possible for make to decide again after a
non-verbose xtensa-build-all.sh but not possible to decide again after a
verbose xtensa-build-all.sh... very confusing.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-03-26 12:10:38 +00:00
Marc Herbert c84706e3f8 check patch: "top_of_sof_tree()" so it works out of the box
Adjust top_of_kernel_tree() function to SOF so invoking
./scripts/checkpatch.pl works out of the box and doesn't require
figuring what's going on and the existence of the --no-tree option which
sof-ci invokes "behind the scenes".

This instead of failing with:

  Must be run from the top-level dir. of a kernel tree

Compared to --no-tree, this is also enables a couple extra checks like:
WARNING: use relative pathname instead of absolute in changelog text

PS: the space between check and patch is here to... defeat checkpatch
itself. It apparently doesn't expect any change to itself.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2020-03-25 14:46:03 +01:00
Diana Cretu 3dd843a46d scripts: qemu: Add qemu check for i.MX8M platform
Enable checks to i.MX8M platform of QEMU now.

Signed-off-by: Diana Cretu <dianacretu2806@gmail.com>
2020-03-23 10:52:58 +02:00
Pan Xiuli bfa8bf7ba1 scripts: make verbose build into an option
Disable verbose build by default in build script.
It would be too annoying if we do not need to debug
with make systems.

Use -v option to enable verbose log if need.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-03-20 13:34:43 +00:00
Janusz Jankowski 4d02a1faf7 script: clang scan-build for xtensa
Add utility scripts for launching clang static analyzer.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-03-04 11:02:56 +01:00
Janusz Jankowski 4da2c9659c xtensa: cmake: clang scan build support
Add support for compiling FW with settings acceptable for clang,
in order to let it perform static analysis on the code.

Clang works mostly on ASTs made out of C code, so there is
no need to build complete signed binary for it.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-03-04 11:02:56 +01:00
Diana Cretu 866ddf874c scripts: qemu: Add qemu check for i.MX8X platform
Enable checks to i.MX8X platform of QEMU now.

Signed-off-by: Diana Cretu <diana.cretu@nxp.com>
2020-02-28 16:50:56 +00:00
Pan Xiuli ee8e4bfcbb scripts: fix issue in qemu-check.sh
Fix false positive return value for upsupported platforms.
Fix wrong parameter passed in when mutliple platform test.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-02-28 16:38:20 +00:00
Pan Xiuli f933116807 scripts: docker: update the qemu branch to sof-v4.2
Update qemu docker branch to sof-v4.2

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2020-02-28 15:17:19 +00:00
Diana Cretu ca352dbfb7 scripts: qemu: Add qemu check for i.MX8 platform
Enable checks to i.MX8 platform of QEMU now.
Check both IPC header regs and memory window IPC message header.

Signed-off-by: Diana Cretu <diana.cretu@nxp.com>
2020-02-26 13:11:21 +02:00
Daniel Baluta 22de787f1f scripts: update sof_builder docker with imx8m support
Add imx8m cross compiler in sof_builder docker build file.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-02-20 21:45:59 +00:00
Daniel Baluta 0d1344a53b scripts: Add build support for imx8m
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-01-22 09:57:21 +02:00
Daniel Baluta faa9cf9132 scripts: add build for im8x
Add build scripts for i.mx8x with gcc and xcc support.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2020-01-14 14:12:50 +01:00
Marcin Maka 91fb594bd9 cannonlake: use low power ring osc as default dsp clock
Running on 120MHz Low Power Ring Oscillator enables more
aggressive power saving. Therefore this should be a default
options for all Cannonlake configurations that may run
on a single dsp core and does not need more than 120 MCPS.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-01-10 12:30:35 +01:00
Marcin Maka c5db2daeab build: use xcc defconfigs as the default ones
Since xcc is the default toolchain for xtensa architecture,
the defconfigs should be customized for xcc.

gcc versions are saved for CI builds.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2020-01-10 12:30:35 +01:00
Janusz Jankowski c1f4c3f197 cmake: version: consider unannotated tags
Command git describe looks only for annotated tags, but we should
get any tag reachable from master, that's why --tags flag is needed.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2020-01-07 14:59:48 +00:00
Marcin Maka d077b9728d scripts: checkpatch: accept long trace strings (80+ characters)
This is an exception similar to the kernel pr_...() family.
Having a log string in a single line is much more readable for
a person who works with the trace output frequently.

Splitting trace strings into multiple lines seems to be a worse
alternative since it generates another warning anyway and encourages
developers to create very long trace entries which are wrapped
on a trace console and less readable.

Signed-off-by: Marcin Maka <marcin.maka@linux.intel.com>
2019-12-21 18:43:03 +01:00
Karol Trzcinski 5548b0a7bb sof: Add compiler version macros
Unify calls for compiler version and name for XCC and GCC.
Separate conversion of optimization level from Kconfig settings
to compiler flags to separate cmake function, because of usage
in two places.
Read XCC_TOOLS_VERSION from compiler.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2019-12-15 13:05:51 +01:00
Pan Xiuli 7d52bb6ef0 scripts: update xcc build for all platform
Update xcc build config for all existing platforms.
xcc build with byt, cht and sue need special defconfig.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2019-11-26 12:53:03 +01:00
Paul Olaru 75a6a8cce3 platform: imx: Update build script for compiling with XCC
The tools version and core must be correctly defined in order to be
able to compile for this platform.

Signed-off-by: Paul Olaru <paul.olaru@nxp.com>
2019-11-20 10:45:47 +00:00
Janusz Jankowski 24f3160977 cmake: scripts: relative path define utility
Add helper function sof_append_relative_path_definitions that
defines RELATIVE_PATH per source file for given target.

__FILE is not always suitable as C standard states that __FILE__ expands to
input file name, that usually is absolute path what will cause f.e. .rodata
size to be dependent on where project is physically located on the disk.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-11-11 12:50:30 +00:00
Janusz Jankowski 5211799133 cmake: trigger olddefconfig on kconfig changes
When there are changes made to Kconfig files it's better
to run olddefconfig automatically to prevent undesired behaviour,
like for example depending on added config that has some default value
that is not present because developer didn't run olddefconfig
after pulling changes.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-11-07 09:12:52 +01:00
Janusz Jankowski 98449205fb checkpatch: disable __func__ warning
Traces in SOF are used like trace("<func>() info"),
in that case __func__ is not convenient, because it is not literal
and it would be needed to use %s everywhere and change
all current traces.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-11-07 00:20:43 +01:00
Dragos Tarcatu d98a7ed103 checkpatch: check ABI updates before warning on it
checkpatch is currently checking for changes that need ABI updates
and actual ABI changes in the same loop in process(). So if some
file that needs an ABI change comes first, a WARNING will be issued.

Look for an actual ABI change before starting to crunch the entire
patch line by line.

Signed-off-by: Dragos Tarcatu <dragos_tarcatu@mentor.com>
2019-11-05 14:49:22 +01:00
Janusz Jankowski e044194844 checkpatch: disable short fixed size types for SOF
Do not check for u/s* vs u/sint*_t in SOF,
because there is only the longer variant.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-11-04 14:41:27 +01:00