Commit Graph

241 Commits

Author SHA1 Message Date
ShriramShastry e6baebd54b Math: library: Add an exponential function
The 32-bit exponential library function has an accuracy
of 1e-4 and a unit in last place error of 4.5878 for
inputs from -5 to +5 (Q4.28) and outputs from 0.0067379470
to 148.4131591026 (Q9.23).

Signed-off-by: ShriramShastry <malladi.sastry@intel.com>
2023-02-20 11:17:37 +00:00
Serhiy Katsyuba e6e441ced5 ipc4: add IPC4 gateway
Adds IPC4 gateway. IPC4 gateway transfers audio between host
and DSP without DMA: via memory window (audio payload) and IPC4
messages (commands).

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2023-02-07 16:27:20 +00:00
Adrian Warecki d33af9ffbd platform: ace: watchdog: Add ll watchdog support
This commit adds watchdog support in zephyrs ll domain for ace platform.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-02-01 12:43:29 +02:00
Piotr Makaruk d92f07ad30 hda: chain management and logic implementation
Hardware HDA chain require manager for controlling multiple streams tasks.
Enable support with LL task and DMA mandatory logic.

Signed-off-by: Piotr Makaruk <piotr.makaruk@intel.com>
2023-01-19 15:37:32 +01:00
Jakub Dabek 99093bac4e memory: Add virtual memory regions gathering and structs
Add virtual memory regions info gathering from zephyr and introduce
structs agregating this information.
Add proper defines for memory management.

Signed-off-by: Jakub Dabek <jakub.dabek@intel.com>
2023-01-17 16:10:44 +02:00
Krzysztof Frydryk 6b647412bf lib: Add mcps budget manager for cpu clock control
Initial implementation of MCPS budget manager.
FW can request/free MCPS usage on enabling certain FW elements. Caution
should be taken when processing on different cores, as kcps_budget_data
is uncache only. The manager will change clock source to match requested
MCPS consumption. Budget manager may interfere with manually setting
clock values!

Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
2023-01-09 15:12:13 +00:00
Andy Ross c50eddce1f platform: Add Zephyr native_posix-based emulation environment
This extends the ideas in CONFIG_LIBRARY=y to implement SOF as an
application for the Zephyr native_posix architecture.  These are host
x86 or x86_64 binaries that include a full OS build, which can be used
(via mocked drivers) for testing against host validation environments
like ASAN/MSAN.

The mechanism uses the existing "host" architecture used by
CONFIG_LIBRARY, but adds a new platform layer named "posix", populated
entirely with stubs.

No driver integration is provided in this patch.  The resulting
executable builds correctly, but has no devices and won't do anything.

