MCLK and BCLK can be set/release separately. We can set/release mclk/bclk
more flexible with these helpers.
The helpers are defined after the Linux ones, 'prepare_enable' will
first select the relevant resources then enable the clock
output. Conversely 'disable_unprepare' will stop the clock output then
release the clock resources.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Add two clks_control bits. MCLK and/or BCLK will start during hw_params
and stop during hw_free if the corresponding bit is set.
This is tagged as a ABI 3.19 change.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
The DAI_CONFIG IPC is currently used both for hw_params and
hw_free. For some DAIs, there are hacky ways with e.g. invalid DMA
channels to indicate a hw_free. Rather than adding a new IPC for
hw_params and hw_free, let's add a flag that indicates if the
DAI_CONFIG is really applied during a hw_params or hw_free stage.
This is tagged as a ABI 3.19 change.
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
when the bclk is not based on the default source, we will thrown an
error message but return the result of the mclk configuration.
Fix by adding an explicit -EINVAL return value.
Reported-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
SOF under Zephyr has switched over to a separate LL scheduler, this
code isn't used any longer, remove it.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This reverts commit af6655e7fa.
That commit removed disabling interrupts in
pipeline_schedule_triggered() which is usually fine, except if an
xrun happens during pipeline_schedule_copy() which then removes the
task from the scheduler list, it then leads to a DSP exception in
pipeline_schedule_copy() is called for the next pipeline in the list.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Anyone having a performance issue can use the standard
-DCMAKE_BUILD_TYPE=Release. Crashes seem more common.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Before:
error: unable to open sof.elf for reading: 2
After:
error: unable to open sof.elf for reading: No such file or directory
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
When building SOF with Zephyr, for i.MX, we get the following
error: undefined reference to `z_xtensa_cache_inv'.
i.MX has only one DSP core, so CONFIG_KERNEL_COHERENCE is not set.
Therefore include arch/xtensa/cache.h, where z_xtensa_cache_inv
is defined and implemented, in cases when the kernel is not built in
a mode where all shared data is placed in uncached memory.
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
When building SOF with Zephyr for i.MX the following
additional adjustments, to the wrapper, are required:
1. include heapmem variable in .heap_mem section,
otherwise the HEAP_SIZE is duplicated in two sections and
the sdram0 region overflows;
2. no need to split heap into shared and unshared since
we only have 1 DSP core; In this case, the kernel will
never be built in a mode where all shared data is placed
in multiprocessor-coherent (generally "uncached") memory.
3. use simple interrupt_get_irq() to get the Linux interrupt
and later pass it to irq_steer;
4. use Xtensa timer, as we do now with SOF and XTOS.
Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
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>