tdfb: enable building as an llext module

Add support for LLEXT building to tdfb.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This commit is contained in:
Guennadi Liakhovetski 2024-07-04 12:48:07 +02:00 committed by Kai Vehmanen
parent 26a02fc434
commit a216c1a793
8 changed files with 62 additions and 13 deletions

View File

@ -9,6 +9,7 @@ CONFIG_COMP_SEL=m
CONFIG_COMP_SRC=m
CONFIG_COMP_ASRC=m
CONFIG_COMP_RTNR=m
CONFIG_COMP_TDFB=m
CONFIG_COMP_IGO_NR=m
CONFIG_COMP_VOLUME=m
CONFIG_COMP_DCBLOCK=m

View File

@ -9,6 +9,7 @@ CONFIG_COMP_SEL=m
CONFIG_COMP_SRC=m
CONFIG_COMP_ASRC=m
CONFIG_COMP_RTNR=m
CONFIG_COMP_TDFB=m
CONFIG_COMP_IGO_NR=m
CONFIG_COMP_VOLUME=m
CONFIG_COMP_DCBLOCK=m

View File

@ -1,13 +1,14 @@
# SPDX-License-Identifier: BSD-3-Clause
config COMP_TDFB
bool "TDFB component"
tristate "TDFB component"
depends on COMP_MODULE_ADAPTER
select MATH_FIR
select MATH_IIR_DF1
select SQRT_FIXED
select CORDIC_FIXED
select COMP_BLOB
default m if LIBRARY_DEFAULT_MODULAR
default y
help
Select for time domain fixed beamformer (TDFB) component. The

View File

@ -0,0 +1,11 @@
# Copyright (c) 2024 Intel Corporation.
# SPDX-License-Identifier: Apache-2.0
sof_llext_build("tdfb"
SOURCES ../tdfb.c
../tdfb_direction.c
../tdfb_generic.c
../tdfb_hifiep.c
../tdfb_hifi3.c
../tdfb_ipc4.c
)

View File

@ -0,0 +1,6 @@
#include <tools/rimage/config/platform.toml>
#define LOAD_TYPE "2"
#include "../tdfb.toml"
[module]
count = __COUNTER__

View File

@ -613,7 +613,7 @@ static int tdfb_free(struct processing_module *mod)
{
struct tdfb_comp_data *cd = module_get_private_data(mod);
comp_info(mod->dev, "tdfb_free()");
comp_dbg(mod->dev, "tdfb_free()");
ipc_msg_free(cd->msg);
tdfb_free_delaylines(cd);
@ -797,7 +797,7 @@ static int tdfb_reset(struct processing_module *mod)
struct tdfb_comp_data *cd = module_get_private_data(mod);
int i;
comp_info(mod->dev, "tdfb_reset()");
comp_dbg(mod->dev, "tdfb_reset()");
tdfb_free_delaylines(cd);
@ -824,3 +824,22 @@ static const struct module_interface tdfb_interface = {
DECLARE_MODULE_ADAPTER(tdfb_interface, tdfb_uuid, tdfb_tr);
SOF_MODULE_INIT(tdfb, sys_comp_module_tdfb_interface_init);
#if CONFIG_COMP_TDFB_MODULE
/* modular: llext dynamic link */
#include <module/module/api_ver.h>
#include <module/module/llext.h>
#include <rimage/sof/user/manifest.h>
#define UUID_TDFB 0x49, 0x17, 0x51, 0xdd, 0xfa, 0xd9, 0x5c, 0x45, 0xb3, 0xa7, \
0x13, 0x58, 0x56, 0x93, 0xf1, 0xaf
SOF_LLEXT_MOD_ENTRY(tdfb, &tdfb_interface);
static const struct sof_man_module_manifest mod_manifest __section(".module") __used =
SOF_LLEXT_MODULE_MANIFEST("TDFB", tdfb_llext_entry, 1, UUID_TDFB, 40);
SOF_LLEXT_BUILDINFO;
#endif

View File

@ -1,3 +1,7 @@
#ifndef LOAD_TYPE
#define LOAD_TYPE "0"
#endif
REM # TDFB module config
[[module.entry]]
name = "TDFB"
@ -5,8 +9,8 @@
affinity_mask = "0x1"
instance_count = "40"
domain_types = "0"
load_type = "0"
init_config = "1"
load_type = LOAD_TYPE
init_config = "1"
module_type = "9"
auto_start = "0"
sched_caps = [1, 0x00008000]

View File

@ -958,14 +958,20 @@ elseif(CONFIG_SAMPLE_SMART_AMP)
)
endif()
zephyr_library_sources_ifdef(CONFIG_COMP_TDFB
${SOF_AUDIO_PATH}/tdfb/tdfb.c
${SOF_AUDIO_PATH}/tdfb/tdfb_direction.c
${SOF_AUDIO_PATH}/tdfb/tdfb_generic.c
${SOF_AUDIO_PATH}/tdfb/tdfb_hifiep.c
${SOF_AUDIO_PATH}/tdfb/tdfb_hifi3.c
${SOF_AUDIO_PATH}/tdfb/tdfb_${ipc_suffix}.c
)
if(CONFIG_COMP_TDFB STREQUAL "m")
add_subdirectory(${SOF_AUDIO_PATH}/tdfb/llext
${PROJECT_BINARY_DIR}/tdfb_llext)
add_dependencies(app tdfb)
elseif(CONFIG_COMP_TDFB)
zephyr_library_sources(
${SOF_AUDIO_PATH}/tdfb/tdfb.c
${SOF_AUDIO_PATH}/tdfb/tdfb_direction.c
${SOF_AUDIO_PATH}/tdfb/tdfb_generic.c
${SOF_AUDIO_PATH}/tdfb/tdfb_hifiep.c
${SOF_AUDIO_PATH}/tdfb/tdfb_hifi3.c
${SOF_AUDIO_PATH}/tdfb/tdfb_${ipc_suffix}.c
)
endif()
zephyr_library_sources_ifdef(CONFIG_SQRT_FIXED
${SOF_MATH_PATH}/sqrt_int16.c