From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabio Estevam Date: Thu, 8 Mar 2018 20:24:50 -0300 Subject: [U-Boot] [PATCH] imximage: Check the IVT offset in the correct location In-Reply-To: References: <1520541633-29312-1-git-send-email-festevam@gmail.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, Mar 8, 2018 at 7:24 PM, Fabio Estevam wrote: > Hi Troy, > > On Thu, Mar 8, 2018 at 7:03 PM, Troy Kisky > wrote: > >> Did you test that an image without BOOT_FROM still gets an error message ? > > Good point! It is not properly detecting such case. > > Will need to rework the patch, thanks. I am back to the original mainline code plus this debug line: --- a/tools/imximage.c +++ b/tools/imximage.c @@ -778,6 +778,7 @@ static uint32_t parse_cfg_file(struct imx_header *imxhdr, char *name) fclose(fd); /* Exit if there is no BOOT_FROM field specifying the flash_offset */ + fprintf(stderr, "******* offset is 0x%x\n", imximage_ivt_offset); if (imximage_ivt_offset == FLASH_OFFSET_UNDEFINED) { fprintf(stderr, "Error: No BOOT_FROM tag in %s\n", name); exit(EXIT_FAILURE); This is what I get after a 'make mrproper; make vf610twr_defconfig; make -j4' SHIPPED dts/dt.dtb FDTGREP dts/dt-spl.dtb CAT u-boot-dtb.bin COPY u-boot.dtb COPY u-boot.bin CFGS board/freescale/vf610twr/imximage.cfg.cfgtmp CFGS board/freescale/vf610twr/imximage.cfg.cfgtmp MKIMAGE u-boot-dtb.imx ******* offset is 0xffffffff Error: No BOOT_FROM tag in board/freescale/vf610twr/imximage.cfg.cfgtmp arch/arm/mach-imx/Makefile:100: recipe for target 'u-boot-dtb.imx' failed make[1]: *** [u-boot-dtb.imx] Error 1 Makefile:911: recipe for target 'u-boot-dtb.imx' failed make: *** [u-boot-dtb.imx] Error 2 make: *** Waiting for unfinished jobs.... MKIMAGE u-boot.imx ******* offset is 0x400 ******* offset is 0x400 rm u-boot.imx If I run with -j1 I see: OBJCOPY u-boot-nodtb.bin DTC arch/arm/dts/vf500-colibri.dtb DTC arch/arm/dts/vf610-colibri.dtb DTC arch/arm/dts/vf610-twr.dtb DTC arch/arm/dts/pcm052.dtb DTC arch/arm/dts/bk4r1.dtb make[2]: 'arch/arm/dts/vf610-twr.dtb' is up to date. SHIPPED dts/dt.dtb FDTGREP dts/dt-spl.dtb CAT u-boot-dtb.bin CFGS board/freescale/vf610twr/imximage.cfg.cfgtmp MKIMAGE u-boot-dtb.imx ******* offset is 0x400 ******* offset is 0x400 COPY u-boot.bin MKIMAGE u-boot.imx ******* offset is 0x400 ******* offset is 0x400 MKIMAGE u-boot.vyb OBJCOPY u-boot.srec SYM u-boot.sym COPY u-boot.dtb CHK include/config.h CFG u-boot.cfg CFGCHK u-boot.cfg rm u-boot.imx It seems we need to rework the logic in arch/arm/mach-imx/Makefile to not call the cfg parser twice one (one for u-boot-dtb.imx and another one for u-boot.imx). Any ideas?