Commit Graph

7156 Commits

Author SHA1 Message Date
Guennadi Liakhovetski 1ef769dd87 zephyr: apl: further reduce heap size
Recent changes increased the size of various sections, breaking
linkage again. We need to make the linker calculate the heap size
automatically but until that is ready, reduce the heap size further
to fix the current breakage.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-10-21 15:59:13 +01:00
Daniel Baluta 955c7c9009 topology1: imx8: Add mixing PCM and Compr stream topology
This topologies are for i.MX8QXP/i.MX8QM, i.MX8MP demonstrating
mixing for 1 PCM stream and 1 Compr stream.

Signed-off-by: Daniel Baluta <daniel.baluta@nxp.com>
2021-10-21 15:53:11 +01:00
Marc Herbert 9818410347 cmake: use new --erase_vars feature and test new 'reproducible.ri'
Update the scripts/test-repro-build.sh test accordingly.

Finally, different people and CI systems can make sure they're building
the same firmware.

reproducible.ri is sof.ri with variable parts removed.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-10-21 13:59:46 +01:00
Marc Herbert f8ca8536fd sof_ri_info: add new --erase_vars feature for reproducible builds
sof_ri_info.py  --erase_vars reproducible.ri sof.ri

replaces variable fields (signature and date right now) by constants.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-10-21 13:59:46 +01:00
Marc Herbert d9b7d9f6eb sof_ri_info: new attributes signature and date start and length
Signature and date are (for now) the only variable fields when
re-signing with the same tool so their locations matter.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-10-21 13:59:46 +01:00
Marc Herbert a43cf1aff0 sof_ri_info: pylint: disable=invalid-name, missing-function-docstring
Add:

... to reduce pylint warnings to a usable amount.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-10-21 13:59:46 +01:00
Marc Herbert 85aa873198 sof_ri_info: minor reader.info() additions and tweaks
These changes are visible only in -v mode.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-10-21 13:59:46 +01:00
Marc Herbert 31b3a39202 sof_ri_info: print error messages on stderr
stderr is often highlighted with a different color.
This also makes the usual >/dev/null redirection possible.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-10-21 13:59:46 +01:00
Marc Herbert 2dbec9f2b2 sof_ri_info: show file offsets for most components + some lengths
File offsets were critical in finding the serious begin_off bug fixed in
the same series. The information is already there so just show it.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-10-21 13:59:46 +01:00
Marc Herbert 06187791d7 sof_ri_info: fix adsp_mft_cse_entry.entry_file_offset
Fixes the adsp_mft_cse_entry Component added by
commit 8885b465df ("tools: sof-ri-info: move parsing adsp mft outside
cse mft").

`adsp_mft_cse_entry.entry_file_offset` did not account for the extended
manifest.

Also fix the large `reader.ext_mft_length + entry_offset`
copy/paste/diverge

That variable did not seem to be used anywhere yet but it's wrong value
was confusing and time-consuming when debugging.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-10-21 13:59:46 +01:00
Marc Herbert c66e26a9cf sof_ri_info: fix wrong begin_off in parse_mft_extension()
This broke parsing any extension past the first one.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-10-21 13:59:46 +01:00
Marc Herbert a780519e3f test-repro-build.sh: exclude two more .ninja_ files
Also convert 'differ' to all caps 'DIFFER' to highlight different files.
No other functional change.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-10-21 13:59:46 +01:00
Marc Herbert 512e22eae4 installer: comment fix: hsw and sue are not SIGNED
Pure comments, no code change.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2021-10-21 13:59:46 +01:00
Ranjani Sridharan afc05fcb35 drivers: Intel: hda-dma: Add documentation for HDA DMA programming sequence
Spell out the HD-Audio DMA programming sequence to make it
easier to follow.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-10-21 13:38:07 +01:00
Ranjani Sridharan 7e54f456eb drivers: Intel: hda-dma: ensure DMA channel is idle after stop
Make sure the HDA DMA channel is idle after stopping by checking the
GBUSY bit.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-10-21 13:38:07 +01:00
Ranjani Sridharan 2774464719 drivers: Intel: hda-dma: Handle two-step stop and pause
The recommended programming sequence for HD-Audio DMA's is to clear the
GEN bit after the host has cleared the RUN bit. For host DMA, we can
replace the stop op with the stop_delayed op so that the GEN bit can be
cleared during host reset. For link DMA, add the stop_delayed op to
perform DMA stop during DAI_CONFIG IPC with hw_free if the two-step stop
flag is set for the DAI. For single-step op, there's no change in
sequence.

The two-step sequence for pause is similar to stop. The DMA will be
stopped with dma_stop_delayed when the DAI_CONFIG IPC with the
SOF_DAI_CONFIG_FLAGS_2_STEP_STOP_PAUSE flag after the host has cleard
the RUN bit.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-10-21 13:38:07 +01:00
Ranjani Sridharan e3b6a326c6 audio: dai: Set dev_data for DMA chan
This can be used by the DMA drivers to access device-specific data.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-10-21 13:38:07 +01:00
Ranjani Sridharan 2ce0e3ccd3 lib: dma: Add a new field to struct dma_chan_data
Add a pointer to save the device-specific data for the client device that
requests the DMA channel in struct dma_chan_data.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-10-21 13:38:07 +01:00
Ranjani Sridharan 2416184bc5 audio: host: call dma_stop_delayed during host reset
Some DMA's like the HD-Audio DMA need to be stopped ater the pipeline
has been reset. So call dma_stop_delayed op in host reset so that the DMA
can be stopped during the PCM_FREE IPC when the host gets reset.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-10-21 13:38:07 +01:00
Ranjani Sridharan 8afb35436a audio: DAI: handle two-step stop and pause
If the two_step_stop flag is set for a DAI, DMA reset will be skipped
during DAI reset and it will be done when the DAI_CONFIG IPC is sent
during hw_free. Also, for the pause push case, the DAI_CONFIG IPC will
be sent with the flag SOF_DAI_CONFIG_FLAGS_2_STEP_STOP_PAUSE which
call dma_reset to stop the DMA.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-10-21 13:38:07 +01:00
Ranjani Sridharan e9d2595577 lib: dma: Add stop_delayed op
Add a new optional op for DMA that can be used to stop the DMA after the
pipeline has been reset.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-10-21 13:38:07 +01:00
Ranjani Sridharan aa2cf1fc94 lib: dma: make dma stop op optional
In preparation for adding a reset op that could be used in place of the
stop op for DAI's that support the two-step stop option.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-10-21 13:38:07 +01:00
Ranjani Sridharan 6b420fd538 audio: DAI: Add a delayed_dma_stop flag to DAI data
Add a new field, delayed_dma_stop to struct dai_data that will be set by
the host when the DAI_CONFIG IPC is sent during hw_params.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-10-21 13:38:07 +01:00
Ranjani Sridharan f6c4853271 IPC: DAI: Expand DAI_CONFIG IPC flags
Some DAI components, such as HDaudio, need to be stopped in two steps
a) stop the DAI component
b) stop the DAI DMA

