Implement sof/lib/dai.h for Zephyr build and do not rely o
the xtos version for Zephyr builds. Add a warning to catch
invalid build configurations.
Link: https://github.com/thesofproject/sof/issues/9015
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
In the case where the copier has more than one output and,
additionally, we will be using a pin other than pin 0
(for example, when we want to copy data from pin 1 of
a gateway-type copier to the next pipeline), it is necessary
to copy data in playback path from the source to the output
for all possible active sinks.
Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
Adds a channel map parameter to conversion functions, allowing for
the introduction of conversions that can handle both format conversion
and channel remapping.
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
When compiled with '-std=c99' or newer 'typeof' is unavailable and
'__typeof__' should be used instead [1].
[1] https://gcc.gnu.org/onlinedocs/gcc/Alternate-Keywords.html
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Make the filename argument be a const char * to avoid the following
warning with c++ compliation:
warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Except for trace file, there is no usage for META in sof
source code, posix and xtos are all aligned with zephyr definiton.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
The Pulse Density Modulated Microphone Interface (MICFIL) is a popular
way to deliver audio from microphones to the processor in several
applications, such as mobile telephones. However, current digital-audio
systems use multibit audio signal (also known as multibit PCM) to
represent the signal. This block implements the required digital
interface to provide a 24-bits audio signal from a PDM microphone
bitstream in a configurable output sampling rate.
This patch adds initial support for PDM MICFIL IP found on i.MX8MP
board.
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
Host based mailbox needs to be fixed in another place. It's here
now until rtos partitioning is done.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
add peak mcps counter to indicate which period have max mcps.
Also changed sample_cnt to period_cnt to make name more sense.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
To support pipelines connection between cores, ipc4_create_buffer()
must be able to create buffer shared between source and sink
components created on different cores. ipc4_create_buffer() requires
source component obs size. When both source and sink components
created on same core, ipc4_create_buffer() is executed on that core,
otherwise it is executed of core 0 (IPC processing core). So for the
case when source and sink components are created on different cores
comp_get_attribute_remote() is used to receive source obs size.
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
bind/unbind handler must be called from core on which component was
created.
When both source and sink components are created on same core,
bind/unbind IPC is processed on that core. However, when connected
source and sink are on different cores, IPC is processed on core 0.
Hence comp_bind_remote() and comp_unbide_remote() is added to call
bind/unbide from proper core.
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
Previously, due to cycle get max is UINT32_MAX, so check
and wrap cycles based on INT32_MAX, however, unsigned int can wrap
automatically with minus, remove the check and make
perf difference calculation more simple.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Add a new DMA copy function, dma_buffer_copy_from_no_consume(), that can
be used to copy from the DMA buffer to the sink without modifying the
read pointer in the DMA buffer. This will be used when the DMA data
needs to be copied to multiple sink buffers. The DMA buffer pointer
should be updated at the end of all copies in this case.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
__packed and __aligned are defined in compiler_attributes.h, which
wasn't included, and when building for Zephyr that needs to include
the zephyr/toolchain.h header which is the original source of those
macros.
Transitive headers were saving this, but building for posix/fuzzing
works differently.
Signed-off-by: Andy Ross <andyross@google.com>
select_cpu_clock() on cAVS currently takes all the clock locks while
adjusting them. And that function is called from clock_set_freq()
which also takes one of those locks, which leads to a recursive
spin-lock. To fix that remove per-clock spin-locks and use a global
clock lock instead.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The purpose of this commit is to get rid of the dependency
on xtos/include/sof/lib/io.h when building SOF for Zephyr.
Apart from that, this commit solves or gets us closer to
solving the following issues:
1) Compiling SOF for arm64 architecture results
in warnings such as the following:
"warning: cast to pointer from integer
of different size [-Wint-to-pointer-cast]"
2) Enabling CONFIG_SOF_ZEPHYR_STRICT_HEADERS will
result in a compilation error. One of the causes
for this is the fact that sof/lib/io.h doesn't
exist.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
The naming scheme used for the 64-bit read/write function is
not consistent with the naming scheme used for the other
read/write functions. This commit fixes this.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Add Asynchronous Messaging Service. This can be used to communicate between
modules.
Asynchronous Messages are one-way messages from one producer to one or
multiple registered consumers. Messages between modules on different
cores are sent through IDC. All inter-core communication must be proxied
by the main core.
Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
The purpose of this commit is to separate the XTOS-specifc
code from the Zephyr-specifc code found in sof/drivers/idc.h.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
The purpose of this commit is to separate XTOS-specific code
from the Zephyr-specific code found in sof/schedule/task.h.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
The purpose of this commit is to separate the XTOS-specifc
code from the Zephyr-specifc code found in sof/sof.h.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Since sof/debug/panic.h has been removed, the only file which should
be including arch/debug/panic.h is XTOS's rtos/panic.h. This commit
removes the forced "#define __SOF_DEBUG_PANIC_H__" from rtos/panic.h
and makes all arch/debug/panic.h files include-able from rtos/panic.h.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Since all sof/debug/panic.h does is it includes rtos/panic.h
why not just simply replace sof/debug/panic.h with rtos/panic.h?
This commit does exactly that.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
The purpose of this commit is to separate Zephyr-specific definitions
from XTOS-specific definitions. Based on the build, <rtos/panic.h>
will contain the required definitions.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
To statically initialise a list do something like
static struct list_item item = LIST_INIT(item);
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This macro integrates SOF modules into Zephyr initialisation
framework. SOF module initialisation functions use
DECLARE_MODULE_ADAPTER() or DECLARE_MODULE() to register with the SOF
native initialisation scheme, now the same initialisation functions
can be used with the new SOF_MODULE_INIT() macro to integrate them
into the Zephyr initialisation flow.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
It uses spin lock to support mutex.
Suggested-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Suggested-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Rander Wang <rander.wang@intel.com>
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>
Use Zephyrs dma_get_attribute when using Zephyr native drivers.
After switching to dma_get_attribute from Zephyr,
local copy of get_attribute function for dw and alh
in ace platform is no longer necessary.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Since zephyr does not support reading the period count
attribute from dma, this value has been moved to
dma_plat_data.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
This commit prepares for the introduction of the
dma_get_attribute function in Zephyr.
The dma_get_attribute function was renamed to
dma_get_attribute_legacy. Fixed all existing calls to it.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
PERFORMANCE_COUNTERS_RUN_AVERAGE is not an independent macro,
it depend on: PERFORMANCE_COUNTERS, so it is duplicated,
remove this macro and use one macro to control this module,
also reduced unnecessary profiling log print.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Current hw cycle is based on 38400000, and perf cnt module did not consider
the clock wrap case, i.e the later cycle maybe small than the previous one.
so add code to handle this situation.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
This patch is used to make sure profiling code only can be run
with performance profiling build, and unify all performance profiling
with same format and usage.
Signed-off-by: Baofeng Tian <baofeng.tian@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>
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>
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>