Signed-off-by: Andy Ross <andyross@google.com>
2022-12-07 17:25:39 +00:00
Marc Herbert 5311f61037 zephyr/cmake: fix target_compile_options() comments. No code change
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>
2022-11-30 11:50:28 +00:00
Andrula Song 7f36f83333 Audio: Mixin_mixout: Optimize the mixin processing functions
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>
2022-11-25 11:58:18 +00:00
Jaroslaw Stelter e430629a1e xt-clang: Do not use -std=gnu99 for C++
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>
2022-11-22 16:03:31 +00:00
Marcin Szkudlinski 315962c4d7 zephyr: move memory allocation code 1:1 from wrapper.c to alloc.c
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>
2022-11-21 17:09:52 +00:00
Daniel Baluta 25493e5d44 zephyr: Add zephyr lib.c standalone file
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>
2022-11-11 15:57:50 +02:00
Laurentiu Mihalcea 1daedbf646 Introduce Zephyr DMA domain as experimental feature
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>
2022-11-02 12:34:34 +00:00
Andrula Song 87bd3d628b Math: IIR: add Direct-1 format implementation of IIR
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>
2022-10-28 12:33:56 +01:00
Tomasz Leman e973f5245e zephyr: cpu: moving outside of the wrapper
Moving core management code out of the wrapper for solutions builded
with zephyr.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2022-10-26 13:27:25 +01:00
Adrian Warecki ac33ac128b ace: dma: Add dma configuration
Added code containing configuration of the dma channels.

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>
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2022-10-18 16:10:37 +03:00
Adrian Warecki c47a0bf6ff ace: clock: Update clock definitions
Added code with clock definitions

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>
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2022-10-18 16:10:37 +03:00
Jaska Uimonen 251ee59b2e ipc: rename ace ipc zephyr stubb as ipc-zephyr.c
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>
2022-10-17 17:01:09 +03:00
Adrian Warecki 784bce763c mtl: Added meteorlake platform to the build system
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>
2022-09-21 15:15:26 +02:00
Anas Nashif ddc104c66d zephyr: both BDW and BYT are not supported in zephyr
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>
2022-09-16 15:32:25 +01:00
Jaroslaw Stelter de889c554b library_manager: module_adapter: Enable build of library manager and IADK modules
Add the library manager and IADK modules to build.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2022-09-07 18:05:11 +01:00
Daniel Baluta 0488ffee32 zephyr: Fix DRC module compilation
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>
2022-09-06 21:40:06 +01:00
Liam Girdwood c3c94fc515 header: rtos: use rtos specific version of wait.h
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>
2022-09-06 15:37:21 +01:00
Liam Girdwood c90055f2f5 header: rtos: use rtos specific version of string.h
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>
2022-08-31 12:01:07 +01:00
Liam Girdwood ce0879a432 header: rtos: use rtos specific version of atomic.h
No runtime functional change. Code can now include <rtos/atomic.h>

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-08-31 12:01:07 +01:00
Liam Girdwood 1629a1f72c header: rtos: decouple headers into rtos specific directories.
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>
2022-08-31 12:01:07 +01:00
Kai Vehmanen 8a8845e5ff ipc4: implement mtrace logging support
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>
2022-08-31 10:33:46 +01:00
Andrula Song 100144a1d0 Audio: Mixer: Add hifi version processing functions for mixer
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>
2022-08-24 12:00:30 +01:00
Kai Vehmanen c3d1228fb0 probe: add backend for logging via probes
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>
2022-08-16 15:36:42 +01:00
Krzysztof Frydryk a6e936359c src: enable hifi4 optimized src build with zephyr
Add src_hifi4.c to sources when building with zephyr.

Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
2022-07-27 23:08:16 +01:00
Andrula Song 12d660b088 Audio: copier: add hifi version implementation of apply_attenuation
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>
2022-07-15 08:55:11 +01:00
Serhiy Katsyuba 9d2857fe37 mixin/mixout all topologies support
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>
2022-07-13 09:47:09 +01:00
Guennadi Liakhovetski 162dafc288 zephyr: add third-party components
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>
2022-07-01 11:11:23 +01:00
Jaska Uimonen 015ec63c4d zephyr: add glue code to use zephyr dai drivers
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>
2022-06-16 20:15:59 +01:00
Liam Girdwood e327f09250 ipc: blob: Add a Kconfig option for the blob loader
Save memory when not used.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2022-06-10 20:27:31 +01:00
Ranjani Sridharan f7663de1f4 volume: use the new module interface
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>
2022-06-10 09:50:08 +01:00
Adrian Bonislawski 2b7fdc95de dma: add Zephyr native DMA support to host & dai
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>
2022-05-31 15:28:27 +01:00
Daniel Baluta 2e3823ac34 zephyr: Fix compile error after switching to module_adapter naming
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>
2022-05-12 09:50:04 +01:00
Kai Vehmanen 9c9ad34464 zephyr: move Zephyr IDC implementation to zephyr_idc.c
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>
2022-05-06 10:21:00 +01:00
Jyri Sarha b81c76f854 component: Split data_blob.[ch] out of component.[ch]
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>
2022-04-05 17:47:18 +01:00
Daniel Baluta b18f08d095 zephyr/cmake: Add support for linking with cadence libs
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>
2022-03-10 09:57:11 +02:00
Marc Herbert f052cbffaa zephyr/cmake: fix SOF_ROOT_SOURCE_DIR to fix the .ldc checksum
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>
2022-03-08 22:02:36 +00:00
Daniel Baluta b06f2cfe23 zephyr: add codec adapter components
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>
2022-02-18 21:12:24 +00:00
Guennadi Liakhovetski d0057a7def Revert "zephyr: add a generic Zephyr platform"
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>
2022-02-11 11:18:54 +00:00
Chao Song 487363fb1b zephyr: add copier and base_fw components
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>
2022-02-11 11:02:19 +00:00
Seppo Ingalsuo beb0610148 Math: IIR: Move IIR DF2T initialize helpers to library
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>
2022-02-04 10:02:55 +00:00
Marc Herbert 361fbf4504 zephyr/cmake: remove obsolete cmake 3.12 version test
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>
2022-01-26 10:14:15 -08:00
Guennadi Liakhovetski 92f6db8ba9 zephyr: add support for IPC4
Select correct IPC implementation depending on the selected version.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-21 17:05:58 +00:00
Marc Herbert 12f4834e40 zephyr: move GENERATED_DIRECTORY from source tree to build directory
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>
2022-01-14 16:56:29 +00:00
Marc Herbert deb0e7340e Rename generated version.h to sof_versions.h
Zephyr also a version.h too so the situation was a buggy #include mess
that (among others) dropped the SOF git version from the SOF banner when
using Zephyr. It's absolutely impossible to fix this mess while keeping
two .h files both named exactly the same and even included with the
exact same '#include version.h' line, I mean no sof/version.h or other
prefix.

