Commit Graph

12010 Commits

Author SHA1 Message Date
Adrian Warecki e0aba2b67a component: module_adapter: Move module_interface pointer to comp_driver
Moved pointer to module_interface from struct module_data to comp_driver
structure. The change is aimed at clearing the module_data structure of
fields intended for exclusive use by sof. All modules are eventually use
module interface so this pointer will be in comp_driver anyway.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-03-18 14:43:58 +02:00
Kai Vehmanen 494acf4562 west.yml: update Zephyr to ceff785434b
Patches affecting SOF:

fb54eb5ab133 llext: symbol.h: Explicit typecast in EXPORT_SYMBOL macros
ce243944375e llext: add object test case
33c6bdab9ad1 llext: add STT_OBJECT relocation
41b3c7158687 drivers: dma: intel_adsp_hda: Fix L1 exit condition
5cac834bb651 llext: arch_elf_relocate: pass opval unmodified

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-03-18 14:07:36 +02:00
Adrian Warecki dff7332326 lib_manager: Set target memory flags after data loading from storage
Memory region must first be mapped as writable to allow data to be placed
there. Then the target access flags are set, e.g. read-only and executable.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-03-15 22:31:12 +02:00
Kai Vehmanen 6bdbf7186e topology2: sof-tgl/adl-nocodec: disable multicore
Multicore is not working correctly for Intel cAVS2.5 in Zephyr
upstream and the fixing will take a longer time, so disable
this feature in nocodec configuration.

Link: https://github.com/thesofproject/sof/issues/8942
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-03-15 18:30:45 +02:00
Laurentiu Mihalcea 7cb15d722a scripts: xtensa-build-all: remove imx8ulp
XTOS is going to be deprecated on i.MX8ULP so prevent
building it by removing it from the list of supported
platforms from `xtensa-build-all.sh`. This is needed for
switching to Zephyr native drivers.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-03-15 13:14:15 +02:00
Laurentiu Mihalcea d49395b8e8 workflow: remove imx8ulp from gcc build test
XTOS is going to be deprecated on i.MX8ULP so remove it from
the gcc build test which uses SOF with XTOS.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-03-15 13:14:15 +02:00
Seppo Ingalsuo 727ad82997 Tools: Topology2: Add IIR, FIR, DRC to HDA analog playback
This patch replaces pipeline mixout-gain-dai-copier-playback with
mixout-gain-efx-dai-copier-playback. The purpose is to allow
enhance of audio playback quality with equalizers (IIR and FIR)
and dynamic range control (DRC).

The components are programmed by default to passthrough for minimal
overhead. They can be activated via sof-ctl or UCM with ALSA controls.

- Post Mixer Analog Playback IIR Eq bytes
- Post Mixer Analog Playback FIR Eq bytes
- Post Mixer Analog Playback DRC bytes
- Post Mixer Analog Playback DRC switch

The recommendation is to keep headphone playback flat and enable
processing only when HDA output is in speaker mode.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-03-14 10:40:43 +02:00
Kai Vehmanen 494f4245c3 west.yml: update Zephyr to 251f52cbceb8
Update Zephyr to newer baseline. Among other updates, this brings in
Zephyr commit "intel_adsp/ace: power: Lock interruption when power gate
fails" that fixes a frequent issue seen in SOF CI on Intel MTL
platforms.

Patches affecting SOF:

251f52cbceb8 list_hardware.py: sort rglob(SOC_YML) HWMv2 results
f91065b7c983 nxp: adsp: enable usage of DCACHE API
03a79d638773 llext: elf.h: fix sign of the `r_addend` field of struct elf32_rela
7eb1d3d57d2d llext: elf.h: fix wrong 32 bits length of elf64_rela fields
4ad9f9063848 llext.c: fix logging of 64 bits pointers
07426a800c74 intel_adsp/ace: power: Lock interruption when power gate fails
c15f029a7108 init.h: restore designated initializers in SYS_INIT_NAMED()
223e81b96888 soc: intel_adsp/ace: use CONFIG_XTENSA_MORE_SPIN_RELAX_NOPS
0a6e90b3b833 xtensa: make assembly-called functions static
3fa291690f32 xtensa: use CONFIG_PRIVILEGED_STACK_SIZE for stack size

