Skip to content

Commit f2f29cf

Browse files
Merge branch 'main' into imx8qm_qxp_fix
Signed-off-by: Laurentiu Mihalcea <laurentiumihalcea111@gmail.com>
2 parents 5141359 + b7d7fb0 commit f2f29cf

File tree

78 files changed

+425
-231
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+425
-231
lines changed

lmdk/cmake/build.cmake

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ foreach(MODULE ${MODULES_LIST})
1313
add_executable(${MODULE})
1414
add_subdirectory(${LMDK_BASE}/modules/${MODULE} ${MODULE}_module)
1515

16-
### set_target_properties(${MODULE} PROPERTIES OUTPUT_NAME ${MODULE}.mod)
16+
# uncomment line below to compile module with debug information
17+
#target_compile_options(${MODULE} PUBLIC "-g3")
1718

1819
target_include_directories(${MODULE} PRIVATE
1920
"${LMDK_BASE}/include"
@@ -35,9 +36,9 @@ foreach(MODULE ${MODULES_LIST})
3536
)
3637

3738
target_link_options(${MODULE} PRIVATE
38-
"-nostdlib" "-nodefaultlibs"
39+
"-nostartfiles"
3940
"-Wl,--no-undefined" "-Wl,--unresolved-symbols=report-all" "-Wl,--error-unresolved-symbols"
40-
#"-Wl,--gc-sections" # may remove .bss and that will result in rimage error, do not use for now
41+
"-Wl,--gc-sections"
4142
"-Wl,-Map,$<TARGET_FILE:${MODULE}>.map" # optional: just for debug
4243
"-T" "${MODULE}_ldscripts/elf32xtensa.x"
4344
)
@@ -55,13 +56,26 @@ cmake_path(APPEND SOF_BASE "../build-rimage" OUTPUT_VARIABLE RIMAGE_SOF_INSTALL_
5556
cmake_path(NORMAL_PATH RIMAGE_SOF_INSTALL_DIR)
5657
cmake_path(ABSOLUTE_PATH SIGNING_KEY BASE_DIRECTORY ${CMAKE_SOURCE_DIR} NORMALIZE)
5758

59+
foreach(MOD_NAME IN LISTS MODULES_LIST)
60+
list(APPEND RIMAGE_MODULES_LIST ${MOD_NAME}.mod)
61+
62+
# Change .module section flags to tell rimage to not include it in a final image
63+
add_custom_target(${MOD_NAME}.mod
64+
COMMENT "Preparing .mod(ule) files for rimage"
65+
DEPENDS ${MOD_NAME}
66+
COMMAND ${CMAKE_OBJCOPY}
67+
--set-section-flags .module=noload,readonly
68+
${MOD_NAME} ${MOD_NAME}.mod
69+
)
70+
endforeach()
71+
5872
find_program(RIMAGE_COMMAND NAMES rimage
5973
PATHS "${RIMAGE_INSTALL_DIR}"
6074
HINTS "${RIMAGE_SOF_INSTALL_DIR}"
6175
REQUIRED)
6276

6377
add_custom_target(${PROJECT_NAME}_target ALL
64-
DEPENDS ${MODULES_LIST}
65-
COMMAND ${RIMAGE_COMMAND} -k ${SIGNING_KEY} -f 2.0.0 -b 1 -o ${RIMAGE_OUTPUT_FILE} -c ${TOML} -e ${MODULES_LIST}
78+
DEPENDS ${RIMAGE_MODULES_LIST}
79+
COMMAND ${RIMAGE_COMMAND} -k ${SIGNING_KEY} -f 2.0.0 -b 1 -o ${RIMAGE_OUTPUT_FILE} -c ${TOML} -e ${RIMAGE_MODULES_LIST}
6680
COMMAND ${CMAKE_COMMAND} -E cat ${RIMAGE_OUTPUT_FILE}.xman ${RIMAGE_OUTPUT_FILE} > ${OUTPUT_FILE}
6781
)

lmdk/cmake/config.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ cmake_path(ABSOLUTE_PATH LMDK_BASE NORMALIZE)
1414
set(SOF_BASE ${LMDK_BASE}/..)
1515
cmake_path(ABSOLUTE_PATH SOF_BASE NORMALIZE)
1616

17-
set(RIMAGE_INCLUDE_DIR ${SOF_BASE}/rimage/src/include)
17+
set(RIMAGE_INCLUDE_DIR ${SOF_BASE}/tools/rimage/src/include)
1818
cmake_path(ABSOLUTE_PATH RIMAGE_INCLUDE_DIR NORMALIZE)

lmdk/cmake/ldscripts/bss_linker_script.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,18 @@ SECTIONS {
1616
_next_end = ABSOLUTE(.);
1717
*(.bss)
1818
*(.bss.*)
19+
20+
/* Heap memory */
21+
. = ALIGN(4);
22+
__stack = .;
23+
_end = .;
24+
KEEP(*(.heap_mem))
25+
26+
/* Use the unused rest of the memory page as a heap */
27+
. = ALIGN(4096);
28+
29+
/* The sbrk function implementation by xtensa incorrectly checks whether the allocated
30+
memory block fits in the heap, so we have to add 1 to the end of the heap marker. */
31+
_heap_sentry = . + 1;
1932
} >HPSRAM_seg : bss_phdr
2033
}

lmdk/cmake/ldscripts/data_linker_script.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ SECTIONS {
1111
_data_start = ABSOLUTE(.);
1212
*(.data)
1313
*(.data.*)
14+
*(.*.data)
1415
_data_end = ABSOLUTE(.);
1516
} >HPSRAM_seg : data_phdr
1617

