@@ -676,6 +676,17 @@ static int a38x_check_boot_mode(const struct bubt_dev *dst)
if (a38x_boot_modes[mode].id == hdr->blockid)
return 0;
+ for (int i = 0; i < ARRAY_SIZE(a38x_boot_modes); i++) {
+ if (a38x_boot_modes[i].id == hdr->blockid) {
+ printf("Error: image meant to be booted from"
+ " \"%s\", not \"%s\"!\n",
+ a38x_boot_modes[i].name, dst->name);
+ return -ENOEXEC;
+ }
+ }
+
+ printf("Error: unknown boot device in image header: 0x%x\n",
+ hdr->blockid);
return -ENOEXEC;
}
@@ -746,7 +757,6 @@ static int bubt_verify(const struct bubt_dev *dst)
if (IS_ENABLED(CONFIG_ARMADA_38X)) {
err = a38x_check_boot_mode(dst);
if (err) {
- puts("Error: image not built for destination device!\n");
return err;
}
}