Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions src/arch/xtensa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,13 @@ if(MEU_PATH)
set(MEU_OFFSET 1088)
endif()

set(otc_private_key ${PROJECT_SOURCE_DIR}/rimage/keys/otc_private_key.pem)
if(NOT DEFINED ENV{SOF_RIMAGE_KEY})
if(NOT DEFINED SOF_RIMAGE_KEY)
set(SOF_RIMAGE_KEY ${PROJECT_SOURCE_DIR}/rimage/keys/otc_private_key.pem)
endif()
else()
set(SOF_RIMAGE_KEY $ENV{SOF_RIMAGE_KEY})
endif()

add_custom_target(
run_rimage
Expand All @@ -304,7 +310,7 @@ if(MEU_PATH)
-p sof-${fw_name}.ldc
-m ${fw_name}
-s ${MEU_OFFSET}
-k ${otc_private_key}
-k ${SOF_RIMAGE_KEY}
${bootloader_binary_path}
sof-${fw_name}
DEPENDS sof_dump
Expand All @@ -328,12 +334,21 @@ if(MEU_PATH)
USES_TERMINAL
)
else()
if(NOT DEFINED ENV{SOF_RIMAGE_KEY})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't use env variables. I know they may look handy but it makes harder to figure out what comes from where. Also other params are not settable this way, so if we decide to support env variables we would have to do it for all variables for consistency.

if(NOT DEFINED SOF_RIMAGE_KEY)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be just RIMAGE_KEY, other variables are named without SOF_ prefix

set(SOF_RIMAGE_KEY ${PROJECT_SOURCE_DIR}/rimage/keys/otc_private_key.pem)
endif()
else()
set(SOF_RIMAGE_KEY $ENV{SOF_RIMAGE_KEY})
endif()

add_custom_target(
run_rimage
COMMAND ${PROJECT_BINARY_DIR}/rimage_ep/build/rimage
-o sof-${fw_name}.ri
-p sof-${fw_name}.ldc
-m ${fw_name}
-k ${SOF_RIMAGE_KEY}
${bootloader_binary_path}
sof-${fw_name}
DEPENDS sof_dump
Expand Down