From 64bb4fb0581591bb67644397c292a18ddd68ec67 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Mon, 13 Jan 2025 15:52:26 +0100 Subject: [PATCH] smart-amp-test: remove obsolete build options smart-amp-test was one of the first modules, used as an example for loadable module development. Currently it can be built in 4 ways: - monolithic - as an LMDK native module - as legacy LLEXT - as current LLEXT This commit removes legacy options and only preserves the first and the last options. Signed-off-by: Guennadi Liakhovetski --- lmdk/cmake/ldscripts/data_linker_script.txt | 2 +- lmdk/libraries/smart_amp_test/CMakeLists.txt | 25 --- .../smart_amp_test/smart_amp_test.toml | 79 --------- lmdk/modules/smart_amp_test/CMakeLists.txt | 16 -- src/include/ipc4/base-config.h | 3 +- .../sof/samples/audio/smart_amp_test.h | 16 +- src/samples/audio/smart_amp_test_ipc4.c | 159 +++++++----------- 7 files changed, 62 insertions(+), 238 deletions(-) delete mode 100644 lmdk/libraries/smart_amp_test/CMakeLists.txt delete mode 100644 lmdk/libraries/smart_amp_test/smart_amp_test.toml delete mode 100644 lmdk/modules/smart_amp_test/CMakeLists.txt diff --git a/lmdk/cmake/ldscripts/data_linker_script.txt b/lmdk/cmake/ldscripts/data_linker_script.txt index c04a5ea3d97f..9327079f4d7b 100644 --- a/lmdk/cmake/ldscripts/data_linker_script.txt +++ b/lmdk/cmake/ldscripts/data_linker_script.txt @@ -15,7 +15,7 @@ SECTIONS { _data_end = ABSOLUTE(.); } >HPSRAM_seg : data_phdr - .rodata : ALIGN(4096) { + .rodata : { _rodata_start = ABSOLUTE(.); *(.gnu.linkonce.r.*) *(.rodata) diff --git a/lmdk/libraries/smart_amp_test/CMakeLists.txt b/lmdk/libraries/smart_amp_test/CMakeLists.txt deleted file mode 100644 index 0282a83bbf90..000000000000 --- a/lmdk/libraries/smart_amp_test/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -cmake_minimum_required(VERSION 3.20) -set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_LIST_DIR}/../../cmake/xtensa-toolchain.cmake") - -project(smart_amp_test) - -macro(is_zephyr ret) - if(CONFIG_ZEPHYR_SOF_MODULE) - set(${ret} TRUE) - else() - set(${ret} FALSE) - endif() -endmacro() - -# list of modules to be built and included into this loadable library -set(MODULES_LIST smart_amp_test) - -# toml file for rimage to generate manifets -set(TOML "${CMAKE_CURRENT_LIST_DIR}/smart_amp_test.toml") - -# TODO: Move it somewhere??? -add_definitions(-DMAJOR_IADSP_API_VERSION=5) -add_definitions(-DMIDDLE_IADSP_API_VERSION=0) -add_definitions(-DMINOR_IADSP_API_VERSION=0) - -include(../../cmake/build.cmake) diff --git a/lmdk/libraries/smart_amp_test/smart_amp_test.toml b/lmdk/libraries/smart_amp_test/smart_amp_test.toml deleted file mode 100644 index 34f3463343dd..000000000000 --- a/lmdk/libraries/smart_amp_test/smart_amp_test.toml +++ /dev/null @@ -1,79 +0,0 @@ -version = [3, 0] - -[adsp] -name = "mtl" -image_size = "0x2C0000" # (22) bank * 128KB -alias_mask = "0xE0000000" - -[[adsp.mem_zone]] -type = "ROM" -base = "0x1FF80000" -size = "0x400" -[[adsp.mem_zone]] -type = "IMR" -base = "0xA104A000" -size = "0x2000" -[[adsp.mem_zone]] -type = "SRAM" -base = "0xa00f0000" -size = "0x100000" - -[[adsp.mem_alias]] -type = "uncached" -base = "0x40000000" -[[adsp.mem_alias]] -type = "cached" -base = "0xA0000000" - -[cse] -partition_name = "ADSP" -[[cse.entry]] -name = "ADSP.man" -offset = "0x5c" -length = "0x464" -[[cse.entry]] -name = "ADSP.met" -offset = "0x4c0" -length = "0x70" -[[cse.entry]] -name = "ADSP" -offset = "0x540" -length = "0x0" # calculated by rimage - -[css] - -[signed_pkg] -name = "ADSP" -[[signed_pkg.module]] -name = "ADSP.met" - -[adsp_file] -[[adsp_file.comp]] -base_offset = "0x2000" - -[fw_desc.header] -name = "ADSPFW" -load_offset = "0x40000" - -[module] -count = 1 - - [[module.entry]] - name = "SMATEST" - uuid = "167A961E-8AE4-11EA-89F1-000C29CE1635" - affinity_mask = "0x1" - instance_count = "1" - domain_types = "0" - load_type = "0" - init_config = "1" - module_type = "0xD" - auto_start = "0" - sched_caps = [1, 0x00008000] - - # pin = [dir, type, sample rate, size, container, channel-cfg] - pin = [0, 0, 0xfeef, 0xf, 0xa, 0x45ff, - 0, 0, 0xfeef, 0xf, 0xa, 0x45ff, - 1, 0, 0xfeef, 0xf, 0xa, 0x45ff] - - # mod_cfg [PAR_0 PAR_1 PAR_2 PAR_3 IS_BYTES CPS IBS OBS MOD_FLAGS CPC OBLS] - mod_cfg = [0, 0, 0, 0, 4096, 1000000, 128, 128, 0, 0, 0] diff --git a/lmdk/modules/smart_amp_test/CMakeLists.txt b/lmdk/modules/smart_amp_test/CMakeLists.txt deleted file mode 100644 index 4c10559fcc03..000000000000 --- a/lmdk/modules/smart_amp_test/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -target_sources(smart_amp_test PRIVATE ${SOF_BASE}/src/samples/audio/smart_amp_test_ipc4.c) - -set_target_properties(smart_amp_test PROPERTIES - HPSRAM_ADDR "0xa06c1000" -) - -target_compile_definitions(smart_amp_test PRIVATE - __SOF_MODULE_SERVICE_BUILD__=1 - CONFIG_XTENSA=1 - CONFIG_IPC_MAJOR_4=1 -) - -target_include_directories(smart_amp_test PRIVATE - "${SOF_BASE}/src/include" - "${SOF_BASE}/posix/include" -) diff --git a/src/include/ipc4/base-config.h b/src/include/ipc4/base-config.h index 07a35a47e9aa..b95ecbd3e1f9 100644 --- a/src/include/ipc4/base-config.h +++ b/src/include/ipc4/base-config.h @@ -23,9 +23,8 @@ #ifndef __SOF_IPC4_BASE_CONFIG_H__ #define __SOF_IPC4_BASE_CONFIG_H__ -#ifndef __SOF_MODULE_SERVICE_BUILD__ + #include -#endif #include struct sof_ipc_stream_params; diff --git a/src/include/sof/samples/audio/smart_amp_test.h b/src/include/sof/samples/audio/smart_amp_test.h index c5ddd8032d99..3feda5005125 100644 --- a/src/include/sof/samples/audio/smart_amp_test.h +++ b/src/include/sof/samples/audio/smart_amp_test.h @@ -8,10 +8,8 @@ #ifndef __SOF_AUDIO_SMART_AMP_H__ #define __SOF_AUDIO_SMART_AMP_H__ -#ifndef __SOF_MODULE_SERVICE_BUILD__ #include #include -#endif #if CONFIG_IPC_MAJOR_4 #include @@ -21,20 +19,10 @@ #define SMART_AMP_MAX_STREAM_CHAN 8 -/* Max channels for all intel platforms are 8 */ -#define MAX_CHANNELS 8 - /** IPC blob types */ #define SOF_SMART_AMP_CONFIG 0 #define SOF_SMART_AMP_MODEL 1 -#ifdef __SOF_MODULE_SERVICE_BUILD__ -#define LOG_ERR(...) -#define LOG_WRN(...) -#define LOG_DBG(...) -#define LOG_INF(...) -#endif - struct smart_amp_model_data { uint32_t data_size; void *data; @@ -95,8 +83,8 @@ struct smart_amp_model_data { struct sof_smart_amp_config { uint32_t size; uint32_t feedback_channels; - int8_t source_ch_map[MAX_CHANNELS]; - int8_t feedback_ch_map[MAX_CHANNELS]; + int8_t source_ch_map[PLATFORM_MAX_CHANNELS]; + int8_t feedback_ch_map[PLATFORM_MAX_CHANNELS]; }; #if CONFIG_IPC_MAJOR_4 diff --git a/src/samples/audio/smart_amp_test_ipc4.c b/src/samples/audio/smart_amp_test_ipc4.c index 41d8ff2db25a..7aeb5c0f2b6f 100644 --- a/src/samples/audio/smart_amp_test_ipc4.c +++ b/src/samples/audio/smart_amp_test_ipc4.c @@ -3,8 +3,8 @@ // Copyright(c) 2020 Intel Corporation. All rights reserved. // // Author: Bartosz Kokoszko - -#ifndef __SOF_MODULE_SERVICE_BUILD__ +#include +#include #include #include #include @@ -18,29 +18,11 @@ #include LOG_MODULE_REGISTER(smart_amp_test, CONFIG_SOF_LOG_LEVEL); -#include SOF_DEFINE_REG_UUID(smart_amp_test); DECLARE_TR_CTX(smart_amp_test_comp_tr, SOF_UUID(smart_amp_test_uuid), LOG_LEVEL_INFO); -#else -#include -#include -#include - -#include -#include -#include -#include