Commit Graph

156 Commits

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