Skip to content

Commit 5da2040

Browse files
committed
tdfb: enable building as an llext module
Add support for LLEXT building to tdfb. Signed-off-by: Guennadi Liakhovetski <[email protected]>
1 parent efd1031 commit 5da2040

File tree

8 files changed

+61
-12
lines changed

8 files changed

+61
-12
lines changed

app/overlays/lnl/module_overlay.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
CONFIG_LIBRARY_BASE_ADDRESS=0xa0688000
22
CONFIG_SAMPLE_SMART_AMP=m
33
CONFIG_COMP_MIXIN_MIXOUT=m
4+
CONFIG_COMP_TDFB=m
45
CONFIG_COMP_FIR=m
56
CONFIG_COMP_IIR=m
67
CONFIG_COMP_DRC=m

app/overlays/mtl/module_overlay.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
CONFIG_LIBRARY_BASE_ADDRESS=0xa0688000
22
CONFIG_SAMPLE_SMART_AMP=m
33
CONFIG_COMP_MIXIN_MIXOUT=m
4+
CONFIG_COMP_TDFB=m
45
CONFIG_COMP_FIR=m
56
CONFIG_COMP_IIR=m
67
CONFIG_COMP_DRC=m

src/audio/tdfb/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# SPDX-License-Identifier: BSD-3-Clause
22

33
config COMP_TDFB
4-
bool "TDFB component"
4+
tristate "TDFB component"
55
depends on COMP_MODULE_ADAPTER
66
select MATH_FIR
77
select MATH_IIR_DF1
88
select SQRT_FIXED
99
select CORDIC_FIXED
1010
select COMP_BLOB
11+
default m if LIBRARY_DEFAULT_MODULAR
1112
default y
1213
help
1314
Select for time domain fixed beamformer (TDFB) component. The
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2024 Intel Corporation.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
sof_llext_build("tdfb"
5+
SOURCES ../tdfb.c
6+
../tdfb_direction.c
7+
../tdfb_generic.c
8+
../tdfb_hifiep.c
9+
../tdfb_hifi3.c
10+
../tdfb_ipc4.c
11+
)

src/audio/tdfb/llext/llext.toml.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include <tools/rimage/config/platform.toml>
2+
#define LOAD_TYPE "2"
3+
#include "../tdfb.toml"
4+
5+
[module]
6+
count = __COUNTER__

src/audio/tdfb/tdfb.c

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ static int tdfb_free(struct processing_module *mod)
613613
{
614614
struct tdfb_comp_data *cd = module_get_private_data(mod);
615615

616-
comp_info(mod->dev, "tdfb_free()");
616+
comp_dbg(mod->dev, "tdfb_free()");
617617

618618
ipc_msg_free(cd->msg);
619619
tdfb_free_delaylines(cd);
@@ -797,7 +797,7 @@ static int tdfb_reset(struct processing_module *mod)
797797
struct tdfb_comp_data *cd = module_get_private_data(mod);
798798
int i;
799799

800-
comp_info(mod->dev, "tdfb_reset()");
800+
comp_dbg(mod->dev, "tdfb_reset()");
801801

802802
tdfb_free_delaylines(cd);
803803

@@ -824,3 +824,22 @@ static const struct module_interface tdfb_interface = {
824824

825825
DECLARE_MODULE_ADAPTER(tdfb_interface, tdfb_uuid, tdfb_tr);
826826
SOF_MODULE_INIT(tdfb, sys_comp_module_tdfb_interface_init);
827+
828+
#if CONFIG_COMP_TDFB_MODULE
829+
/* modular: llext dynamic link */
830+
831+
#include <module/module/api_ver.h>
832+
#include <module/module/llext.h>
833+
#include <rimage/sof/user/manifest.h>
834+
835+
#define UUID_TDFB 0x49, 0x17, 0x51, 0xdd, 0xfa, 0xd9, 0x5c, 0x45, 0xb3, 0xa7, \
836+
0x13, 0x58, 0x56, 0x93, 0xf1, 0xaf
837+
838+
SOF_LLEXT_MOD_ENTRY(tdfb, &tdfb_interface);
839+
840+
static const struct sof_man_module_manifest mod_manifest __section(".module") __used =
841+
SOF_LLEXT_MODULE_MANIFEST("TDFB", tdfb_llext_entry, 1, UUID_TDFB, 40);
842+
843+
SOF_LLEXT_BUILDINFO;
844+
845+
#endif

src/audio/tdfb/tdfb.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1+
#ifndef LOAD_TYPE
2+
#define LOAD_TYPE "0"
3+
#endif
4+
15
REM # TDFB module config
26
[[module.entry]]
37
name = "TDFB"
48
uuid = "DD511749-D9FA-455C-B3A7-13585693F1AF"
59
affinity_mask = "0x1"
610
instance_count = "40"
711
domain_types = "0"
8-
load_type = "0"
12+
load_type = LOAD_TYPE
913
init_config = "1"
1014
module_type = "9"
1115
auto_start = "0"

zephyr/CMakeLists.txt

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -922,14 +922,20 @@ zephyr_library_sources_ifdef(CONFIG_COMP_RTNR_STUB
922922
${SOF_AUDIO_PATH}/rtnr/rtnr_stub.c
923923
)
924924

925-
zephyr_library_sources_ifdef(CONFIG_COMP_TDFB
926-
${SOF_AUDIO_PATH}/tdfb/tdfb.c
927-
${SOF_AUDIO_PATH}/tdfb/tdfb_direction.c
928-
${SOF_AUDIO_PATH}/tdfb/tdfb_generic.c
929-
${SOF_AUDIO_PATH}/tdfb/tdfb_hifiep.c
930-
${SOF_AUDIO_PATH}/tdfb/tdfb_hifi3.c
931-
${SOF_AUDIO_PATH}/tdfb/tdfb_${ipc_suffix}.c
932-
)
925+
if(CONFIG_COMP_TDFB STREQUAL "m")
926+
add_subdirectory(${SOF_AUDIO_PATH}/tdfb/llext
927+
${PROJECT_BINARY_DIR}/tdfb_llext)
928+
add_dependencies(app tdfb)
929+
elseif(CONFIG_COMP_TDFB)
930+
zephyr_library_sources(
931+
${SOF_AUDIO_PATH}/tdfb/tdfb.c
932+
${SOF_AUDIO_PATH}/tdfb/tdfb_direction.c
933+
${SOF_AUDIO_PATH}/tdfb/tdfb_generic.c
934+
${SOF_AUDIO_PATH}/tdfb/tdfb_hifiep.c
935+
${SOF_AUDIO_PATH}/tdfb/tdfb_hifi3.c
936+
${SOF_AUDIO_PATH}/tdfb/tdfb_${ipc_suffix}.c
937+
)
938+
endif()
933939

934940
zephyr_library_sources_ifdef(CONFIG_SQRT_FIXED
935941
${SOF_MATH_PATH}/sqrt_int16.c

0 commit comments

Comments
 (0)