Commit Graph

6467 Commits

Author SHA1 Message Date
Kai Vehmanen 9235eb8360 kconfig: move BUILD_VM_ROM Kconfig.xtos-build
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>
2021-05-25 15:53:39 +01:00
Kai Vehmanen 3541b37d46 kconfig: move XTOS build specific debug options to a separate file
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>
2021-05-25 15:53:39 +01:00
Kai Vehmanen ffe22f2831 Kconfig: move compiler options to a separate file
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-05-25 15:53:39 +01:00
Marcin Rajwa 479c09b3e9 codec_adapter: cadence: rework of reset & free procedures
This patch fixes the reset procedure of cadence codecs.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
2021-05-25 15:20:23 +01:00
Keyon Jie c8589b925c dai: allocate RUNTIME_SHARED for shared data
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>
2021-05-25 09:57:33 +08:00
Keyon Jie 9b8bb275c1 dw-dma: allocate RUNTIME_SHARED for dw_chan
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>
2021-05-25 09:57:33 +08:00
Marc Herbert fa5cc118b5 fuzzer: add deprecation README.md
As discussed in https://github.com/thesofproject/sof/pull/4132

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-05-24 15:27:18 -07:00
Marc Herbert e69e1c7eeb scripts/build-tools: some usage and other clarifications
Fixes #4141. I got tired of repeatedly having to read CMakeLists.txt
files.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-05-24 15:27:18 -07:00
Marc Herbert cc3b302797 .github: add build-tools.sh (all) back, lost with Travis
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>
2021-05-24 15:27:18 -07:00
Marc Herbert a5b3c8e36b logger: increase time_fmt[] size to avoid a gcc warning.
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>
2021-05-24 15:27:18 -07:00
Jaska Uimonen 636cbefc62 topology: add missing tokens in SSP_CONFIG_DATA
Add all same tokens to SSP_CONFIG_DATA that we have in
SSP_MULTI_CONFIG_DATA.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2021-05-24 22:02:49 +01:00
Jaska Uimonen 5cffff335d topology: remove obsolete s24_4le from COMP_SAMPLE_SIZE
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>
2021-05-24 17:07:14 +01:00
Iuliana Prodan 4475f604aa zephyr: trace: remove useless #ifdef __ZEPHYR__ macro
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>
2021-05-24 16:01:05 +01:00
Guennadi Liakhovetski 7bdbe295ef ll-scheduler: use a correct function to initialise a list head
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>
2021-05-24 11:17:22 +01:00
Guennadi Liakhovetski 90045619d3 ll-scheduler: only modify the task if it is valid
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>
2021-05-24 11:17:22 +01:00
Guennadi Liakhovetski 2617ccb68a ll-scheduler: no need for a safe version of list_for_item()
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>
2021-05-24 11:17:22 +01:00
Guennadi Liakhovetski 56cb4f08f6 schedule: (cosmetic) remove three redundant variable initialisations
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>
2021-05-24 11:17:22 +01:00
Guennadi Liakhovetski 4baab5ff30 ipc: simplify a confusing variable use
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>
2021-05-24 11:17:22 +01:00
Guennadi Liakhovetski b602e275c9 zephyr: kpb: fix a compiler warning
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>
2021-05-24 11:17:22 +01:00
Guennadi Liakhovetski 1a249e8421 ll-schedule: (cosmetic) simplify a conditional
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>
2021-05-24 11:17:22 +01:00
Guennadi Liakhovetski c15c43e9fe clock: add a function to convert microseconds to ticks
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>
2021-05-24 11:17:22 +01:00
Slawomir Blauciak 06c3a90b6e rimage: update rimage submodule
Updates the rimage submodule to:
6f45b61921

Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
2021-05-24 11:16:30 +01:00
Curtis Malainey ab7961ccbc ipc: check pipeline validity
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>
2021-05-24 10:31:03 +01:00
Iuliana Prodan 8357dcf793 zephyr: trace: use zephyr utilities when enabled
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>
2021-05-21 15:56:58 +01:00
fy.tsuo c32a0e032f topology: igo_nr: move igo_nr to core 1.
igo_nr runs on core 1 to balance loading.

