diff options
author | Joel Johnson <mrjoel@lixil.net> | 2020-04-17 09:38:08 -0600 |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2020-04-22 14:28:15 +0200 |
commit | f60a66ef5d7da1980f180cd1cbfd2ce01157e522 (patch) | |
tree | d219f034d3281956d111920bb3e248ecb2626e8e /cmd | |
parent | 549ba7b440cf22dd196a20816b09c44d1f2b77e4 (diff) | |
download | u-boot-f60a66ef5d7da1980f180cd1cbfd2ce01157e522.zip u-boot-f60a66ef5d7da1980f180cd1cbfd2ce01157e522.tar.gz u-boot-f60a66ef5d7da1980f180cd1cbfd2ce01157e522.tar.bz2 |
cmd: mvebu: bubt: show image boot device
When a mismatch is found trying to write an image for one boot method
to a different boot device, print an error message including the image
header marked target boot device type.
Signed-off-by: Joel Johnson <mrjoel@lixil.net>
Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/mvebu/bubt.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/cmd/mvebu/bubt.c b/cmd/mvebu/bubt.c index be6c586..dc0ce01 100644 --- a/cmd/mvebu/bubt.c +++ b/cmd/mvebu/bubt.c @@ -728,7 +728,17 @@ static int bubt_check_boot_mode(const struct bubt_dev *dst) if (a38x_boot_modes[mode].id == hdr->blockid) return 0; - puts("Error: A38x image not built for destination device!\n"); + for (int i = 0; i < ARRAY_SIZE(a38x_boot_modes); i++) { + if (a38x_boot_modes[i].id == hdr->blockid) { + printf("Error: A38x 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 A38x image header: " + "0x%x\n", hdr->blockid); return -ENOEXEC; } else { return 0; |