Commit Graph

7763 Commits

Author SHA1 Message Date
Guennadi Liakhovetski 77a08b6861 ipc4: simplify logic in ipc4_trigger_chain_dma()
Instead of checking cdma->header.r.enable multiple times, handle the
!cdma->header.r.enable case first and simplify other conditionals
after that. Also fixes a possibly uninitialised variable.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-20 18:07:57 +00:00
Curtis Malainey 0b10a1e526 ipc4: initialize return var
cppcheck is complaining that in theory we could return an uninitialized
value, which is true assuming bad IPC data.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2022-01-20 17:41:35 +00:00
Curtis Malainey ccab5cd8a3 ipc: fix signed int overflow in macro
shifting anything into the sign bit location is technically undefined,
add unsigned marker to satisfy cppcheck

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2022-01-20 17:41:35 +00:00
Curtis Malainey 773bfc0aed copier: fix unlikely uninitialized use
cppcheck is complaining if the foreach loop doesn't run what would
happen.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2022-01-20 17:41:35 +00:00
Marc Herbert a053e04d7e trace: add Zephyr git version to the initial FW ABI banner
Add Zephyr git version in the initial FW ABI banner. Sample output:

SHM: FW ABI 0x3014000 DBG ABI 0x5003000 tags \
SOF:v2.0-rc1-245-g4be53bca4ab5-dirty zephyr:v2.7.99-3167-g8a8abd69228d \
src hash 0xb8098c48 (ldc hash 0xb8098c48)

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-20 17:26:26 +00:00
Guennadi Liakhovetski 09c69b7607 platform/zephyr: remove unused macros
HEAP_LP_BUFFER_* macros aren't used in Zephyr builds, remove them.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-20 17:05:10 +00:00
Guennadi Liakhovetski 339e5ac217 platform/zephyr: enable power management for non-cAVS platforms
This enables hardware initialisation and power management paths for
non-cAVS platforms with Zephyr.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-20 17:05:10 +00:00
Guennadi Liakhovetski 079ce95b98 zephyr: (cosmetic) make a needlessly global variable static
_smex_placeholder dowsn't have to be global, make it static.
Also no need to explicitly specify smex_placeholder_f() as inline,
the compiler will decide by itself.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-20 17:05:10 +00:00
Guennadi Liakhovetski 98db7915b1 zephyr: trace: fix builds with CONFIG_TRACE=n
When CONFIG_TRACE is disabled in Zephyr builds, they fail because
then _DECLARE_LOG_ENTRY isn't defined.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-20 17:05:10 +00:00
Guennadi Liakhovetski 1c6ae93d92 platform/zephyr: use an OS call for time stamps
On generic Zephyr platform case, use an OS timer call to get a time
stamp.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-20 17:05:10 +00:00
Guennadi Liakhovetski abc1673d59 memory: include memory.h explicitly, where needed
Several files use symbols, defined in memory.h, add explicit includes
for it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-20 17:05:10 +00:00
aeloglix 1165dae2b5 ipc4: Move the 'dai_index' 4 bits to the right
I2S Node ID virtual index structure:
-first 4 bits are index of the time slot group
	(uint8_t time_slot_group_index : 4)
-next 4 bits are index instance
	(uint8_t i2s_instance : 4)

Therefore dai.dai_index should be moved 4 bits to the right.

Signed-off-by: aeloglix <ArsenX.Eloglian@intel.com>
2022-01-18 17:00:01 +00:00
Brent Lu 113a49d253 topology: sof-adl-rt5682: add new topology
Add support for boards without speaker amplifier. Just simply remove
all speaker related components and configuration.

Signed-off-by: Brent Lu <brent.lu@intel.com>
2022-01-18 16:59:35 +00:00
YC Hung c08784b674 platform: mt8195: fix afe-memif sinegen log error
Fix log to Show sgen_id in mt8195_afe_sinegen_enable function.

Signed-off-by: YC Hung <yc.hung@mediatek.com>
2022-01-18 16:56:17 +00:00
Adrian Bonislawski 2c86a89098 ipc4: invalidate HOSTBOX for comp_new
This will allow to remove invalidate calls for each component init

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-01-18 16:55:57 +00:00
Adrian Bonislawski 6ecfdbf810 ipc4: report correct value for hw core count
MAX_CORE_COUNT was removed in:
commit 2bd41aaf26 ("platform: remove MAX_CORE_COUNT")

CONFIG_CORE_COUNT should be used instead of CONFIG_MAX_CORE_COUNT

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-01-18 16:01:02 +00:00
Lionel Koenig 07a612258e topology: Ensure PCM for detect pipeline
detect pipelines require PCM_ID to be define which is the case only
when they get inserted using PIPELINE_PCM_ADD.

Note that PIPELINE_PCM_ADD and PIPELINE_ADD have different signature.

