]> git.sur5r.net Git - u-boot/blobdiff - tools/imximage.c
scripts/dtc: Update to upstream version v1.4.6-9-gaadd0b65c987
[u-boot] / tools / imximage.c
index 6dabb13520de53fde34fd172c2b7e964f99fd3e5..5f63bf875945b9b8ddc850a6cb0736cbe1413165 100644 (file)
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * (C) Copyright 2009
  * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
@@ -5,8 +6,6 @@
  * (C) Copyright 2008
  * Marvell Semiconductor <www.marvell.com>
  * Written-by: Prafulla Wadaskar <prafulla@marvell.com>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include "imagetool.h"
@@ -520,7 +519,7 @@ static void print_hdr_v2(struct imx_header *imx_hdr)
                               (uint32_t)fhdr_v2->self, 0,
                               hdr_v2->boot_data.size - imximage_ivt_offset -
                               imximage_csf_size);
-                       printf("DCD Blocks:   00910000 %08x %08x\n",
+                       printf("DCD Blocks:   0x00910000 0x%08x 0x%08x\n",
                               offs, be16_to_cpu(dcdlen));
                }
        } else {
@@ -777,6 +776,11 @@ static uint32_t parse_cfg_file(struct imx_header *imxhdr, char *name)
        (*set_dcd_rst)(imxhdr, dcd_len, name, lineno);
        fclose(fd);
 
+       /* Exit if there is no BOOT_FROM field specifying the flash_offset */
+       if (imximage_ivt_offset == FLASH_OFFSET_UNDEFINED) {
+               fprintf(stderr, "Error: No BOOT_FROM tag in %s\n", name);
+               exit(EXIT_FAILURE);
+       }
        return dcd_len;
 }