Commit Graph

7359 Commits

Author SHA1 Message Date
Laurentiu Mihalcea 48499455c8 cleanup: platform: imx8: remove unneeded `include` statements
Remove unneeded `include` statements. An `include` statement
is deemed as unneeded if, by removing it, the build process
will not fail.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-04-29 13:56:20 +03:00
Laurentiu Mihalcea c03635d84b cleanup: platform: imx8: remove `platform_wait_for_interrupt` definition
`platform_wait_for_interrupt()` is an XTOS-only construct
so it's not needed for imx8 which is a Zephyr-only platform.
Remove it.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-04-29 13:56:20 +03:00
Laurentiu Mihalcea 42ed96ef44 cleanup: platform: imx8: remove unused structure declaration
Commit b0cc9dc7b5 ("cleanup: platform: imx8: remove redundant
calls in platform_init()") removes function call that uses the
`timer_shared` structure so it can be dropped.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-04-29 13:56:20 +03:00
Laurentiu Mihalcea 6e30aaee32 cleanup: platform: imx8: remove redundant calls in platform_init()
XTOS is no longer supported on imx8. As a consequence,
some calls from imx8's platform_init() have become
redundant. Remove these calls/initializations as well
as those who are redundant because of some configurations
that are not enabled (e.g: `CONFIG_TRACE`, or `CONFIG_HAVE_AGENT`).

This is a followup for #8863.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-04-29 13:56:20 +03:00
Tobiasz Dryjanski 40a6fc7dab volume: fix fadeout curve shape
Fadeout curve had inaccurate shape due to incorrect computation of ramp
function.

Suggested by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com>
2024-04-29 10:56:08 +03:00
Damian Nikodem e603d8f09b audio: copier: use v_index for DAI index in I2S link creation
This commit updates the copier DAI creation logic for I2S links to use
the `v_index` field from the `node_id` structure as the DAI index. This
change ensures that the correct DAI index is used when creating I2S links,
aligning with the new SSP link management mechanism.

West update to necessary SSP changes:
driver: ssp: update Intel SSP DAI driver to support dynamic SSP management

Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
2024-04-25 15:58:23 +01:00
Marcin Szkudlinski 5f25174789 dp: make dp_queue using externally provided params set
Dp_queue is currently used only as a comp_buffer "shadow"
for DP modules.
Shadow buffers must have the very same param set as main
buffers.
Problem: till now the complete vector of params was
copied from comp_buffer to dp_queue inm prepare method.
Problem is that if anything will change any of params
afterwards, the change won't propagate.
This commit introduces sharing the param vector between
comp_buffer and its shadow

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2024-04-25 15:35:06 +01:00
Marcin Szkudlinski 80445dc5ee dp: remove dead code from dp_queue
the backdoor removed in this commit has never been used
A new backdoor will be introduced in new commit

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2024-04-25 15:35:06 +01:00
Laurentiu Mihalcea 65b8a32f27 nxp: imx8ulp: switch to native Zephyr drivers and timer domain
Switch to Zephyr native drivers and timer domain. This
includes:
	1) Switching all imx8ulp topologies to timer domain.
	2) Disabling Zephyr DMA domain
	3) Various interrupt-related fixes via Kconfig-related
	ifdef logic.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-04-25 14:12:41 +03:00
Kai Vehmanen d42e8822f2 audio: base_fw: add missing copyright statement to banner
Add missing copyright statement to file header.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-04-24 13:36:35 +03:00
Kai Vehmanen 5a6455630e audio: base_fw: move IPC4_EXTENDED_SYSTEM_TIME to platform code
Move implementation of IPC4_EXTENDED_SYSTEM_TIME from generic
to platform specific code. The implementation depends on specific
ART counter that is not available on all platforms, so it is better
to handle this in platform specific code.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-04-24 13:36:35 +03:00
Kai Vehmanen 422fdc1229 audio: base_fw: move IPC4_MEMORY_STATE_INFO_GET code to platform
The implementation for IPC4_MEMORY_STATE_INFO_GET requires
reading direct register contents to fill out the structure,
so this is by definition platform specific code. Move this
to platform implementation.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-04-24 13:36:35 +03:00
Kai Vehmanen a1120f0f9f audio: base_fw: move L1_EXIT control to platform specific code
Move the Intel specific L1_EXIT control handling from base_fw.c
to Intel specific platform code.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-04-24 13:36:35 +03:00
Kai Vehmanen c75c17e800 ipc4: base_fw: add support for get/set large config extensions
Add support to handle platform specific extensions with
platform_basefw_get_large_config() and
platform_basefw_set_large_config(). These functions are called when
get/set handled is called with a parameter type not handled
in generic code.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-04-24 13:36:35 +03:00
Kai Vehmanen c4cd66b8b2 audio: base_fw: add platform layer to fw_config data
Some of the IPC4 FW_CONFIG fields are platform specific and cannot be
filled with generic code.

