Commit Graph

10063 Commits

Author SHA1 Message Date
Marc Herbert ce0dd67bb7 sof_builder/Dockerfile: restore deleted toolchains
Building a Docker image takes several hours. To reduce costs and save
time we don't want to maintain a different Docker image for the
stable-v2.2 branch. Restore toolchains that were accidentally removed
from the Dockerfile because this will unnecessarily paint red every PR
submitted to the stable-v2.2 branch, example:

https://github.com/thesofproject/sof/actions/runs/4867162042/jobs/8679468096

If we want to stop supporting something then let's keep things simple
and remove it only where it actually gets in the way and where it
actually becomes a problem. No need to search and scrub every reference
to it from the face of the planet and accidentally make our life harder
on release branches, create pointless git conflicts and _increase_
maintenance costs when trying to reduce them!

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-05-15 11:17:40 +03:00
Marc Herbert fca84b8773 .github/zephyr: align hal_xtensa when compiling with Zephyr main branch
We import hal_xtensa indirectly through zephyr/west.yml.

When overriding the Zephyr revision in sof/west.yml to test the Zephyr
main branch "zmain", we must also update the version of hal_xtensa
specified in zephyr/west.yml. Stop doing a manual, single repo git fetch
and use a submanifest to perform this correctly. This is exactly why
submanifests/ were added in the first place.

These fixes the imx8m compilation error spotted and discussed
in (unrelated) #7579 following the IMX rename in
https://github.com/zephyrproject-rtos/zephyr/pull/57084 and
https://github.com/zephyrproject-rtos/zephyr/pull/57795

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-05-12 11:40:42 -07:00
Kwasowiec, Fabiola adb7b14793 Peakvol: correct volume processing function
When calculating the out_sample value,
the AE_SLAI32S function is used,
which rounds the result to the value 1/(-1),
resulting in a rectangular signal.

Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com>
2023-05-12 11:35:13 -07:00
Baofeng Tian 51ade663cb copier: fix ipcgtw position issue
there is no interface for ipcgtw position, also no variables to
track for ipcgtw position, since ipcgtw device was removed,
ipcgtw position support have to be removed from copier.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-05-12 08:01:32 -07:00
Baofeng Tian bc74137c3c ipcgtw: remove all device related function content
Those standard interface are no longer needed by copier, since
copier already can call with zephyr prefix function to have same
functionality, so removed those code.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-05-12 08:01:32 -07:00
Baofeng Tian ce6ec18fcb copier: remove ipcgtw device creation and its usage
After all ipcgtw expose new interface to copier, copier does not
depend on ipcgtw device anymore, remove it to align with host and
dai optimization.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-05-12 08:01:32 -07:00
Baofeng Tian 84e4484b94 copier: remove ipcgtw copy case
ipcgtw copy is empty, due to ipcgtw device will be removed, so
remove its copy function.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-05-12 08:01:32 -07:00
Baofeng Tian e9d00eb4ef copier: expose ipcgtw_zephyr_params and reset to copier
copier use zephyr prefixed function calling instead of through
ops driver to implement params and reset functionality.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-05-12 08:01:32 -07:00
Baofeng Tian 77904bacf9 ipcgtw: split the ipcgtw_params function
Split the ipcgtw_params() function and add a new helper,
ipcgtw_zephyr_params() that can also be invoked from the copier device.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-05-12 08:01:32 -07:00
Baofeng Tian 65bd630f96 ipcgtw: split the ipcgtw_reset function
Split the ipcgtw_reset() function and add a new helper,
ipcgtw_zephyr_reset() that can also be invoked from the copier device.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-05-12 08:01:32 -07:00
Baofeng Tian df9421836e copier: replace ipcgtw trigger and prepare with direct calling
for ipcgtw case, there is nothing to do for it, except for set
ipcgtw device state, so directly set state for prepare and trigger
instead of through ops driver, this part of code will be removed
since ipcgtw device will be removed eventually.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-05-12 08:01:32 -07:00
Baofeng Tian 79faeb5a95 copier: expose ipcgtw_zephyr_new and ipcgtw_zephyr_free function
Expose the ipcgtw_zephyr_new()/free() functions and use them for
creating/freeing the endpoint device. This is preparation to
replace the endpoint device with the copier device and eventually
remove the endpoint device itself.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-05-12 08:01:32 -07:00
Baofeng Tian 07805bfb09 ipcgtw: split the ipcgtw_free function
Split the ipcgtw_free() function to add a helper function,
ipcgtw_zephyr_free() in preparation for this to be called
from both a ipcgtw device and copier device.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-05-12 08:01:32 -07:00
Baofeng Tian 8d89d8223c ipcgtw: split the ipcgtw_new function
Split the ipcgtw_new() function to add a helper function,
ipcgtw_zephyr_new() in preparation for this to be called from both
a ipcgtw device and copier device.

