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>
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>
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>
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>
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>
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>
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>
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>
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>
Removed unused desc parameter from llext_manager_load_module and
llext_manager_unload_module functions.
Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Add support for loadable modules, built for dynamic linking with
Zephyr's LLEXT API.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
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>
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>
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>
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>
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>
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>