rimage: add option to set imr type

Signed-off-by: Janusz Jankowski <janusz.jankowski@linux.intel.com>
This commit is contained in:
Janusz Jankowski 2019-04-11 14:09:02 +02:00
parent 9fa0aef635
commit 1edb31d2d6
4 changed files with 11 additions and 3 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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 + \

View File

@ -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);
}
@ -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;
@ -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;
@ -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++) {