This patch enables this two-step stop by expanding the DAI_CONFIG
IPC flags and split them into 2 parts.

The 4 LSB bits indicate when the DAI_CONFIG IPC is sent, ex: hw_params,
hw_free or pause. The 4 MSB bits are used as the quirk flags to be used
along with the command flags. The quirk flag called
SOF_DAI_CONFIG_FLAGS_2_STEP_STOP shall be set along with the HW_PARAMS
command flag, i.e. before the pipeline is started so that the stop/pause
trigger op in the FW can take the appropriate action to either
perform/skip the DMA stop. If set, the DMA stop will be executed when the
DAI_CONFIG IPC is sent during hw_free. In the case of pause, DMA pause
will be handled when the DAI_CONFIG IPC is sent with the PAUSE command
flag.

Along with this, modify the signature for the hda_ctrl_dai_widget_setup/
hda_ctrl_dai_widget_free() functions to take additional flags as an
argument and modify all users to pass the appropriate quirk flags. Only
the HDA DAI's need to pass the SOF_DAI_CONFIG_FLAGS_2_STEP_STOP quirk
flag during hw_params to indicate that it supports two-step stop and
pause.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-10-21 13:38:07 +01:00
Ranjani Sridharan 500e96b6ac lib: dai: expose and rename dai_config_reset()
Move the function dai_config_reset to the common DAI code so it can be
reused. Also, rename it to dai_dma_release as it does not really reset the
DAI config but rather releases the DMA channel.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-10-21 13:38:07 +01:00
Rander Wang 4c3aafea4c ipc4: add set_large_config support in copier module
Currently copier only supports setting sink format and
auttenuation in set_large_config ops, not in cmd ops.
We will add other features step by step.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2021-10-19 13:47:59 +01:00
Ming Jen Tai bf1e3b7f5b Support both 48kHz and 16kHz recording
Add 48kHz recording support to RTNR
Signed-off-by: Ming Jen Tai <mingjen_tai@realtek.com>
2021-10-19 13:40:12 +01:00
Kai Vehmanen de408a2349 zephyr: trigger system panic if MEM_ZONE_SYS alloc fails
As per documentation in include/sof/lib/alloc.h, rmalloc from
MEM_ZONE_SYS will always succeed. In the unlikely case the alloc
fails, trigger a system panic in rmalloc().

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-10-18 15:58:42 +01:00
Kai Vehmanen 15885b76e1 zephyr: make SYS and RUNTIME zones cached
Add caching to more heap zones. With addition of SYS, SYS_RUNTIME
and RUNTIME the mapping is now aligned with XTOS allocator.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2021-10-18 15:43:16 +01:00
Guennadi Liakhovetski 8549c9c628 multicore: (cosmetic) replace cpu_is_secondary() with cpu_is_primary()
cpu_is_primary() can be easier to parse than !cpu_is_secondary(), make
the swap.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-10-18 15:08:21 +01:00
Guennadi Liakhovetski 5ba5415777 ipc: ipc3: ignore PCM_PARAMS for active pipelines
With IPC3 it is an error to send a PCM_PARAMS IPC on an active
pipeline, but it is a valid use-case with IPC4, ignore such IPCs.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-10-18 15:08:21 +01:00
Guennadi Liakhovetski 02d7974cf7 keyword: check test_keyword_get_threshold() return value
test_keyword_get_threshold() can return errors, make sure to check
its return value before using it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-10-18 15:08:21 +01:00
Guennadi Liakhovetski 8798dd508f ipc: print the incoming IPC code
IPCs from the host aren't very frequent during normal operation, and
having all their codes in firmware trace output is extremely useful
for debugging. Add a trace print for arriving IPCs.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-10-18 15:08:21 +01:00
Guennadi Liakhovetski 7060593a65 ipc: properly account IPC responses on multicore
It is possible, that ipc_complete_cmd() is entered 3 times while
processing a single IPC message in multicore configurations: once by
the primary core, then by the IDC IPC processing context, and finally
by the pipeline thread, actually executing the IPC. To make sure that
the response is only sent once by the core, that actually processes
the IPC, we must not clear the .delayed_response flag on the primary
core in such cases, it should only be done by the IDC IPC context
before the pipeline task actually sends the response.

