NXP's i.MX8 and Intel's CAVS are the only platforms using
Zephyr that also require the usage of drivers/interrupt.h. Since
for i.MX8 platforms drivers/interrupt.h is included through
xtos/rtos/interrupt.h, add a macro guard around the inclusion of
drivers/interrupt.h which will allow the other Zephyr platforms
(i.e: NXP's i.MX93 and Intel's ACE) to finally remove the SOF-specific
drivers/interrupt.h. This is desired because the platforms should only
rely on the Zephyr interrupt support instead of having to use
a hybrid between Zephyr and SOF interrupt support.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.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>
New IDC request idc_comp_free() is required to delete
component located on different core than the pipline to which
the module belongs.
Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
Add definitions for pipeline state change phases to be executed when a
PPL_STATE message is handled by a remote core.
The phase can be a combination of:
PREPARE and TRIGGER.
PREPARE will run a configuration (state change preparations) phase on the
pipeline
TRIGGER will run a a trigger on the pipeline
Set ONESHOT in ipc4_set_pipeline_state() to have both phases to be run in
order to avoid regression.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
In preparation to share the extension with an action, first introduce a
mask so that the idc code is prepared for a shared use of the extension.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Add virtual heap allocators that allocate on proper heaps and
map physical memory where nesscessary.
Add free function that frees up the virtual heap memory and
unmaps physical memory when possible.
Virtual heap allocator allows using virtual memory as a base
for allocation and booking memory. Physical memory banks
will be mapped when needed allowing for greater flexibility
with mapping.
Signed-off-by: Jakub Dabek <jakub.dabek@intel.com>
This will allow to correctly set multiple pipelines state
even if they are allocated on different cores.
ipc4_set_pipeline_state will check if several cores are involved
- set ppl state if only current core requested
- process IPC on another core if only single secondary core requested
- send IDC messages if several secondary cores involved
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Signed-off-by: Jaska Uimonen <jaska.uimonen@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>
Struct cascade_root & mn are used by xtos build only so remove them for
zephyr native driver. And these two items are too specific to intel
platforms. Remove these item also save memory.
Signed-off-by: Rander Wang <rander.wang@intel.com>
During PowerOff (D3) transition Zephyr Power Manager must have
a pointer in IMR to save the LP/HPSRAM memory before
powering off.
As zephyr has no access to IMR heap, the memory must
be allocated by SOF
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
Thanks to PR [1], Zephyr cache management API can now be
used on xtensa-based SoCs. As a consequence to this, there's
no longer a need to use SOF's arch/ layer for cache management.
This commit forces all SoCs which support Zephyr to use
its native cache management API.
[1]: https://github.com/zephyrproject-rtos/zephyr/pull/50136
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Informing the primary core that the Idle thread on secondary core is
ready. During the D3 exit flow thread is not initialize again, but
restored from previously saved context.
This patch includes also zephyr version update to aba3b12e31 (total 15
commits). Changes related to intel_adsp contain refactor and fixes for
ACE secondary cores power flows.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
ARM64's GIC doesn't utilize cascaded interrupts so interrupt_get_irq
will have to return the given INTID.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
This is required by ARM64 platforms as they don't have
an arch/compiler_info.h so the compilation would fail.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.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>
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>
All arch/ files should be only used by XTOS. Since the
include statement from cpu.h is not used at all we can safely
remove it. With this, we can make the split between Zephyr
and XTOS more clean.
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/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>
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>
Remove all support for Broadwell and Haswell platforms, they
aren't supported any more.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Remove all support for Baytrail and Cherrytrail platforms, they
aren't supported on the "main" branch any more. To build SOF for them
use the "table-v2.2" branch.
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>
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>
The last parameter of memcpy_s() isn't the size of the source buffer,
it's the actual number of bytes that should be copied.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.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>
The timer.h header references k_cycle_get_64(), which is defined in
kernel.h. Was previously hidden by a transitive include somewhere.
Signed-off-by: Andy Ross <andyross@google.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>
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>
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>
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>
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>
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>