Commit Graph

241 Commits

Author SHA1 Message Date
Laurentiu Mihalcea a65f19e5a6 zephyr: CMakeLists.txt: include required sources for imx95
Include required sources for the imx95 platform.

Signed-off-by: Laurentiu Mihalcea <laurentiu.mihalcea@nxp.com>
2024-10-04 11:14:58 +03:00
Ievgen Ganakov d64be92617 copier: gain: add basic configuration
Prepare infrastructure for copier gain feature. Add basic configuration
scenario.

Signed-off-by: Ievgen Ganakov <ievgen.ganakov@intel.com>
2024-10-01 14:08:09 +01:00
Grzegorz Bernat 3304e6f34d app: board: Change the soc from ace30_ptl to ace30
Renamed soc from ace30_ptl to ace30.
We were previously using the wrong soc name.
The correct name is ace30.

There is only one ptl platform, but there can be several ace30 platforms.

Signed-off-by: Grzegorz Bernat <grzegorzx.bernat@intel.com>
2024-09-26 15:59:28 +01:00
Kai Vehmanen 0a7711faea zephyr: decouple from platform pm_runtime.h interface
SOF defines a pm_runtime.h interface that consists of a RTOS
layer and a platform specific layer.

So far, the interface has been used in driver code and a very
small set of audio modules (e.g. key phrase buffer in kpb.c).
The platform layer has only been implemented on Intel platforms.
A no-op implementation is used for other platforms.

As all Intel platforms have moved to Zephyr, this now allows to
simplify the code a lot for SOF Zephyr builds and drop all
dependencies to the pm_runtime.h platform layer. With Zephyr,
the drivers are defined on Zephyr side and the device runtime
management can be handled with Zephyr device interfaces.

This patch removes all use of the pm_runtime.h platform layer in Zephyr
builds and replaces linkage of generic sof/src/lib/pm_runtime.c with
sof/zephyr/lib/pm_runtime.c. The Zephyr sof/lib/pm_runtime.h provides
sufficient functionality to cover all uses of pm_runtime interface in
SOF application code (e.g. init and kbp).

The changes simplify the codebase and reduce the amount of
boilerplate code needed to add new hardware targets to SOF, when
Zephyr is used as the RTOS.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-09-24 12:58:06 +03:00
Kai Vehmanen d5f9f3771d zephyr: imx: drop linking to platform/memory.c
The platform memory.c defines "sof->memory_map" which is used by
the XTOS allocator code (sof/src/lib/alloc.c). The NXP Zephyr
build targets no longer use this allocator, so the platform memory
definitions are no longer needed.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-09-19 13:54:45 +03:00
Guennadi Liakhovetski 3659b69d97 mux: enable building as an llext module
Add support for LLEXT building to mux.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-18 13:24:49 +03:00
Guennadi Liakhovetski 99a35a1798 google_rtc_aec: enable building as an llext module
Add support for LLEXT building to google_rtc_audio_processing. Only
building in a stub configuration is supported, linking with a
prebuilt library should be implemented separately.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-18 13:24:49 +03:00
Guennadi Liakhovetski 1b38612460 mfcc: enable building as an llext module
Add support for LLEXT building to mfcc.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-18 13:24:49 +03:00
Guennadi Liakhovetski 661c05dfc5 aria: enable building as an llext module
Add support for LLEXT building to aria.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-18 13:24:49 +03:00
Guennadi Liakhovetski e206134083 multiband_drc: enable building as an llext module
Add support for LLEXT building to multiband_drc.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-18 13:24:49 +03:00
Guennadi Liakhovetski a216c1a793 tdfb: enable building as an llext module
Add support for LLEXT building to tdfb.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-18 13:24:49 +03:00
Guennadi Liakhovetski 26a02fc434 igo_nr: enable building as an llext module
Add support for LLEXT building to igo_nr. Only building in a stub
configuration is supported, linking with a prebuilt library should be
implemented separately.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-18 13:24:49 +03:00
Guennadi Liakhovetski 3800f23f3f dts: enable building as an llext module
Add support for LLEXT building to dts. Only building in a stub
configuration is supported, linking with a prebuilt library should be
implemented separately.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-18 13:24:49 +03:00
Guennadi Liakhovetski 15d503075f dcblock: enable building as an llext module
Add support for LLEXT building to dcblock.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-18 13:24:49 +03:00
Guennadi Liakhovetski a33b955f64 selector: enable building as an llext module
Add support for LLEXT building to selector.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-18 13:24:49 +03:00
Guennadi Liakhovetski 5b23a37d88 crossover: enable building as an llext module
Add support for LLEXT building to crossover.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-18 13:24:49 +03:00
Guennadi Liakhovetski 71f5486ae5 build: (cosmetic) merge multiple conditional blocks in cmake
zephyr/CmakeLists.txt contains multiple conditional blocks with the
same condition, that can be trivially merged. This patch does that.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-18 13:24:49 +03:00
Guennadi Liakhovetski 095e2d674c google_ctc_aec: enable building as an llext module
Add support for LLEXT building to google_ctc_audio_processing. Only
building in a stub configuration is supported, linking with a
prebuilt library should be implemented separately.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-18 13:24:49 +03:00
Guennadi Liakhovetski 3136819473 rtnr: enable building as an llext module
Add support for LLEXT building to RTNR. Only building in a stub
configuration is supported, linking with a prebuilt library should be
implemented separately. So far no platform is switched to building
RTNR as a module.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-18 13:24:49 +03:00
Guennadi Liakhovetski 5c025b0d9d asrc: enable building as an llext module
Add support for LLEXT building to asrc.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-12 18:07:16 +03:00
Guennadi Liakhovetski ed65e22943 eq-fir: enable building as an llext module
Add support for LLEXT building to eq-fir.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-12 18:07:16 +03:00
Guennadi Liakhovetski dcd21cd0cb volume: add LLEXT support
This makes it possible to build volume as an LLEXT module to be
loaded at run-time.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-12 18:07:16 +03:00
Guennadi Liakhovetski cfd27fbde0 src: convert to a loadable module
Build src as a loadable llext module.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-12 18:07:16 +03:00
Guennadi Liakhovetski 9f48037505 llext: automatically calculate module addresses
Currently LLEXT module starting addresses are hard-coded in their
respective CMakeLists.txt files. This is very wasteful, since it's
unknown in what order modules are loaded, inflexible and not easily
extendible to other platforms. Switch to calculating addresses
automatically based on a single per-platform Kconfig value.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-09-10 09:23:24 +03:00
Jyri Sarha fdfddff696 debug: debug_stream_slot: Debug slot transportation for debug_stream
Implementation for debug stream transportation over debug window
slot. The protocol details are documented in debug_stream_slot.h
header.

