summaryrefslogtreecommitdiff
path: root/tools/kwbimage.c
Commit message (Collapse)AuthorAgeLines
* tools/kwbimage.c: fix parser error handlingAndreas Bießmann2015-01-11-6/+8
| | | | | | | | | | | | | | | | | | | | The two error checks for image_boot_mode_id and image_nand_ecc_mode_id where wrong and would never fail, fix that! This was detected by Apple's clang compiler: ---8<--- HOSTCC tools/kwbimage.o tools/kwbimage.c:553:20: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] if (el->bootfrom < 0) { ~~~~~~~~~~~~ ^ ~ tools/kwbimage.c:571:23: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] if (el->nandeccmode < 0) { ~~~~~~~~~~~~~~~ ^ ~ 2 warnings generated. --->8--- Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> Acked-By: Jeroen Hofstee <jeroen@myspectrum.nl>
* fix: tools: kwbimage.c: Initialize headersz to suppress warningŁukasz Majewski2015-01-10-1/+1
| | | | | | | | | | | | | | | | When building with my toolchain (4.8.2): CROSS_COMPILE=/home/lukma/work/ptxdist/toolchains/arm/OSELAS.Toolchain-2013.12.0/arm-v7a-linux-gnueabi/gcc-4.8.2-glibc-2.18-binutils-2.24-kernel-3.12-sanitized/bin/arm-v7a-linux-gnueabi- I see following WARNING: tools/kwbimage.c: In function "kwbimage_set_header": tools/kwbimage.c:803:8: warning: "headersz" may be used uninitialized in this function [-Wmaybe-uninitialized] memcpy(ptr, image, headersz); ^ This fix aims to suppress it. Signed-off-by: Lukasz Majewski <l.majewski@samsung.com> Acked-by: Stefan Roese <sr@denx.de> Acked-by: Heiko Schocher <hs@denx.de>
* ARM: kwimage: fix v0 formatGerald Kerma2014-11-04-4/+6
| | | | | | | | | | This patch fix the kwimage tools for version 0 fileformat used for kirkwood Tested on sheevaplug Signed-off-by: Gerald Kerma <drEagle@doukki.net> Tested-by: Stefan Roese <sr@denx.de> Reviewed-by: Stefan Roese <sr@denx.de> Acked-By: Prafulla Wadaskar <prafulla@marvell.com>
* tools/kwbimage: Fix compilation warningStefan Roese2014-10-31-6/+17
| | | | | | | | | | | | | | | This patch fixes a compilation warning of kwbimage.c: tools/kwbimage.c: In function ‘kwbimage_set_header’: tools/kwbimage.c:784:8: warning: ‘headersz’ may be used uninitialized in this function [-Wmaybe-uninitialized] memcpy(ptr, image, headersz); ^ Instead of using multiple if statements, use a switch statement with a default entry. And return with error if an unsupported version is configured in the cfg file. Signed-off-by: Stefan Roese <sr@denx.de> Acked-By: Wolfgang Denk <wd@denx.de>
* tools/kwbimage.c: fix build on darwinAndreas Bießmann2014-10-31-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | kwbimage uses get_current_dir_name(3) which is a gnu extension and not available on darwin host. Fix this by converting to portable getcwd(3) function. This patch fixes the following error: ---8<--- HOSTCC tools/kwbimage.o tools/kwbimage.c:399:16: warning: implicit declaration of function 'get_current_dir_name' is invalid in C99 [-Wimplicit-function-declaration] char *cwd = get_current_dir_name(); ^ tools/kwbimage.c:399:10: warning: incompatible integer to pointer conversion initializing 'char *' with an expression of type 'int' [-Wint-conversion] char *cwd = get_current_dir_name(); ^ ~~~~~~~~~~~~~~~~~~~~~~ 2 warnings generated. ... Undefined symbols for architecture x86_64: "_get_current_dir_name", referenced from: _image_headersz_v1 in kwbimage.o ld: symbol(s) not found for architecture x86_64 --->8--- Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com> Cc: Stefan Roese <sr@denx.de> Acked-by: Stefan Roese <sr@denx.de> [agust: fixed getcwd() return warning] Signed-off-by: Anatolij Gustschin <agust@denx.de>
* tools: kwbimage: Add image version 1 support for Armada XP / 370Stefan Roese2014-10-23-268/+782
| | | | | | | | | | | | | | | | | | | | | | | | This patch integrates the Barebox version of this kwbimage.c file into U-Boot. As this version supports the image version 1 type for the Armada XP / 370 SoCs. It was easier to integrate the existing and known to be working Barebox source than to update the current U-Boot version to support this v1 image header format. Now all Marvell MVEBU SoCs are supported: Image type 0: Kirkwood & Dove Image type 1: Armada 370 & Armada XP Please note that the current v1 support has this restuction (same as has Barebox version): Not implemented: support for the register headers and secure headers in v1 images Tested on Marvell DB-78460-BP eval board. Signed-off-by: Stefan Roese <sr@denx.de> Tested-by: Luka Perkov <luka@openwrt.org>
* tools: moved code common to all image tools to a separated module.Guilherme Maciel Ferreira2013-12-13-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to avoid duplicating code and keep only one point of modification, the functions, structs and defines useful for "dumpimage" were moved from "mkimage" to a common module called "imagetool". This modification also weakens the coupling between image types (FIT, IMX, MXS, and so on) and image tools (mkimage and dumpimage). Any tool may initialize the "imagetool" through register_image_tool() function, while the image types register themselves within an image tool using the register_image_type() function: +---------------+ +------| fit_image | +--------------+ +-----------+ | +---------------+ | mkimage |--------> | | <-----+ +--------------+ | | +---------------+ | imagetool | <------------| imximage | +--------------+ | | +---------------+ | dumpimage |--------> | | <-----+ +--------------+ +-----------+ | +---------------+ +------| default_image | +---------------+ register_image_tool() register_image_type() Also, the struct "mkimage_params" was renamed to "image_tool_params" to make clear its general purpose. Signed-off-by: Guilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com> Signed-off-by: Simon Glass <sjg@chromium.org>
* tools/Makefile: Move _GNU_SOURCE to MakefileYork Sun2013-08-16-3/+0
| | | | | | | | | | Commit 669dfc2e adds libfdt_env.h to HOSTCPPFLAGS. It causes stdio.h to be included before _GNU_SOURCE is defined in C files. On some old hosts some prototypes are protected by #ifdef __USE_GNU, which is set when _GNU_SOURCE is defined. Signed-off-by: York Sun <yorksun@freescale.com> Acked-by: Simon Glass <sjg@chromium.org>
* Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk2013-07-24-17/+1
| | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
* kwbimage: Fix check variable of checksumNobuhiro Iwamatsu2011-05-12-1/+1
| | | | | | | calc_hdrcsum two times are checked. checksumi of exthdr is not checked. Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> CC: Prafulla Wadaskar <prafulla@marvell.com>
* Fix typo ("comand" instead of "command")Loïc Minier2011-01-19-1/+1
| | | | Signed-off-by: Loc Minier <loic.minier@linaro.org>
* kwbimage.c: Fix compile warning when building on 64 bit systems (again)Wolfgang Denk2009-09-15-1/+1
| | | | | | | | | | | Commit 51003b89 attempted to fix a build problem on 64 bit systems, but just turned it into a build problem on 32 bit systems (silly me). Now do the Right Thing (TM) and use a "%zu" printf format. Also fix spelling error. Signed-off-by: Wolfgang Denk <wd@denx.de>
* kwbimage.c: Fix compile warning when building on 64 bit systemsWolfgang Denk2009-09-11-1/+1
| | | | | | | | | | Fix this warning when building on 64 bit systems: tools/kwbimage.c: In function 'kwbimage_checksum32': tools/kwbimage.c:135: warning: format '%d' expects type 'int', but argument 4 has type 'long unsigned int' Signed-off-by: Wolfgang Denk <wd@denx.de> Cc: Prafulla Wadaskar <prafulla@marvell.com>
* mkimage: Add Kirkwood Boot Image support (kwbimage)Prafulla Wadaskar2009-09-10-0/+405
This patch adds support for "kwbimage" (Kirkwood Boot Image) image types to the mkimage code. For details refer to docs/README.kwbimage This patch is tested with Sheevaplug board Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com> Acked-by: Ron Lee <ron@debian.org> Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com>