Add reference to -fno-inline-functions issue
https://github.com/thesofproject/sof/issues/5212
Add examples of compilation failures without gnu99.
Fixes commit e430629a1e ("xt-clang: Do not use -std=gnu99 for C++")
that separated the comment from its code.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Use audio_stream_samples_without_wrap_sx to replace the complicated
boundary detection for every sample and separate the mix functions to
normal mode and remap mode.
Normal mode (the default mode) can save at least 55.5% cycles for C
version and at least 76.7% for HiFi3 version.
Signed-off-by: Andrula Song <xiaoyuan.song@intel.com>
Option -std=gnu99 applied to C++ files trigerrs warning for xcc
compiler however throws error for xt-clang.
This patch limits usage of this flag to C, ASM code only.
Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
Adjust PATH to give precedence to any local sparse. New precedence:
1. zephyr-workspace
2. /opt/sparse/bin
3. Anything else in default PATH
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Logging what the container is made of will help diagnose binary
incompatibilities or other problems.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
to have more order in the code - move memory code from a huge
common wrapper.c to specific lib/alloc.c
Note there is NO changes in the code, code is as it was before
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
In zephyr ipc3 case, the first heap allocation come too early
and zephyr logging even is not initialized, it cause sof boot failure.
Limit heap status collection for zephyr+ipc4 only.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Heap memory profiling is based on runtime zephyr API.
It will print out each memory allocation with allocated bytes
and free bytes, display as below:
zephyr: heap allocatd: 22c0 free: 152a90 max allocated: 1000
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
We need this in order to export symbols to external libraries.
E.g Cadence library needs __vec_memset / __vec_memcpy.
Previous commit d9aed376d5 ("zephyr: rtos: Add __vec_memcpy /
__vec_memset") is not enough in the case of external libs.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
libc used by Zephyr does not provide implementation for
__vec_memcpy / __vec_memset so add them here.
Fixes c90055f2f5 ("header: rtos: use rtos specific version of string.h")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
D3 (PM_STATE_SOFT_OFF) state can be only entered after IPC request from
host. That why this prevent should be permanent.
D0i3 (PM_STATE_RUNTIME_IDLE) can be entered if host allows it and under
special conditions. State is prevented by default. Host will remove this
prevent with dedicated IPC message.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
This series of changes allows developers to enable DMA
domain on Zephyr. Currently, this feature is marked as
experimental because it still requires a lot of testing
and bug fixes.
In the case of i.MX, these changes still allow the usage
of dma_multi_chan_domain in conjunction with ll_schedule
if so desired. This is done because the feature is still
experimental and once it becomes more stable the appropriate
changes will be done in order to make DMA domain the
default option.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Add C and hifi3 version Direct-1 implementation for IIR,
and rename the structure of sof_eq_iir_header_df2t to
sof_eq_iir_header for both two format sharing. Compared
with the original Direct-2 transport format,Direct-1 has
better performance on low frequency since lower quantization
noise while asking the same memory. The C version cost the
same cycles and hifi version can save about 9.8% cycles than
Direct-2 transport format.
Signed-off-by: Andrula Song <xiaoyuan.song@intel.com>
On i.MX8 k_cycle_get_64 always returns 0 so use sof_cycle_get_64
instead.
There is no better solution to support 64bit cycle counting for i.MX
and will have to stick with this implementation.
Fixes: c3c94fc515 ("header: rtos: use rtos specific version of wait.h")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Rename ace ipc zephyr stubb as ipc-zephyr.c as it is a generic interface
towards zephyr cavs/ace ipc drivers. Change existing zephyr ace/mtl
makefile reference to it and start using it in cavs/tgl ipc4 zephyr
native drivers builds. Tgl ipc3 builds will still use sof cavs ipc
driver.
Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
`docker images` has no globbing option so just use `grep zephyr`
This fixes two different issues:
- Fixes tabulation images with names of a different length
- Displays any internal local cache some users may have
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Besides making things more obvious, the important functional change is
that the user switch is now performed for _every_ invoked, command, not
just for the build command.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Added new mtl platform to xtensa-build-zephyr.py.
Added ace directories to cmake files.
Added ACE to kconfig.
Add Meteorlake platform to be built with Zephyr under
CONFIG_ACE_VERSION_1_5 flag.
Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Signed-off-by: Konrad Leszczynski <konrad.leszczynski@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Define a dedicated .heap section in case of zephyr build.
Such explicit section is required to allow for unmapping
of unused physical pages which can be later used for
loadable library/modules support.
Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
Both Broadwell and Baytrail are not supported in zephyr and those
Kconfigs are not defined anywhere, neither in SOF nor in zephyr.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Continue changes in commit c194125b83 ("zephyr: add
notifier_register(ipc_send_queued_msg) in task_main_start()") and
implement the delayed IPC msg sending in Zephyr work queue.
The old implementation did not cover cases where IPC needed to be resent
when no active LL scheduler tasks were active.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Code can now include <rtos/cache.h> which can wrap onto rtos cache
APIs. Will wrap onto Zephyr generic cache API when ready.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Code can now include <rtos/alloc.h> and uses thinly wrapped Zephyr
native for most uses. Wrapping can be removed over time.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Code can now include <rtos/interrupt.h> and uses native Zephyr IRQ API
for most uses. Some wrapping still exists which can be removed over
time. IMX is missing IRQ driver in Zephyr so falls back to xtos IRQ
driver.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Code can now include <rtos/timer.h> and uses native Zephyr timer API
for most uses. Some wrapping still exists which can be removed over
time.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Add IPC4 support for extraction & injection probes
IPC4 header changes, checksum calculation
moved checksum from header to the end of data packet
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
The memcpy_s() function is called from CPP code in IADK modules.
Declare it as extern "C" when header included in CPP code.
Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
Add DRC files to Zephyr compilation to avoid failures like this:
sof/src/audio/drc/drc_generic.c:188: undefined reference to
`drc_lin2db_fixed'
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Code can now include <rtos/wait.h> and uses native Zephyr 64
cycle API instead of SOF version.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Explain how to use this script with a different image version.
Docker image versions and tags tend to confuse new users.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This makes it possible to run interactive commands like:
./sof/zephyr/docker-run.sh /bin/bash
Fixes commit 02c1269144 ("Add new, convenience zephyr/docker-run.sh
script")
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This makes it much easier to run commands in the
ghcr.io/zephyrproject-rtos/zephyr-build container.
Loosely based on scripts/docker-run.sh.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
No runtime semantic change. Use C library when RTOS uses
C library otherwise use own C library calls.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
No functional runtime change, but changes to rtos partitioning and the
layout of headers .
This patch creates RTOS specifc header paths and updates spinlock.h
and kernel.h to show the new usage. Other headers will incrementally follow.
It reuses the current zephyr topleve directory and creates a new
toplevel xtos directory for xtos specific files.
Due to the mixing of RTOS, driver and library headers at the top level include
directory it was necessary to create rtos specific header directories i.e.
src/include/rtos-xtos
src/include/rtos-zephyr
These RTOS include directories will eventually contain RTOS specific headers
whilst common logic and structures will be placed in non RTOS directories.
This will also mean
"#include <sof/spinlock.h>"
will become
"#include <rtos/spinlock.h>"
and will allow easier visualisation of where and why RTOS headers are being used.
This will help to eliminate cross usage of headers between RTOSes.
Subsequqnt patches will move more headers and rtos specific wrppaer
source files into rtos specific locations.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Handle IPC4_ENABLE_LOGS basefw message. If firmware is built with
Zephyr and CONFIG_LOG_BACKEND_ADSP_MTRACE is defined, initialize
the mtrace logging backend.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Extend the EDF scheduler adaptation to Zephyr to allow repeating
tasks. This allows SOF code to use the per core threads used by
EDF for more usages.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Add hifi3 & hifi4 version implementation of mixer processing functions.
The hifi version functions can save at least 47% cycles than C version.
Signed-off-by: Andrula Song <xiaoyuan.song@intel.com>