Skip to content

Commit

Permalink
crossover: enable building as an llext module
Browse files Browse the repository at this point in the history
Add support for LLEXT building to crossover.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
  • Loading branch information
lyakh committed Sep 10, 2024
1 parent cada501 commit 440c9f8
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/boards/intel_adsp_ace15_mtpm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ CONFIG_COMP_SRC=y
CONFIG_COMP_SRC_IPC4_FULL_MATRIX=y
CONFIG_COMP_SRC_LITE=y
CONFIG_COMP_DRC=m
CONFIG_COMP_CROSSOVER=y
CONFIG_COMP_CROSSOVER=m
CONFIG_COMP_MULTIBAND_DRC=y
CONFIG_COMP_MFCC=y

Expand Down
1 change: 1 addition & 0 deletions app/boards/intel_adsp_ace20_lnl.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CONFIG_IPC4_BASE_FW_INTEL=y
CONFIG_COMP_SRC=y
CONFIG_COMP_SRC_IPC4_FULL_MATRIX=y
CONFIG_COMP_DRC=m
CONFIG_COMP_CROSSOVER=m

# power settings
CONFIG_PM=y
Expand Down
2 changes: 1 addition & 1 deletion src/audio/crossover/Kconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: BSD-3-Clause

config COMP_CROSSOVER
bool "Crossover Filter component"
tristate "Crossover Filter component"
select COMP_BLOB
select MATH_IIR_DF2T
default n
Expand Down
19 changes: 19 additions & 0 deletions src/audio/crossover/crossover.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,3 +636,22 @@ static const struct module_interface crossover_interface = {

DECLARE_MODULE_ADAPTER(crossover_interface, crossover_uuid, crossover_tr);
SOF_MODULE_INIT(crossover, sys_comp_module_crossover_interface_init);

#if CONFIG_COMP_CROSSOVER_MODULE
/* modular: llext dynamic link */

#include <module/module/api_ver.h>
#include <module/module/llext.h>
#include <rimage/sof/user/manifest.h>

#define UUID_CROSSOVER 0xD1, 0x9A, 0x8C, 0x94, 0x6A, 0x80, 0x31, 0x41, 0x6C, 0xAD, \
0xB2, 0xBD, 0xA9, 0xE3, 0x5A, 0x9F

SOF_LLEXT_MOD_ENTRY(crossover, &crossover_interface);

static const struct sof_man_module_manifest mod_manifest __section(".module") __used =
SOF_LLEXT_MODULE_MANIFEST("XOVER", crossover_llext_entry, 1, UUID_CROSSOVER, 40);

SOF_LLEXT_BUILDINFO;

#endif
6 changes: 5 additions & 1 deletion src/audio/crossover/crossover.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#ifndef LOAD_TYPE
#define LOAD_TYPE "0"
#endif

REM # Crossover module config
REM # Note: Crossover has init_config set to 1 to let kernel know that the base_cfg_ext needs to
REM # be appended to the IPC payload. The Extension is needed to know the output pin indices.
Expand All @@ -7,7 +11,7 @@
affinity_mask = "0x1"
instance_count = "40"
domain_types = "0"
load_type = "0"
load_type = LOAD_TYPE
module_type = "9"
init_config = "1"
auto_start = "0"
Expand Down
8 changes: 8 additions & 0 deletions src/audio/crossover/llext/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (c) 2024 Intel Corporation.
# SPDX-License-Identifier: Apache-2.0

sof_llext_build("crossover"
SOURCES ../crossover.c
../crossover_generic.c
../crossover_ipc4.c
)
6 changes: 6 additions & 0 deletions src/audio/crossover/llext/llext.toml.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <tools/rimage/config/platform.toml>
#define LOAD_TYPE "2"
#include "../crossover.toml"

[module]
count = __COUNTER__
16 changes: 11 additions & 5 deletions zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -799,11 +799,17 @@ zephyr_library_sources_ifdef(CONFIG_COMP_ARIA
${SOF_AUDIO_PATH}/aria/aria_generic.c
)

zephyr_library_sources_ifdef(CONFIG_COMP_CROSSOVER
${SOF_AUDIO_PATH}/crossover/crossover.c
${SOF_AUDIO_PATH}/crossover/crossover_generic.c
${SOF_AUDIO_PATH}/crossover/crossover_${ipc_suffix}.c
)
if(CONFIG_COMP_CROSSOVER STREQUAL "m")
add_subdirectory(${SOF_AUDIO_PATH}/crossover/llext
${PROJECT_BINARY_DIR}/crossover_llext)
add_dependencies(app crossover)
elseif(CONFIG_COMP_CROSSOVER)
zephyr_library_sources(
${SOF_AUDIO_PATH}/crossover/crossover.c
${SOF_AUDIO_PATH}/crossover/crossover_generic.c
${SOF_AUDIO_PATH}/crossover/crossover_${ipc_suffix}.c
)
endif()

if(CONFIG_COMP_DRC STREQUAL "m")
add_subdirectory(${SOF_AUDIO_PATH}/drc/llext
Expand Down

0 comments on commit 440c9f8

Please sign in to comment.