Use the Zephyr sys/util.h when Zephyr RTOS is used.
While here, remove sof/lib/cpu.h which is not used.
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Zephyr already uses main() and has already performed
a lot of initialization before entering SOF.
Split initialization, for i.MX platforms, to make sure
no operation is repeated.
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
This patch adds init_done status check at the very end of
cadence_codec_prepare() function. This is needed to know if
codec is fully prepared for the processing or not. Note we don't
do anything with the value read at prepare, we postpone final
verification until copy/process time since some codec variants
require input in order to finish its initialization.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This patch simplifies reset procedure of cadence codecs
by only calling the init_process() function in which
XA_CMD_TYPE_INIT_PROCESS is the API call responsible for
the actual reset of codec parameters.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
After the reset codec should not need to be prepared again.
We want reset procedure to just set all the parameters to their
default values.
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
Switch SOF under Zephyr to use a simplified native low-latency
scheduler implementation.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Currently a global semaphore is used to signal all schedulers on all
cores, waiting for the next timer period. A more reliable solution is
using a per-core semaphore. This patch switched over to that
approach.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Under Zephyr LL scheduling is implemented by per-core threads. They
are spawned when the first task on that core is scheduled. When the
last task on that core is completed, the thread is terminated, which
can happen in context of that very thread. This patch adapts the
generic LL scheduler code and the Zephyr LL domain scheduler for
that by making sure to call thread termination in a consistent state.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
zephyr_domain.c is a drop-in replacement for timer_domain.c. To avoid
modifying initialisation code we used the same timer_domain_init()
name for its initialisation function. However, the rest of the file
uses the zephyr_domain_* namespace. Rename the function to stay
within the same namespace and use a macro to redirect the call.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
.next_tick has to be initialised at domain registration and updated
on each scheduling domain event.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
When the .domain_unregister() method is called, .total_num_tasks is
still positive, it will only become 0 for the last task after
.domain_unregister() returns. When cleaning up also set the user
pointer to NULL.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
For some reason s32le does not work for DAI definitions on JSL-NOCODEC
platforms. alsa-bat tests fail, but they work fine on APL, CNL,
TGL. This is likely to be an ICL platform issue. The root cause is
still TBD
Use s24le for now to unlock Intel daily tests.
All other platforms remain with s32le.
BugLink: https://github.com/thesofproject/sof/issues/4427
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Revert these for now. Will be fixed with other multi-core fixes.
This reverts commit 928dba0853.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
With Zephyr linker scripts updated on all cAVS platforms, we can now
unify uncache_to_cache() and cached_to_uncache() implementation in
Zephyr builds.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
... down from ERROR. It was never an error, this was a hack to be
duplicated to both trace and etrace. This will make it easier to search
for actual errors.
Also make the banners slightly different between etrace and trace thanks
to new SHM: and DMA: prefixes. This makes identification of log files
easier.
Signed-off-by: Marc Herbert <marc.herbert@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>
Returns a small constant instead of crashing platform_timer_get() when
timer is NULL.
This is required to restore early tracing before sof->timer is
initialized.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Found by chance while looking for something else.
This makes no difference right now because we checked the "length" in
the line immediately before but let's do the right thing anyway, at the
very least it's more readable.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Add matching comp_data_blob_handler_free calls for
comp_data_blob_handler_new in error paths, which are
missing in many components' "new" functions.
Signed-off-by: Li-Yu Yu <aaronyu@google.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>
Reword doxygen comments and change the private helper function
names to better reflect the actual implementation. No functional
change.
The PM_RUNTIME_HOST_DMA_L1 resource is used to coordinate host DMA
users, so that DMI link is kept in L1 until all users are ready to
activate the link. This is a bit unusual usage of runtime-pm interface
in that a 'put on a resource' triggers transition to higher power state,
so this deserves some more documentation.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Buffer and params not initialised to zero like the other IPC structures
used by testbench. Fix this.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This enables support for running the allocator mocks with valgrind by
building the allocator for the host library target using a similar
heap map to Intel CAVS targets (memory.c is almost identical copy of CAVS
version).
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This makes it possible to match the table with the definitions.
Pure comment change, no code change.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
If the core is not up, the comp exist in the comp_list.
So no need to check if the core is up.
This reverts commit bccecb1a8e.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.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>
Disable dmic interrupts first followed freeing by the dmic task
and finally, free the dmic pdata.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Buffer lists were being deleted twice, at first by the
pipeline_disconnect() (the correct place) and then by buffer_free().
Fix this so buffer_free() only frees the buffer.
==426365== Invalid write of size 8
==426365== at 0x49CB47B: list_item_del (list.h:57)
==426365== by 0x49CB47B: buffer_free (buffer.c:179)
==426365== by 0x49C8C7B: ipc_buffer_free (helper.c:697)
==426365== by 0x10C1E6: free_comps (testbench.c:165)
==426365== by 0x10C1E6: main (testbench.c:415)
==426365== Address 0x4bdce48 is 152 bytes inside a block of size 168 free'd
==426365== at 0x484521F: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==426365== by 0x49C9163: comp_free (component_ext.h:55)
==426365== by 0x49C9163: ipc_comp_free (helper.c:866)
==426365== by 0x10C200: free_comps (testbench.c:162)
==426365== by 0x10C200: main (testbench.c:415)
==426365== Block was alloc'd at
==426365== at 0x4847A25: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==426365== by 0x10D4E8: comp_alloc (component.h:548)
==426365== by 0x10D4E8: file_new (file.c:430)
==426365== by 0x49C81E7: comp_new (helper.c:423)
==426365== by 0x49C8F0F: ipc_comp_new (helper.c:823)
==426365== by 0x10E642: load_fileread (topology.c:323)
==426365== by 0x49E13A0: load_widget (tplg_parser.c:1281)
==426365== by 0x10F796: parse_topology (topology.c:779)
==426365== by 0x10BE76: main (testbench.c:310)
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
DAI config IPC is propagated to all DAI comps scheduled on
all cores but it should only be done if the secondary core is
enabled.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Make them shared between cores as they can be shared with
other pipelines, trace and possibly even DMA.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
When a secondary core is disabled and re-enabled without a
D3 cycle, the POWER_UP IDC message end up reading the trace
point message from the first boot. Reset it during power down
to avoid this.
Suggested-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Pipeline components will be freed by the host before the
pipeline widget itself is freed. No need to walk the pipeline
and free anything during pipeline_free().
Fix the unit tests to remove the tests that are not relevant anymore.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
edf_sh->list is not an item. So calling list_itel_del()
on it is wrong in scheduler_free_edf().
remove list_init() from scheduler_free_edf() as the list
should already be free and initialized.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Check and return error if enabling a core fails instead
of overwriting the error with a subsequent successful
core power up.
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Move the existing sof-apl-nocodec to the development folder, in case
SOF CI still wants to use it.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>