Signed-off-by: Jyri Sarha <jyri.sarha@linux.intel.com>
2024-09-06 12:28:58 +03:00
Marcin Szkudlinski a2813a79bd buf: rename buffer.c to comp_buffer.c and move to buffers
comp_buffer, implemented in buffer.c file, should
be kept in the buffers directory, together with all
buffers
Also it has been renamed to comp_buffer.c

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2024-09-02 16:47:40 +01:00
Marcin Szkudlinski d23f8e81d9 buf: add secondary buffer support to struct audio_buffer
secondary buffer mechanism is a feature independent of a buffer
implementation, therefore it should be located in a base class for
all buffers

this commit intentionally is not removing the same feature from
comp_buffer nor trying to use it anywhere

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2024-09-02 16:47:40 +01:00
Guennadi Liakhovetski 8b48c563ce drc: move logging context to the base image
Logging context can be accessed from the deferred logging
thread. Therefore it must be always available to avoid
access to unmapped memory when an LLEXT module is unloaded.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-08-30 16:03:28 +03:00
Curtis Malainey a3b1436b46 zephyr: don't build host targets with xtos headers
Posix is for posix

Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
2024-08-23 13:36:17 +01:00
Seppo Ingalsuo f7715b814b Audio: MFCC: Fix build of component for current SOF
It has not been possible to build the component earlier for Zephyr
IPC4 systems. This patch makes the next fixes:

- Add SOF_MODULE_INIT() and include of rtos/init.h
- For unit test fix the init function to
  sys_comp_module_mfcc_interface_init()
- To Zephyr/CMakeLists.txt add the needed math library sources
- Add .toml files for rimage for IPC4 systems

Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
2024-08-21 14:39:05 +01:00
Tobiasz Dryjanski 3a4c9db40d src: create separate file for normal src
Defines for normal src and src_lite were not separated correctly. Added new
variables so those values can be different depending on the type of src
being used. Those are assigned in prepare function in a new src.c file,
similarly to src_lite.c

Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com>
2024-08-21 13:02:32 +01:00
Tobiasz Dryjanski 285ec51914 src: rename src.c to src_common.c
Renaming src.c, as this filename will have a different purpose. File
src_common.c will contain common functions for all src types.

