Commit Graph

8911 Commits

Author SHA1 Message Date
Adrian Warecki 447b365b62 mtl: board: Update mtl board configuration
Necessary configuration options of the mtl board
have been enabled.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Signed-off-by: Konrad Leszczynski <konrad.leszczynski@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2022-10-18 16:10:37 +03:00
Adrian Warecki 02152c3dcf ace: dma: Add temporary dma ops to allow get attributes
The attributes of the dma controllers must be moved
to the zephyr. Until then, we will use a own copy of the
get_attribute function from the alh and dw_dma drivers.
Thanks to this, we can completely disable it building
in the configuration.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2022-10-18 16:10:37 +03:00
Adrian Warecki ac33ac128b ace: dma: Add dma configuration
Added code containing configuration of the dma channels.

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Signed-off-by: Konrad Leszczynski <konrad.leszczynski@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2022-10-18 16:10:37 +03:00
Adrian Warecki c47a0bf6ff ace: clock: Update clock definitions
Added code with clock definitions

Signed-off-by: Andrey Borisovich <andrey.borisovich@intel.com>
Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Signed-off-by: Konrad Leszczynski <konrad.leszczynski@intel.com>
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
Signed-off-by: Rafal Redzimski <rafal.f.redzimski@intel.com>
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2022-10-18 16:10:37 +03:00
Tomasz Lissowski 8c60a56fef ipc4: add mixing-based processing in channel selector
Add mixing-based processing in channel selector to implement
capabilities resulting from IPC4 configuration. Enable flexible
channels count (from 1 to 8) independently for input and output.

Signed-off-by: Tomasz Lissowski <tomasz.lissowski@intel.com>
2022-10-18 14:09:48 +03:00
Baofeng Tian 47c52ccfe4 Component: move comp_copy from header file to source file an
On sof zephyr ipc4 build, component performance profiling logs can't
be enabled due to current xcc compiler does not support inline
logging in header file, logs as below:

  log_level undeclared (first use in this function)
  log_current_const_data undeclared (first use in this function)

Move comp_copy to component.c can resolve this limitation.
However, this brings another cmocka issue for mixer unit test,
this patch also fixed cmocka mixer unit test issue.

BugLink: https://github.com/zephyrproject-rtos/zephyr/issues/43786
Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2022-10-18 13:42:53 +03:00
Baofeng Tian 177b61457f performance: perf cnt bugfix for profiling
Current hw cycle is based on 38400000, and perf cnt module did not consider
the clock wrap case, i.e the later cycle maybe small than the previous one.
so add code to handle this situation.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2022-10-18 13:41:37 +03:00
Baofeng Tian 32129b9bf4 component: add frames and period info to component performance profiling
Frames and period are key information for time calculation, with these
and sample rate, it would be easy to get current component consumed data
in time domain. CI script also easy to get these information for
further calculation.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2022-10-18 13:40:03 +03:00
Balakishorepati a28dde6702 drivers:amd: fix acp clock based on usecases.
Switch between ACLK and internal clock based on
active usecases and clock requirement.

Signed-off-by: Balakishorepati <balaKishore.pati@amd.com>
2022-10-18 11:06:32 +01:00
Kai Vehmanen 838d001390 pipeline: add pipeline and component ids to pipe_foo() output for Zephyr
The component and pipeline identifiers were direct part of the older
SOF dictionary format. This information was added directly to encoded
output and was not part of the log message. When using Zephyr logging
subsystem, this type of audio specific information has be to put
as part of the log messages like any other log content.

Modify pipe_{err,warn,info,dbg} macros to add pipeline and component
identifiers to all printed log messages.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-10-18 09:01:23 +03:00
Kai Vehmanen bae8457c78 buffer: add pipeline and component ids to buf_foo() output for Zephyr
The component and pipeline identifiers were direct part of the older
SOF dictionary format. This information was added directly to encoded
output and was not part of the log message. When using Zephyr logging
subsystem, this type of audio specific information has be to put
as part of the log messages like any other log content.

Modify buf_{err,warn,info,dbg} macros to add buffer pipeline
and buffer-id identifiers to all printed log messages.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-10-18 09:01:23 +03:00
Kai Vehmanen cef9544f06 component: add pipeline and component ids to comp_foo() output for Zephyr
The component and pipeline identifiers were direct part of the older
SOF dictionary format. This information was added directly to encoded
output and was not part of the log message. When using Zephyr logging
subsystem, this type of audio specific information has be to put
as part of the log messages like any other log content.

