X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=tools%2Fimximage.c;h=5f63bf875945b9b8ddc850a6cb0736cbe1413165;hb=f9b88b3a5d7ff18760c2c5a0cb596ec8c577706e;hp=6dabb13520de53fde34fd172c2b7e964f99fd3e5;hpb=5512f5ccf1dc5cec068f8efa1d8ce81f51a988d3;p=u-boot diff --git a/tools/imximage.c b/tools/imximage.c index 6dabb13520..5f63bf8759 100644 --- a/tools/imximage.c +++ b/tools/imximage.c @@ -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 * Written-by: Prafulla Wadaskar - * - * 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; }