Commit Graph

68 Commits

Author SHA1 Message Date
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 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
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 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
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
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
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 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 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 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
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
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
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
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
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
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
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
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
Pierre-Louis Bossart 826e361e7a CMake/rimage: add option to use out-of-tree private key
On specific Intel platforms, we have to use a private key which is not
shared with the rest of the world.

Extend xtensa-build-all.sh with an option, and pass the key path
explicitly to cmake if needed.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2019-04-10 15:54:20 +02:00
Curtis Malainey 9cc3f6d10e scripts: use local cpu count to build
Build faster by using all available cores by default
The xtensa script claims it used infinite build threads when j was not
specified but it was actually falling back to 1.

Signed-off-by: Curtis Malainey <cujomalainey@google.com>
2019-03-24 13:14:08 +00:00
Ranjani Sridharan d0bc31425a scripts: add option to modify defconfig
Add an option to modify the defconfig during fw build using the
script. Without this, modifying the default config and building
the FW is a 2 step process.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2019-03-19 15:07:31 +00:00
Janusz Jankowski 7342811168 cmake: make CI builds verbose
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-01-29 12:38:48 +00:00
Keyon Jie 905bad4252 scripts: xtensa-build-all: Add support to force build UP Arch
Add -u option to allow force building xtensa(up) ARCH on platforms which
usually building xtensa-smp by default.

Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
2019-01-24 15:32:27 +00:00
Pan Xiuli 140914aa03 scripts: update build all scripts
Use different build folder for gcc and xcc build.
Will auto selected if ROM build is not supported for the platform,
thus make -a -r can work.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2019-01-23 10:59:50 +00:00
Janusz Jankowski 9840ecbbfe cmake: update xtensa-build-all.sh
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2019-01-22 15:35:35 +00:00
Pan Xiuli 26528f6313 scripts: default to have local rimage install
rimage will default to be build and install to local folder to avoid
ABI changes issues.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2019-01-10 15:10:10 +00:00
Pan Xiuli 8174738b53 scripts: add rom build option
Enable build rom for the target. Could only use with GCC compiler.

Signed-off-by: Pan Xiuli <xiuli.pan@linux.intel.com>
2018-12-04 13:43:51 +00:00
Liam Girdwood baf2806626 scripts: xtensa-build-all: Add support for > 1 makefile job
Add -j option to allow setting Makefile jobs.

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-11-21 15:52:00 +00:00
Janusz Jankowski b5af84deaa scripts: add smp builds to xtensa-build-all.sh
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
2018-11-15 13:46:33 +01:00
Liam Girdwood 08236fcb46 build: make builds reproducible.
Add a debug option to include build number, date and time into build.
This will be disabled b default so that all builds are reproducible.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2018-11-09 16:16:38 +00:00