As a bonus, this rename also reduces the XTOS-only confusion between
"version.h" and cavs/version.h".

Generating a file in the source tree is a serious bug (to be fixed
later), it means this file is never cleaned. Do not hide this bug with a
.gitignore rule.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-14 16:56:29 +00:00
Guennadi Liakhovetski e0ff1b16d8 zephyr: add a generic Zephyr platform
When built with Zephyr, SOF ideally should be a fully platform-
agnostic application. All platform-specific code should reside in
Zephyr itself, including core architecture and platform
infrastructures and drivers. To prepare for this transition we add a
generic SOF-Zephyr platform. It is based on the current Tiger Lake
architecture and should be usable for cAVS 2.5 and newer systems.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-12-31 08:06:24 +00:00
Guennadi Liakhovetski aa767fd5ce zephyr: remove non-existent directories from CMakeLists.txt
Two directories for cAVS 2.0 and 2.5 in Zephyr CMakeLists.txt don't
exist. They're safely ignored, but remove them to avoid confusion.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-12-20 22:58:27 +00:00
Marc Herbert c30dffcc35 zephyr/cmake: BUILD_ALWAYS for smex and sof-logger
Discovered the hard way that the Zephyr build assumes sof-logger is
always up to date when present. It's not clear from cmake's
ExternalProject documentation why that is the case. In any case
BUILD_ALWAYS fixes the issue and takes very little time because it does
not rebuild sof-logger from scratch. BUILD_ALWAYS is already used for
XTOS.