Fixes: 82857a78ba ("ipc: fix a IPC completion race")
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-10-18 15:08:21 +01:00
Ranjani Sridharan 9c93028e1e buffer: use cache ptr for inv/wtb
Buffer allocation has been changed to the runtime_shared
zone. Use cache ptr to do the invalidates/writebacks.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2021-10-18 15:05:52 +01:00
Guennadi Liakhovetski b82e0efc75 pipeline: always check pipeline_for_each_comp() return value
Make sure all pipeline_for_each_comp() return values are
consistently checked.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-10-15 16:24:53 +01:00
Guennadi Liakhovetski 3b0c91e222 ll_schedule: (cosmetic) remove a redundant type-cast
atomic_read() returns values of type uint32_t, no need to cast to it
again.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-10-15 15:21:47 +01:00
Guennadi Liakhovetski acba2d12d0 ll_schedule: don't re-enable the domain if no tasks are active
If the last task completes in a domain, don't re-enable it. It will
be re-enabled when a new task is submitted.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-10-15 15:21:47 +01:00
Guennadi Liakhovetski d4fd1b3eb6 timer_domain: don't unregister interrupt handler from itself
If the last task in the timer domain is completed, the ll_scheduler
tries to unregister the task from the domain. The timer domain
driver currently tries to unregister the interruptin its
.domain_unregister handler, which then leads to a crash. Avoid
unregistering the handler from itself.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-10-15 15:21:47 +01:00
Guennadi Liakhovetski b60b77d004 pipeline: stop recursing if requested by a component
When recursing pipeline components, using pipeline_for_each_comp(),
each component's .comp_func() method is called. Those methods can
return 0 for success, a negative error code or PPL_STATUS_PATH_STOP
if recursing should stop. However, the latter code is ignored by
pipeline_for_each_comp(). Add a check for that code and terminate
recursion if detected.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-10-15 15:10:12 +01:00
Guennadi Liakhovetski d9652bd6c2 pipeline: check error codes, propagate errors
pipeline_for_each_comp() and buffer_set_params() can fail, make sure
to check their return values and propagate any errors.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2021-10-15 15:10:12 +01:00
Curtis Malainey 675a255e11 ipc: don't shadow functions with variables
ipc_free is a function, we should avoid shadowing in the event we tried
to use the function here.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-10-15 14:14:40 +01:00
Curtis Malainey ffbc717c30 style: make delcaration match implementations
minor style violation, these should match exactly

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-10-15 14:14:40 +01:00
Curtis Malainey fb834b68c1 dmic: conditionally include variables
conditionally used variables should be conditionally compiled in

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-10-15 14:14:40 +01:00
Curtis Malainey ae8b2e0730 crossover: fix return type
Can't return a negative error if we are returning an unsigned type.
C is great right? No reason to ever use something like rust...

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-10-15 14:14:40 +01:00
Curtis Malainey 2c4f57d0f2 codec_adapter: remove pointless null pointer check
We should always have a dev, and even if we didn't we would crash here
because we logged above in debug using dev and we are logging the
error itself using dev.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-10-15 14:14:40 +01:00
Curtis Malainey b72d3c2446 dmic: change condition to satisfy cppcheck
cppcheck for some reason doesn't understand that j > 1 has nothing to do
with the indexing itself and this the check is pointless, so switch to
!= so it doesn't flag the issue anymore.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-10-15 14:14:40 +01:00
Curtis Malainey 751cc6ddf8 numbers: fix signed int overflow
if we shift 1 left 31 times we will overflow the signed bit. Assuming
the intent is correct lets make this unsigned so cppcheck won't
complain.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-10-15 14:14:40 +01:00
Curtis Malainey d648016b83 multiband_drc: fix null pointer check
cppcheck pointed out that either our nullpointer check was not needed or
that we are failing to do it before using the pointer. The check looks
valid so lets fix the lookup.

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-10-15 14:14:40 +01:00
Curtis Malainey 09703d33f6 dmic_nhlt: fix uninitialized value
cppcheck error

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2021-10-15 14:14:40 +01:00