Commit Graph

281 Commits

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