Fixes commit f6c71c21d0 ("zephyr/CMakeLists.txt: build smex and
sof-logger")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-12-03 10:21:20 +00:00
Iuliana Prodan a79614295f zephyr: build: add support for imx8m
Build SOF with Zephyr for i.MX8MP platform.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-10-04 10:34:26 +03:00
Iuliana Prodan 0065719234 zephyr: add cache_attr.c in zephyr_library_sources
COMPILER_WORKAROUND_CACHE_ATTR is also enabled on Zephyr,
but the cache_attr.c file is not compiled since is not added in
zephyr_library_sources.

Without this fix, we get:
cache.h:110: undefined reference to `glb_is_cached'

I've added the file for all platforms since cache_attr.c is generic.


Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-08-27 14:00:10 +01:00
Rander Wang 23c0839e4a ipc: share some utility functions for ipc4 path
Ipc3 & Ipc4 will share some component operations.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-08-03 15:17:37 +01:00
Iuliana Prodan 65a33a537c zephyr: imx: enable second level interrupts handling
On i.MX the DMA interrupts are routed via IRQ_STEER.
In order for this to work we need to:
- make any second level interrupts handling go
through interrupt-irqsteer.c;
- use first level interrupt handling from
wrapper.c.

TODO: Implement a driver for the IRQ_STEER in Zephyr,
to replace the legacy code (interrupt-irqsteer.c).

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-07-27 14:43:44 +01:00
Iuliana Prodan daa122f7c2 zephyr: imx: use ll_schedule instead of zephyr_ll
For now, zephyr_ll is limited to timer_domain.

For i.MX we use dma_domain, so keep the ll_schedule
from SOF, until we extend the zephyr_ll for DMA_IRQ.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-07-27 14:43:44 +01:00
Iuliana Prodan b96077cde0 zephyr: intel: remove zephyr_ll from mandatory files
Remove zephyr_ll.c from mandatory files for building
SOF with Zephyr and include it where necessary: in CAVS 1.5,
CAVS 1.8, CAVS 2.0 and CAVS 2.5.

While here, add ll_schedule for BROADWELL and BAYTRAIL
when building SOF with Zephyr.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-07-27 14:43:44 +01:00
Seppo Ingalsuo 4f8cf51b6f Drivers: Intel: DMIC: Add NHLT binary data based configuration
This patch adds to DMIC driver support for binary data based HW
registers setup. The driver mode is selected in Kconfig.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-07-19 13:17:49 +01:00
Seppo Ingalsuo c5f50f533f Drivers: Intel: DMIC: Separate decimation filters setup computation
This patch moves the run-time decimation factors search and filter
coefficients scaling code to separate module as preparation to add
more functionality to the driver. There are no changes to
functionality.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-07-19 13:17:49 +01:00
Seppo Ingalsuo 922cb6af7c Drivers: Intel: DMIC: Move driver code to subdirectory dmic
In preparation for more functionality the module is moved
to own directory similarly as other DAI drivers.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2021-07-19 13:17:49 +01:00
Marc Herbert f6c71c21d0 zephyr/CMakeLists.txt: build smex and sof-logger
Temporary solution until we switch to the Zephyr logger.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-07-13 15:56:49 +01:00
Marc Herbert 6c9bbd6fef zephyr/CMakeLists.txt: explain why we need if(CONFIG_SOF)
Not obvious plus many SOF developers are new to west.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-07-13 15:56:49 +01:00
Iuliana Prodan 894f28fbda zephyr: build: add initial support for imx
Build SOF with Zephyr for i.MX platforms.

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
2021-07-06 14:22:37 +03:00
Guennadi Liakhovetski a439ea93f6 zephyr: ll-schedule: switch over to a simplified implementation
Switch SOF under Zephyr to use a simplified native low-latency
scheduler implementation.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-07-02 14:10:30 +01:00
Liam Girdwood d62e9267f6 ipc: split IPC major code into IPC specific directories
Prepare for supporting new IPC major versions by partitioning
IPC code into directories.

This is a code move only, no code changes except Makefiles.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-05-31 13:08:20 +01:00
Liam Girdwood 45918aa19b dai: abstract the DAI hardware configuration
Currently the DAI HW configuration is tightly bound to the IPC major
version and IPC structures. Provide a mechanism whereby different
IPC data structures can be passed for DAI configuration.

This change does the following changes.

1) Pass a common ipc_config_dai structure to all dai config call. This
allows retention of common logic that uses this common data.

2) Provide a IPC specific private data pointer to the dai config that
can be interpreted by the DAI as custom data. Today this is the
existing IPC, but it could also support an NHLT binary register blob in
the future.

3) Splits ipc specific code out of src/audio/dai.c and into
src/ipc/ipc3-dai.c.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-05-20 14:01:34 +01:00
Guennadi Liakhovetski f1f5abab0d zephyr: split timer domain
timer_domain.c contains a lot of Zephyr- and XTOS-specific code and
relatively little common code. Aplit it into two files instead of
using a large number of #ifdef instructions.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-20 12:41:07 +01:00
Kai Vehmanen bc6888ecab zephyr: add sample-smart-amp component to the wrapper
Add the sample-smart-amp to the wrapper build if the component
is enabled in build config.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-05-06 14:45:05 +01:00
Guennadi Liakhovetski 385586a5f6 zephyr: implement IDC using P4WQ
When running on Zephyr we use P4WQ to implement inter-core
messaging.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-05 11:03:35 +01:00
Guennadi Liakhovetski 3e8526110c zephyr: fix build: add a missing IPC file
Commit b3f195e92a ("zephyr: fix build with recent file name
changes.") partially fixed a regression, caused by 4e436f8570
("ipc: split out ipc functions into separate files.")
partially. This patch completes the fix.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-04-22 14:03:49 +01:00
yxh 5447a4f7b1 cmake file: PLATFORM variable is empty
When CONFIG_LIBRARY is enabled, but the architecture that
exists in sof is not enabled, the "PLATFORM" variable in
the zephyr\CMakeLists.txt file is empty, resulting in an
error in the include path.
The modification here is to get the correct include
path under this condition

Signed-off-by: yxh <yangxiaohuamail@gmail.com>
2021-04-21 09:18:14 +01:00
Liam Girdwood b3f195e92a zephyr: fix build with recent file name changes.
Align the Zephyr build to recent file name changes.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-04-19 14:46:10 +01:00
Marc Herbert 5aeb29b554 zephyr/cmake: stop trying to build removed pipeline_static.c
Fixes commit 093589899a ("pipeline: remove legacy static pipeline
support") that broke zephyr compilation.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-04-05 11:42:33 +03:00
Liam Girdwood 4875c44609 pipeline: split pipeline up by function.
Split the pipeline logic up into stream, params, graph, scheduling and xrun
so that it easier to follow and understand. This is to help on the TSC work
to integrate the codec adaptor into core logic.

This PR is all mechanical code moves. There are NO functional changes. Some
function that were static are now public.

Followup patches will add more documentation updates alongside.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-04-01 21:46:29 +01:00
Anas Nashif f4e4ca752a Revert "zephyr: fixed cached rimage path"
This reverts commit f4c9c28bc5.

This is no longer needed as we removed local copy of rimage from
zephyr/ext.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2021-02-11 20:19:15 +00:00
Guennadi Liakhovetski f4c9c28bc5 zephyr: fixed cached rimage path
Fix the cached rimage path to the temporary cloned rimage location.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-22 13:35:29 +00:00
Guennadi Liakhovetski b580a787da zephyr: update for unsupported arch builds
Add some files from src/platform/library/ to generic arch
builds with Zephyr.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-11 16:11:42 +00:00
Guennadi Liakhovetski 7531d6bd07 zephyr: add a cache variable with a rimage configuration path
zephyr needs a path to rimage configuration files, add it to
cmake cache.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-01-08 10:24:07 +00:00
Guennadi Liakhovetski c8ae78ab0e zephyr: fix a path to a header, build LPS conditionally
Use a correct path to the cAVS memory.h header, build cAVS LPS
only when the respective Kconfig option is selected.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-11-27 16:32:32 +00:00
Guennadi Liakhovetski ddbf5255d2 zephyr: set ARCH to "host" when not building for Xtensa
When building for unsupported architectures under Zephyr set ARCH
to "host" to use generic headers.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-11-21 16:22:54 +00:00
Guennadi Liakhovetski 375a46d176 zephyr: only build trace support if enabled in the configuration
Files under src/trace should only be built if CONFIG_TRACE is selected
in configuration.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-11-18 11:37:37 +00:00
Guennadi Liakhovetski b672923809 zephyr: adjust for new location of audio component samples
Audio component samples have been moved to a new location, fix Zephyr
builds to account for it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-10-23 10:16:55 +01:00
Karol Trzcinski 095e3ac8ae ipc: Remove probe_support from mailbox
This information is already provided by extended manifest,
so there is no need to double it in runtime code.
It allows to save 28 bytes from .DATA and  128 bytes from .TEXT
for cnl platform.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-12 11:41:11 +01:00
Karol Trzcinski 737bdb877f ipc: Remove cc_version from mailbox
This information is already provided by extended manifest,
so there is no need to double it in runtime code.
It allows to save 92 bytes from .DATA and 128 bytes from .TEXT
for cnl platform.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
2020-10-12 11:41:11 +01:00
Guennadi Liakhovetski fa5eee2463 zephyr: fix iir and fir file renaming
Two recent commits moved and renamed some of eq-iir and eq-fir files,
without updating zephyr cmake files.

fixes ab4a608198 ("Audio: Move FIR core to math library")
fixes baa43558f6 ("sof: math: move iir_df2t function to src/math")
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2020-09-15 09:40:23 +01:00
Liam Girdwood 87c23eb3ce zephyr: fix build for new sof git hashes.
Git hashes need exported for Zephyr build.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2020-08-25 09:47:10 +01:00
Liam Girdwood 4b2edf8eed zephyr: wrapper: complete zephyr support for working audio
This patch finalises the wrapper to allow LL scheduling of
timer domain audio, EDF sccheduling of IPC, trace re-direction
and kconfig build support.

There are still many items that are WIP and have been marked with
TODO: comments.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2020-08-14 15:07:34 +01:00
Liam Girdwood 207c6fdbee zephyr: add wrappers to bridge between Zephyr and SOF APIs.
Add a wrapper to convert SOF API calls to Zephyr equivalents. This allows
development to continue in parallel with xtos/HAL and Zephyr RTOSes until
parity is reached.

The initlial Zephyr APIs to be used are HAL, boot, IRQs, scheduling and
memory. The wrapper reflects this and will probably grow until feature
parity is reached when it can be deleted (as Zephyr APIs can be used
directly).

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2020-04-21 20:34:34 +01:00
Liam Girdwood de41202f8f zephyr: build: Add initial build support for SOF application.
Builds an initial Zephyr SOF audio module. This will be the starting
point for the porting work.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2020-04-16 21:01:43 +01:00