From 8f4d72a2d4b23c0fb4190159afba706d0f3508cc Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski Date: Wed, 25 Oct 2023 13:05:59 +0200 Subject: [PATCH] [DEBUG] rimage: manifest: remove adsp_file_ext from ACE 1_5 manifest Signed-off-by: Adrian Bonislawski --- config/mtl.toml | 4 ---- src/adsp_config.c | 4 ---- src/include/rimage/manifest.h | 3 --- src/manifest.c | 37 +++++++++++++++++++---------------- src/rimage.c | 2 -- 5 files changed, 20 insertions(+), 30 deletions(-) diff --git a/config/mtl.toml b/config/mtl.toml index 62ec7df..649d2e4 100644 --- a/config/mtl.toml +++ b/config/mtl.toml @@ -48,10 +48,6 @@ partition_usage = "0x23" [[signed_pkg.module]] name = "ADSP.met" -[adsp_file] -[[adsp_file.comp]] -base_offset = "0x2000" - [fw_desc.header] name = "ADSPFW" load_offset = "0x40000" diff --git a/src/adsp_config.c b/src/adsp_config.c index ac19607..ce2d06f 100644 --- a/src/adsp_config.c +++ b/src/adsp_config.c @@ -2257,10 +2257,6 @@ static int parse_adsp_config_ace_v1_5(const toml_table_t *toml, struct image *im if (ret < 0) return err_key_parse("partition_info", NULL); - ret = parse_adsp_file_ext_v2_5(toml, &ctx, &out->man_ace_v1_5->adsp_file_ext, verbose); - if (ret < 0) - return err_key_parse("adsp_file", NULL); - ret = parse_fw_desc(toml, &ctx, &out->man_ace_v1_5->desc, verbose); if (ret < 0) return err_key_parse("fw_desc", NULL); diff --git a/src/include/rimage/manifest.h b/src/include/rimage/manifest.h index c1f820c..a54cf90 100644 --- a/src/include/rimage/manifest.h +++ b/src/include/rimage/manifest.h @@ -106,7 +106,6 @@ struct manifest_module { #define MAN_FW_DESC_OFFSET_ACE_V1_5 \ (MAN_META_EXT_OFFSET_ACE_V1_5 + \ - sizeof(struct sof_man_adsp_meta_file_ext_v2_5) + \ MAN_EXT_PADDING) #define MAN_FW_DESC_OFFSET_V2_5 \ @@ -192,8 +191,6 @@ struct fw_image_manifest_ace_v1_5 { struct signed_pkg_info_ext_ace_v1_5 signed_pkg; struct info_ext_0x16 info_0x16; - struct sof_man_adsp_meta_file_ext_v2_5 adsp_file_ext; - /* reserved / pading at end of ext data - all 0s*/ uint8_t reserved[MAN_EXT_PADDING]; diff --git a/src/manifest.c b/src/manifest.c index 24c86d9..c7d5afa 100644 --- a/src/manifest.c +++ b/src/manifest.c @@ -593,14 +593,16 @@ static int man_write_unsigned_mod(struct image *image, int meta_start_offset, { int count; - /* write metadata file for unsigned FW */ - count = fwrite(image->fw_image + meta_start_offset, - ext_file_size, 1, - image->out_man_fd); - - /* did the metadata/manifest write succeed ? */ - if (count != 1) - return file_error("failed to write meta", image->out_man_file); + if (ext_file_size) { + /* write metadata file for unsigned FW */ + count = fwrite(image->fw_image + meta_start_offset, + ext_file_size, 1, + image->out_man_fd); + + /* did the metadata/manifest write succeed ? */ + if (count != 1) + return file_error("failed to write meta", image->out_man_file); + } fclose(image->out_man_fd); @@ -1490,9 +1492,10 @@ int man_write_fw_ace_v1_5(struct image *image) /* calculate hash inside ADSP meta data extension for padding to end */ assert(image->meu_offset < image->image_end); - ret = hash_sha384(image->fw_image + image->meu_offset, image->image_end - image->meu_offset, - m->adsp_file_ext.comp_desc[0].hash, - sizeof(m->adsp_file_ext.comp_desc[0].hash)); + //ret = hash_sha384(image->fw_image + image->meu_offset, image->image_end - image->meu_offset, + // m->adsp_file_ext.comp_desc[0].hash, + // sizeof(m->adsp_file_ext.comp_desc[0].hash)); + if (ret) goto err; @@ -1500,12 +1503,12 @@ int man_write_fw_ace_v1_5(struct image *image) memset(m->reserved, 0xff, 16); /* calculate hash inside ext info 16 of sof_man_adsp_meta_file_ext_v2_5 */ - assert((MAN_META_EXT_OFFSET_ACE_V1_5 + sizeof(struct sof_man_adsp_meta_file_ext_v2_5)) < - image->image_end); + //assert((MAN_META_EXT_OFFSET_ACE_V1_5 + sizeof(struct sof_man_adsp_meta_file_ext_v2_5)) < + // image->image_end); - ret = hash_sha384(image->fw_image + MAN_META_EXT_OFFSET_ACE_V1_5, - sizeof(struct sof_man_adsp_meta_file_ext_v2_5), - m->signed_pkg.module[0].hash, sizeof(m->signed_pkg.module[0].hash)); + //ret = hash_sha384(image->fw_image + MAN_META_EXT_OFFSET_ACE_V1_5, + // sizeof(struct sof_man_adsp_meta_file_ext_v2_5), + // m->signed_pkg.module[0].hash, sizeof(m->signed_pkg.module[0].hash)); if (ret) goto err; @@ -1540,7 +1543,7 @@ int man_write_fw_ace_v1_5(struct image *image) /* write the unsigned files*/ ret = man_write_unsigned_mod(image, MAN_META_EXT_OFFSET_ACE_V1_5, MAN_FW_DESC_OFFSET_ACE_V1_5, - sizeof(struct sof_man_adsp_meta_file_ext_v2_5)); + 0); if (ret < 0) goto err; diff --git a/src/rimage.c b/src/rimage.c index 7c89e09..e3a1257 100644 --- a/src/rimage.c +++ b/src/rimage.c @@ -191,8 +191,6 @@ int main(int argc, char *argv[]) } if (image.adsp->man_ace_v1_5) { - if (imr_type_override) - image.adsp->man_ace_v1_5->adsp_file_ext.imr_type = image.imr_type; image.adsp->man_ace_v1_5->css.reserved0 = pv_bit; }