Skip to content
Merged
Show file tree
Hide file tree
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
22 changes: 14 additions & 8 deletions src/arch/xtensa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if(CONFIG_CAVS)
set(family_path intel/cavs)
endif()

set(fw_name ${CONFIG_FIRMWARE_SHORT_NAME})
set(fw_name ${CONFIG_RIMAGE_SIGNING_SCHEMA})

if(CONFIG_BOOT_LOADER)
set(build_bootloader y)
Expand Down Expand Up @@ -462,30 +462,36 @@ else()
add_custom_target(run_meu DEPENDS run_rimage)
endif()

if(NOT DEFINED FIRMWARE_NAME)
Copy link
Member

Choose a reason for hiding this comment

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

nit-pick: typo on commit title.

Can you also add more explanations on how this would actually be used?

Are you suggesting people manually create new firmware names which don't even have a reference to the platform? e.g. sof-kbl-custom.ri sounds better to me than sof-custom.ri, which risks increasing confusion. I think it's fine to customize, but in addition to a base.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Can't the base be incorrect or something? For example imx8 and imx8x could use nearly the same firmware image (and with a modicum of runtime detection the image could be completely shared), so changing the base can be allowed.

Copy link
Contributor Author

@jajanusz jajanusz Sep 8, 2020

Choose a reason for hiding this comment

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

@plbossart It is for the case when you have exactly the same PCH but for example different MEU config / key. Let's assume that f.e. EHL (that is TGL) will have only different key, then you'd need sof-ehl and sof-tgl binaries.

Also what do you mean by base? sof- or sof-tgl-, so output binary will be f.e. sof-tgl-ehl?

Are you suggesting people manually create new firmware names which don't even have a reference to the platform?

Yes. It's custom/advanced option, person that is going to use it should know what he/she's doing. If you really want to keep reference to some name you can always include it manually. BTW these names usually are not meaningful and are just there becasue were first used for given signing scheme (manifest version), f.e. apl could be also named glk.

Copy link
Member

Choose a reason for hiding this comment

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

@jajanusz ok, but do you mind adding a comment in the code that this is an advanced version and that OSes will need a specific configuration to make use of such custom names?

set(fw_output_name "${fw_name}")
else()
set(fw_output_name "${FIRMWARE_NAME}")
endif()

if(MEU_NO_SIGN)
# copy rimage output that can be used to sign firmware
add_custom_target(
bin ALL
COMMAND ${CMAKE_COMMAND} -E copy sof-${fw_name}.ri.uns ${PROJECT_BINARY_DIR}/sof-${fw_name}.ri.uns
COMMAND ${CMAKE_COMMAND} -E copy sof-${fw_name}.ri.met ${PROJECT_BINARY_DIR}/sof-${fw_name}.ri.met
COMMAND ${CMAKE_COMMAND} -E copy sof-${fw_name}.ldc ${PROJECT_BINARY_DIR}/sof-${fw_name}.ldc
COMMAND ${CMAKE_COMMAND} -E copy sof-${fw_name}.ri.uns ${PROJECT_BINARY_DIR}/sof-${fw_output_name}.ri.uns
COMMAND ${CMAKE_COMMAND} -E copy sof-${fw_name}.ri.met ${PROJECT_BINARY_DIR}/sof-${fw_output_name}.ri.met
COMMAND ${CMAKE_COMMAND} -E copy sof-${fw_name}.ldc ${PROJECT_BINARY_DIR}/sof-${fw_output_name}.ldc
DEPENDS run_meu bin_extras
VERBATIM
USES_TERMINAL
)
else()
add_custom_target(
bin ALL
COMMAND ${CMAKE_COMMAND} -E copy sof-${fw_name}.ri ${PROJECT_BINARY_DIR}/sof-${fw_name}.ri
COMMAND ${CMAKE_COMMAND} -E copy sof-${fw_name}.ldc ${PROJECT_BINARY_DIR}/sof-${fw_name}.ldc
COMMAND ${CMAKE_COMMAND} -E copy sof-${fw_name}.ri ${PROJECT_BINARY_DIR}/sof-${fw_output_name}.ri
COMMAND ${CMAKE_COMMAND} -E copy sof-${fw_name}.ldc ${PROJECT_BINARY_DIR}/sof-${fw_output_name}.ldc
DEPENDS run_meu bin_extras
VERBATIM
USES_TERMINAL
)
endif()

install(
FILES ${PROJECT_BINARY_DIR}/sof-${fw_name}.ri
${PROJECT_BINARY_DIR}/sof-${fw_name}.ldc
FILES ${PROJECT_BINARY_DIR}/sof-${fw_output_name}.ri
${PROJECT_BINARY_DIR}/sof-${fw_output_name}.ldc
DESTINATION bin
)
2 changes: 1 addition & 1 deletion src/arch/xtensa/configs/jasperlake_defconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CONFIG_ICELAKE=y
CONFIG_FIRMWARE_SHORT_NAME="jsl"
CONFIG_RIMAGE_SIGNING_SCHEMA="jsl"
CONFIG_INTEL_DMIC=y
CONFIG_INTEL_SSP=y
CONFIG_INTEL_ALH=y
Expand Down
2 changes: 1 addition & 1 deletion src/arch/xtensa/configs/kabylake_defconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CONFIG_APOLLOLAKE=y
CONFIG_FIRMWARE_SHORT_NAME="kbl"
CONFIG_RIMAGE_SIGNING_SCHEMA="kbl"
CONFIG_INTEL_DMIC=y
CONFIG_INTEL_SSP=y
CONFIG_CORE_COUNT=2
Expand Down
2 changes: 1 addition & 1 deletion src/arch/xtensa/configs/skylake_defconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CONFIG_APOLLOLAKE=y
CONFIG_FIRMWARE_SHORT_NAME="skl"
CONFIG_RIMAGE_SIGNING_SCHEMA="skl"
CONFIG_INTEL_DMIC=y
CONFIG_INTEL_SSP=y
CONFIG_CORE_COUNT=2
Expand Down
7 changes: 3 additions & 4 deletions src/platform/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ config CAVS_USE_LPRO_IN_WAITI
Choose n if unclear.

# TODO: it should just take manifest version and offsets
config FIRMWARE_SHORT_NAME
string "Rimage firmware name"
config RIMAGE_SIGNING_SCHEMA
string "Rimage firmware signing schema name"
default "byt" if BAYTRAIL
default "cht" if CHERRYTRAIL
default "hsw" if HASWELL
Expand All @@ -332,8 +332,7 @@ config FIRMWARE_SHORT_NAME
default "imx8m" if IMX8M
default ""
help
3-characters long firmware identifer
used by rimage to decide how to build final binary
Signing schema name used by rimage to decide how to build final binary

config SYSTICK_PERIOD
int "System tick period in microseconds"
Expand Down