Commit Graph

294 Commits

Author SHA1 Message Date
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