Signed-off-by: Baofeng Tian <baofeng.tian@intel.com>
2023-05-12 08:01:32 -07:00
Ranjani Sridharan 9e7ec5a3f2 Revert "topology2: cavs-nocodec: add a module copier to SSP 0 capture pipeline"
DAI copiers now support multiple sinks. So revert the temporary
workaround in the cavs-nocodec topology.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-12 14:26:51 +03:00
Ranjani Sridharan 5e60b3721e dai-zephyr: Support multiple sink buffers with single endpoint copier DAIs
Add support for single endpoint DAI copiers with multiple sinks by copying
from the DMA to all the sink buffers in a loop while using the right PCM
converter function. Modify the signature of dai_zephyr_copy() to pass the
array of converter functions to be used while copying from the DMA.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-12 14:26:51 +03:00
Ranjani Sridharan a09982e093 lib: dma: Add a new DMA buffer copy function
Add a new DMA copy function, dma_buffer_copy_from_no_consume(), that can
be used to copy from the DMA buffer to the sink without modifying the
read pointer in the DMA buffer. This will be used when the DMA data
needs to be copied to multiple sink buffers. The DMA buffer pointer
should be updated at the end of all copies in this case.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-12 14:26:51 +03:00
Kai Vehmanen 4a4d8d2619 intel: ssp: drain RX fifo when starting
If DMA transaction is ongoing when RX is enabled, this can lead
to stuck communication between DMA and SSP (DMA service request
not seen by the DMA).

To avoid this, flush the RX fifo before enabling SSP RX.

Link: https://github.com/thesofproject/sof/issues/7548
Suggested-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-05-12 14:01:43 +03:00
Kai Vehmanen e94071fb82 intel: ssp: do not read data directly if DMA is active
If DMA is active, do not read data directly from the SSP
RX fifo.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2023-05-12 14:01:43 +03:00
Serhiy Katsyuba c00354b46d LMDK: Loadable Modules Dev Kit build scripts
Initial commit with set of cmake and linker scripts to build loadable
modules binary.

Things yet TODO:
  add all necessary Dev Kit header files to include dir,
  replace dummy example with somewhat useful module example.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2023-05-12 10:56:34 +02:00
Kwasowiec, Fabiola 0f20e2affb dma: reset DGCS_GEN when pipeline is reset
DGCS_GEN bit should be set to 0 on a pipeline state change to reset

Signed-off-by: Kwasowiec, Fabiola <fabiola.kwasowiec@intel.com>
2023-05-12 10:43:24 +02:00
Ranjani Sridharan 2185d4a04b audio: buffer: Realloc buffer with alignment
When the DMA buffer is reallocated pass the alignment argument to honor
the buffer address alignment that was used originally. Update the
buffer_set_size() to pass the requested alignment and all its users.
This is particularly needed in the case of host and DAI DMA buffers that
query the buffer address alignment from the DMA driver while allocating
the DMA buffers.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-12 10:48:48 +03:00
Rander Wang 406e660a34 topology2: add google rtc aec support
Add google rtc aec in topolog for chrome project

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-05-11 12:46:44 -07:00
Rander Wang 912408822c topology2: add google-rtc-aec-reference
Top topology can include this conf file to enable google rtc aec

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-05-11 12:46:44 -07:00
Rander Wang 4bf7c60061 topology2: add google-rtc-aec-capture pipeline
This aec is connected to host copier

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-05-11 12:46:44 -07:00
Rander Wang ff5c10337f topology2: add google rtc aec module support
Goolge rtc aec only supports 16bits input & output and 2 channels

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-05-11 12:46:44 -07:00
Guennadi Liakhovetski a4c8d4ef79 Intel: remove XTOS support
XTOS isn't supported any more for Intel platforms, remove support for
it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2023-05-11 19:17:17 +03:00
Tomasz Leman 93947f98a4 platform: ace: notifying about idle thread readiness
Informing the primary core that the Idle thread on secondary core is
ready. During the D3 exit flow thread is not initialize again, but
restored from previously saved context.

