Add Zephyr version of sof/trace/preproc.h interface. The full
preproc.h interface needed for CONFIG_TRACE is not duplicated
here, so this commit effectively prevents using CONFIG_TRACE
in Zephyr.
Link: https://github.com/thesofproject/sof/issues/9015
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Add Zephyr version of sof/init.h. This is used define main
entry points to the SOF application. The arch_init() entry
point is not needed on Zephyr.
Link: https://github.com/thesofproject/sof/issues/9015
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
The alloc.h header depends on PLATFORM_DCACHE_ALIGN, but does not
include sof/lib/memory.h, but relies for the definition to be
available indirectly. Fix this and make the include statement
explicit.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
In order to avoid first level interrupt handling from
wrapper.c second level interrupt handling go through interrupt.c
define macros to rename the duplicated functions
Signed-off-by: DineshKumar Kalva <DineshKumar.Kalva@amd.com>
Add a note to Zephyr sof/lib/dma.h explaining the relation of
SOF and Zephyr DMA interfaces and warn about the name space overlaps
that exist. Also enumerate the main usage scenarios that have
to be handled in this file.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
The SOF DMA RTOS interface is one of the largest and also one of the
hardest to maintain, as it's used a lot in SOF, and there is unfortunate
overlap in interface naming between Zephyr and XTOS.
To get the cleanup work started, branch out the sof/lib/dma.h for Zephyr
and remove the conditional definitions from both versions. This patch
maintains support for all build variants, including building SOF with
Zephyr but using XTOS drivers.
Link: https://github.com/thesofproject/sof/issues/9015
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Implement sof/lib/memory.h for Zephyr build and do not rely on
the xtos version for Zephyr builds.
Link: https://github.com/thesofproject/sof/issues/9015
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
SOF defines a pm_runtime.h interface that consists of a RTOS
layer and a platform specific layer.
So far, the interface has been used in driver code and a very
small set of audio modules (e.g. key phrase buffer in kpb.c).
The platform layer has only been implemented on Intel platforms.
A no-op implementation is used for other platforms.
As all Intel platforms have moved to Zephyr, this now allows to
simplify the code a lot for SOF Zephyr builds and drop all
dependencies to the pm_runtime.h platform layer. With Zephyr,
the drivers are defined on Zephyr side and the device runtime
management can be handled with Zephyr device interfaces.
This patch removes all use of the pm_runtime.h platform layer in Zephyr
builds and replaces linkage of generic sof/src/lib/pm_runtime.c with
sof/zephyr/lib/pm_runtime.c. The Zephyr sof/lib/pm_runtime.h provides
sufficient functionality to cover all uses of pm_runtime interface in
SOF application code (e.g. init and kbp).
The changes simplify the codebase and reduce the amount of
boilerplate code needed to add new hardware targets to SOF, when
Zephyr is used as the RTOS.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Introduce a separate file for Zephyr compiler_attributes.h and
move all Zephyr-specific definitions to this file. This is
a prerequisite to build with CONFIG_SOF_ZEPHYR_STRICT_HEADERS=y.
Link: https://github.com/thesofproject/sof/issues/9015
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Definitions of mm_heap.h interface are not needed in Zephyr builds. To
avoid pulling in XTOS definitions when building with
CONFIG_SOF_ZEPHYR_STRICT_HEADERS=n, add a no-op version for Zephyr.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
The RTOS layer should provide the same interface for all OS'es.
Currently rtos/mutex.h is only defined for XTOS. Add rtos/mutex.h
also for Zephyr to allow generic SOF code to use this interface.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
In certain configurations "asm" breaks compilation, use "__asm__"
instead.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
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>
The imx-related macro logic from `interrupt_get_irq` can be
simplified. Now that `CONFIG_IMX93_A55` selects `CONFIG_IMX`,
`interrupt_get_irq` should return the INTID for all imx platforms
except for imx8m, which is yet to be transitioned to zephyr
native drivers.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Switch to Zephyr native drivers and timer domain. This
includes:
1) Switching all imx8ulp topologies to timer domain.
2) Disabling Zephyr DMA domain
3) Various interrupt-related fixes via Kconfig-related
ifdef logic.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
This commit includes all necessary changes for switching
to timer domain and Zephyr native drivers on imx8 and imx8x.
This consists of:
1) Switching all imx8 topologies to timer domain.
2) Disabling Zephyr DMA domain
3) Various interrupt-related fixes via Kconfig-related
ifdef logic.
This commit includes all necessary changes for switching
to native Zephyr drivers on imx8/imx8x.
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
For Zephyr builds, only definition needed from platform/drivers/idc.h
was prototype for idc_send_msg(). There's no need to keep the platform
layer just for this, so add the definition to rtos/idc.h for Zephyr
builds, and remove the platform/drivers/idc.h for all Intel platforms.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
The interrupt.h interface is no longer used by any Intel platform
as all drivers have been replaced with native Zephyr drivers, so these
definitions are no longer needed.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
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>