summaryrefslogtreecommitdiff
path: root/tools/imximage.c
Commit message (Collapse)AuthorAgeLines
* tools: imximage: Let .name field be more genericFabio Estevam2013-01-28-1/+1
| | | | | | | 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>
* tools: imximage: Load a size that is multiple of 512Fabio Estevam2013-01-05-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* imximage: make set_imx_hdr_v1/v2 easier to readTroy Kisky2012-10-20-19/+11
| | | | Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
* imximage: change parameters to set_imx_hdrTroy Kisky2012-10-20-11/+9
| | | | | | | Call with the value the function will use instead of going through a pointer. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
* imximage: delay setting of image sizeTroy Kisky2012-10-20-6/+6
| | | | | | | | 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>
* imximage: fix size of image to load.Troy Kisky2012-10-20-4/+2
| | | | | | | sbuf->st_size already includes sizeof(struct imx_header), so remove extra addition. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
* imximage: move flash_offset check to common locationTroy Kisky2012-10-20-14/+5
| | | | | | | | 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>
* imximage: remove redundant setting of app_dest_ptrTroy Kisky2012-10-20-1/+0
| | | | | Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Stefano Babic <sbabic@denx.de>
* imximage: check dcd_len as entries addedTroy Kisky2012-10-20-15/+11
| | | | | | | 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>
* imximage: Remove overwriting of flash_offsetDirk Behme2012-03-27-4/+14
| | | | | | | | | | | | | | | | | | | | 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>
* imximage: Sort bootops alphabeticallyDirk Behme2012-02-12-3/+3
| | | | | | | | 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>
* imximage: Add support for i.MX6Dirk Behme2012-02-12-1/+3
| | | | | | | | | | | | 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>
* imximage: Add MX53 boot image supportLiu Hui-R643432011-02-02-138/+387
| | | | | | | | | 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>
* mkimage: correct spelling error in imximageStefano Babic2010-04-30-1/+1
| | | | Signed-off-by: Stefano Babic <sbabic@denx.de>
* tools: fix imximage warningKim Phillips2010-02-24-1/+1
| | | | | | | | | | | 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>
* mkimage: SEGFAULT with imximage on 64 bit systemsStefano Babic2010-02-24-16/+14
| | | | | | | | 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>
* Fix compiler warning in imximage.c due to getline prototypeKumar Gala2010-01-27-0/+3
| | | | | | | 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>
* mkimage: Add Freescale imx Boot Image support (imximage)Stefano Babic2010-01-25-0/+324
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>