Signed-off-by: Lionel Koenig <lionelk@google.com>
2022-01-17 14:41:04 +01:00
Lionel Koenig 7162534498 topology: define PIPELINE_FORMAT from DAI_ADD
Pipeline extects PIPELINE_FORMAT to be defined. When including a
pipeline using DAI_ADD, DAI_FORMAT is defined but no PIPELINE_FORMAT.
Prior c687815, the last previously defined PIPELINE_FORMAT was used.
This change ensure the requested DAI_FORMAT is used in the pipeline.

This addresses bug #5193.

Signed-off-by: Lionel Koenig <lionelk@google.com>
2022-01-17 14:41:04 +01:00
Adrian Bonislawski 83373eb970 ipc4: report dsp properties to host driver
Host driver checks dsp properties

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2022-01-14 22:22:58 +00:00
Daniel Baluta e6f4930524 drivers: imx: sdma: Fix state in sdma_release
In order to be correctly restarted after RELEASE sdma channel
status needs to be COMP_STATE_PREPARE.

Otherwise, following sdma_start() will return an error.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2022-01-14 16:59:42 +00:00
Daniel Baluta 78d3afb0eb drivers: sai: Start SAI on RELEASE
SAI is stopped at PAUSE and it needs to be started again at RELEASE.

Reported-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2022-01-14 16:59:42 +00:00
Marc Herbert 2ebf92f279 trace: new macro to de-duplicate the common part of the FW ABI banner
There was no need to copy/paste; fixes commit02c21c25ba33 ("dma-trace.c:
use new mtrace_printf() to demote FW ABI banner to INFO")

Zero observable change.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-14 16:59:01 +00:00
Marc Herbert 5de4a09756 version.cmake: include scripts/ and zephyr/ in the .ldc dictionary hash
scripts/ has kconfig defaults and CMake code that can affect the
dictionary. Note this does not fix #3890 because .config (and maybe
others) are still not hashed but it helps a bit.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-14 16:59:01 +00:00
Marc Herbert 58d3551960 version.cmake: more robust logging of the current git commit and parents
execute_process() runs in the current directory of the process invoking
cmake. This can be completely outside the git repo.