Signed-off-by: Tobiasz Dryjanski <tobiaszx.dryjanski@intel.com>
2024-08-21 13:02:32 +01:00
Eddy Hsu b2521eaa7b comp: Add initial Google CTC component
Introduce a new component to perform crosstalk-cancellation on
the playback path.

Signed-off-by: Eddy Hsu <eddyhsu@google.com>
2024-08-06 13:32:51 -07:00
Serhiy Katsyuba 8082006042 ipc4: pcm_converter: Add channel remapping conversion functions
Adds a set of conversion functions that perform both format conversion
and channel remapping. These are required to swap channels for the device
posture feature.

Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
2024-07-17 15:27:41 +03:00
Guennadi Liakhovetski c06ad78195 drc: enable building as an llext module
Add support for LLEXT building to drc. Since multiband DRC calls
functions from DRC, we cannot so far build it if DRC is configured as
a module. In the future it should be possible to build both as
modules and to export symbols between them.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-07-16 15:29:47 +03:00
Guennadi Liakhovetski a98fb5c79c llext: fix Windows builds
Under windows the Python interpreter has to be called explicitly.
Without it an attempt to execute a Python script fails silently.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Suggested-by: Marc Herbert <marc.herbert@intel.com>
2024-07-16 15:29:47 +03:00
Marcin Szkudlinski ac17c743d7 kconfig: add PIPELINE_2_0 flag
This flag enables changes to new pipeline structure,
known as pipeline2_0
It is required for certain new features, like DP_SCHEDULER.
The changes are incremental and at the moment pipeline 2.0
is fully backward compatible with legacy platforms, however
it generates some overhead in data and code, so it is useful to
turn if off if not needed

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2024-07-10 15:31:06 +03:00
Marcin Szkudlinski 65ddefc559 buf: Rename dp_queue.c to ring_buffer.c
dp_queue was created as a buffer to handle
special needs for DP modules.
However, in pipeline2.0 there will be more usecases
for it - as in fact it is a lockless cross-core
cached ring buffer.
This commit does rename dp_queue to more adequate name
It also moves the file to "buffers" directory, a place
for all implementations of buffers in pipeline 2.0

The commit, however, does not change names of structures
because git/github does not handle complex changes like
rename and modification correctly

Signed-off-by: Marcin Szkudlinski <marcin.szkudlinski@intel.com>
2024-07-10 15:31:06 +03:00
Andy Ross 51a5fb9c80 uuid: Add app-global UUID registry
Add a very simple uuid-registry.txt file containing all known UUIDs in
the tree, use it to generate a C header (the script validates it in
the process) that can then be used for a simplified
SOF_DEFINE_REG_UUID() mechanism that avoids the risk and temptation
temptation of components incorrectly implementing UUIDs.

The intent is that in the longer term, this file can be used by other
downstream tooling (manifest and topology generation) to more easily
reference known IDs by name in a way that avoids duplication and
error.

Signed-off-by: Andy Ross <andyross@google.com>
2024-07-05 14:32:56 +01:00
Andy Ross 321d32b77d uuid: Use Zephyr ITERABLE sections for the UUID table
Zephyr has a similar trick to the .static_uuids trick SOF had been
playing that works in a (mostly) portable way and has some nice
features like runtime FOREACH iteration.

Use that for the UUID table, allowing it to be linked in globally in
Zephyr builds in a uniform way.

Also includes some general cleanup to try to reduce the amount of
backslashery required to express the various macros.

Signed-off-by: Andy Ross <andyross@google.com>
2024-07-05 14:32:56 +01:00
Andy Ross 0868b1f71e zephyr: Remove legacy logging artifacts
The sof-logger/smex tools and the .ldc formats are all dead code in
Zephyr builds.  The logging/trace macros don't emit the correct
metadata anymore, using Zephry logging instead (and I don't think they
ever did?), and the resulting .ldc files are degenerate containing
just the header and the records for component UUIDs, which nothing
uses.

Save a few milliseconds of build time and a few bytes of output, and
free up the evolution path by not having to support legacy tools.

Signed-off-by: Andy Ross <andyross@google.com>
2024-07-05 14:32:56 +01:00
Kai Vehmanen 997e536a73 zephyr: shell: add initial SOF custom commands
One of the benefits and common ways to use the Zephyr shell
subsystem is definition of application specific commands.

This commit adds the initial SOF custom command,
"sof test_inject_sched_gap". This new command allows to inject
scheduling gaps into low-latency timer scheduler execution,
using the domain_block() SOF interface. Optional argument
can be used to specify duration of the block in micro seconds.

