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
4 changes: 2 additions & 2 deletions tools/rimage/src/adsp_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -2052,7 +2052,7 @@ static int parse_adsp_config_v1_5(const toml_table_t *toml, struct image *image)

/* assign correct write functions */
out->write_firmware = man_write_fw_v1_5_sue;
out->write_firmware_meu = man_write_fw_meu_v1_5;
out->write_firmware_meu = NULL;
out->verify_firmware = ri_manifest_verify_v1_5;

/* parse others sibtables */
Expand Down Expand Up @@ -2235,7 +2235,7 @@ static int parse_adsp_config_ace_v1_5(const toml_table_t *toml, struct image *im

/* assign correct write functions */
out->write_firmware = man_write_fw_ace_v1_5;
out->write_firmware_meu = man_write_fw_meu_v2_5;
out->write_firmware_meu = NULL;
out->verify_firmware = ri_manifest_verify_v2_5;

/* version array has already been parsed, so increment ctx.array_cnt */
Expand Down
13 changes: 11 additions & 2 deletions tools/rimage/src/manifest.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,11 @@ static int man_module_create_reloc(struct image *image, struct manifest_module *
struct elf_section section;
int err;

if (!modules) {
fprintf(stderr, "error: relocatable image requires module configuration\n");
return -EINVAL;
}

/* load in module manifest data */
err = elf_section_read_by_name(&module->file.elf, ".module", &section);
if (err) {
Expand Down Expand Up @@ -1786,8 +1791,12 @@ int resign_image(struct image *image)
}
}

if (i >= size) {
fprintf(stderr, "error: didn't found header marker %d\n", i);
/* the scan stops a full marker before the end, so a trailing partial word
* leaves the loop index below the size; test the result of the scan itself
*/
if (!image->fw_image) {
fprintf(stderr, "error: could not find valid CSE header $CPD in %s\n",
image->in_file);
ret = -EINVAL;
goto out;
}
Expand Down
7 changes: 6 additions & 1 deletion tools/rimage/src/rimage.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ int main(int argc, char *argv[])
goto out;
}

if (image.meu_offset && !image.adsp->write_firmware_meu) {
fprintf(stderr, "error: MEU signing is not supported for this target\n");
ret = -EINVAL;
goto out;
}

/* set IMR Type and the PV bit in found machine definition */
if (image.adsp->man_v1_8) {
if (imr_type_override)
Expand Down Expand Up @@ -274,7 +280,6 @@ int main(int argc, char *argv[])

/* process and write output */
if (image.meu_offset) {
assert(image.adsp->write_firmware_meu);
ret = image.adsp->write_firmware_meu(&image);
} else {
assert(image.adsp->write_firmware);
Expand Down
Loading