Fixes commit a5899812b7 ("version.cmake: don't trust CI to record time
and versions and log ourselves")

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-14 16:59:01 +00:00
Marc Herbert 805e57b28f xtensa-build-zephyr: include DEFAULT_PLATFORMS in SUPPORTED_PLATFORMS
Include DEFAULT_PLATFORMS in SUPPORTED_PLATFORMS instead of the other
way round. SUPPORTED_PLATFORMS will always be bigger than
DEFAULT_PLATFORMS and it's easier to add a platform than remove one.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-14 16:57:35 +00:00
Marc Herbert ac1a09afdb xtensa-build-zephyr: de-dup. first vs incremental west invocation
Passing spurious --board and source directory arguments to an already
build directory does not help but it does not hurt either and it
simplifies the code. It also provides a more consistent west command in
the set -x "logs", one that can be re-used in any circumstance.

The only restriction is to make sure CMAKE_ARGS is empty on all but the
first invocation but that's not new and unchanged here.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-14 16:57:35 +00:00
Marc Herbert 12f4834e40 zephyr: move GENERATED_DIRECTORY from source tree to build directory
This makes it possible to clean sof_versions.h.

Also remove DOT_CONFIG_PATH copy/paste which is unused in
Zephyr.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-14 16:56:29 +00:00
Marc Herbert deb0e7340e Rename generated version.h to sof_versions.h
Zephyr also a version.h too so the situation was a buggy #include mess
that (among others) dropped the SOF git version from the SOF banner when
using Zephyr. It's absolutely impossible to fix this mess while keeping
two .h files both named exactly the same and even included with the
exact same '#include version.h' line, I mean no sof/version.h or other
prefix.

As a bonus, this rename also reduces the XTOS-only confusion between
"version.h" and cavs/version.h".

Generating a file in the source tree is a serious bug (to be fixed
later), it means this file is never cleaned. Do not hide this bug with a
.gitignore rule.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2022-01-14 16:56:29 +00:00
Bard Liao 06c83dc375 topology2: cavs-sdw: add audio format tokens
Add audio format tokens for cavs-sdw.conf

Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
2022-01-14 16:52:37 +00:00
Pierre-Louis Bossart 6b8b1cee16 topology: add all possible permutations for ES8336-based platforms
So far we support apl, glk, cml, jsl, tgl.

SSP0 or SSP2 can be used.

DMICS may or may not be present, the simplifying assumption is that we
have 0, 2 or 4channels.

the existing topology names are kept but will not be used with kernel
updates, the -ssp<N> and -dmic<N> ch suffixes will be added based on
NHLT information to avoid a need to override topology files.

A better solution would be a DAI index that can be overridden in a
topology file, but we have no interface to do so at the moment, so
brute-force combinatorial handling of all possible solutions it is.

Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
2022-01-13 14:18:43 +00:00
Ranjani Sridharan 17064d4f22 module_interface: remove the id field
It is never used.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-12 14:24:32 +00:00
Ranjani Sridharan 317f80b4f2 codec_adapter: waves: make interface ops static
and remove waves.h

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-12 14:24:32 +00:00
Ranjani Sridharan 115ffbc1bc codec_adapter: dts: Make interface ops static
and remove dts.h.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-12 14:24:32 +00:00
Ranjani Sridharan 509532e0b5 codec_adapter: cadence: Make all interface ops static
Make all the ops static.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-12 14:24:32 +00:00
Ranjani Sridharan 57fabdca8e codec_adapter: passthrough: remove passthrough.h
All interface op definitions are static. No need to declare them.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-12 14:24:32 +00:00
Ranjani Sridharan 9a89f4eb80 codec_adapter: fix states before and after processing
set the state to MODULE_PROCESSING before starting to process the
samples and reset it to MODULE_IDLE afterwards.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-12 14:24:32 +00:00
Ranjani Sridharan 820ef37c82 codec_adapter: generic: remove unnecessary goto's
Return ret in case of error.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-12 14:24:32 +00:00
Ranjani Sridharan 0fdfca96d6 codec_adapter: fix typo in error message
It's free not reset and while we're at it, remove the unnecessary braces
too.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-12 14:24:32 +00:00
Ranjani Sridharan 7615eced49 codec_adapter: remove some unnecessary else's
No need for an else after returns or gotos.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-12 14:24:32 +00:00
Ranjani Sridharan fe04bad091 codec_adapter: remove unnecessary goto's in module_init()
Remove the goto's and return the appropriate values right away.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-12 14:24:32 +00:00
Ranjani Sridharan 9ba96e2c4a codec_adapter: remove validate_setup_config()
It has not been implemented and can be introduced later when needed.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2022-01-12 14:24:32 +00:00
Guennadi Liakhovetski befc3d9a61 lib: use 32-bit assignments for memset()
SOF loves memset(). It takes great care to 0-initialise buffers and
objects. And its memset() routine only sets one byte at a time.
Optimise it to use 32-bit assignments where possible.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-12 13:05:12 +00:00
Guennadi Liakhovetski 9abc285574 build: add missing headers
common.h calls panic() and uses SOF_IPC_PANIC_ASSERT, add missing
headers.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-12 13:05:12 +00:00
Guennadi Liakhovetski 986b16495c build: add a missing RELATIVE_FILE definition
base_module and boot_module are separate targets, they need
RELATIVE_FILE defined for them too.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2022-01-12 13:05:12 +00:00
Seppo Ingalsuo 9c002f37e0 Arch: Host: Enable default-no components for testbench build
Components those use library functions fail to run in testbench
if they are not enabled in library_defconfig. The testbench build
builds the component library but not the library dependencies. E.g.
DRC component run in testbench failed because of this. Crossover
worked because it does not currently use library functions. All such
components with functional source are enabled for completeness.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2022-01-11 22:12:02 +00:00
Rander Wang 0ced5ed0f3 ipc4: set pipeline ready after reset.
Currently pipeline reset is used by ipc3 for pipeline
free and pcm param error. It is used by ipc4 to
reinitialize pipeline, so it suitable to set pipeline
to default ready status

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-01-11 22:11:18 +00:00
Rander Wang 17453b58ec ipc4: refine HDA dai driver for ipc4
The blob data of HDA is only for lp mode, not
for hw params, so just return.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-01-11 22:11:18 +00:00
Rander Wang d14b1931a5 ipc4: add chain dma support
Chain dma is only support by HDA gateway. The idea is
to copy data from host to dai directly without any process.
It is just like a pass-through pipeline.

This patch adds support by create a pass-through pipeline
internally.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-01-11 22:11:18 +00:00
Rander Wang 40d625db38 ipc4: return correct ipc status to host
Currently some of pipeline setting ipc messages are
scheduled in another thread, both ipc thread and the
schedule thread may return the status. It is work for
IPC3, but for IPC4 a batch of pipelines will be set
by single ipc message and they will be scheduled in
multiple threads, then multiple ipc messages will be
repied to host. This is invalid.

In this case error may occur in both ipc thread and
schedule thread. To update err status simple, schedule
thread will only return error to ipc thread which will
maintain error status and reply to host.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-01-11 22:11:18 +00:00
Rander Wang f8451fd8b1 ipc4: fix pause issue with windows audio player
(1) IPC4 does not need mixer workaround.
(2) trigger pipeline in release state for pause-running case

Signed-off-by: Rander Wang <rander.wang@intel.com>
2022-01-11 22:11:18 +00:00