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>
Implement a Zephyr logging backend which routes the logs via SOF
probes interface.
Tested with Linux SOF driver, crecord and sof/tools/probes for decoding.
The patch modifies the probes IPC3 interface, adding a new probe purpose
field (PROBE_PURPOSE_LOGGING, 0x3) to specify probe extraction for
logging. A field for system trace (as is also reserved (PROBE_PURPOSE_TRACING).
Example usage in Linux:
term1# crecord -c3 -d0 -b8192 -f4 -FS32_LE -R48000 -C4 /tmp/extract.dat
term2# echo 0,3,0 > /sys/kernel/debug/sof/probe_points
term1# <terminate crecord>
term1# sof-probes -p /tmp/extract.dat
term1# cat buffer_0.bin
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
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>