This patch includes also zephyr version update to aba3b12e31 (total 15
commits). Changes related to intel_adsp contain refactor and fixes for
ACE secondary cores power flows.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-05-11 19:08:28 +03:00
Tomasz Leman a048951286 zephyr: cpu: secondary core idle thread init
Idle thread should be initialize only when core it booting for the first
time. Doing this again would overwrite the kernel structs and the idle
thread stack.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2023-05-11 19:08:28 +03:00
Ranjani Sridharan 4123f95353 topology2: cavs-nocodec: Build LNL nocodec topology
Build LNL nocodec topology with simple copier-copier pipelines.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-11 19:03:21 +03:00
Ranjani Sridharan 142b8de409 topology2: intel: dmic-generic: Implement passthrough option
Add the host and IO gateway pipelines when the passthrough option is
chosen and connect them.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-11 19:03:21 +03:00
Ranjani Sridharan 88ead25037 topology2: intel: dmic-generic: Make processing pipelines optional
In preparation for adding copier-copier pipeline, make the processing
pipelines conditional. There is no change in functionality or
definitions. This is purely to make it easier to exclude the
pipelines/pcms/routes from the final topology.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-11 19:03:21 +03:00
Ranjani Sridharan fff55d4235 topology: include: pipelines: ip-gateway-capture: set default direction
It is meant for capture.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-11 19:03:21 +03:00
Ranjani Sridharan 19d9cce4cf topology2: cavs-nocodec: Implement passthrough option
Add the host and io gateway pipelines when the passthrough option is
chosen and connect them directly.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-11 19:03:21 +03:00
Ranjani Sridharan 5ea630dbef topology2: cavs-nocodec: Make the processing pipelines optional
In preparation for generating simple copier->copier pipelines, add an
option to make the processing pipelines conditional. There is no change
in functionality or definitions. This is purely to make it easier to
exclude these pipelines/pcms/routes from the final topology.

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-11 19:03:21 +03:00
Ranjani Sridharan d37da44c39 topology2: cavs-nocodec: Make io-gateway for SSP1 capture conditional
It should be added only if SSP1 is enabled

Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
2023-05-11 19:03:21 +03:00
Marc Herbert 45c3f13215 .github/fuzzer: add IPC matrix and IPC4 to new fuzzer
Hot on the heels of PR #7531.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-05-11 11:43:07 +03:00
Marc Herbert 1f9c58af6f .github/fuzzer: fix comment indentation, applies to only one fuzzer
Fix the comment indentation to show it applies only to the older fuzzer.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-05-11 11:43:07 +03:00
Marc Herbert bc0b868ffd fuzz.sh: update comments for IPC4. No functional change.
Update comments for brand new IPC4 support. No functional change.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2023-05-11 11:43:07 +03:00
Seppo Ingalsuo 1cc853d1e9 Audio: SRC: Use only module API and fix IPC4 capture direction
This patch cleans up SRC component. There is no need to keep
IPC3 version build with legacy component interface. The patch
mainly removes code under CONFIG_IPC_MAJOR_3 and makes some
functions available for all builds from CONFIG_IPC_MAJOR_4.

