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>
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>
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>
Replace the comp_drv ops for the mixin component to use the
module_adapter interface. The trigger and get_attribute ops are replaced
with the module_adapter ops which do the exact same thing. The base_cfg
field from struct mixin_data is removed as it is replaced with the
base_cfg in struct module_config and all users have been updated.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Convert the mixout module to use the module adapter. The
bind/unbind/get_attribute ops in the mixout module have been moved to the
module_adapter ops and is functionally the same as with the comp_drv
ops.
The struct mixout_data struct has been simplified to contain 2 fields as
the source info table has been moved to struct processing_module and
rename the consumed_yet_not_produced_frames field in struct mixout_data
to pending_frames.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
CMake 3.21 changed the order object files are passed the linker. This
breaks build reproducibility.
Signed-off-by: Marc Herbert <marc.herbert@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>
This file needs the clk.h APIs, so include the header. Don't include
the Xtensa cache.h, as it's unused (and not supposed to be, zephyr.c
is portable code). Use the proper interrupt en/disable APIs instead
of the SOC-level calls they wrap.
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>
Adopt module interface for src component.
IPC3 has compatibility issues, it continues to use comp_driver.
Convert to module adapter only for IPC4.
Signed-off-by: Gongjun Song <gongjun.song@intel.com>
L3 memory should support have support
for allocating/freeing memory
A heap support in L3 is introduced by
this commit
Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
The heap size def should not be in alloc.c
This is a platform specific setting
Also (unused by now) macros regarding IMR bootloader
have been removed - moved to Zephyr
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
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>
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>
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>
Adjust PATH to give precedence to any local sparse. New precedence:
1. zephyr-workspace
2. /opt/sparse/bin
3. Anything else in default PATH
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Logging what the container is made of will help diagnose binary
incompatibilities or other problems.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
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>
In zephyr ipc3 case, the first heap allocation come too early
and zephyr logging even is not initialized, it cause sof boot failure.
Limit heap status collection for zephyr+ipc4 only.
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
Heap memory profiling is based on runtime zephyr API.
It will print out each memory allocation with allocated bytes
and free bytes, display as below:
zephyr: heap allocatd: 22c0 free: 152a90 max allocated: 1000
Signed-off-by: Baofeng Tian <baofeng.tian@intel.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>
D3 (PM_STATE_SOFT_OFF) state can be only entered after IPC request from
host. That why this prevent should be permanent.
D0i3 (PM_STATE_RUNTIME_IDLE) can be entered if host allows it and under
special conditions. State is prevented by default. Host will remove this
prevent with dedicated IPC message.
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
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>
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>
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>