Commit Graph

12032 Commits

Author SHA1 Message Date
Laurentiu Mihalcea 47e9c82c34 west.yml: bump up Zephyr revision
Bump up Zephyr revision to fetch a Zephyr version that
contains the following patch:
	1) 64ba1b221091c343f7cca79a7970981eb1ff3a35
	("dts: nxp: imx93: add nodes for SAI3 and EDMA4")
This is required for the transition to Zephyr native drivers
on i.MX93.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-03-25 15:12:00 +02:00
Laurentiu Mihalcea 2711784ed5 tools: topology1: imx8ulp: change protocol and BCLK polarity
The BT codec used by the IW416 chip expects FSYNC to be
asserted for only one BCLK. Also, FSYNC should be active HIGH.
As such, change from I2S protocol to DSP_A protocol since the
configurations made for this protocol inside the SAI driver
are more suited.

Also, by default, the BT codec drives data on BCLK rising
edge and samples it on falling edge. With the DSP_A protocol,
the SAI driver also has the same configuration, which is wrong
since we can't drive and sample on the same edge and cycle. As such,
invert BCLK polarity such that the SAI will drive on rising edge
and sample on falling edge.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-03-25 12:31:02 +02:00
Laurentiu Mihalcea bbd20a9766 tools: topology1: imx8ulp: correct BCLK frequency
8ULP has two supported BT HFP scenarios: NBS and WBS. For
NBS the frequency of FSYNC is 8k, while for WBS the frequency
of FSYNC is 16k. Since the BCLK is computed as:
	Freq(BCLK) = TDM_SLOTS * TDM_SLOT_WIDTH * Freq(FSYNC)
then that means we're going to end up with two different BCLK
frequencies (one for each supported scenario).

Currently, what we do is pass the frequency of FSYNC
as a build argument, while keeping the frequency of BCLK
constant (set to 256000, which would be the same value as the
one used in WBS). This causes the following issues:

	1) The Zephyr native SAI driver returns an error
	when trying to commit the configuration because the
	frequency of BCLK doesn't abide by the aforementioned
	formula.

	2) We end up consuming twice as many samples in a given
	unit of time.

To fix these issues, use the aforementioned formula to compute
the frequency of BCLK.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-03-25 12:31:02 +02:00
Laurentiu Mihalcea 03dd62abbd tools: topology1: imx8ulp: rename `RATE` to `FSYNC_RATE`
Rename the `RATE` parameter to `FSYNC_RATE` in order to
remove ambiguity regarding what the parameter is.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-03-25 12:31:02 +02:00
Adrian Bonislawski edd489aa19 dp: do not block ppl because of sink/source limits
Module adapter DP copy checks shouldn't block pipeline,
similarly to  LL-only scenario

Add sink free size check to calculate copy size

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2024-03-25 09:34:50 +02:00
Serhiy Katsyuba 6f33aee270 kpb: Fix draining task and LL conflict
KPB draining task is executed by low priority preemptible EDF thread.
The task accesses KPB sink buffer and calls comp_copy() for component
connected to sink. If LL thread preempts draining task that could result
in broken state of sink buffer or component connected to sink. This fix
prevents LL from preempting draining task in bad moment.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2024-03-22 10:31:33 +02:00
Kai Vehmanen 6f7aee832c idc: zephyr: remove unnecessary cache invd/flush calls
The IDC message objects are stored to static "idc_work", so
the cache operations are unnecessary when pointers to these
messages are passed around.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-03-22 10:27:49 +02:00
Mac Chiang 980f193d09 topology2: sof-mtl-rt5650: add SSP FMT 24 bits support
Use 24 bits format on playback and capture pipelines if codec needs,
e.g. RT5650 HS/SPK codec.

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
2024-03-22 10:26:28 +02:00
Mac Chiang 7bd3f0c6e8 topology2: fix nhlt binary file naming
All topologies are built in parallel. The same name will lead
to file overrides. Therefore, correct to use the respective file
names properly.

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
2024-03-22 10:26:28 +02:00
Mac Chiang 1004762500 topology2: remove USE_CHAIN_DMA flag as it's applied to iDisp links.
The CHAIN_DMA has been replaced with HDMI_USE_CHAIN_DMA, which was already
enabled by default on iDisplay HDAudio codec in hdmi-default.conf.

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
2024-03-22 10:26:28 +02:00
Mac Chiang 859c23c567 topology2: cavs-mixin-mixout-eqiir-dts: fix the indentation
Replace whitespaces with tabs.

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
2024-03-22 10:26:28 +02:00
Mac Chiang d49cfe5e46 topology2: cavs-mixin-mixout-ssp: fix the indentation
Replace whitespaces with tabs.