Handle this data by adding a call to platform_basefw_fw_config()
and add an implementation for all current platforms with IPC4
support.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-04-24 13:36:35 +03:00
Kai Vehmanen 4d0a9f5299 ipc4: base_fw_platform: fix typo in doxygen
Fix spelling in platform_basefw_hw_config() documentation.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-04-24 13:36:35 +03:00
Grzegorz Bernat 7b0c202f7b Audio: basefw: Implemented ipc4 libraries info get
Added support for ipc4 query no 16. This makes it possible to get
information about the current basefw library.

Signed-off-by: Grzegorz Bernat <grzegorzx.bernat@intel.com>
2024-04-23 19:40:49 +03:00
Laurentiu Mihalcea 9737e124bc nxp: imx8/imx8x: switch to native Zephyr drivers and timer domain
This commit includes all necessary changes for switching
to timer domain and Zephyr native drivers on imx8 and imx8x.
This consists of:
	1) Switching all imx8 topologies to timer domain.
	2) Disabling Zephyr DMA domain
	3) Various interrupt-related fixes via Kconfig-related
	ifdef logic.

This commit includes all necessary changes for switching
to native Zephyr drivers on imx8/imx8x.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-04-23 12:20:31 +01:00
Laurentiu Mihalcea ca72c403a3 lib: dai: add entry for NXP's ESAI
Add entry for NXP's ESAI IP inside the "zephyr_dev" array.
What the entry does is it fetches all "struct device"s for
ESAI nodes marked as "okay".

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-04-23 12:20:31 +01:00
Laurentiu Mihalcea 43422abe02 audio: dai-zephyr: add entry for NXP'S ESAI
Add entry for NXP's ESAI IP in dai_set_config().

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-04-23 12:20:31 +01:00
Grzegorz Bernat db97b54939 Audio: basefw: Implement ipc4 pipeline info get
Added support for ipc4 query no 255 (10).
This make it possible to get information about
the current loaded pipelines.

Signed-off-by: Grzegorz Bernat <grzegorzx.bernat@intel.com>
2024-04-23 12:16:50 +01:00
Serhiy Katsyuba 06869cb20d detect_test: Fix processing for 24in32 format
* Added sign extension to properly convert 24in32 sample to int32_t.

* To choose default threshold valid sample size should be used instead
of container size.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2024-04-22 14:24:53 +01:00
Tobiasz Dryjanski 8a84d02bac volume: fix wrong volume ramp being chosen
Fade out was not working due to wrong order of operations. Ramp type was
set up before the correct type was set, so the default was always used.

Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com>
2024-04-22 14:18:58 +01:00
Serhiy Katsyuba 30b3011bd8 ipc4: mixin: Add gain support (generic and HIFI3)
Restore gain support which was accidentally removed during previous
HIFI optimization/refactoring.

This commit only adds gain supports to "generic" and "HIFI3" mixin
implementation.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2024-04-22 14:18:17 +01:00
Johny Lin 58f141c19e module_adapter: return error if get_conf is not implemented
At present, if get_configuration is not implemented by internal module,
module_adapter will return 0 directly on config read commands. Under
the circumstances, the host will suppose the reading is succeeded, but
in fact the ata in IPC buffer is unwanted.

This commit changes the return code to non-zero for such cases, which
prevents the host getting the unwanted config data.

Signed-off-by: Johny Lin <johnylin@google.com>
2024-04-18 11:55:13 +03:00
Kai Vehmanen 14c4e86757 audio: base_fw: add platform layer to IPC4 hw_config data
Some of the IPC4 HW_CONFIG fields are platform specific and cannot be
filled with generic code.

