The BUILD_VM_ROM option only affects SOF XTOS builds, so move
the option to a separate file.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Some of the DEBUG options are only used in the XTOS implementation
and do not impact e.g. Zephyr builds. Make the split explicit by
moving these options to a separate file.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
The dd and dai_spec_config need to be shared among DSP cores, allocate
them in RUNTIME_SHARED area.
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
The DMA channels need to be shared among pipelines and DSP cores,
allocate buffer for it in RUNTIME_SHARED area.
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
We used to do this in Travis, see commit 7072eb4447 ("travis: run
build-tools.sh with CMAKE_BUILD_TYPE=Release") and older.
Related to issue #4141 build-tools.sh -T does not build development
topologies.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
gcc does not know that we already filtered unreasonable precision
values.
Increase the size of the temporary string from 32 bytes to 64
bytes. We're running on the host, memory is cheap.
Fixes commit d6f6a456c1 ("logger: fix column and header alignments")
For some reason CMake uses -Werror=format-truncation only in Release
mode.
Avoids the following warning:
```
sof/tools/logger/convert.c: In function ‘fetch_entry’:
sof/tools/logger/convert.c:514:27: error: ‘%d’ directive output may be
truncated writing between 1 and 10 bytes into a region of size
between 0 and 18 [-Werror=format-truncation=]
514 | "%%s[%%%d.%df] (%%%d.%df)%%s ",
| ^~
sof/tools/logger/convert.c:514:6: note: directive argument in the
range [0, 2147483647]
514 | "%%s[%%%d.%df] (%%%d.%df)%%s ",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:867,
from sof/tools/logger/convert.h:13,
from sof/tools/logger/convert.c:21:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10:
note: ‘__builtin___snprintf_chk’ output between 21 and 59 bytes into
a destination of size 32
67 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
68 | __bos (__s), __fmt, __va_arg_pack ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
```
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Remove definition of s24_4le from COMP_SAMPLE_SIZE macro as it is not
used anywhere. Instead all pipelines are using s24le definition and the
COMP_SAMPLE_SIZE macro works only because it defaults to 4 bytes.
Signed-off-by: Jaska Uimonen <jaska.uimonen@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>
In scheduler_free_ll() sch->tasks is a list head, not a list item.
Use list_init() instead of list_item_del() to initialise it.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
schedule_ll_task_cancel() looks for a task on the list to cancel it.
However, if it doesn't find the task on the list it still sets its
status and deletes it from the list. Currently this doesn't cause
any problems, but it's potentially dangerous. This function can be
called for completed tasks, which are no longer on the list. So
list_item_del() will be called for the second time for it. Currently
this isn't a problem because SOF implementation of that function
also initialises the list head, but not all doubly-linked list
implementations do that. E.g. Zephyr's sys_dlist_remove() nullifies
both .next and .prev, so, a repeated call to it would cause a
NULL dereference. In general it's safer to only modify an element
when it has been verified to be valid.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
The list isn't modified in schedule_ll_clients_reschedule() when
scanning it for the earliest task, replace list_for_item_safe()
with the usual list_for_item().
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.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>
The hdr variable in ipc_compact_read_msg() initially points to data
on stack, and then that variable is returned from the function,
creating an impression of a bug. However, that isn't a bug because
it is only returned from the function if it is overwritten to point
to a different data block, this time not on stack. Trivially
simplify the function to eliminate the confusion.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
When built under Zephyr the wrong format generates a compiler
warning:
modules/audio/sof/zephyr/include/sof/trace/trace.h:35:11: warning: \
format '%d' expects argument of type 'int', but argument 3 has \
type 'uint64_t'
Since native SOF tracing cannot print 64-bit data, only print the
low 32 bits of the time interval.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
If one of the "if" branches contains a jump instruction like "goto,"
"return," "break" etc. usually making that the only "if" branch
simplifies the code. Fix one such case in schedule_ll_task().
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Several code paths use the existing clock_ms_to_ticks() function in
some not ideal ways, potentially leading to computation overhead or
to precision loss. The function is often called to calculate ticks
for 1 millisecond, which then is recalculated to the required time
interval. It's better to let the function calculate the number of
ticks for the required time interval directly. E.g. instead of
clock_ms_to_ticks(PLATFORM_DEFAULT_CLOCK, 1) * milliseconds
it's better to call
clock_ms_to_ticks(PLATFORM_DEFAULT_CLOCK, milliseconds)
directly. For microseconds however replacing
clock_ms_to_ticks(PLATFORM_DEFAULT_CLOCK, 1) * microseconds / 1000
with
clock_ms_to_ticks(PLATFORM_DEFAULT_CLOCK, microseconds / 1000)
can lead to a loss of precision. To avoid that a new function
clock_us_to_ticks() is added.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
We have some commands that fail to check the component's pipeline
pointer before running the command which results in various null pointer
dereferences across the codebase. Solution is to copy existing checks
and patch the code paths.
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
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>
To roll back SSP clock setting to original one.
igo_nr now support 48k-in-48-out and the entire pipeline
DMIC_PIPELINE_48k is reverted back to 48k too.
Signed-off-by: fy.tsuo <fy.tsuo@intelli-go.com>
The Zephyr linker scripts for cavs20/25 do not map sections
on uncached RAM, so the memory accesses to uncached memory will
fail. This shows up as a DSP panic while loading initial topology.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Add static inline for math sin() and cos()
functions.This PR is just moving existing code to
improve runtime performance due to less function calls
Signed-off-by: ShriramShastry <malladi.sastry@intel.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>
Some new lines were not removed during a recent "sed" based search and
replace. Remove them now.
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
- Replace several further "timer" name domain left-overs with zephyr
domain counterparts
- Remove useless "inline" specifier, the compiler will decide itself
- Remove the unused struct zephyr_domain::arg member
- Add delayable work cancellation when cancelling a task
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@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>
Cordic sin cos input value range is [-2*pi to 2*pi]
and output range is [-1 to +1]
This is common function to calculate trignometric sine
and cosine using separate lookup table size for speeds
and accuracy calculation.
For 32bit sine and cosine
Error (max = 0.000000011175871), THD+N = -170.152933
For 16bit sine and cosine
Error (max = 0.000061), THD+N = -91.518584
Signed-off-by: ShriramShastry <malladi.sastry@intel.com>
Add a proper namespace prefix to CONFIG_HW_LLI. While this
option is only used by DW-DMA driver at the moment, this is
a generic option, so remove the DW-DMA specific text from
top-level documentation.
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
ASRC new() receives incorrect topology tokens values before this
fix. It occurred as pipeline DAI find fail for capture direction
ASRC.
Fixes#4193
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
... because it has definitely helped reproduce compilation issues in the
past in just two lines without going through the whole setup process,
see a list of examples in #4126.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
power_down is an assembly function that powers down memory banks.
Before that it locks the execution code and data into cache for
obvious reasons. However, for this cacheable address aliases have to
be used. Under Zephyr this code executes in a thread with a
dynamically allocated stack, which currently means, that it uses
uncached memory aliases. This leads to a memory access exception.
This patch fixes it by using a cached alias of the data.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Currently conversions between cached and uncached addresses is done
by adding or subtracting the alias offset. This is unsafe because it
cannot be done repeatedly. Setting and clearing the aliasing bit is
safe, but it cannot be used in static variable initialisations. This
patch converts conversions to bitwise operations where possible and
adds a new macro for static variable initialisation and uses it where
needed.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Lets not trust that everyone remembers to lint themselves or that they
fetch the repo in order to execute their job.
Also rename workflow file to be a bit more generic
Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Fixes incomplete commit 0e60ec8da4 ("Copy sof-$platform.{ri,ldc} to
sof.{ri,ldc}"), see full rationale there. I missed the
copy/paste/diverge at the time and did it only in the MEU_SIGN case.
Signed-off-by: Marc Herbert <marc.herbert@intel.com>
This patch moves DMIC pipeline to run on DSP core 2,
and SSP1 pipelines to run on DSP core 3 for multi-core
verification.
Signed-off-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Zhang Keqiao <keqiao.zhang@linux.intel.com>
Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>