Switch SOF under Zephyr to use a simplified native low-latency
scheduler implementation.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Direct access to mbox shared memory logging when DMA tracing is
either not initialized yet or disabled or found broken for any
reason.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Fixes#4356
In XTOS SOF, ipc_send_queued_msg() is run by task_main_primary_core(),
the initialization of which has a hard and circular dependency with the
initialization of the EDF scheduler. This EDF scheduler is not part of
Zephyr. Because of the circular dependency it does not seem
possible (nor desirable?) to refactor this code and make it compatible
with Zephyr. So schedule ipc_send_queued_msg() differently in Zephyr:
using a notifier triggered by the periodic Low Latency scheduler.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
To increase performance of audio application code, the SOF heap should
be mapped to cached address region on platforms with aliased
cached/uncached memory layout.
This splits the heap into two and maps the SOF_MEM_ZONE_BUFFER to
the cached heap and all rest to uncached heap.
The raw heap memory area is still mapped to uncached memory, even for
the cached heap. The allocated blocks are converted to cached addresses
and passed to SOF users of rmalloc() and rballoc_align(). To ensure
application buffers do not share cachelines with heap metadata chunks,
allocation sizes are rounded up to integer multiples of platform
cacheline size.
BugLink: https://github.com/thesofproject/sof/issues/4306
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
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>
Commit 8357dcf793 ("zephyr: trace: use zephyr utilities when enabled")
added Zephyr's sys/printk.h in order to fix:
warning: implicit declaration of function 'printk'.
Remove #ifdef __ZEPHYR__ macro since this is not needed, because
the whole file is for Zephyr only.
Fixes: 8357dcf793 ("zephyr: trace: use zephyr utilities when enabled")
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Remove redundant ret initialisation in two versions of
schedule_task_init_edf() and in schedule_task_init_ll().
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Use the Zephyr sys/printk.h when Zephyr RTOS is used.
Suggested-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
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>
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>
schedule_edf_task_cancel() should return 0 or an error code, whereas
k_work_cancel_delayable() returns flags, depending on the state of
the task being cancelled. Return value of schedule_task_cancel()
is never checked so this bug had no negative effect on SOF.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The key-phrase-buffer (kpb) component can be included in
Zephyr-based builds, but the component is not initialized
properly in the builds.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Notifier data has to be per-core and its allocation is
performed in init_system_notify(), no need to also do it in
architecture code.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
sof_main() doesn't run on secondary cores. Instead we provide
a new function, that initialises a dummy thread, runs SOF
initialisation by calling secondary_core_init() and switches
over to the dummy thread.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
When running on Zephyr, timer domain and EDF scheduling is
implemented by per-core work queues. Make sure they only run
on designated cores.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Remove a log-module declaration to eliminate unused static
variables until we return to using the LOH_* Zephyr API.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Move logging code and static data to platform/library and
declare a LOG module properly.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The use of Zephyr LOG_*() API in SOF is breaking compilation.
Replace it with with the native trace logging until a proper
fix is available.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
SOF registers IRQ handlers dynamically, therefore disabling
support for dynamic interrupts for SOF builds doesn't make
much sense. However, this can be used to at least increase
compile-time testing coverage and potentially enable
applications, not using dynamic interrupt registration.
BugLink: https://github.com/thesofproject/sof/issues/4044
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
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>
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>
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>
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>
Reference Kconfig in zephyr module file which is evaluated by Zephyr
directly. This will eliminate the need for including the SOF Kconfig
directly.
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
The Zephyr timer implementation reads high and low 32 bits
in a non-atomic way. Add a loop to make sure the read is
consistent.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Recently added platform_timer_get_atomic() has to be
implemented for Zephyr too.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Add some files from src/platform/library/ to generic arch
builds with Zephyr.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
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>
When building SOF with Zephyr for unsupported architectures
the following additional adjustments to the wrapper are required:
1. define HEAP_RUNTIME_SIZE
2. implement stubs for interrupt handlich code
3. remove arch_timer_get_system() as it's provided by a header
4. hardcode "return 0;" for platform_timer_get()
5. disable sys_module_init() which anyway isn't yet functional
under Zephyr
6. add dummy platform_init() and platform_boot_complete()
7. add log_const_sof
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
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>
Broadwell support with Zephyr had only been dry-coded, it has never
been tested, and it contains an infinite recursion bug: functions
platform_timer_get() and arch_timer_get_system() call each other
infinitely. Break the recursion formally, until a proper fix is
available.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
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>
This kconfig variable no longer exists in upstream Zephyr (the feature
it used to control is now zero-overhead and always enabled).
Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
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>
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>
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>
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>
UUID objects are represented by struct sof_uuid_entry instances in SOF.
Instead of casting pointers to them to integers for passing around,
carry them as pointers until they have to be cast to integers for
packing into data structures. This also fixes printing UUID, using a
"%pU" format.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
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>
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>
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>