Handle this functionality by separating platform specific parts of
base_fw to a new base_fw_platform.h interface. Move out existing code
for Intel cAVS and ACE platforms. Add a new stub implementation for
posix platform. This posix stub can be also used as a starting point
when adding IPC4 support to new platforms.

This platform construct can be later used to move out other
vendor and platform data out from base_fw.c.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-04-17 16:20:48 +01:00
Adrian Warecki 902b1e5817 lib_manager: modules: move native lib support to lib_manager
Moved module type identification to lib_manager. Since llext modules place
the buildinfo structure in a separate section, API version verification has
been moved to llext_manager. Thanks to these changes, the Processing Module
Adapter is used only by IADK modules as intended. This commit also fixes an
issue with the modules_free function not being called for native modules.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-04-17 14:34:58 +03:00
Serhiy Katsyuba 784da5468e detect_test: Do not overwrite supplied threshold
Default threshold should be applied only if it was not already set
via IPC4_DETECT_TEST_SET_CONFIG call.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2024-04-17 14:34:04 +03:00
Kai Vehmanen 918eff3dab platform: tigerlake: remove unused driver headers
Remove leftover driver headers that are no longer used.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-04-17 09:13:30 +03:00
Kai Vehmanen 7111ed266d platform: mtl: fix SSP DAI count
Fix the SSP DAI count to 3.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-04-17 09:12:03 +03:00
Guennadi Liakhovetski c5230a9f0d smart-amp-test: add support for the Cadence toolchain
The Cadence Xtensa cross-toolchain cannot build shared libraries,
when using it we build relocatable ELF objects instead. Update
smart-amp-test to support both formats.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-04-16 15:30:02 +01:00
Guennadi Liakhovetski 132fdafbf4 llext: check whether the first instance is initialised
We need to tell Zephyr whether or not to perform local relocations.
Check persistent library data to distinguish the first instantiation
from the following ones.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-04-16 15:30:02 +01:00
Guennadi Liakhovetski 9dca9832d8 llext: use data size from Zephyr
Some image formats, notably relocatable objects, don't create ELF
segments. To work around this use the object data size, calculated by
Zephyr.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-04-16 15:30:02 +01:00
Guennadi Liakhovetski f9c22377a0 llext: avoid copying 32KiB of meaningless data
We're skipping unused 0x8000 bytes of data at the beginning of the
module, so we have to reduce the amount of data to be copied
accordingly.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-04-16 15:30:02 +01:00
Tobiasz Dryjanski 821f961fba smart_amp_test: fix crash due to different source formats
Smart amp test chooses a process function based on the sink only. Because
of this, there's a possibility that one of the sources has a 16bit format,
which can't be safely processed by the 32bit process function. The crash
only happened when dai_copier sent one less sample than usual to the
smart_amp. This makes total sample count an odd number, making the data in
the audio_stream buffer misaligned.

This patch changes the prepare function of smart_amp_test to consider all
the sources and sinks while deciding which process function to use.

Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com>
2024-04-16 12:42:44 +01:00
Kai Vehmanen 537b0b321c platform: remove platform/drivers/idc.h for Intel platforms
For Zephyr builds, only definition needed from platform/drivers/idc.h
was prototype for idc_send_msg(). There's no need to keep the platform
layer just for this, so add the definition to rtos/idc.h for Zephyr
builds, and remove the platform/drivers/idc.h for all Intel platforms.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-04-16 14:12:34 +03:00
Kai Vehmanen fea70bd307 idc: zephyr_idc: implement idc_send_msg for non-multicore platforms
Ensure idc_send_msg() is implemented for all platforms linking
zephyr_idc. For non-multicore, idc_send_msg() will return -ENOTSUP
error.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-04-16 14:12:34 +03:00
Kai Vehmanen ef6e86a527 ipc: ipc4: remove use of platform/drivers/alh.h
Definitions of XTOS ALH driver interface are no longer used in
SOF tree. Remove the unnecessary inclusion in ipc4 dai.c, and all
instances of the platform alh.h header.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-04-16 09:02:33 +01:00
Kai Vehmanen 834f8cef7d ipc4: dai: drop code for XTOS ALH drivers
Drop support for XTOS drivers for Intel ALH DAI.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-04-16 09:02:33 +01:00
Kai Vehmanen 0db7caa7b1 platform: remove drivers/interrupt.h for Intel platforms
The interrupt.h interface is no longer used by any Intel platform
as all drivers have been replaced with native Zephyr drivers, so these
definitions are no longer needed.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-04-16 02:59:55 +03:00
Laurentiu Mihalcea c592f78e25 module: cadence: don't return on non-fatal error
Assuming the following pipeline:

   HOST ---> MA (CADENCE [MP3 DECODER]) ---> DAI

