Using -imacros on the compiler command line instead of explicitly
including config.h is not just less tedious in the future:
- it also makes sure configuration always comes first and is never
accidentally missed by an earlier #include
- it makes sure all translation units get the (same) configuration
- it lets parent projects like Zephyr override the config.h name
To test this I ran ./scripts/xtensa-build-all.sh -a -r, compared
binaries before and after this change and found no output difference.
Full disclosure: this required a few unrelated tricks not submitted here
like a .tarball-version file, commenting out __DATE__ and __TIME__ in a
few places, running strip-determinism on the .a files because our
crosstool-ng reference is not cutting-edge, etc.
As Tigerlake is not built by default it required a couple more hacks to
compile.
Blank lines are left instead of the former #include lines so even debug
objects are the same.
Only defconfigs were tested. On the other hand, this commit was _not_
performed by a script but by changing the name of the generated file and
clicking on and fixing every build failure. This proves that every
removed #include was actually required by one or more tested defconfigs
and that the added -imacros flag does affect the compilation of all the
modified files.
There is no #include config.h left: they were all in use in at least
one _defconfig.
I think comparing all binaries produced by ./scripts/xtensa-build-all.sh
-r -a provides extensive enough coverage but note this was tested only
with the crosstool-ng toolchain described in the SOF documentation.
The obsolete[*] xt-xcc front-end is gcc-based and the newer xt-clang
front-end is (surprise) clang-based. clang (copies many gcc options and)
does support -imacros so I don't expect any issue with either xt-xcc or
xt-clang. In the worst case, I do not expect any compiler front end to
_silently_ discard any unknown command line flag nor to ignore a missing
or misnamed config.h file.
[*] https://github.com/zephyrproject-rtos/zephyr/issues/3165
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
No functional change for now.
This is needed because SOF is a CMake sub/"external" project when
building some host tools. We want to switch all projects to "-imacros
config.h" but subprojects cannot inform parents where their files are
located. So make parents able to dictate where config.h is instead.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
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>
Fixes this -Werror on tgl platform:
.../xtensa/lib/cpu.c:65:38: error: taking address of expression of
type 'void' [-Werror]
void *dyn_vec_start_addr = (void *)(&_WindowOverflow4);
While "void foo;" is syntactically correct, doing anything with it is
illegal in standard C. Only the tgl platform was affected because it's
the only one with CONFIG_NO_SLAVE_CORE_ROM right now.
Any C type works, I tried a few and when compiling with xtensa-cnl-elf
they all produce the exact same -g0 binaries than the original without
-Werror. I find that the uint8_t[] type doesn't make _WindowOverflow4
look too different from what it is: assembly code.
This is the only change required to compile with the xtensa-cnl-elf
crosstool-ng toolchain documented in the getting started guide.
Note the build with this xtensa-cnl-elf gcc toolchain has NOT been
tested! The purpose of this commit is purely to add the gcc build to
CI, avoid future gcc bitrot and catch more warnings and bugs.
Fixes #2516 / commit be083cf350 ("cpu: unpack dynamic vectors")
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This will fix cache handling for shared_vecbase and allow to
boot slave cores in a proper way.
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
Smart amplifier should be used in following topology:
+------------------------------------------+
+------+ | +---+ +-------------+ +---+ +-------+ |
| Host |----->|Buf|->| Smart Amp |->|Buf|->|SSP Dai|-----------+
+------+ | +---+ +-------------+ +---+ +-------+ | |
+-----------------^------------------------+ |
| |
+---+ |
|Buf| |
+---+ |
^ |
+-----------------|--------------------------+ |
+------+ | +---+ +--------|------+ +---+ +-------+ | |
| Host |<-----|Buf|<-| Demux |<-|Buf|<-|SSP Dai|<--------+
+------+ | +---+ +---------------+ +---+ +-------+ |
+--------------------------------------------+
Smart amplifier test component does not implement any specific processing
algorithm at the moment. I can pass chosen channels from source (buffer
between Host and Smart amplifier) or feedback (buffer between Smart
amplifier and Demux component) buffers. Those channels are selected by
sending proper config to this component. Smart amplifier can be
configured via SOF_SMART_AMP_CONFIG or SOF_SMART_AMP_MODEL data
(similarly as it happens in detector case).
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
This commit replaces private detector component functions with
generic ones in order to remove code duplication.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
This commit rewrites functions responsible for large config configuration
from detect_test component and puts them in component.c file as
generic ones - as a result they can be used by other components.
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
Demux should select proc func based on source buffer,
because sink can be not set yet (e.g. this can be observed
in Smart Amplifier topology scenario where we have
buffer between playback and capture pipeline).
Signed-off-by: Bartosz Kokoszko <bartoszx.kokoszko@linux.intel.com>
All timers should have logical_irq properly set up.
In case of arch timers logical_irq is equal to irq.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
- 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>
This information known at build time does not need to be
provided in a mailbox.
There was need to remove variable array from sof_ipc_window,
what give possibility to embed this struct inside another one,
but leads to ABI minor change.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Such a macro can be used to port .fw_ready structures to .fw_metadata
section with proper header.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Topology is modified to include another JSL+ product variant with
MX98360a AMP + ALC5682 Headset codec. Created a platform specific
for RT1015, included this and already existing MX98360a in
sof-jsl-rt5682.m4
Signed-off-by: Uday M Bhat <uday.m.bhat@intel.com>
SOF has #sof dedicated channel on irc.freenode.net server.
This will enable travis ci to send notifications to the IRC
channel each time a build is finished (either successful or not).
We will see how this works and refine it later if it is too spammy.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
This patch fixes from errors trace a message where the length
parameter is always shown as zero:
ERROR Filter length 0 exceeds limitation for build.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Align escape characters in macros, use tabs instead of spaces
(when possible), use single tab indentation in tracec context
declaration.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
The same function implementation should be kept in same place or in
separate implementation files, to easily get which one is used under
what condition.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
It's quite easy to get lost when long, multi level #if/#endif are
used, pointing corresponding condition name near #else and #endif
helps to keep context during reading.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
The topology is cloned from sof-tgl-max98357a-rt5682.m4 with
changes on ssp config, iDisp and DMIC pipeline pcm number etc.
The dai_index matches the order defined in sof-rt5682.c machine driver.
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
This patch adds capture PCM with ASRC for capturing from SPDIF
input of WM8804 codec. This topology is used mainly for testing
of a bi-directional ASRC connected slave-DAI.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
This patch replaces the fixed step increment/decrement linear ramp
update with a time since transition start calculated direct line point
value. It does not suffer from accumulated rounding errors.
The new ramp_coef[] vector (that replaced ramp_increment[]) defines
per channel the slope coefficient as Q16.16 units per millisecond. The
slope points calculation needs a new counter variable that counts
frames since ramp start. Also the volumes vector at time of ramp start
need to be stored. The old fixed increment calculation related macros
are removed.
The zero crossings timed volume mode suffered from fixed step the most
since depending on signal the fixed step could update the value too
much or too little.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Ability to change log level per UUID component improve user
experience during debugging firmware. Threshold trace level
defined in log message with value from trace context, where
trece context is related with component instance (local or
global instance).
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Output sample size is unrelated wit input one. To calculate
write pointer address, correct value should be use.
Without this path, output data will be placed in wrong memory
area, what results in corrupted output stream when output offset
differ from zero.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This patch will update our clock change procedure to align
with hardware recommended flow for TGL platforms
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@linux.intel.com>
As discussed in PR #2964, the Travis badge shows the status of the
master branch but it links to the random PR of the moment. Fix that link
to point to the more useful "branches" page which has the master branch
at the top.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Currently, in the ipc_schedule_process function, when we call
schedule_task to schedule an ipc task, we use magic number to
indicate the time kernel waits before calling timeout on an
IPC. This makes it difficult to search for the timeout period
using grep and other utilities. Replacing it with a macro makes
it easier to search and change only at one place.
Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com>
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>
If it's possible, each line with comment to struct field
should be aligned, to keep code style consistent.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
It allows to comparison this full UUID value with value in IPC message,
what is important step to create new component from topology by their
UUID value.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
UUID entries, related with components from topology,
should be loaded into SRAM to allow runtime comparison with
value in IPC message during component creation.
UUID of the components whose are not created by IPC message
are not needed in runtime, so there should not be there to
reduce memory consumtion - as it is now. It's untouched.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Each component driver should have assigned UUID value and trace
contecxt, to allow generic component creation routine usage.
It's espiecially important for trace context, because it's
accessed by pointer so dereferencing NULL pointer will lead to
segmentation fault.
Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
Cleanups MCLK and MN related functionality. Moves some defines
from ssp to mn header. Also hides some definitions in platform
specific headers.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
Check if re-register failed in dma_domain_unregister_owner.
Error reported by clang static analyzer.
Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
Implements new DMIC_HW_VERSION 3. It requires to set ipm values
no matter how many controllers are implemented.
Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
The stream parameters set in the pipeline were mismatched with
the DMIC hardware configuration, which resulted in failures.
Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>