Modify comp_{err,warn,info,dbg} macros to add component pipeline
and component identifiers to all printed log messages.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-10-18 09:01:23 +03:00
Daniel Baluta de739dd89c zephyr: Fix cycle counting on i.MX
On i.MX8 k_cycle_get_64 always returns 0 so use sof_cycle_get_64
instead.

There is no better solution to support 64bit cycle counting for i.MX
and will have to stick with this implementation.

Fixes: c3c94fc515 ("header: rtos: use rtos specific version of wait.h")
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2022-10-18 08:57:39 +03:00
Ranjani Sridharan 51501bfcef ipc4: handler: skip setting state when pipeline is already active
No need to proceed if the pipeline is already active.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-10-18 08:55:36 +03:00
Jaska Uimonen 251ee59b2e ipc: rename ace ipc zephyr stubb as ipc-zephyr.c
Rename ace ipc zephyr stubb as ipc-zephyr.c as it is a generic interface
towards zephyr cavs/ace ipc drivers. Change existing zephyr ace/mtl
makefile reference to it and start using it in cavs/tgl ipc4 zephyr
native drivers builds. Tgl ipc3 builds will still use sof cavs ipc
driver.

Signed-off-by: Jaska Uimonen <jaska.uimonen@intel.com>
2022-10-17 17:01:09 +03:00
Marc Herbert 5a30534aab sof_ri_info: add platform aliases to DSP_MEM_SPACE_EXT
Fixes this error:
```
No platform found in name "sof-rpl.ri"; unknown memory layout.
```

... and shows the Memory Layout.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-17 16:38:38 +03:00
Kai Vehmanen c807d6844b Revert "topology2: nocodec: add volume and mixer support"
This reverts commit 5594ad3512.
2022-10-14 18:23:01 +03:00
Kai Vehmanen f07f5ed823 Revert "topology2: fix multi-stream test issue in ci"
This reverts commit 321bfde913.
2022-10-14 18:23:01 +03:00
Kai Vehmanen fb07f450d7 ipc4: dai: reduce get_llp_reg_info log verbosity
The "get_llp_reg_info(): gpdma id 32 out of array bounds."
message is hit constantly with current mainline topologies with
no apparent impact to functinality.