17-
.rodata : ALIGN(4096) {
18+
.rodata : {
1819
_rodata_start = ABSOLUTE(.);
1920
*(.gnu.linkonce.r.*)
2021
*(.rodata)
@@ -24,7 +25,7 @@ SECTIONS {
2425
} >HPSRAM_seg : rodata_phdr
2526

2627
/* Module manifest is here */
27-
.module : ALIGN(4096) {
28+
.module 0 : {
2829
KEEP(*(.module))
29-
} >HPSRAM_seg : rodata_phdr
30+
}
3031
}

lmdk/cmake/ldscripts/text_linker_script.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ PHDRS {
1111
SECTIONS {
1212
.text : ALIGN(4096) {
1313
_text_start = ABSOLUTE(.);
14-
*(.buildinfo)
14+
KEEP(*(.buildinfo))
1515
*(.gnu.linkonce.literal.*)
1616
*(.gnu.linkonce.lit4)
1717
*(.literal)

lmdk/cmake/xtensa-toolchain.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ cmake_path(APPEND XTENSA_TOOLCHAIN_PATH "XtensaTools" OUTPUT_VARIABLE TOOLCHAIN_
1818
set(CROSS_COMPILE xt-)
1919

2020
# clang or xcc
21-
find_program(CMAKE_C_COMPILER NAMES ${CROSS_COMPILE}xcc
21+
find_program(CMAKE_C_COMPILER NAMES ${CROSS_COMPILE}clang
2222
PATHS ${TOOLCHAIN_BASE} PATH_SUFFIXES "bin" REQUIRED NO_DEFAULT_PATH
2323
)
2424
# clang++ or xc++
25-
find_program(CMAKE_CXX_COMPILER NAMES ${CROSS_COMPILE}xc++
25+
find_program(CMAKE_CXX_COMPILER NAMES ${CROSS_COMPILE}clang++
2626
PATHS ${TOOLCHAIN_BASE} PATH_SUFFIXES "bin" REQUIRED NO_DEFAULT_PATH
2727
)
2828
find_program(CMAKE_LD NAMES ${CROSS_COMPILE}ld

scripts/cmake/misc.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ function(get_optimization_flag OUT_VAR)
4040
endif()
4141
endfunction()
4242

43+
# Zephyr duplicate in sof/zephyr/CMakeLists.txt; keep in sync
44+
macro(is_zephyr ret)
45+
if(CONFIG_ZEPHYR_SOF_MODULE)
46+
set(${ret} TRUE)
47+
else()
48+
set(${ret} FALSE)
49+
endif()
50+
endmacro()
51+
4352
# Adds sources to target like target_sources, but assumes that
4453
# paths are relative to subdirectory.
4554
# Works like:

scripts/rebuild-testbench.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ setup_xtensa_tools_build()
5757
BUILD_TYPE=xt
5858
BUILD_TARGET=
5959
BUILD_DIR_NAME=build_xt_testbench
60+
COMPILER="xt-xcc"
6061

6162
# check needed environment variables
6263
test -n "${XTENSA_TOOLS_ROOT}" || die "XTENSA_TOOLS_ROOT need to be set.\n"
@@ -72,11 +73,10 @@ setup_xtensa_tools_build()
7273
test -n "${XTENSA_CORE}" ||
7374
die "Illegal platform $BUILD_PLATFORM, no XTENSA_CORE found.\n"
7475

75-
compiler="xt-xcc"
7676
install_bin=install/tools/$XTENSA_TOOLS_VERSION/XtensaTools/bin
7777
tools_bin=$XTENSA_TOOLS_ROOT/$install_bin
7878
testbench_sections="-Wl,--sections-placement $BUILD_TESTBENCH_DIR/testbench_xcc_sections.txt"
79-
export CC=$tools_bin/$compiler
79+
export CC=$tools_bin/$COMPILER
8080
export LD=$tools_bin/xt-ld
8181
export OBJDUMP=$tools_bin/xt-objdump
8282
export LDFLAGS="-mlsp=sim $testbench_sections"

scripts/set_xtensa_params.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,10 @@ case "$platform" in
8181
HOST="xtensa-mt8195-elf"
8282
XTENSA_TOOLS_VERSION="RI-2019.1-linux"
8383
;;
84+
mtl)
85+
PLATFORM="mtl"
86+
XTENSA_CORE="ace10_LX7HiFi4_2022_10"
87+
XTENSA_TOOLS_VERSION="RI-2022.10-linux"
88+
COMPILER="xt-clang"
89+
;;
8490
esac

src/audio/copier/copier.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ static int copier_init(struct processing_module *mod)
8484
for (i = 0; i < IPC4_COPIER_MODULE_OUTPUT_PINS_COUNT; i++)
8585
cd->out_fmt[i] = cd->config.out_fmt;
8686

87-
ipc_pipe = ipc_get_comp_by_ppl_id(ipc, COMP_TYPE_PIPELINE, config->pipeline_id);
87+
ipc_pipe = ipc_get_comp_by_ppl_id(ipc, COMP_TYPE_PIPELINE,
88+
config->pipeline_id,
89+
IPC_COMP_IGNORE_REMOTE);
8890
if (!ipc_pipe) {
8991
comp_err(dev, "pipeline %d is not existed", config->pipeline_id);
9092
ret = -EPIPE;

0 commit comments

Comments
 (0)