Restore ability to use (and test!) zephyr/docker-build.sh locally
without overwriting work in progress.
Fixes commit b371373f7d ("scripts: docker-build.sh updated with
changes from xtensa-build-zephyr.py")
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Zephyr removed support for header inclusion without the zephyr/ path.
Update SOF with correct paths.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Removed old flags from python script call and replaced with
new one. Added one more working directory to zephyr-build container
now SOF is placed in /workdir/sof and west workspace in /workdir .
Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
With Zephyr, SOF uses k_cycle_get_64() API in order to
count clock cycles.
Not all platforms have a 64bit counter (e.g i.MX dsp integration
only has xtensa timer which is limited to 32 bits).
So, instead of using k_cycle_get_64 introduce new API sof_cycle_get_64
which keeps the existing behavior for platforms which define
CONFIG_TIMER_HAS_64BIT_CYCLE_COUNTER, otherwise use k_uptime_ticks().
See comments from @andyross at
https://github.com/zephyrproject-rtos/zephyr/pull/48318
Suggested-by: Andy Ross <andrew.j.ross@intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Use the module interface instead of the comp drv interface for the
EQ IIR component.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
add hifi version implementation of apply_attenuation, using xtensa
instructions can save about 74% cycles than the original one.
Signed-off-by: Andrula Song <xiaoyuan.song@intel.com>
Adds possibility to connect single mixin to multiple
mixouts. This allows for all possible mixin/mixout
topologies.
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
Add multiple third-party and optional audio processing components to
the Zephyr cmake and initialisation lists.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This patch adds a mechanism to load and use dai driver from zephyr
instead of xtos driver.
Patch includes following changes:
- dai-zephyr.c calls directly zephyr driver methods
- include/lib/dai.h is divided into dai-legacy.h and dai-zephyr.h
- use zephyr dais by configuring CONFIG_ZEPHYR_NATIVE_DRIVERS=y
Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Move the volume component inside the module_adapter folder and use the
module interface API instead of the component driver interface. Also fix
the volume cmocka tests to use the modified scale_vol function.
Also, add kconfig option for keeping the legacy comp_drv interface for platforms
that are limited in text region memory size, such as
BYT/CHT/APL/JSL/ICL.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
This patch will add new versions of host and dai components
with Zephyr native DMA support
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
There are few left paths and config names after switching from
codec_adapter to module_adapter.
Without this building codec modules fails
Fixes: b4591ca8f4 ("codec_adapter: rename it to module_adapter and fix all includes")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
heap_alloc_aligned_cached() is a helper function used to allocate
memory with a cached alias. Therefore its returned pointer should
use the __sparse_cache annotation.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
SOF uses IDC (Intra DSP Communication) protocol to orchestrate
work across multiple DSP cores.
The interface in sof/drivers/idc.h defines the protocol and
also provides a high-level interface for drivers. On Zephyr,
the SOF IDC protocol is used, but the actual communication
is implemented on top of Zephyr P4WQ workqueue interface,
instead of directly calling into drivers.
Move the Zephyr implementation from src/schedule/ into
src/idc/ which is more suitable place for this code.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
to DECLARE_MODULE_ADAPTER and comp_driver to comp_module_adapter.
Also rename SOF_COMP_MODULE_ADAPTER to SOF_COM_MODULE_ADAPTER.
No functional changes.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
The log context in zephyr is per file or module.
To use zephyr logging api, LOG_MODULE_REGISTER is used
to register a log context, LOG_MODULE_DECLARE is used
to refer to the registered context.
For function in header file, LOG_MODULE_DECLARE should
be used within that function to avoid context collapse,
a condition one source file have multiple context
registered or declared.
Signed-off-by: Chao Song <chao.song@linux.intel.com>
This fixes SOF version.cmake which was just broken by a recent git
security update and started to fail like this:
```
-- SOF version.cmake starting at 2022-04-25T18:14:56Z UTC
-- /workdir/zephyr/.. is at git commit with parent(s):
fatal: unsafe repository ('/workdir' is owned by someone else)
To add an exception for this directory, call:
git config --global --add safe.directory /workdir
```
(example at https://github.com/thesofproject/sof/runs/6162885265)
chgrp -R was always an ugly hack because it was messing with
(persistent) file permissions on the host, outside the container. This
new adduser solution is unfortunately much more code but it does not
leak any side effect outside the container.
Do not fix scripts/docker-run.sh yet because there is still no UID
mismatch between Github Actions and the SOF container (they're both
1001) but add a warning + TODO.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Add a static variable w_core_enable_mask in Zephyr wrapper.c to
track requests to enable and disable cores, and use this to
implement arch_cpu_enabled_cores().
We don't yet have a implementation to power off secondary cores.
This creates issues to SOF application code that may rely on
disabling of cores to be reflected in cpu_enabled_cores(). Instead
of adding ifdefs in application code, manage this within wrapper.c.
Once the secondary core power-off is implemented, this static
variable can be removed.
BugLink: https://github.com/thesofproject/sof/issues/5701
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
The function rballoc_align did not take into account the passed flags, so
it always incorrectly allocated a cached memory. Added support for the
SOF_MEM_FLAG_COHERENT flag.
Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
`_end` and `_heap_sentry` linker symbols are used to infer heap size. In
Zephyr, `_end` is referenced as `char []` while in SOF as `uint8_t`.
This may "conflicting types", should those declarations be built
together.
This patch changes the Zephyr wrapper to also use `char []`, thus
avoiding this issue.
Signed-off-by: Ederson de Souza <ederson.desouza@intel.com>
The data blob handler functionality is quite independent from the rest
of the generic component code. The component.c and component.h are
already too big so it is better to split the data blob handler
functionality out before adding more features to it.
Signed-off-by: Jyri Sarha <jyri.sarha@intel.com>
Multi-core configurations already use uncached memory for LLI. This
also makes sense to avoid having to manually synchronise cache. Force
LLI objects uncached.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Replaced sof timer related functions with Zephyr alternative.
Signed-off-by: Adrian Warecki <adrianx.warecki@intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
We add support for linking with Cadence AAC/MP3 libs.
Cadence lib MP3 support is enabled via CONFIG_CADENCE_CODEC_MP3_DEC config
symbol. Path to library file needs to be set via CONFIG_CADENCE_CODEC_MP3_DEC_LIB
Similar for AAC.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Fixes copy/paste of commit de41202f8f ("zephyr: build: Add initial
build support for SOF application.")
This fixes the dictionary hash when using Zephyr; no more fallback on
the git SHA1.
When using Zephyr, SOF_ROOT_SOURCE_DIR (and SOF_ROOT_BINARY_DIR) are used
only by version.cmake
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Fix issue of ipc4 pipeline initialization with zephyr enabled.
Need to initialize these two components. Gain module is another
type of volume without peak volume support and mixin has subset
function of mixer.
Signed-off-by: Rander Wang <rander.wang@intel.com>
Use the new interface to initialize non-primary cores before
enabling them with arch_start_cpu(). This interface is not
available in Zephyr 3.0.0, but is mandatory in later release.
Depends on Zephyr commit 2b210cb3db05 ("kernel: Refactor SMP cpu
initialization a bit").
BugLink: https://github.com/thesofproject/sof/issues/5456
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
z_wrapper_cpu_enable_secondary_core() may be called
repeatedly on a core that is already running. Add a check
to ensure we do not try to restart a core that is already
running.
Also add a check for ready_flag as done in upstream Zephyr
kernel/smp.c to ensure z_wrapper_cpu_enable_secondary_core()
does not return until the target core has finished its
startup and arch_cpu_active() returns true.
BugLink: https://github.com/thesofproject/sof/issues/5446
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
This enables codec_adapter and cadence/passhtrough codecs
with SOF on Zephyr.
passthrough codec can be used as it is, but cadence codec
will also need codec libraries from cadence.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
This reverts commits e0ff1b16d8,
339e5ac217 and
09c69b7607. A different approach will
be used for making SOF a platform-agnostic Zephyr application.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The two components copier and base_fw are
essential to IPC4 support on SOF on Zephyr.
This patch integrates the build of the two
components to SOF build with zephyr RTOS.
Signed-off-by: Chao Song <chao.song@linux.intel.com>
The DF2T IIR core has been moved earlier to library but the
helper functions for configuring it were left to EQ component.
This patch eases use of IIR core from other components. The
file src/audio/eq_iir/iir.c is moved to src/math. There are no
changes except of remove iir.h since the contents specific
for DF2T type were merged to iir_df2t.h
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
To align with Zephyr smp.c:smp_init_top(), add the missing call to
smp_timer_init() in secondary_init() of the SOF wrapper. Also
add inline documentation why we are open-coding the function on
SOF side.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
This reverts commit 414089aa44.
Failures hit with 4core cAVS2.5 configuraions, so this has
to be reverted. We need an implementation that keeps both
Zephyr (and SOF runtime-DSP if still used) in the loop.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Currently there is code to power up secondary cores both
in Zephyr architecture hooks in wrapper.c, as well as in
SOF runtime-PM driver.
Some of this is necessary overlap until full replacement of
SOF runtime-PM is available. But for secondary core power up,
we can already clean up the flow and hook the Zephyr core
enable code to runtime-PM driver directly. This fixes startup
issues seen on Intel cAvS2.5 platforms.
Core power-down is left intentionally for runtime-PM driver
to handle as the related interface in Zephyr is not ready
for use yet.
BugLink: https://github.com/thesofproject/sof/issues/5018
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
This reverts commit 079ce95b98.
As explained in the comment that it modified, predicted in the #5159
discussion and reproduced in test #5290 /
https://github.com/thesofproject/sof/runs/4988844402, this commit broke
'CONFIG_TRACE=n'. Simple reproduction steps:
$ rm -rf zephyrproject/build-apl
$ echo 'CONFIG_TRACE=n' >> \
boards/xtensa/intel_adsp_cavs15/intel_adsp_cavs15_defconfig
$ sof/scripts/xtensa-build-zephyr.sh [ -p /path/to/zephyrproject ] apl
fw abi main version: 3.20.1
fw abi dbg version: 5.3.0
warning: can't find section .static_log_entries in zephyr/zephyr.elf
error: section .static_log_entries can't be found
error: unable to write dictionaries, -22
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Zephyr requires CMake 3.21 and SOF requires 3.13, see
commit a0acad3414 ("CMake: require version 3.13")
Fixes commit 4b2edf8eed ("zephyr: wrapper: complete zephyr support for
working audio")
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
_smex_placeholder dowsn't have to be global, make it static.
Also no need to explicitly specify smex_placeholder_f() as inline,
the compiler will decide by itself.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
On generic Zephyr platform case, use an OS timer call to get a time
stamp.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This makes it possible to clean sof_versions.h.
Also remove DOT_CONFIG_PATH copy/paste which is unused in
Zephyr.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>