diff options
author | Simon Baatz <gmbnomis@gmail.com> | 2016-08-10 10:15:42 +0200 |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2016-08-26 08:42:50 +0200 |
commit | bdf58c73ca406e31be49ad875969b2f9aacb9b65 (patch) | |
tree | db35b4ddac36fa80ff96957c51bd7e9d7560131f | |
parent | c90d7ab6b01e58cb3689ff6dac70982bd215d9b0 (diff) | |
download | u-boot-imx-bdf58c73ca406e31be49ad875969b2f9aacb9b65.zip u-boot-imx-bdf58c73ca406e31be49ad875969b2f9aacb9b65.tar.gz u-boot-imx-bdf58c73ca406e31be49ad875969b2f9aacb9b65.tar.bz2 |
tools: kwboot: patch destaddr only for SoCs with header version 1
Commit f4db6c976cf ("arm: mvebu: Add runtime detection of UART (xmodem)
boot-mode") added a change to hdr->destaddr when dynamically patching an
image for UART boot mode. With this change, kwboot ceases to work on
Kirkwood.
Thus, let's change hdr->destaddr only when we are patching an image with
header version 1 (Orion and Kirkwood use header version 0).
Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
Fixes: f4db6c976cf ("arm: mvebu: Add runtime detection of UART (xmodem) boot-mode")
Cc: Stefan Roese <sr@denx.de>
Cc: Luka Perkov <luka.perkov@sartura.hr>
Cc: Kevin Smith <kevin.smith@elecsyscorp.com>
Signed-off-by: Stefan Roese <sr@denx.de>
-rw-r--r-- | tools/kwboot.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/kwboot.c b/tools/kwboot.c index e00958a..26b3949 100644 --- a/tools/kwboot.c +++ b/tools/kwboot.c @@ -655,14 +655,6 @@ kwboot_img_patch_hdr(void *img, size_t size) hdr->blockid = IBR_HDR_UART_ID; - /* - * Subtract mkimage header size from destination address - * as this header is not expected by the Marvell BootROM. - * This way, the execution address is identical to the - * one the image is compiled for (TEXT_BASE). - */ - hdr->destaddr = hdr->destaddr - sizeof(struct image_header); - if (image_ver == 0) { struct main_hdr_v0 *hdr_v0 = img; @@ -672,6 +664,14 @@ kwboot_img_patch_hdr(void *img, size_t size) hdr_v0->srcaddr = hdr_v0->ext ? sizeof(struct kwb_header) : sizeof(*hdr_v0); + } else { + /* + * Subtract mkimage header size from destination address + * as this header is not expected by the Marvell BootROM. + * This way, the execution address is identical to the + * one the image is compiled for (TEXT_BASE). + */ + hdr->destaddr = hdr->destaddr - sizeof(struct image_header); } hdr->checksum = kwboot_img_csum8(hdr, hdrsz) - csum; |