The IPC4 capture issue is fixed by using the src_init()
IPC rates for source and sink rate initialize. It needs a
similar kernel update to always set those values. In practical
topologies in prepare the buffers may not contain the correct
stream information because the order of host copier and
dai copier pipeline prepare can be host first where capture
SRC is usually placed.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-05-10 19:01:31 +03:00
Seppo Ingalsuo 1240cf03ff Audio: Module adapter: Pass entire new() IPC to SRC
This patch differentiates SRC component from normal processing
component IPC. The corrected size allows the client component to
receive all of init() IPC.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-05-10 19:01:31 +03:00
Rander Wang c605296636 topology2: add multicore support for CI test
create another topology to test multicore since Currently we have done
too much work in cavs-nocodec and CI test will be failed for main branch
is not ready for multicore feature.

Signed-off-by: Rander Wang <rander.wang@intel.com>
2023-05-10 17:12:30 +03:00
Seppo Ingalsuo 81060d9b88 Tools: Tune: Add to DMIC modes generate alsa-utils export
This patch adds export format for header file that alsa-utils
uses. Automatic generation is much more convenient than hand
editing when there is update need.

The patch also contains some cleanup of unused code and small
code improvement. There are no changes to exported coefficients
values.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2023-05-10 11:28:33 +03:00
Adrian Warecki bf397bf9c2 dmic: Use the correct 24 bit conversion function
The DMIC interface places 24-bit samples on the most significant bits of
a 32-bit container. The correct conversion function for this gateway was
used.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2023-05-09 09:08:19 -07:00
Andy Ross 7f02b0b30b ipc4: Quiet errors when fuzzing
Fuzzing produces (by design) an endless flood of protocol errors.
Quiet the top level ones when in use, because otherwise the log output
takes up most of the CPU time available that we'd rather spend on
fuzzing.  Same trick from IPC3.

Signed-off-by: Andy Ross <andyross@google.com>
2023-05-09 12:17:44 +03:00
Andy Ross deefe40f0d platform/posix: IPC4 updates
Don't use the IPC3 protocol whiteboxing for IPC4, the formats are
different.

Also IPC4 seems to send a LOT of zero-length empty replies.  Those are
causing spurious errors (memcmp_s fails when you pass it a null
destination pointer, even when the length is zero), where the Intel
IPC driver will just drop them.  Suppress handling to match behavior,
though this is probably a buglet worth investigating.

Signed-off-by: Andy Ross <andyross@google.com>
2023-05-09 12:17:44 +03:00
Andy Ross 3f817fd192 platform/posix: Update for IPC4
Add new APIs needed for CONFIG_IPC_MAJOR_4=y builds.  Note that many
of these are fairly Intel-specific, meaning they probably don't belong
in the platform layer.  But in this case (fuzzing) it's probably
worthwhile to enable as much code as possible vs. refactoring for
purity.  Future IPC4 hardware platforms will need to do that
refactoring for us anyway.

Signed-off-by: Andy Ross <andyross@google.com>
2023-05-09 12:17:44 +03:00
Andy Ross c542db3466 ipc4: Clean up Intel/rimage dependencies
The component model for IPC4 seems to be based on an array of manifest
headers at the start of the firmware image.  Those are rimage data,
and not all platforms (in particular the fuzzer) are packing their
output with rimage.

Just stub this for now.  In the source tree as it exists, there don't
seem to be any extra components to build, nor is there any support I
can see at the linker/rimage level to get them included anyway.

Signed-off-by: Andy Ross <andyross@google.com>
2023-05-09 12:17:44 +03:00
Andy Ross 2897d4029f base_fw: No Intel register reads in non-platform code
This was trying to read hardware registers, which obviously doesn't
work on other platforms.  Stub with zeros for now.

Longer term: this whole message ("basefw_mem_state_info") might want
some rework.  In addition to being heavily hardware-specific, it seems
like a comparatively large block without self-describing data
(e.g. id/val pairs), nor with a struct definition to specify it, nor
with any documentation that I can find.

Signed-off-by: Andy Ross <andyross@google.com>
2023-05-09 12:17:44 +03:00
Andy Ross bffe168d89 init.c: Missing header
This calls mailbox APIs when building for IPC4, but was missing the header

Signed-off-by: Andy Ross <andyross@google.com>
2023-05-09 12:17:44 +03:00