The log is printed at a very high rate, which causes CPU and SRAM
traffic pressure that affects test execution.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-10-14 15:58:24 +03:00
Baofeng Tian 33ea9ea5ab profiling task: modify task profiling with performance counter macro
This patch is used to make sure profiling code only can be run
with performance profiling build, and unify all performance profiling
with same format and usage.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2022-10-14 12:08:03 +03:00
Rander Wang 321bfde913 topology2: fix multi-stream test issue in ci
Duplicated dai index results to module initialization
faiure in multi-stream test. Dai 2 should be used by
stream nocodec-2.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-10-14 08:10:25 +03:00
Marc Herbert 8fd351ea9a west.yml: add warning to keep git submodules in sync
Trying avoid out-of-sync situations like commit a3b3c525d1 ("west:
update to newer rimage baseline").

Also explain why sof cannot be cloned as "sof2"

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-13 10:47:49 -07:00
Marc Herbert 6fc6940e1c rimage: update submodule to 542924d70c, back in sync with west.yml
Fixes commit a3b3c525d1 ("west: update to newer rimage baseline")

542924d70c config: tgl-h-cavs: add probe module
5b076f1738 config: tgl-cavs: add probe module
6b4848e25d mtl: Add UPDWMIX module to the manifest
d50aefcb63 manifest max size for loadable modules
d94cfc9cc6 mtl: add MicSel support
5504179137 Add lib_code module type.
12bb327122 toml: add tgl-h config file for IPC4
452847ddc0 mtl: Add SRC module to the manifest

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-13 10:47:49 -07:00
Kai Vehmanen 5702939836 west.yml: upgrade Zephyr to ed661a6c6909
Upgrade Zephyr from 0956647aaf6bd2b1e840adcc86db503f274d84a9 to
ed661a6c6909b338035b026cfc101ddda65ab8eb (1020 commits, including
441 since v3.2.0 tag).

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-10-13 14:55:26 +03:00
Anas Nashif 82d8dc9ece app: remove explicit CONFIG_DW_ICTL_ACE_V1X
This config was renamed is automatically selected for this platform, so
no need to include it here.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2022-10-12 19:34:18 +03:00
Kai Vehmanen 76e8bd0122 init: print SOF version information at boot also in Zephyr builds
The log print for SOF build and ABI version numbers at boot time, is
only printed in dma_trace_enable(). It is done here to ensure
the log is not emitted until logging infrastructure is in place
and the log print is not lost.

The information is very useful, so similar log should be emitted
also in SOF Zephyr builds, where the Zephyr logging subsystem is
used instead of SOF's own trace infra.

As Zephyr logging subsystem is available early, this code
can now be added directly to primary_core_init(), which is called
from sof_main().

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-10-12 19:04:19 +03:00
Baofeng Tian 56bc7efb91 performance profiling enable: add conf file for profiling enabling
After add this file, with -o app/perf_overlay.conf in build command
line, profiling functionality will be enabled and mtrace/sof log will
have performance data for further analysis.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2022-10-12 18:55:20 +03:00
Rander Wang 5594ad3512 topology2: nocodec: add volume and mixer support
Mixer and volume (gain) are used in nocodec topology.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-10-11 10:54:07 -07:00
Jaroslaw Stelter b104f70c3d iadk_modules: lib_manager: Enable loadable modules on MTL
This patch will enable lib_manager and iadk_modules support for
MTL platform.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2022-10-11 14:13:51 +03:00
Jaroslaw Stelter c43521f43c iadk_modules: lib_manager: Fix compilation issue
This patch fixes compilation issue in iadk_modules and
lib_manager.

Signed-off-by: Jaroslaw Stelter <Jaroslaw.Stelter@intel.com>
2022-10-11 14:13:51 +03:00
Marc Herbert 1e4236be68 tools: make sof_ri_info.py a usable library that can be imported
2 small changes required:

- Stop calling sys.exit(1) in case of error not to exit the importer
- Change EraseVars() to return the checksum value instead of printing
  it. Move the print() to the main() function

This is required by the new sof-bin tests that compare signed with
unsigned binaries; submitted in
https://github.com/thesofproject/sof-bin/pull/105

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-11 13:34:01 +03:00
Guennadi Liakhovetski 72ad230056 ipc4: print incoming IPC messages
Similar to IPC3, seeing all IPC messages in the log is very useful
for debugging, e.g. when matching kernel and firmware logs. Use a
format similar to IPC3.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-10-10 20:29:36 +03:00
Marc Herbert d155062195 scripts/build-tools.sh: switch to incremental build by default
Faster build and focused and readable logs at last.

Add a warning not to surprise anyone.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-10 11:34:11 +01:00
Marc Herbert 016b555a06 topology2: generate abi.conf at build time, fix incremental on abi.h
Move abi.conf generation to build time.

Changing abi.h now rebuilds all v2 topologies.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-10 11:34:11 +01:00
Marc Herbert eee058abcd topology2: concat abi.conf at build time to fix incremental build
It's now possible to rebuild just only one modified topology without
rebuilding all of them from scratch.

Building topologies v2 has two steps:

 1. concatenation of abi.conf with topo.conf
 2. run alsatplg on the concatenation

Concatenation step 1. was wrongly implemented at configuration time, not
at build time. So when the topology source of step 1 (topo.conf) was
modified, the dependency of step 2 (= the concatenation) was not
affected and the topology was not rebuilt.

Fix this by moving the concatenation to build time.

Fixes commit 308a24a92b ("topology2: Add build support")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-10 11:34:11 +01:00
Marc Herbert a29d522059 topology1: fix incremental build dependency on abi.h
Modifying abi.h now rebuilds topologies v1

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-10 11:34:11 +01:00
Marc Herbert d56d8ab01c scripts/build-tools.sh: switch to Ninja because make is too verbose
Make prints a line for every topology that is already up to date and not
rebuilt. It's impossible to see what was done.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-10 11:34:11 +01:00
Marc Herbert 567ad2122e topology1: prefix custom targets with their subdirectory name
This makes it possible to find stuff in the output of `ninja help`.

Zero effect on the build artefacts.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-10 11:34:11 +01:00
Marc Herbert 36b3ff4025 zephyr/docker-run.sh: log all '*zephyr*' images and align columns
`docker images` has no globbing option so just use `grep zephyr`

This fixes two different issues:
- Fixes tabulation images with names of a different length
- Displays any internal local cache some users may have

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-10 11:29:05 +01:00
Marc Herbert 77bb169887 .github: de-hardcode zephyr SDK version in sparse build
Also add references documenting sparse's REAL_CC pain.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-10 11:29:05 +01:00
Marc Herbert c28400baaa scripts/docker-run.sh: fix wrong uid in warning 1001 -> 1000
Fixes commit d09844ab98 ("zephyr/docker-build.sh: match UID with
'adduser' instead of 'chgrp -R'")

Also clarify comment and add reference to new sudo-cwd.sh script.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-10 11:29:05 +01:00
Marc Herbert 0a4b1d62d5 sudo-cwd.sh: drop the all 'sof_' prefixes and references
This script is now generic. This was not done earlier to be gentle on
git blame.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-10 11:29:05 +01:00
Marc Herbert 027be98371 zephyr/docker: move exec_as_sof_uid() to new sudo-cwd.sh
Besides making things more obvious, the important functional change is
that the user switch is now performed for _every_ invoked, command, not
just for the build command.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-10-10 11:29:05 +01:00
Kai Vehmanen 76e35fbec2 ipc4: use atomic primitives to maintain delayed_reply state
In tests with repeated IPCs that require handling in
the pipeline context (such as SET_PIPELINE_STATE), the delayed_reply
state sometimes goes out of sync.

When this happens, pipeline has processed the message and called
ipc_compound_msg_done(), but the next call to ipc_wait_for_compound_msg()
does not see the correct value, leading to a timeout.

Fix the problem by using atomic primitives to maintain the state.

Also make it explicit that the delayed_reply is a boolean
condition and in current code, having multiple IPC messages in
flight concurrently should never happen.

BugLink: https://github.com/thesofproject/sof/issues/6220
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-10-07 18:42:48 +03:00
Kai Vehmanen 0654a66664 zephyr: app: increase log thread stack size to 4096
Set the logging thread stack size explicitly for SOF builds
and use a safe default of 4096 bytes. Individual board overlays
can override this default to save stack space.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-10-07 15:01:11 +03:00
Kai Vehmanen 529d593454 zephyr: app: increase log size to 4096 bytes
Set CONFIG_LOG_BUFFER_SIZE=4096 for all SOF builds.

As SOF uses DEFERRED mode for logging, the frontend buffer for
logs must be large enough to cover all typical burts of messages.

Tests using CONFIG_LOG_MEM_UTILIZATION debugging infrastructure,
show that maximum buffer usage is over 2048 bytes in typical
sof-test run on a SOF nocodec topology, tested on Intel TGL
hardware.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-10-07 15:01:11 +03:00
Kai Vehmanen 576373594b zephyr: app: tune logging thread sleep and trigger threshold values
Logging output of SOF is sporadic in nature (unless debug configuration
is used) and it cannot be assumed that a steady flow of log messages
is output at all times. During stable state, there are either no or very
few messages output. When the DSP pipeline state is modified, there is
a flurry of event. Similarly upon errors, a burst of log messages is
output.

For better balance between delay in writing logs, and limiting overhead
of the logging thread, set new defaults to:
  CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD=5
  CONFIG_LOG_PROCESS_THREAD_SLEEP_MS=100

The SLEEP_MS sets an upper bound how long a single log message can
stay in the log frontend buffer.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-10-07 15:01:11 +03:00
Kai Vehmanen 19970d51d5 zephyr: app: explicitly use DEFERRED log mode
Calls to log messages are done in many places in SOF code,
including latency sensitive low-latency code paths. To minimize
the cost to low-latency path, use CONFIG_LOG_MODE_DEFERRED=y
by default for all SOF Zephyr builds. This will offload log
processing and output to a separate low priority thread.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-10-07 15:01:11 +03:00
Ming Jen Tai 21d8948e73 rtnr: Support setting data blob
This commit lets user to set  data blob from host.

For example:
$ amixer -Dhw:0 controls | grep RTNR
numid=47,iface=MIXER,name='RTNR10.0 rtnr_bytes_10'
numid=48,iface=MIXER,name='RTNR10.0 rtnr_data_10'
numid=49,iface=MIXER,name='RTNR10.0 rtnr_enable_10'

$ sof-ctl -Dhw:0 -n 48 -b -s ./preset.bin

A new empty data control added to the topology will be used to send the
blob.
Model handler is now used for transferring the blob data.

Signed-off-by: Ming Jen Tai <mingjen_tai@realtek.com>

Code Refine
2022-10-05 13:25:44 +01:00
Guennadi Liakhovetski 770e81c6cc pipeline: (cosmetic) simplify pipeline_comp_reset()
Use switch-case instead of if-else, add a local variable for a
repeating pointer dereference and remove a resundant local variable.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-10-05 13:08:45 +01:00