Skip to content

Commit

Permalink
TEST: Convert AEC as loadable
Browse files Browse the repository at this point in the history
Signed-off-by: Yong Zhi <yong.zhi@intel.com>
  • Loading branch information
yongzhi1 committed Feb 27, 2024
1 parent 0b3b574 commit 0a036b9
Show file tree
Hide file tree
Showing 3 changed files with 137 additions and 0 deletions.
25 changes: 25 additions & 0 deletions lmdk/libraries/aec_stub/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
cmake_minimum_required(VERSION 3.20)
set(CMAKE_TOOLCHAIN_FILE "${CMAKE_CURRENT_LIST_DIR}/../../cmake/xtensa-toolchain.cmake")

project(aec_stub)

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 aec_stub)

# toml file for rimage to generate manifets
set(TOML "${CMAKE_CURRENT_LIST_DIR}/aec_stub.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)
77 changes: 77 additions & 0 deletions lmdk/libraries/aec_stub/aec_stub.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
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 = "RTC_AEC"
uuid = "B780A0A6-269F-466F-B477-23DFA05AF758"
// bit #i = 1 means core #i is allowed.
affinity_mask = "0x7"
instance_count = "1"
domain_types = "1"
load_type = "1"
module_type = "10"
init_config = "1"
auto_start = "0"
sched_caps = [1, 0x00008000]

// pin = [dir, type, sample rate, size, container, channel-cfg]
pin = [0, 0, 0x8, 0x2, 0x2, 0x1,
0, 0, 0x8, 0x2, 0x2, 0x4,
1, 0, 0x8, 0x2, 0x2, 0x1]
35 changes: 35 additions & 0 deletions lmdk/modules/aec_stub/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
target_sources(aec_stub PRIVATE
${SOF_BASE}/src/audio/google/google_rtc_audio_processing.c
${SOF_BASE}/src/audio/google/google_rtc_audio_processing_mock.c
)

set_target_properties(aec_stub PROPERTIES
HPSRAM_ADDR "0xa06c1000"
)

target_compile_definitions(aec_stub PRIVATE
__SOF_MODULE_SERVICE_BUILD__=1
CONFIG_XTENSA=1
CONFIG_IPC_MAJOR_4=1
)

function(sof_append_relative_path_definitions target)
get_target_property(sources ${target} SOURCES)
foreach(src ${sources})
get_filename_component(ABS_PATH ${src} ABSOLUTE)
file(RELATIVE_PATH rel ${PROJECT_SOURCE_DIR} ${ABS_PATH})
set_property(
SOURCE ${src}
APPEND
PROPERTY COMPILE_DEFINITIONS
RELATIVE_FILE="${rel}")
endforeach()
endfunction()

sof_append_relative_path_definitions(aec_stub)

target_include_directories(aec_stub PRIVATE ${SOF_BASE}/xtos/include)
target_include_directories(aec_stub PRIVATE ${SOF_BASE}/src/include)
target_include_directories(aec_stub PRIVATE ${SOF_BASE}/src/arch/xtensa/include)
target_include_directories(aec_stub PRIVATE ${SOF_BASE}/src/platform/meteorlake/include)
target_include_directories(aec_stub PRIVATE ${SOF_BASE}/src/platform/intel/ace/include)

0 comments on commit 0a036b9

Please sign in to comment.