From f4ce87d8a277a47af03bb8b4a2dc21fa4f98f861 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Wed, 4 Oct 2023 16:42:11 -0700 Subject: [PATCH 1/2] cmake: add new ${RIMAGE_TOP} constant In preparation for changing it, see https://github.com/thesofproject/sof/issues/8178 No functional change yet. Signed-off-by: Marc Herbert --- CMakeLists.txt | 6 ++++-- src/arch/xtensa/CMakeLists.txt | 6 +++--- src/ipc/ipc4/CMakeLists.txt | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d951e86a2de..c7b0ddd8ddd2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,6 +43,8 @@ project(SOF C ASM) set(SOF_ROOT_SOURCE_DIRECTORY "${PROJECT_SOURCE_DIR}") set(SOF_ROOT_BINARY_DIRECTORY "${PROJECT_BINARY_DIR}") +set(RIMAGE_TOP "${PROJECT_SOURCE_DIR}/rimage") + # check git hooks include(scripts/cmake/git-hooks.cmake) @@ -159,8 +161,8 @@ install( ${PROJECT_SOURCE_DIR}/src/include/ipc ${PROJECT_SOURCE_DIR}/src/include/kernel ${PROJECT_SOURCE_DIR}/src/include/user - ${PROJECT_SOURCE_DIR}/rimage/src/include/sof/kernel - ${PROJECT_SOURCE_DIR}/rimage/src/include/sof/user + ${RIMAGE_TOP}/src/include/sof/kernel + ${RIMAGE_TOP}/src/include/sof/user DESTINATION include/sof PATTERN "*.h" ) diff --git a/src/arch/xtensa/CMakeLists.txt b/src/arch/xtensa/CMakeLists.txt index 474be5988727..ba045fe6ccb1 100644 --- a/src/arch/xtensa/CMakeLists.txt +++ b/src/arch/xtensa/CMakeLists.txt @@ -330,7 +330,7 @@ add_custom_target( ExternalProject_Add(rimage_ep DEPENDS check_version_h - SOURCE_DIR "${PROJECT_SOURCE_DIR}/rimage" + SOURCE_DIR "${RIMAGE_TOP}" PREFIX "${PROJECT_BINARY_DIR}/rimage_ep" BINARY_DIR "${PROJECT_BINARY_DIR}/rimage_ep/build" EXCLUDE_FROM_ALL TRUE @@ -386,7 +386,7 @@ if(MEU_PATH OR DEFINED MEU_NO_SIGN) # Don't sign with rimage run_rimage COMMAND ${PROJECT_BINARY_DIR}/rimage_ep/build/rimage -o sof-${fw_name}.ri - -c "${PROJECT_SOURCE_DIR}/rimage/config/${fw_name}.toml" + -c "${RIMAGE_TOP}/config/${fw_name}.toml" -s ${MEU_OFFSET} -k ${RIMAGE_PRIVATE_KEY} -i ${RIMAGE_IMR_TYPE} @@ -427,7 +427,7 @@ else() # sign with rimage run_rimage COMMAND ${PROJECT_BINARY_DIR}/rimage_ep/build/rimage -o sof-${fw_name}.ri - -c "${PROJECT_SOURCE_DIR}/rimage/config/${fw_name}.toml" + -c "${RIMAGE_TOP}/config/${fw_name}.toml" -k ${RIMAGE_PRIVATE_KEY} -i ${RIMAGE_IMR_TYPE} -f ${SOF_MAJOR}.${SOF_MINOR}.${SOF_MICRO} diff --git a/src/ipc/ipc4/CMakeLists.txt b/src/ipc/ipc4/CMakeLists.txt index 7f9d75f654be..2e162e702672 100644 --- a/src/ipc/ipc4/CMakeLists.txt +++ b/src/ipc/ipc4/CMakeLists.txt @@ -9,4 +9,4 @@ add_local_sources(sof ams_helpers.c ) -target_include_directories(sof_options INTERFACE ${PROJECT_SOURCE_DIR}/rimage/src/include) +target_include_directories(sof_options INTERFACE ${RIMAGE_TOP}/src/include) From 0e48cbce1b30e3dba8bda0f69c76aa07127ccfe8 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Wed, 4 Oct 2023 17:04:01 -0700 Subject: [PATCH 2/2] zephyr/cmake: add new ${RIMAGE_TOP} constant In preparation for changing it, see https://github.com/thesofproject/sof/issues/8178 No functional change yet. Signed-off-by: Marc Herbert --- zephyr/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt index 7e2b9c46055b..a618f966eee6 100644 --- a/zephyr/CMakeLists.txt +++ b/zephyr/CMakeLists.txt @@ -58,11 +58,11 @@ set(SOF_IPC_PATH "${SOF_SRC_PATH}/ipc") set(SOF_DEBUG_PATH "${SOF_SRC_PATH}/debug") set(SOF_MATH_PATH "${SOF_SRC_PATH}/math") set(SOF_TRACE_PATH "${SOF_SRC_PATH}/trace") +set(RIMAGE_TOP ${sof_top_dir}/rimage) # Save path to rimage configuration files in cmake cache for later use by # rimage during the "west sign" stage -get_filename_component(RIMAGE_CONFIG "../rimage/config" ABSOLUTE) -set(RIMAGE_CONFIG_PATH ${RIMAGE_CONFIG} CACHE PATH +set(RIMAGE_CONFIG_PATH ${RIMAGE_TOP}/config} CACHE PATH " Path to rimage board configuration files") include(ExternalProject) @@ -87,7 +87,7 @@ ExternalProject_Add(sof_logger_ep ) # default SOF includes -target_include_directories(SOF INTERFACE ${sof_top_dir}/rimage/src/include) +target_include_directories(SOF INTERFACE ${RIMAGE_TOP}/src/include) target_include_directories(SOF INTERFACE ${SOF_SRC_PATH}/include) target_include_directories(SOF INTERFACE ${SOF_SRC_PATH}/arch/${ARCH}/include) target_include_directories(SOF INTERFACE ${sof_top_dir}/third_party/include)