Signed-off-by: fy.tsuo <fy.tsuo@intelli-go.com>
2021-05-21 11:06:47 +01:00
fy.tsuo 9266614004 audio: igo_nr: igo_nr support 48k
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>
2021-05-21 11:06:47 +01:00
Kai Vehmanen 72a51a462f cavs: memory: fix panic on tplg load for zephyr on cavs20/25
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>
2021-05-20 16:29:33 +01:00
ShriramShastry 7de1744501 Math: Trignometry: Cordic sine() and cos()
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>
2021-05-20 15:35:26 +01:00
Liam Girdwood 25a3fde242 kpb: validate data size passed in by IPC new.
Make sure IPC data fits.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
2021-05-20 14:01:34 +01:00
Liam Girdwood 45918aa19b dai: abstract the DAI hardware configuration
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>
2021-05-20 14:01:34 +01:00
Liam Girdwood 7965c563f1 dai: remove extra new lines
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>
2021-05-20 14:01:34 +01:00
Guennadi Liakhovetski 367fa7cec5 zephyr: clean up timer-domain left-overs, fix task cancellation
- 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>
2021-05-20 12:41:07 +01:00
Guennadi Liakhovetski 560d29ddaf zephyr: rename functions and objects in zephyr_domain.c
Mostly a result of s/timer_domain/zephyr_domain/g

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-20 12:41:07 +01:00
Guennadi Liakhovetski f1f5abab0d zephyr: split timer domain
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>
2021-05-20 12:41:07 +01:00
Yong Zhi 68499a08ba topology: sof-tgl-rt711-rt1308: add BT offload for ADL
Add pipelines for Bluetooth offload support:

PCM14 <---> passthrough (pipe 13, 14) <---> SSP2 BT offload

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-05-19 15:22:35 +01:00
ShriramShastry 845c278ed6 Math: Trignometry: Added cordic sin cos function
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>
2021-05-19 11:00:27 +01:00
Kai Vehmanen 7c5e08c4f1 kconfig: move DW_DMA_AGGREGATED_IRQ to dw/Kconfig
The DW-DMA driver specific option does not belong to the top-level
Kconfig file.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-05-19 10:50:02 +01:00
Kai Vehmanen 0efce6361d kconfig: rename HW_LLI to DMA_HW_LLI
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>
2021-05-19 10:50:02 +01:00
Seppo Ingalsuo 79c647542d IPC: Handle ASRC as ASoC component type and not as process type
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>
2021-05-19 10:47:35 +01:00
Marc Herbert ab08781733 .github/ipc_fuzzer: add back local compilation hack as a comment
... 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>
2021-05-19 10:40:00 +01:00
Guennadi Liakhovetski 7aee1e594b agent: exit for system power down
Exit the system agent for system power down.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-05-19 10:36:17 +01:00
Guennadi Liakhovetski e76540d883 cavs: zephyr: fix power_down
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>
2021-05-19 10:36:17 +01:00
Guennadi Liakhovetski 41945cfdba cavs: use safer macros for cache-uncache conversions
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>
2021-05-19 10:36:17 +01:00
Curtis Malainey 0a1029c2a2 actions: consolidate yamlint
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>
2021-05-18 17:24:22 +01:00
Curtis Malainey e11c3c9e51 actions: rename fuzzer job
rename scant to ipc as this is the ipc fuzzer

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-05-18 17:24:22 +01:00
Curtis Malainey 39551b08ce actions: scant fuzzer: refactor CI build
Use oss-fuzz infra to make sure we don't break the fuzzer

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-05-18 17:24:22 +01:00
Marc Herbert 571cc290a4 xtensa/cmake: fix !CONFIG_TRACE
Looks like no one ever !CONFIG_TRACE

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-05-18 16:46:44 +01:00
Marc Herbert 964b7afa74 smex: don't corrupt the build with a bogus .ldc output
This made troubleshooting CMake issues more complicated.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-05-18 16:46:44 +01:00
Marc Herbert 7e1fd0adef Really copy sof-$platform.{ri,ldc} to sof.{ri,ldc}
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>
2021-05-18 16:46:44 +01:00
Chao Song f510435a25 topology: sof-tgl-nocodec-ci: run pipelines on different cores
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>
2021-05-17 22:24:06 +08:00