Commit Graph

243 Commits

Author SHA1 Message Date
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
Janusz Jankowski d88ac84e54 checkpatch: restore MAINTAINER file check
It was previously removed from SOF, but it's better to just disable
it for SOF to make delta with original checkpatch as small as possible.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-11-04 14:41:27 +01:00
Janusz Jankowski 386abbe8bc checkpatch: add SOF constant
Introduce constant that enables SOF-specific behaviour of checkpatch.
Changes made to original checkpatch should be easily visible
to make merging updates easier.

If code that is not applicable to SOF is just removed, then
while updating it's hard to distinguish if it is new feature
in checkpatch or was removed for SOF. It's better to just disable
parts of code that do not work for SOF.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-11-04 14:41:27 +01:00
Pan Xiuli d310beb9bb scripts: qemu: change ipc shm file name for cavs platform
The cavs platform IPC shm file name in QEMU is changed
from ipc-io to ipc-dsp-io.
Use regular expression to find the right SHM IPC register file,
so that we can smoothly pass the transition of the QEMU update.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2019-11-04 10:07:57 +01:00
Janusz Jankowski 62012c49a4 checkpatch: update to match kernel 5.4-rc4
Merge kernel's checkpatch with custom features added for SOF.
SOF follows kernel code style, so checkpatch should be also up-to-date.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-11-04 10:06:55 +01:00
Pan Xiuli 074ea8b93d scripts: add build for JSL
Add build scripts for JSL with gcc and xcc support.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2019-10-30 17:46:11 +01:00
Keyon Jie aa7c73c156 scripts:xtensa-build-all: update to use 2017.8 toolchain for CNL
Let's align to use the newer 2017.8 toolchain for CNL building.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-10-25 14:57:41 +02:00
Jakub Dabek b63f559bb4 memory: removed hp buffer heap
Merged hp buffer heap with normal buffer heap.
Since current buffer heap was actually using hp memory and it served
no purpose to have two heaps.
Removed extern capabilities and merged other capabiliteis to
buffer heap. Currently none of those buffer heaps supports extern.

Signed-off-by: Jakub Dabek <jakub.dabek@intel.com>
2019-10-21 12:07:03 +02:00
Pan Xiuli b0bb5a33c8 scripts: qemu: fix qemu check for BDW and HSW
The qemu for BDW and HSW removed shm mbox and moved it into dram.
Change the scripts to the new version.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2019-09-19 15:36:59 +01:00
Liam Girdwood 9d560bba9e tools: build: use standard naming convention for build dirs.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2019-09-18 21:01:16 +02:00
Curtis Malainey 23d9c78a5c scripts: allocate tty on docker
Bash and menuconfig cannot run without this flag. Docker-run just hangs
without it

Signed-off-by: Curtis Malainey <cujomalainey@google.com>
2019-09-12 19:52:34 +01:00
Tomasz Lauda fe9f9a1f36 apl: increase HP Buffer Heap and Runtime Sys Heap sizes
Increases HP Buffer Heap and Runtime System Heap sizes in order to
fit all the pipeline buffers.

Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
2019-09-06 15:51:02 +01:00
Janusz Jankowski 15065eb01c cmake: add sof_add_static_library utility function
Adding static libraries properly may be troublesome for developers
that are not familiar with CMake, so function that makes it easier
should be useful.

Usually developer will just add sources directly to the target.
Using static libraries should be limited just to closed / precompiled
3rd party components.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-08-09 16:44:50 +02:00
Ranjani Sridharan ee194890b5 scripts: add option to build fuzzer
Enable building the fuzzer with the -f option
in the build-tools.sh script.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2019-08-07 08:47:58 +02:00
Pan Xiuli c6dd479787 [skip ci]scripts: update glib support for fuzzer
Install libglib2.0-dev with apt.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2019-07-31 07:57:36 +02:00
Janusz Jankowski c6e12d53d8 scripts: add documentation generator
Process of documentation building and publishing requires
3 repositories. It is troublesome for people that are responsible
f.e. only for documentation publishing. It makes the process
easier by turning some easy to break steps from publisher instructions
into a script.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-06-13 13:29:02 +01:00
Janusz Jankowski 5dd9aaccb4 cmake: xtensa: use absolute paths for tools
CMake has convention of changing relative paths to absolute
for CMAKE_* variables. It does it automatically f.e. CMAKE_C_COMPILER.
However for our tools like objcopy we have to do it manually.
It also helps with integration of CMake in some IDEs.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-06-05 11:38:23 +02:00
Janusz Jankowski ba2fefb172 license: use spdx identifier in shell scripts
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-06-02 16:38:17 +01:00
Janusz Jankowski 69b32abda1 checkpatch: add spdx identifier
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-06-02 16:38:17 +01:00
Janusz Jankowski 644a1b4746 license: use spdx identifier in python files
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-06-02 16:38:17 +01:00
Janusz Jankowski c6064624f6 cmake: add spdx license identifier
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-06-02 16:38:17 +01:00
Janusz Jankowski e39ed5ebf4 include: split uapi headers into more directories
Some of interface headers are not needed by kernel,
but are needed by user-space applications, so we can split them
into multiple directories that indicate their purpose.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-05-31 20:10:45 +01:00
Pan Xiuli 9c15883f67 scripts: add imx8 platform in build all sripts
Add imx8 support in build all scripts.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2019-05-30 13:18:47 +02:00
Pan Xiuli c467b5285e scripts: update sof_builder docker with imx8 support
Add imx8 cross compiler in sof_builder docker build file.t

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2019-05-30 13:18:47 +02:00
Pan Xiuli 462f9174a9 scripts: update build step align with wiki
In SOF WIKI, used another clean up cmd, change here to align with docs.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2019-05-30 13:18:47 +02:00
Janusz Jankowski df48bfce77 cmake: git hooks for non-unix os
Add support for non-unix systems that have bash shell.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-05-22 08:26:05 +02:00
Jakub Dabek db16f82c8c checkpatch: added check for memcpy calls
Added check for memcpy calls and warning that they should be
memcpy_s calls if possible.

Signed-off-by: Jakub Dabek <jakub.dabek@intel.com>
2019-05-15 12:45:48 +02:00
Janusz Jankowski 982307ebdc scripts: build testbench for host
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-05-07 08:49:48 +02:00
Janusz Jankowski 2693daf503 cmake: rename BUILD_HOST to BUILD_LIBRARY
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-05-07 08:49:48 +02:00
Janusz Jankowski fdda8f6820 host: enable kconfig
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-05-07 08:49:48 +02:00
Slawomir Blauciak 980171e607 dai: supply caps and other info from within drivers
This change gathers some of the information inside of the DAI drivers,
which was previously inferred using external logic.

Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
2019-05-03 03:14:43 -07:00