Signed-off-by: Mac Chiang <mac.chiang@intel.com>
2024-03-22 10:26:28 +02:00
Adrian Bonislawski 9950b39c7d ipc4: helper: fix checks in comp dir update
- list_is_empty is required to properly check source list
- at this stage empty list is allowed since source bind might not
happen yet

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
2024-03-21 21:20:26 +02:00
Johny Lin 6c3bd4791b topology2: cavs-rt5682 separate variants for google aec
When Google RTC AEC is not ready to launch, it shouldn't be included
in production builds for Chromebook. This commit removes Google RTC
AEC from the current variants while making another copy with suffix
"-google-aec".

Signed-off-by: Pin-chih Lin <johnylin@google.com>
2024-03-20 11:30:53 +02:00
Kai Vehmanen e81d6138bf west.yml: update Zephyr to 8858a024c015
Contains following updates affecting SOF targets:

81658e67e7c0 dts: xtensa: intel_adsp: Remove ALH nodes from ACE 2.0 LNL DTS
4ea52bdd1297 soc: xtensa: intel: Update power status bitfields for LNL
a39a61015c59 dts: xtensa: intel: Reorder LNL power domains
64a81ffb23ba dts: xtensa: intel_adsp: ace15: Update power domain for hda link nodes
ff2dd7f25a99 dts: xtensa: intel: Reorder ACE 1.5 power domain nodes
315ee38b95a2 ADSP: don't use timer interrupts on secondary cores
e914c60ae156 boards: intel_adsp: fix dead link
010f39a409e0 soc: intel_adsp_cavs: store PS when power gating secondary core

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-03-20 10:11:42 +02:00
Seppo Ingalsuo 51bd1aead3 App: Boards: Set CONFIG_COMP_DRC=y for LNL platform
The DRC component was not included to build. This change
avoids error and DSP panic in topology load.

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-03-19 20:19:57 +02:00
Damian Nikodem 57d65790ca tools: toml: add src_lite module definition
Add the missing src_lite module definition to the toml
file for the LNL project.

Signed-off-by: Damian Nikodem <damian.nikodem@intel.com>
2024-03-19 19:46:46 +02:00
Guennadi Liakhovetski 480a32857d LLEXT: update for new Zephyr paths
Update LLEXT include directories.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-03-19 18:00:25 +02:00
Guennadi Liakhovetski 540eeebd88 Add an LLEXT build test
Add a GitHub workflow entry to build with LLEXT enabled, using the
Zephyr toolchain.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-03-19 18:00:25 +02:00
Laurentiu Mihalcea fc48fbd1b3 audio: dai-zephyr: convert DMA src/dst addresses to host-relative addresses
The DMAC has the same view of the address space as the HOST.
As such, the source and destination addresses need to be converted
to HOST-relative addresses before attempting to perform a DMA
transfer. This is only relevant for platforms for which the DSP
and HOST have different views of the address space (e.g: i.MX8ULP).

Also, if a platform doesn't define the `local_to_host` macro
(used for converting DSP local address to HOST-relative address)
we assume that the HOST and the DSP have the same view of the
address space. As such, we also add a definition of `local_to_host`
which will just return the passed address.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-03-18 14:56:32 +02:00
Marc Herbert 12ad82a756 xtensa-build-zephyr.py: checksum autoconf.h instead of configs.c
autoconf.h has strings, configs.c has not.

We can do this now since this $BOARD_REVISION fix:

https://github.com/zephyrproject-rtos/zephyr/commit/811a74c0199f

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-03-18 14:45:27 +02:00
Adrian Warecki 2df6d1b048 modules: lib_manager: Move declare_dynamic_module_adapter to lib_manager
The declare_dynamic_module_adapter function has been moved from
module_adapter/module/modules.h to lib_manager and renamed to
lib_manager_prepare_module_adapter. It was and still is only used in
lib_manager.

Signed-off-by: Adrian Warecki <adrian.warecki@intel.com>
2024-03-18 14:43:58 +02:00
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