Skip to content

Commit

Permalink
[DEBUG] rimage: manifest: remove adsp_file_ext from ACE 1_5 manifest
Browse files Browse the repository at this point in the history
Signed-off-by: Adrian Bonislawski <[email protected]>
  • Loading branch information
abonislawski committed Oct 25, 2023
1 parent 06b981c commit 8f4d72a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 30 deletions.
4 changes: 0 additions & 4 deletions config/mtl.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 0 additions & 4 deletions src/adsp_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 0 additions & 3 deletions src/include/rimage/manifest.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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];

Expand Down
37 changes: 20 additions & 17 deletions src/manifest.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -1490,22 +1492,23 @@ 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;

/* mue writes 0xff to 16 bytes of padding */
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;

Expand Down Expand Up @@ -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;

Expand Down
2 changes: 0 additions & 2 deletions src/rimage.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 8f4d72a

Please sign in to comment.