diff --git a/src/adsp_config.c b/src/adsp_config.c index 25091940a..8d213e93f 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -1579,7 +1579,8 @@ static int parse_adsp_file_ext_v1_8(const toml_table_t *toml, struct parse_ctx * out->ext_len = sizeof(struct sof_man_adsp_meta_file_ext_v1_8); /* configurable fields */ - out->imr_type = parse_uint32_hex_key(adsp_file_ext, &ctx, "imr_type", 0, &ret); + out->imr_type = parse_uint32_hex_key(adsp_file_ext, &ctx, "imr_type", + MAN_DEFAULT_IMR_TYPE, &ret); if (ret < 0) return ret; @@ -1699,7 +1700,8 @@ static int parse_adsp_file_ext_v2_5(const toml_table_t *toml, struct parse_ctx * out->ext_len = sizeof(struct sof_man_adsp_meta_file_ext_v2_5); /* configurable fields */ - out->imr_type = parse_uint32_hex_key(adsp_file_ext, &ctx, "imr_type", 0, &ret); + out->imr_type = parse_uint32_hex_key(adsp_file_ext, &ctx, "imr_type", + MAN_DEFAULT_IMR_TYPE, &ret); if (ret < 0) return ret; diff --git a/src/rimage.c b/src/rimage.c index 96194977c..7c985e157 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -43,6 +43,7 @@ int main(int argc, char *argv[]) int imr_type = MAN_DEFAULT_IMR_TYPE; int use_ext_man = 0; unsigned int pv_bit = 0; + bool imr_type_override = false; memset(&image, 0, sizeof(image)); @@ -68,6 +69,7 @@ int main(int argc, char *argv[]) break; case 'i': imr_type = atoi(optarg); + imr_type_override = true; break; case 'f': image.fw_ver_string = optarg; @@ -170,17 +172,20 @@ int main(int argc, char *argv[]) /* set IMR Type and the PV bit in found machine definition */ if (image.adsp->man_v1_8) { - image.adsp->man_v1_8->adsp_file_ext.imr_type = imr_type; + if (imr_type_override) + image.adsp->man_v1_8->adsp_file_ext.imr_type = imr_type; image.adsp->man_v1_8->css.reserved0 = pv_bit; } if (image.adsp->man_v2_5) { - image.adsp->man_v2_5->adsp_file_ext.imr_type = imr_type; + if (imr_type_override) + image.adsp->man_v2_5->adsp_file_ext.imr_type = imr_type; image.adsp->man_v2_5->css.reserved0 = pv_bit; } if (image.adsp->man_ace_v1_5) { - image.adsp->man_ace_v1_5->adsp_file_ext.imr_type = imr_type; + if (imr_type_override) + image.adsp->man_ace_v1_5->adsp_file_ext.imr_type = imr_type; image.adsp->man_ace_v1_5->css.reserved0 = pv_bit; }