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
1 change: 0 additions & 1 deletion rimage/man_apl.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ struct fw_image_manifest_v1_8 apl_manifest = {
.adsp_file_ext = {
.ext_type = 17,
.ext_len = sizeof(struct sof_man_adsp_meta_file_ext),
.imr_type = 3,
.comp_desc[0] = {
.version = 0,
.base_offset = MAN_DESC_OFFSET_V1_8,
Expand Down
1 change: 0 additions & 1 deletion rimage/man_cnl.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ struct fw_image_manifest_v1_8 cnl_manifest = {
.adsp_file_ext = {
.ext_type = 17,
.ext_len = sizeof(struct sof_man_adsp_meta_file_ext),
.imr_type = 3,
.comp_desc[0] = {
.version = 0,
.base_offset = MAN_DESC_OFFSET_V1_8,
Expand Down
1 change: 1 addition & 0 deletions rimage/manifest.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
#define MAN_DESC_OFFSET_V1_8 0x2000
#define MAN_DESC_OFFSET_V1_5 0x284
#define MAN_DESC_OFFSET_V1_5_SUE 0x2000
#define MAN_DEFAULT_IMR_TYPE 3

#define MAN_CSS_HDR_OFFSET \
(MAN_CSE_HDR_OFFSET + \
Expand Down
11 changes: 10 additions & 1 deletion rimage/rimage.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ static void usage(char *name)
fprintf(stdout, "\t -r enable relocatable ELF files\n");
fprintf(stdout, "\t -s MEU signing offset\n");
fprintf(stdout, "\t -p log dictionary outfile\n");
fprintf(stdout, "\t -i set IMR type\n");
exit(0);
}

Expand All @@ -53,10 +54,11 @@ int main(int argc, char *argv[])
struct image image;
const char *mach = NULL;
int opt, ret, i, elf_argc = 0;
int imr_type = MAN_DEFAULT_IMR_TYPE;

memset(&image, 0, sizeof(image));

while ((opt = getopt(argc, argv, "ho:p:m:vba:s:k:l:r")) != -1) {
while ((opt = getopt(argc, argv, "ho:p:m:vba:s:k:l:ri:")) != -1) {
switch (opt) {
case 'o':
image.out_file = optarg;
Expand All @@ -82,6 +84,9 @@ int main(int argc, char *argv[])
case 'r':
image.reloc = 1;
break;
case 'i':
imr_type = atoi(optarg);
break;
case 'h':
usage(argv[0]);
break;
Expand Down Expand Up @@ -116,6 +121,10 @@ int main(int argc, char *argv[])

found:

/* set IMR Type in found machine definition */
if (image.adsp->man_v1_8)
image.adsp->man_v1_8->adsp_file_ext.imr_type = imr_type;

/* parse input ELF files */
image.num_modules = argc - elf_argc;
for (i = elf_argc; i < argc; i++) {
Expand Down
7 changes: 7 additions & 0 deletions src/arch/xtensa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,11 @@ if(NOT DEFINED RIMAGE_PRIVATE_KEY)
set(RIMAGE_PRIVATE_KEY ${PROJECT_SOURCE_DIR}/rimage/keys/otc_private_key.pem)
endif()

if(NOT DEFINED RIMAGE_IMR_TYPE)
# default value for non-production firmware
set(RIMAGE_IMR_TYPE 3)
endif()

if(MEU_PATH)
execute_process(
COMMAND ${MEU_PATH}/meu -ver
Expand All @@ -313,6 +318,7 @@ if(MEU_PATH)
-m ${fw_name}
-s ${MEU_OFFSET}
-k ${RIMAGE_PRIVATE_KEY}
-i ${RIMAGE_IMR_TYPE}
${bootloader_binary_path}
sof-${fw_name}
DEPENDS sof_dump
Expand Down Expand Up @@ -343,6 +349,7 @@ else()
-p sof-${fw_name}.ldc
-m ${fw_name}
-k ${RIMAGE_PRIVATE_KEY}
-i ${RIMAGE_IMR_TYPE}
${bootloader_binary_path}
sof-${fw_name}
DEPENDS sof_dump
Expand Down