The intent is to stress test a SOF configuration and test how
the system behaves when audio pipeline is briefly starved.

Example log of what is observed when test_inkect_sched_gap is
run:

[    0.052431] <inf> ll_schedule: zephyr_domain_thread_fn: ll core 0 timer avg 3674, max 4326, overruns 0
[    0.052831] <inf> ll_schedule: zephyr_domain_thread_fn: ll core 0 timer avg 3673, max 4318, overruns 0
~$
~$ sof test_inject_sched_gap 12000
[    0.052968] <inf> ll_schedule: zephyr_domain_block: Blocking LL scheduler
[    0.052973] <inf> ll_schedule: zephyr_domain_unblock: Unblocking LL scheduler
[    0.052973] <inf> host_comp: host_get_copy_bytes_normal: comp:1 0x10004 no bytes to copy, available samples: 0, free_samples: 384
[    0.053231] <inf> ll_schedule: zephyr_domain_thread_fn: ll core 0 timer avg 4074, max 437230, overruns 1

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-07-04 15:05:13 +01:00
Jaroslaw Stelter 05bfc36dac ptl: Add initial PTL configuration
Patch adds PTL configuration basing on MTL

DMIC depends on PM_DEVICE_RUNTIME and PM_DEVICE_POWER_DOMIAN settings.
To effectively enable DMIC these flags must be set.
Additionally DMIC Ownership bit is not supported on ACE 2.0 and ACE 3.0.
Therefore CONFIG_DAI_DMIC_HAS_OWNERSHIP is switched off.

Signed-off-by: Jakub Dabek <jakub.dabek@intel.com>
2024-06-24 16:15:41 +02:00
Dobrowolski, PawelX 1704870309 cmake/zephyr: change if condition to zephyr metod
For syntax clearity changed if conditional to zephyr method

Signed-off-by: Dobrowolski, PawelX <pawelx.dobrowolski@intel.com>
2024-06-24 16:15:41 +02:00
Guennadi Liakhovetski c79628308f llext: don't build if CONFIG_LLEXT=n
Not all configurations need LLEXT, don't include LLEXT support in
such cases.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-06-12 11:07:35 +01:00
Guennadi Liakhovetski 0bda13d0bd llext: check a Kconfig option to select ld flags
When using xt-clang we cannot build shared objects, so we use '-r' to
link relocatable objects. But the decision shouldn't be made based on
the name of the compiler, but based on the selected LLEXT_BINARY_TYPE
option.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-06-04 12:53:49 +03:00
Kai Vehmanen 013e210209 west.ytml: update to Zephyr 53ddff639562
Update Zephyr baseline to 53ddff639562 . The location of generated
headers has changed, so modify the SOF build scripts to use the new
location.

Change affecting SOF build targets:

6509b8199b02 shell: add shell backend for audio DSP using shared memory window
5a7600bec60b soc: intel_adsp: tools: add shell support to cavstool.py
db00b813f043 soc: intel_adsp: tools: align code style in maps_regs()
44dd5a4da9c0 soc: intel_adsp: tools: fix ace20 fw load flow
fa798ce2d5be soc: intel_adsp: only implement FW_STATUS boot protocol for cavs
8fc76f1b6d16 soc: intel_adsp: tools: improve FW boot handling on ace1.x
024bd41efb65 llext: xtensa: add support for the xt-clang toolchain

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
2024-06-04 11:04:04 +03:00
Guennadi Liakhovetski d6ee13c37c ipc: simplify CMakeLists.txt by using a suffix variable
Everywhere, where IPC3 and IPC4 are distinguished in CMakeLists.txt
the only difference is the use of x_ipc3.c vs. x_ipc4.c. Instead of
duplicating all build instructions for IPC3 and IPC4 just define and
use a suffix variable.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-06-03 18:44:02 +03:00
Marc Herbert 2e6162bf78 zephyr/cmake: fix llext.uuid growing from the last build
Reset the llext.uuid file so it does not start with content from the
previous build.

Fixes LLEXT incremental builds which apparently never worked (some
people like it slow?)

Fixes commit 05e69e1bb9 ("llext: update to use add_llext_target()")
and the ones before that.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
2024-05-27 13:04:58 +03:00
Guennadi Liakhovetski f86ad4fa20 eq-iir: convert to a loadable module
Build eq-iir as a loadable llext module.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
2024-05-14 14:37:44 +01:00