Commit Graph

9342 Commits

Author SHA1 Message Date
Kai Vehmanen 4bec5b292c logger: exit with error if calloc fails
In user-space tools, memory allocations can reasonably be expected to
always succeed. Make this assumption explicit by adding error handling
after calloc.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-12-20 11:47:01 +02:00
Kai Vehmanen 4d64893b86 sof-logger: exit with error if malloc fails
In user-space tools, memory allocations can reasonably be expected to
always succeed. Make this assumption explicit by adding error handling
after malloc.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-12-20 11:45:34 +02:00
Kwasowiec, Fabiola 19416908dd selector: remove return error when input buffer is 0
A pipeline that contains a selector cannot be run before the pipeline
that is connected to the selector because an error is returned.
The order of the run pipelines should not matter for functionality.

Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com>
2022-12-19 20:23:00 +02:00
Serhiy Katsyuba e06e1f0a44 ipc4: copier: remove redundant assignment
Removes variable cd->converter[i] assigning to self. This
fixes error reported by static code analyzer.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2022-12-19 17:26:07 +00:00
Marc Herbert 4ac3e3ff44 xtensa-build-zephyr.py: don't leave the install of an old build behind
In theory a failure from this script should immediately stop the show
and no one should then use the staging directory.

In practice we cannot make sure, especially not with shell scripts. So
make sure no previous build of a requested platform is left behind.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-19 17:25:28 +00:00
Guennadi Liakhovetski 3b9bc16400 lib-manager: fix cache annotations
lib-manager allocated memory for library modules with a cached alias
and explicitly synchronises cache in it (apparently superfluously).
Add cache address space annotations as needed.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-19 17:21:53 +00:00
Guennadi Liakhovetski fcd6e9541d alloc: fix argument for cache alias conversion
z_soc_uncached_ptr() takes a cached alias as argument.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-19 17:21:53 +00:00
Guennadi Liakhovetski eb0c038e96 selector: make frame formats explicitly cached
audio_stream_fmt_conversion() takes cached aliases of frame formats,
fix selector respectively.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-19 17:21:53 +00:00
Guennadi Liakhovetski 6cdc29472a mixin-mixout: fix address space attribution
src_info, as returned by find_mixout_source_info(), is a part of
mixed_data_info which is explicitly cached. Annotate src_info to be
the same.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-19 17:21:53 +00:00
Guennadi Liakhovetski 6c4b4ec843 ace: fix cache-uncache conversion macros for sparse
cache_to_uncache() and uncache_to_cache() must be inline functions
with proper argument annotations. Fix ACE definitions by alanogy with
cAVS.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-19 17:21:53 +00:00
Guennadi Liakhovetski 66a556062a ace: remove "volatile" from cached addresses
Cached addresses aren't used to access the hardware in mailbox.h,
they don't need to be volatile.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-19 17:21:53 +00:00
Marc Herbert 2ea4bc0ec4 .github/pull-request.yml: upgrade checkout v2 -> v3
This upgrade was already performed for other jobs in commit
f71eb15818 (".github/workflows: upgrade actions/checkout@v2 -> v3")
and everything went fine. Finish the job and get rid of the last
warnings in the daily tests (example:
https://github.com/thesofproject/sof/actions/runs/3709176785)

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-19 16:44:36 +00:00
Pin-chih Lin b581aa52e9 topology: add waves-integrated tplg file for RT1019 codec
Add topology case {WAVES + RT1019 CODEC}

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2022-12-19 16:41:32 +00:00
Seppo Ingalsuo 8d166a432f Audio: Copier: Add missing DMIC DAI index mapping to create_dai()
The dai_index needs to be mapped similarly as in kernel. The SSP
type was handled correctly in the function but not DMIC.

Signed-off-by: Jaska Uimonen <jaska.uimonen@linux.intel.com>
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-12-19 14:28:32 +00:00
Chao Song 764ce675ee smart_amp_test: add ipc4 support for smart amp test
Smart amp test module read config from ipc msg and convert ipc4 settings
to ipc3. It is a dummy module used for smart amplifier validation.

Signed-off-by: Chao Song <chao.song@linux.intel.com>
Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-12-19 13:26:19 +02:00
Rander Wang 5ac79eae01 mutex: add mutex support in XTOS
It uses spin lock to support mutex.

Suggested-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Suggested-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-12-19 13:26:19 +02:00
Rander Wang 7ca9152120 smart_amp_test: fix a typo
Use smart_amp_verify_params

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-12-19 13:26:19 +02:00
Marc Herbert e6f72dee82 zephyr/docker-build.sh: upgrade CMake to 3.21 or above
CMake 3.21 changed the order object files are passed the linker. This
breaks build reproducibility.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-16 15:19:44 -08:00
Marc Herbert 424da2cd9d zephyr/docker: pass http[s]_proxy variables to the container
Support downloads from within the container.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-16 15:19:44 -08:00
Marc Herbert d652d1cd16 .github/zephyr: re-add TGL IPC3 build for now
Partial revert of commit 687c6f305e (".github: workflow: removed
legacy RTOS platforms from Zephyr build") that was a bit too
"enthousiastic".

When someone breaks the Zephyr+IPC3 build we'd like to: 1. notice, 2.
tell whether it's Intel-specific, IMX-specific or not specific.

This is a one-line change and unlike testing, building is "free".
It can be removed in a second when/if that becomes a burden.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-16 15:44:00 +02:00
Marc Herbert 03c078935d .github/zephyr: use a single job for both tgl and tgl-h
The list is getting too long and the "checks" box in the Github User
Interface is small.

Fixes commit 543acc124d (".github/workflows: add tgl-h IPC4 build")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-16 15:44:00 +02:00
Seppo Ingalsuo a8aa7c30d6 Audio: SRC: Delete unused function parameter fir_delay_length
It is not used so it can be deleted. There is no measurable
performance impact from this change.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-12-16 15:41:53 +02:00
Seppo Ingalsuo 8f802378e5 Audio: SRC: Refine input and output blocks count calculation
As a small improvement for 2-stage converters like 44.1 to 48 kHz
the s1_blk_in and s2_blk_out can be calculated once after the if
statement.

There is no measurable MCPS improvement from this change.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-12-16 15:41:53 +02:00
Seppo Ingalsuo 7b8cef02d4 Audio: SRC: Optimize generic C fir data pointer wrap
There is no need for the if statement since the pointer data
always wraps at this code location if the next loop is executed.
Next FIR calculate will start with new data pointer value, so
potentially wrong pointer value when n2 equals zero does not matter.

This patch saves in CML gcc build 2%, or 2.0 MCPS from 46.2 to 45.3
MCPS in stereo 44.1 kHz to 48 kHz conversion.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-12-16 15:41:53 +02:00
Tinghan Shen 1f9dbcad22 platform: mt8188: Fix build error
Add back the mailbox_sw_reg_write inline function
to fix build error of mt8188.

sof/src/platform/mt8188/include/platform/platform.h: In function ‘platform_panic’:
sof/src/platform/mt8188/include/platform/platform.h:69: warning: implicit declaration of function ‘mailbox_sw_reg_write’

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
2022-12-16 15:41:04 +02:00
Andrula Song f6fca6fc7e Audio: Implement a HiFi3 version audio_stream_copy
Since Xtensa provides intrinsics for multi-way load/store
and using those instructions can reduce more cycles than
the function we using now, so there is a HiFi3 audio_stream
_copy implementation.

Signed-off-by: Andrula Song <xiaoyuan.song@intel.com>
2022-12-16 13:46:40 +02:00
Ajye Huang cdcbdae705 topology: sof-adl-nau8825: add variant with nau8318 amplifier
Adding support for nau8318 Amplifier.

sof-adl-nau8318-nau8825:
    nau8825 headphone connects SSP0 link.
    nau8318 Amp speakers connects SSP1 link.
    bluetooth offload uses SSP2 link.

Signed-off-by: Ajye Huang <ajye_huang@compal.corp-partner.google.com>
2022-12-16 13:44:30 +02:00
Marc Herbert 906508bd79 xtensa-build-zephyr.py: checksum deterministic configs.c
.config is not deterministic because it has absolute paths in comments
and its order seems hard to predict. configs.c has the same information
generated in a determistic way.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-16 13:42:08 +02:00
Marc Herbert bc394916d0 xtensa-build-zephyr.py: switch type of InstFile() names to pathlib
Make sure any forward slashes in strings are immediately converted to
OS-dependent directory separators.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-16 13:42:08 +02:00
Adrian Warecki 13c36f3207 module adapter: volume: Validation of channels count
The module operates on arrays whose size is based
on SOF_IPC_MAX_CHANNELS. Added check if the number
of channels given in the configuration does not exceed
the number of maximum supported channels.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2022-12-16 13:40:39 +02:00
Bard Liao 080363ece9 topology2: add sdw spk feedback pcm
This commit create a PCM that can pass amplifier feedback to user space.

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2022-12-16 12:56:53 +02:00
Ranjani Sridharan 41a16145fc mixer: convert the mixer comp to use the module interface
Convert the mixer component and the mock tests to use the module
interface

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-12-15 20:44:20 +02:00
Ranjani Sridharan 98e9d3f0f6 module_adapter: Add support for modules with multiple sources
Add support for modules with multiple sources such as the mixer.
Expand the scope of the simple_copy flag in struct processing_module to
include components that have multiple input buffers but only a single
output buffer and do not need any deep-buffering.

Make changes to the prepare, copy and trigger callbacks in the
module_adapter ops to add support for handling multiple input buffers.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-12-15 20:44:20 +02:00
Ranjani Sridharan 6e7f31c141 module_adapter: Add a no_pause field for modules
Add a new field, no_pause in struct processing_module which will be set
by modules that do not support pause, ex: mixer.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-12-15 20:44:20 +02:00
Ranjani Sridharan af352a2bb2 module_adapter: Add the verify_params_flags field for modules
Add a verify_params_flags field in struct processing_module which should
be set by the modules during initialization to indicate which
parameters should be skipped during comp_verify_params().

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-12-15 20:44:20 +02:00
Kai Vehmanen 543acc124d .github/workflows: add tgl-h IPC4 build
Add build check for Intel 'tgl-h' IPC4 build.

Link: https://github.com/thesofproject/sof/issues/6710
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-12-15 09:09:03 -08:00
Tinghan Shen c916f3fdd7 src: mediatek: Fix MediaTek company name and SPDX checkpatch warnings
The company name should be MediaTek instead of Mediatek.
                                ^                   ^

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
2022-12-15 16:11:23 +00:00
Tinghan Shen f28dc601cb platform: Add mt8188 to Kconfig
Add mt8188 to Kconfig.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
2022-12-15 16:11:23 +00:00
Tinghan Shen 4139ca8fe4 platform: Add build support for MediaTek mt8188 platform
Add CMakefile for MediaTek mt8188 platform to build it.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
2022-12-15 16:11:23 +00:00
Tinghan Shen 3b8e2e4113 config: Add default config for mt8188
Add default config for mt8188 platform.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
2022-12-15 16:11:23 +00:00
Tinghan Shen cd8e75df5d platform: mtk: Add support for mt8188 platform
mt8188 platform integrates a single-core HIFI5 DSP.

The highest DSP operation frequency is 800MHz which requires
0.75v working voltage. otherwise, it should switch to 26M which
can operate at the lowest working voltage 0.55v.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
2022-12-15 16:11:23 +00:00
Tinghan Shen bff918a271 drivers: mtk: Reuse mt8186 drivers for mt8188
Reuse mt8186 interrupt, timer, and ipc drivers for mt8188.
mt8188 DSP has 32 interrupts, 4 internal timers, and 5 mailbox for IPC.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
2022-12-15 16:11:23 +00:00
Tinghan Shen 02cf74ae21 platform: mtk: add mt8188 memory layout and register definitions
Add memory layout and register address for mtk mt8188.

[Cache]
I-Cache: 64KB, 4-way Associativity
D-Cache: 128KB, 4-way Associativity

[Memory]
DRAM: DSP can access DRAM shared with CPU
L2TCM: 512KB DSP SRAM POOL

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
2022-12-15 16:11:23 +00:00
Tinghan Shen 5fe6aa2a51 platform: mtk: add xtensa headers for mt8188
Add xtensa headers for mtk mt8188 platform.

Signed-off-by: Tinghan Shen <tinghan.shen@mediatek.com>
2022-12-15 16:11:23 +00:00
Guennadi Liakhovetski c426f810cb module-adapter: attach and detach buffers correctly
When attaching multiple buffers via their uncached list heads, we
have to make sure to synchronise cache of adjacent buffers.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-15 12:25:30 +00:00
Guennadi Liakhovetski a95ea9bfb1 buffer: move linking and unlinking code to functions
We want to re-use the code, used to synchronise caches when linking
and unlinking buffers, move it to two new functions.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-12-15 12:25:30 +00:00
barry.jan 6275d18ce2 module_adapter: free memory resource
Since module-specific prepare API will be called every time on prepare
 of module_adapter (stream start trigger), the reset API should
free all memory that was allocated during the prepare API.

Signed-off-by: barry.jan <barry.jan@waves.com>
2022-12-15 12:23:48 +00:00
Yong Zhi 2cfa90d324 topology2: cavs-rt5682: add deep buffer support on headset
Deep buffer is mixed with ssp0 stream.
Override mixout copier audio_format.1 from 32/24 to 32/32 for I2S.

Signed-off-by: Yong Zhi <yong.zhi@intel.com>
2022-12-15 12:23:00 +00:00
Marc Herbert 501204c684 xtensa-build-zephyr.py: objcopy --remove-section .comment zephyr.strip
Make stripped ELF files compiled by XCC identical across different
machines.

Some Xtensa compilers (ab?)use the .ident / .comment
section and append the typically absolute and not
reproducible /path/to/the.c file after the usual
compiler ID.

https://sourceware.org/binutils/docs/as/Ident.html

strip --strip-all does not remove the .comment section.
Remove ourselves like some gcc test scripts do:

 https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=c7046906c3ae

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-12-15 13:55:07 +02:00
Kai Vehmanen dba643cf2b west.yml: upgrade Zephyr to c5b270e7b003
Total of 440 commits, including following related to
intel_adsp/sparse/dmic/xtensa:

603cc2704579 dma: Add max block count attribute
2c162449eb4c xtensa: linker: Fix #52539 by updating the linker scripts
2dd4cbc75592 dts: xtensa: intel: update cavs25_tgph to match cavs25

Link: https://github.com/thesofproject/sof/issues/6710
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2022-12-15 12:36:03 +02:00