summaryrefslogtreecommitdiff
path: root/tools/imximage.c
AgeCommit message (Collapse)Author
2013-05-05imx: Align the imximage header and payload to multiples of 4kMarek Vasut
The MX53 ROM loads the data from NAND in multiples of pages and supports maximum page size of 4k. Thus, align the image and header to 4k to be safe from ROM bugs. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Albert ARIBAUD <albert.u.boot@aribaud.net> Cc: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Fabio Estevam <fabio.estevam@freescale.com> Cc: Scott Wood <scottwood@freescale.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Tom Rini <trini@ti.com>
2013-04-28tools: arm: imx: Implement BOOT_OFFSET command for imximageMarek Vasut
Implement BOOT_OFFSET command for imximage. This command is parallel to current BOOT_FROM command, but allows more flexibility in configuring arbitrary image header offset. Also add an imximage.cfg with default offset values into arm/arch/imx-common/ so the board-specific imximage.cfg can include this file to avoid magic constants. The syntax of BOOT_OFFSET command is "BOOT_OFFSET <u32 offset>". Signed-off-by: Marek Vasut <marex@denx.de> Cc: Albert ARIBAUD <albert.u.boot@aribaud.net> Cc: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Cc: Fabio Estevam <fabio.estevam@freescale.com> Cc: Scott Wood <scottwood@freescale.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Tom Rini <trini@ti.com> Acked-by: Stefano Babic <sbabic@denx.de> Acked-by: Stefan Roese <sr@denx.de>
2013-01-28tools: imximage: Let .name field be more genericFabio Estevam
Since this structure is not i.MX5x specific, remove the '5x' to make it more generic. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
2013-01-05tools: imximage: Load a size that is multiple of 512Fabio Estevam
In order to mx53 ROM to properly load the U-boot image, its header size should be multiple of 512 bytes. This issue was observed with gcc 4.6.2/4.7.3, which caused data aborts: U-Boot 2013.01-rc2-00172-gf8cfcf1-dirty (Dec 26 2012 - 13:13:28) Board: MX53 LOCO I2C: ready DRAM: 1 GiB MMC: FSL_SDHC: 0, FSL_SDHC: 1 In: serial Out: serial Err: serial CPU: Freescale i.MX53 family rev2.1 at 1000 MHz Reset cause: WDOG Net: FEC Warning: FEC using MAC address from net device Hit any key to stop autoboot: 0 data abort MAYBE you should read doc/README.arm-unaligned-accesses pc : [<aff72220>] lr : [<aff721fc>] sp : af565e20 ip : af566918 fp : 00000000 r10: 00000003 r9 : affabb5b r8 : af565f58 r7 : 00000000 r6 : 36747fff r5 : af5668e8 r4 : 36747fff r3 : af5668ec r2 : af5668eb r1 : 00000000 r0 : af5668e8 Flags: NzcV IRQs off FIQs off Mode SVC_32 Resetting CPU ... resetting ... ,and this patch fixes it. Also, even though the ROUND macro is already defined in common.h, the reason for redefining it in image.h is explained by Stefano Babic: "I will remark a previous comment - even if including common.h seems a good idea to avoid duplications, it makes tools like mkimage to depend on the selected board, because <board>_config must run. Even if this is not a problem for us u-boot developers, it becomes an issue when these tools are included in distros (like u-boot-tools in Ubuntu) and cannot be packaged." Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
2012-10-20imximage: make set_imx_hdr_v1/v2 easier to readTroy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
2012-10-20imximage: change parameters to set_imx_hdrTroy Kisky
Call with the value the function will use instead of going through a pointer. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
2012-10-20imximage: delay setting of image sizeTroy Kisky
When later we change to variable length header, we won't know the file size when set_imx_hdr is called. So this is prep work. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
2012-10-20imximage: fix size of image to load.Troy Kisky
sbuf->st_size already includes sizeof(struct imx_header), so remove extra addition. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
2012-10-20imximage: move flash_offset check to common locationTroy Kisky
Both set_imx_hdr_v1 and set_imx_hdr_v2 perform the same check. Move check to before the set_imx_hdr call. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Stefano Babic <sbabic@denx.de>
2012-10-20imximage: remove redundant setting of app_dest_ptrTroy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Stefano Babic <sbabic@denx.de>
2012-10-20imximage: check dcd_len as entries addedTroy Kisky
Before the len was checked after the entire file was processed, so it could have already overflowed. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
2012-03-27imximage: Remove overwriting of flash_offsetDirk Behme
The flash header supports different flash offsets for different boot devices. E.g. parallel NOR or OneNAND use a different offset than FLASH_OFFSET_STANDARD (== 0x400). The flash offset is correctly read from the configuration in parse_cfg_cmd(). But is then overwritten wrongly in set_imx_hdr_v1/2(). Fix this by removing this overwriting. Use the flash offset correctly read from the configuration, instead. If there is no flash_offset read from the configuration file, i.e. the BOOT_FROM tag is missing, exit with an error message. Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com> CC: Jason Liu <liu.h.jason@gmail.com> CC: Stefano Babic <sbabic@denx.de> Tested-by: Stefano Babic <sbabic@denx.de>
2012-02-12imximage: Sort bootops alphabeticallyDirk Behme
Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com> CC: Fabio Estevam <festevam@gmail.com> CC: Stefano Babic <sbabic@denx.de> CC: Jason Liu <jason.hui@linaro.org> Acked-by: Jason Liu <jason.hui@linaro.org>
2012-02-12imximage: Add support for i.MX6Dirk Behme
The i.MX6 processor can boot from NOR flash and SATA disks, additionally. Add the flash offsets for these additional boot modes. Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com> Signed-off-by: Fabio Estevam <festevam@gmail.com> CC: Stefano Babic <sbabic@denx.de> CC: Jason Liu <jason.hui@linaro.org> Acked-by: Jason Liu <jason.hui@linaro.org>
2011-02-02imximage: Add MX53 boot image supportLiu Hui-R64343
This patch add the MX53 boot image support. This patch has been tested on Freescale MX53EVK board and MX51EVK board. Signed-off-by: Jason Liu <r64343@freescale.com>
2010-04-30mkimage: correct spelling error in imximageStefano Babic
Signed-off-by: Stefano Babic <sbabic@denx.de>
2010-02-24tools: fix imximage warningKim Phillips
Fix build warning: Configuring for MPC837XEMDS board... imximage.c: In function `imximage_parse_cfg_file': imximage.c:146: warning: passing argument 2 of `getline' from incompatible pointer type /usr/include/bits/stdio.h:116: note: expected `size_t *' but argument is of type `uint32_t *' Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
2010-02-24mkimage: SEGFAULT with imximage on 64 bit systemsStefano Babic
Running mkimage to generate an imximage produces a SEGFAULT on 64 bit machines due to pointer arithmetic limited to 32 bit. Signed-off-by: Stefano Babic <sbabic@denx.de> Acked-by: Kim Phillips <kim.phillips@freescale.com>
2010-01-27Fix compiler warning in imximage.c due to getline prototypeKumar Gala
imximage.c: In function 'imximage_parse_cfg_file': imximage.c:142: warning: implicit declaration of function 'getline' Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2010-01-25mkimage: Add Freescale imx Boot Image support (imximage)Stefano Babic
This patch adds support for "imximage" (MX Boot Image) to the mkimage utility. The imximage is used on the Freescales's MX.25, MX.35 and MX.51 processors. Further details under doc/README.imximage. This patch was tested on a Freescale mx51evk board. Signed-off-by: Stefano Babic <sbabic@denx.de>