for native Zephyr SOF, data is first copied from the host
component to MA and then from Linux to the host component.
This means that the first chunk of data will be 0s (since
the host DMA buffer is zero'd via host_prepare()) instead
of useful data. Because of this, the `XA_CMD_TYPE_INIT_PROCESS`
command will return a non-fatal error (i.e:
`XA_MP3DEC_EXECUTE_NONFATAL_NEXT_SYNC_NOT_FOUND`). This
is not the case for non-native SOF since data is first copied
from Linux to host and then from host to MA so the aforementioned
command will get actual data instead of 0s.

Instead of having to alter the flow of data for native Zephyr
SOF (i.e: change the order in which data is copied), which
could impact other components and bits of the firmware, the
fix is to not return if the command returns a non-fatal error.
This way, the first chunk (i.e: the 0s) will be consumed and
the processing can start with the next chunk.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-04-15 20:03:37 +03:00
Tomasz Leman d534df477f pipeline: graph: Use hex format for component IDs in graph logs
Update the logging statements in pipeline-graph.c to display component IDs
in hexadecimal format. This change ensures consistency with other logging
within the system and improves the clarity of the logs when tracking
component IDs during debugging sessions.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-04-15 14:43:50 +01:00
Tomasz Leman 4a6ca60060 ipc4: helper: Convert component ID logs to hexadecimal format
Switch component ID logging to hexadecimal in ipc4/helper.c to align with
the rest of the system's logging conventions. This enhances consistency
and aids in debugging by matching the component ID format used in other
diagnostic tools.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-04-15 14:43:50 +01:00
Tomasz Leman af131ae03f pipeline: params: Display component IDs in hex format in pipeline logs
Standardize component ID logging by displaying them in hexadecimal
format across all pipeline logs. This change aligns the component ID
representation with other parts of the firmware logs where hexadecimal
is used, facilitating quicker cross-referencing and searchability for
specific components during debugging.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-04-15 14:43:50 +01:00
Tomasz Leman ff4daf1ae0 ipc4: helper: Use hex format for component IDs in ipc-helper logs
Unify the logging format for component IDs by converting them to
hexadecimal in ipc-helper.c. This change ensures consistency with other
log entries and improves the ease of identifying components when
cross-referencing with other debugging outputs that use hex notation for
component IDs.

Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
2024-04-15 14:43:50 +01:00
Krzysztof Frydryk 5f90a88dcb platform: register proper basefw CPS consumption on boot
On init, register consumption of 10MCPS for base fw
if CONFIG_KCPS_DYNAMIC_CLOCK_CONTROL enabled

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>
2024-04-15 13:48:33 +01:00
Krzysztof Frydryk db921487c5 pipeline: Register and unregister pipelines CPS consumption on run/pause
Register and unregister pipelines CPS consumption on run/pause

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Signed-off-by: Krzysztof Frydryk <krzysztofx.frydryk@intel.com>

+Squashed commits:
924f0d26db pipeline: print warning if 0 KCPS received
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
7bb6e7ef3b pipeline: register CPS consumption for a proper core
Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
5f0c4e4c31 pipeline: make CPC data "opt-in" with fallback
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
2024-04-15 13:48:33 +01:00
Adrian Bonislawski 6a71338c19 platform: init kcps budged before any kcps adjustments
KCPS budged should be initialized before any KCPS adjustments

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2024-04-15 13:48:33 +01:00
Adrian Bonislawski 824a7820f3 clk: remove unnecessary freq change notifications
Such notification currently is used only in non-zephyr code (ll sched)
so it is safe to remove for MTL because of some idc issues

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2024-04-15 13:48:33 +01:00
Tobiasz Dryjanski 28100904bb base_fw: Add perf measurement state set ipc
Adds performance measurement state ipc to change the state of
performance measurement.

Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com>
2024-04-12 19:21:42 +03:00