Link: https://github.com/thesofproject/sof/issues/8908
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-03-14 10:18:57 +02:00
Kai Vehmanen 0b1d36ad11 app: boards: intel boards, disable winstream console
Disable CONFIG_WINSTREAM_CONSOLE in all Intel configs that enable SOF
mtrace for logging. Also disable CONFIG_LOG_BACKEND_ADSP that uses
winstream as backend. No need to have two memory window based logging
backends enabled at the same time.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-03-14 09:55:08 +02:00
Laurentiu Mihalcea 3926292e00 zephyr: lib: dma: adapt imx93 Kconfig name to HWMv2 name
With the switch to HWMv2, `CONFIG_SOC_SERIES_MIMX9_A55`
has been renamed to `CONFIG_SOC_MIMX9352_A55` so make sure
we also use the correct name when fetching the driver structure
associated with 93's DMACs.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-03-13 10:23:43 +02:00
Adrian Warecki 9ffff145fe llext_manager: Remove unused desc parameter
Removed unused desc parameter from llext_manager_load_module and
llext_manager_unload_module functions.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-03-13 10:19:57 +02:00
Adrian Warecki 73ab99e554 lib_manager: llext_manager: Add const to module allocate functions
Added a const modifier to the ipc_config parameter passed to functions
lib_manager_allocate_module and llext_manager_allocate_module.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-03-13 10:19:57 +02:00
Adrian Warecki a11dd14c0c lib_manager: llext_manager: Add const modifier to module manifest pointers
To prevent unintentional modification of a loadable library manifest,
a const modifier has been added to all variables pointing to it.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-03-13 10:19:57 +02:00
Adrian Warecki 3c114b5595 lib_manager: llext_manager: Simplifying parameter list for free module
Instead of a pointer to a component driver and ipc config, the
lib_manager_free_module and llext_manager_free_module functions now gets
component id.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-03-13 10:19:57 +02:00
Adrian Warecki e0b6f5a94c lib_manager: Simplifying parameter list for lib_manager_register_module
Removed pointer to a library manifest from the parameters list of the
lib_manager_register_module function.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-03-13 10:19:57 +02:00
Adrian Warecki 9ec3a51352 lib_manager: Verify preload_page_count from module manifest
The preload_page_count value from the loadable library manifest is used to
determine size of allocated memory buffer. If this value is smaller than
the manifest size, it will lead to memory corruption.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-03-13 10:19:57 +02:00
Adrian Warecki 7f2c789efd lib_manager: Add const to library manifest variable
Added a const modifier to the module manifest variable in the
lib_manager_store_library function to prevent it from being accidentally
modified.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-03-13 10:19:57 +02:00
Marc Herbert 469c0a7e63 xtensa-build-zephyr.py: checksum newly generated rimage_config.toml file
Add new file generated since commit cf9a444bfc ("toml: modularise TOML
configuration")

Optional because it's not generated for all platforms.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-03-11 20:12:01 +02:00
Kai Vehmanen b97f81a36a idc: zephyr: add a timeout to blocking IDC send
Replace infinite wait with a time-limited wait. In case a blocking
IDC message is not handled within IDC_TIMEOUT, return an error
instead of waiting. This allows to debug stuck core-to-core communication
easier.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-03-11 14:24:24 +02:00
Andy Ross 83f69f144f mt8195: Disable GOOGLE AEC MOCK by default
The mocking layer is an important debugging tool.  It shouldn't be on
by default lest we accidentally build without the real feature.

Signed-off-by: Andy Ross <andyross@google.com>
2024-03-11 11:43:08 +02:00
Andy Ross ba9f8fc8ab topology1/mt8195: Add Graphviz output markers
Add the .dot file header/footer macros.  These are benign if unused,
and it seems like most other devices have them defined.

Signed-off-by: Andy Ross <andyross@google.com>
2024-03-11 11:43:08 +02:00
Andy Ross 8ab49bbf24 mt8195: Bump task stack size for Google AEC
AEC initialization is stack-hungry, needing ~6kb during
initialization.  That happens under the IPC task, not a
component-local stack.  So bump the default for all tasks as that's
the only way to make sure IPC gets it.

(Really this shouldn't be a platform choice, but that's where the
symbol exists)

Signed-off-by: Andy Ross <andyross@google.com>
2024-03-11 11:43:08 +02:00
Andrula Song 02e88372d0 Audio: Component: Add HiFi5 implementation of cir_buf_copy.
Add HiFi3 & HiFi5 implementation of function cir_buf_copy.
Compared with generic C version, the HiFi3 version can save
about 3% cycles and HiFi5 version can save about 40% cycles.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2024-03-08 17:01:03 +02:00
Andrula Song 40c8e477f0 Audio: Component: Fix the potential risks of HiFi3 audio_stream_copy
Use while (shorts > 0) instead of while (short) to reduce the forever
loop risk.

Use general instruction AE_MIN32 replace AE_MIN_32_signed which is an
internal proto intended for Xtensa compiler.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2024-03-08 17:01:03 +02:00
Andrula Song 50c8aeb710 Audio: Component: Add HiFi5 implementation of audio_stream_copy
Add HiFi5 implementation if function audio_stream_copy, compared
with HiFi3 version, the HiFi5 method can save about 29% cycles.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2024-03-08 17:01:03 +02:00
Laurentiu Mihalcea 1f87ffcea0 ipc3: dai: change channel decoding function for native SAI and ESAI
The native SAI and ESAI drivers use a different handshake
encoding. As such, when using native Zephyr drivers use a
different function for decoding the channel from the handshake.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-03-08 14:33:37 +00:00
Laurentiu Mihalcea ef06790b94 audio: dai-zephyr: add function for computing DMA slot
In the case of some DAIs, the DMA slot may be encoded
differently in the DAI configuration handshake. As such,
we can't count on the fact that the handshake itself can
be used as the DMA slot. To fix this, add a function which
parses the handshake and allows each DAI to use its own
encoding of the DMA slot inside the handshake.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-03-08 14:33:37 +00:00
Laurentiu Mihalcea 76c0595938 audio: dai-zephyr: Add state change on DAI trigger
Currently, the DAI component's state is not updated on
dai_trigger() operation, which leads to pipeline_comp_copy()
skipping the dai_copy() operation (since the DAI component
never transitions to the ACTIVE state). To fix this, add
a state transition in dai_comp_trigger_internal(). Also,
make sure not to trigger the DAI component if already in
the requested state.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-03-08 14:33:37 +00:00
Laurentiu Mihalcea 87558f8260 audio: dai-zephyr: Set source/destination address adjustment
Some DMACs (e.g: NXP's EDMA) can automatically adjust the source and
destination addresses upon transfer completion. As such, we need to
indicate how the adjustment should be performed. In the case of playback,
the source address should be decremented, while in the case of capture,
the destination address should be decremented.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-03-08 14:33:37 +00:00
Laurentiu Mihalcea 2c56be62ab audio: dai-zephyr: Allow dai_set_config() to work for NXP's SAI
Since now there's a Zephyr driver for NXP's SAI, the dai_set_config()
should be modified to also allow the configuration of the SAI.
As such, this commit introduces a new case for NXP's SAI that does
exactly that.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-03-08 14:33:37 +00:00
Laurentiu Mihalcea 4887b777a6 lib: dma: Add entries for i.MX93's EDMA and HOST DMAs
Since the EDMA and HOST DMA nodes have been introduced to
the i.MX93 overlay, add entries in the dma array which will
create a struct dma for each of these DMACs.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-03-08 14:33:37 +00:00
Laurentiu Mihalcea 237a2faca4 lib: dai: Add entry for NXP's SAI
Since the Zephyr SAI driver is now enabled, add an entry in
the zephyr_dev array, which will resolve to multiple
"struct device *", one for each SAI node specified in the DTS.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-03-08 14:33:37 +00:00
Laurentiu Mihalcea c375a95245 audio: host-zephyr: Set SRC/DEST addresses during host_common_params()
Source and destination addresses cannot be NULL. As such,
set them to the values found in the first element of
hd->config's elem_array. This is fine to do because the host
component uses only 1 block.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-03-08 14:33:37 +00:00
Laurentiu Mihalcea b0de76420e audio: host-zephyr: Update DMA block configuration when re-configuring
With every copy() operation, the source and destination addresses
keep getting modified. As such, for each re-configuration performed
during host_copy_one_shot(), the HOST DMAC needs to be made
aware of these changes.

This commit changes host_copy_one_shot() such that on each
dma_config() call the DMAC driver receives the updated
addresses and size.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-03-08 14:33:37 +00:00
Laurentiu Mihalcea 886026ea85 ipc3: host-page-table: Add native version for ipc_get_page_descriptors()
Since the DMAC is configured in a somewhat different way in the
native case vs the non-native case, add a native version of the
ipc_get_page_descriptors() function and remove the Zephyr-specific
functions from the non-native version of said function.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-03-08 14:33:37 +00:00
Guennadi Liakhovetski 980b1c64f2 smart-amp-test: make a loadable module
Convert the smart-amp-test in its IPC4 version to a loadable LLEXT
module. Use an overlay configuration to select between monolithic and
modular builds.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-03-08 16:25:28 +02:00
Guennadi Liakhovetski 6b9b4c24d2 modules: don't re-load on each restart
While modules are in use, no need to unload and re-load them,
re-initialising audio interfaces is enough. With llext modules this
uses the LLEXT reference counting to identify when a module should be
unloaded.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-03-08 16:25:28 +02:00
Guennadi Liakhovetski 5d202ba726 modules: split modules_init() into two parts
The first part modules_new() is only needed when a new module is
registered, the rest is needed every time a module is instantiated.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-03-08 16:25:28 +02:00
Guennadi Liakhovetski 1481770a0e lib-manager: use an appropriate type for a pointer integer
lib_manager_allocate_module() returns a pointer as an integer, use
uintptr_t for it.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-03-08 16:25:28 +02:00
Guennadi Liakhovetski ca29bfb895 module: (cosmetic) regroup some declarations and assignments
Regroup code in modules_init() to move declarations and assignments
closer to where they're needed.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-03-08 16:25:28 +02:00
Guennadi Liakhovetski 9db256806c lib-manager: fix a wrongly named .desc pointer
Pointers that we store in a global array for each loaded library,
aren't really firmware manifest descriptor pointers, they're pointers
to storage buffers, where entire libraries are stored. A
SOF_MAN_ELF_TEXT_OFFSET offset has to be added to that address to get
to the manifest descriptor.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-03-08 16:25:28 +02:00
Guennadi Liakhovetski bf1dfb40fb module-adapter: add Zephyr extension context
Module adapter drivers can be loaded and unloaded, using the Zephyr
loadable extension API. Add its context to struct struct module_data.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-03-08 16:25:28 +02:00
Guennadi Liakhovetski 6de605d737 lib-manager: migrate to module adapter context
lib-manager is module-adapter specific, it doesn't need the component
API and shouldn't use struct comp_driver in function arguments.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-03-08 16:25:28 +02:00
Guennadi Liakhovetski 4d3c2ee51f lib-manager: add support for llext
Add support for loadable modules, built for dynamic linking with
Zephyr's LLEXT API.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-03-08 16:25:28 +02:00
Andrula Song e48a171837 Audio: DRC: DRC math function optimization.
Use the xtense intrinsic instrunctions directly can save
at least 10% cycles for those functions, and save about
0.9mcps for DRC component.

Signed-off-by: Andrula Song <andrula.song@intel.com>
2024-03-08 14:24:40 +00:00
Marc Herbert 342d5d0259 .github/zephyr: upgrade deprecated actions/cache@v3.0.11 to v4
Fixes a lot of instances of this warning:

Node.js 16 actions are deprecated. Please update the following actions
to use Node.js 20: actions/cache@v3.0.11. For more information see:
https://github.blog/changelog/
  2023-09-22-github-actions-transitioning-from-node-16-to-node-20/

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-03-08 13:51:26 +00:00
Marc Herbert e29d4bc390 .github: upgrade deprecated upload-artifact@v3 to v4
Fixes a lot of instances of this warning:

Node.js 16 actions are deprecated. Please update the following actions
to use Node.js 20: actions/upload-artifact@v3. For more information see:
https://github.blog/changelog/
  2023-09-22-github-actions-transitioning-from-node-16-to-node-20/

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-03-08 13:51:26 +00:00
Kai Vehmanen 22b3518601 west.yml: update Zephyr to f9f44b6dcdd
Switch back to main Zephyr repository and commit f9f44b6dcdd.

This includes following squashed SOF commits that are
needed to adapt to HWMv2 changes in Zephyr:

zephyr: app: scripts: intel_adsp: change board names to HWMv2
zephyr: sof: update board name for HWMv2
zephyr: intel_adsp: Change ACE SoC name to HWMv2
app: boards: imx93: updates for zephyr hwmv2

Signed-off-by: Iuliana Prodan <iuliana.prodan@nxp.com>
Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-03-08 13:16:58 +02:00
Kai Vehmanen 7507b32e3b west.yml: update Zephyr to 9d1df132b1c + one revert
Update to Zephyr in sof/main-rebase-20240305 branch of SOF
project's clone of Zephyr upstream repository. Revert one
Zephyr commit "pm: Remove CURRENT_CPU macro" that is leading to
failed tests in SOF CI test suite.

The revert allows us to update Zephyr to a newer version and tackle the
SMP boot and cache interface changes in SOF. The latest Zephyr upstream
has further changes needed in SOF for platform configuration and these
will require separarate changes.

Link: https://github.com/thesofproject/sof/issues/8818
Link: https://github.com/zephyrproject-rtos/zephyr/issues/69807
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-03-06 11:13:57 +02:00
Laurentiu Mihalcea 5ec60b341b app: boards: mimx93_evk_a55: change SRAM0's address to 0xd000000
Zephyr commit b985442829dd ("dts: mimx93_evk_a55: avoid conflict
with Ethos-U NPU reserved memory") changes SRAM0's address to
0xd0000000. This breaks the i.MX93 SOF build because the SRAM0
node is no longer deleted so west build complains about having
2 SRAM0 nodes with different addresses.

To fix this, update the deleted node's base address.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-03-06 11:13:57 +02:00