Commit Graph

306 Commits

Author SHA1 Message Date
David Wagner
6ee39f8055 mkenvimage: Use mmap() when reading from a regular file
Fall back to read() if it fails.

Signed-off-by: David Wagner <david.wagner@free-electrons.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-03-27 10:09:52 +02:00
David Wagner
48995b5a96 mkenvimage: Read/Write from/to stdin/out by default or if the filename is "-"
Signed-off-by: David Wagner <david.wagner@free-electrons.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-03-27 10:05:05 +02:00
David Wagner
3d0f9bd034 mkenvimage: More error handling
Verbosly fail if the target environment size or the padding byte are badly
formated.

Verbosly fail if something bad happens when reading from standard input.

Signed-off-by: David Wagner <david.wagner@free-electrons.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-03-27 09:56:25 +02:00
David Wagner
d1acdae986 mkenvimage: Correct an include and add a missing one
compiler.h needs to be included from U-Boot's headers.
Also, group U-Boot-specific includes together

stdlib.h was missing.

Signed-off-by: David Wagner <david.wagner@free-electrons.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-03-27 09:55:51 +02:00
David Wagner
8a1b8fc786 mkenvimage: correct and clarify comments and error messages
Also, don't split error messages over several lines as per a coding style
exception making them easier to grep.

Signed-off-by: David Wagner <david.wagner@free-electrons.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-03-27 09:55:19 +02:00
Wolfgang Denk
e758a5c4a7 mkenvimage: fix usage message
Don't use argv[0] for usage() because it may or may not be clobbered
by the previous call to basename().  Use "prg" instead as it is done
in the rest of the code.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-03-26 11:45:15 +02:00
Otavio Salvador
993d30de99 mxsboot: fix tool name in usage message
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
2012-03-17 21:38:03 +01:00
Tom Rini
1064d980be tools: checkstack.pl from Linux added to tools
Added from Linux - commit 62aa2b537c6f5957afd98e29f96897419ed5ebab

Signed-off-by: Tom Rini <trini@ti.com>
2012-03-06 22:07:55 +01:00
Chander Kashyap
81e352032c EXYNOS: SMDK5250: Add MMC SPL support
This patch adds support for MMC SPL booting.

Signed-off-by: Chander Kashyap <chander.kashyap@linaro.org>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
2012-02-12 10:11:30 +01:00
Dirk Behme
bd25864cc7 imximage: Sort bootops alphabetically
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-12 10:11:25 +01:00
Dirk Behme
19b409c007 imximage: Add support for i.MX6
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>
2012-02-12 10:11:25 +01:00
Frans Meulenbroeks
9cbfee6dc2 fw_env.h: fix comment
made description according to implementation
(where the config file is the default).

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
2012-02-11 22:18:38 +01:00
Marek Vasut
e364daf925 MX28: Fix MXSBOOT segfault if no params specified
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
2012-01-16 08:40:09 +01:00
David Wagner
30de1014a7 Strip mkenvimage
Signed-off-by: David Wagner <david.wagner@free-electrons.com>
2012-01-13 21:03:05 +01:00
David Wagner
dbee61db43 Correctly handle input files beginning with several newlines
Also, fix some comments (minor)

Signed-off-by: David Wagner <david.wagner@free-electrons.com>
2012-01-05 20:10:38 +01:00
Grant Erickson
aa701b9433 tools/env: allow overwrite of ethaddr on default
This patch allows the U-Boot user space companion utility, fw_setenv,
to overwrite the 'ethaddr' key/value pair if the current value is set
to a per-board-configured default.

This change allows 'fw_setenv' to match the behavior of 'setenv' /
'env set' on the U-Boot command line.

Signed-off-by: Grant Erickson <marathon96@gmail.com>
Fixed excessive white space.
Signed-off-by: Wolfgang Denk <wd@denx.de>
2012-01-05 17:00:01 +01:00
Wolfgang Denk
145afab32c Merge branch 'master' of git://git.denx.de/u-boot-arm
* 'master' of git://git.denx.de/u-boot-arm:
  tegra2: Optimize out-of-tree build for Ventana.
  tegra: Move boards over to use arch-level board UART function
  tegra: Add support for UART init in cpu board.c
  tegra: Add a function mux feature
  tegra: add clock_ll_start_uart() to enable UART prior to reloc
  tegra: Move clock_early_init() to arch_cpu_init()
  tegra: Move cpu_init_cp15() to arch_cpu_init()
  arm: Tegra: Fix Harmony and Ventana builds in u-boot-tegra/master
  tegra: Fix build error in plutux, medcom
  tegra2: Add Avionic Design Medcom support.
  tegra2: Add Avionic Design Plutux support.
  tegra2: Add common Avionic Design Tamonten support.
  tegra2: Move tegra2_mmc_init() prototype to public header.
  tegra2: Change CONFIG_SYS_TEXT_BASE to 0x00108000.
  tegra2: Always build with USE_PRIVATE_LIBGCC=yes.
  tegra2: Plumb in SPI/UART switch code
  tegra2: spi: Support SPI / UART switch
  tegra2: Implement SPI / UART GPIO switch
  tegra2: Enable SPI environment on Seaboard
  tegra2: config: Enable SPI flash on Seaboard
  tegra2: spi: Add SPI driver for Tegra2 SOC
  tegra2: Add UARTB support
  tegra2: Tidy UART selection
  arm, davinci: Fix build warnings for cam_enc_4xx
  Devkit8000: Switch over to enable_gpmc_cs_config
  arm, davinci: Add support for generating AIS images to the Makefile
  mkimage: Fix variable length header support
  arm, da850evm: Add an SPL for SPI boot
  arm, davinci: Add SPL support for DA850 SoCs
  sf: Add spi_boot() to allow booting from SPI flash in an SPL
  spl: display_options.o is required for SPI flash support in SPL
  ARM: omap3: add support to Technexion twister board
  ARM: omap3: added common configuration for Technexion TAM3517
  vision2: Fix checkpatch warning
2012-01-05 16:38:50 +01:00
Horst Kronstorfer
72ebafbe2b tools/mkenvimage.c: Fix a merge issue
With bfcc40bb09 'optopt' was reverted.

Signed-off-by: Horst Kronstorfer <hkronsto@frequentis.com>
2012-01-05 16:36:44 +01:00
Igor Grinberg
6f403bad80 env: remove value from boolean defines
Several boolean defines have a value assigned.
Remove the value as defining the symbol is enough.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Acked-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2012-01-05 16:35:54 +01:00
Frans Meulenbroeks
5d5cc38461 fw_env.h: added a few missing defines
The README file lists 4 defined that were not actually present in the .h
file but that were needed to get things working with settings compiled in.
They are
Added these to the .h file
(the values above are the ones from the README file)

Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
2012-01-05 16:07:42 +01:00
Christian Riesch
d1be8f922e mkimage: Fix variable length header support
Support for variable length images like AIS image was introduced
in commit f0662105b6. A parameter
"-s" was also introduced to prohibit copying of the image file
automatically in the main program. However, this parameter
was implemented incorrectly and the image file was copied
nevertheless.

Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Acked-by: Stefano Babic <sbabic@denx.de>
2011-12-24 10:23:30 +01:00
Wolfgang Denk
bfcc40bb09 Merge branch 'next' of ../next
* 'next' of ../next:
  mkenvimage: Add version info switch (-V)
  mkenvimage: Fix getopt() error handling
  mkenvimage: Fix some typos
  phy: add Micrel KS8721BL phy definition
  net: introduce per device index
  mvgbe: remove setting of ethaddr within the driver
  x86: Add support for specifying an initrd with the zboot command
  x86: Refactor the zboot innards so they can be reused with a vboot image
  x86: Add infrastructure to extract an e820 table from the coreboot tables
  x86: Add support for booting Linux using the 32 bit boot protocol
  x86: Clean up the x86 zimage code in preparation to extend it
  x86: Import code from coreboot's libpayload to parse the coreboot table
  x86: Initial commit for running as a coreboot payload
  CHECKPATCH: ./board/esd/hh405/logo_320_240_8bpp.c
  CHECKPATCH: ./board/esd/hh405/logo_1024_768_8bpp.c
  CHECKPATCH: ./board/esd/hh405/logo_320_240_4bpp.c
  CHECKPATCH: ./board/esd/hh405/logo_640_480_24bpp.c
  CHECKPATCH: ./board/esd/apc405/logo_640_480_24bpp.c
  CHECKPATCH: ./board/esd/voh405/logo_320_240_4bpp.c
  CHECKPATCH: ./board/esd/voh405/logo_640_480_24bpp.c
  CHECKPATCH: ./board/esd/hh405/fpgadata.c
  CHECKPATCH: ./board/esd/pci405/fpgadata.c
  CHECKPATCH: ./board/esd/tasreg/fpgadata.c
  CHECKPATCH: ./board/esd/apc405/fpgadata.c
  CHECKPATCH: ./board/esd/voh405/fpgadata.c
  CHECKPATCH: ./board/esd/ash405/fpgadata.c
  CHECKPATCH: ./board/esd/dasa_sim/fpgadata.c
  CHECKPATCH: ./board/esd/ar405/fpgadata_xl30.c
  CHECKPATCH: ./board/esd/ar405/fpgadata.c
  CHECKPATCH: ./board/esd/plu405/fpgadata.c
  CHECKPATCH: ./board/esd/wuh405/fpgadata.c
  CHECKPATCH: ./board/esd/cpci405/fpgadata_cpci405.c
  CHECKPATCH: ./board/esd/cpci405/fpgadata_cpci405ab.c
  CHECKPATCH: ./board/esd/cpci405/fpgadata_cpci4052.c
  CHECKPATCH: ./board/esd/canbt/fpgadata.c
  CHECKPATCH: ./board/esd/du405/fpgadata.c
  CHECKPATCH: ./board/esd/cpciiser4/fpgadata.c
  CHECKPATCH: ./board/dave/PPChameleonEVB/fpgadata.c
  avr32:mmu.c: fix printf() length modifier
  fat.c: fix printf() length modifier
  cmd_sf.c: fix printf() length modifier
  Make printf and vprintf safe from buffer overruns
  vsprintf: Move function documentation into header file
  Add safe vsnprintf and snprintf library functions
  Move vsprintf functions into their own header

Conflicts:
	tools/mkenvimage.c

Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-12-23 20:53:58 +01:00
Horst Kronstorfer
af44f4b2a5 Print program basename instead of whole path in usage()
Signed-off-by: Horst Kronstorfer <hkronsto@frequentis.com>
2011-12-22 09:09:18 +01:00
Horst Kronstorfer
1895420b2e mkenvimage: Add version info switch (-V)
Signed-off-by: Horst Kronstorfer <hkronsto@frequentis.com>
2011-12-20 23:54:22 +01:00
Horst Kronstorfer
5e0c63e2e3 mkenvimage: Fix getopt() error handling
Since the original implementation indicates explicit error handling
we turn off getopt()'s internal error messaging to avoid duplicate
error messages.  Additionally we add ':' (missing option argument)
error handling.

Signed-off-by: Horst Kronstorfer <hkronsto@frequentis.com>
2011-12-20 23:51:36 +01:00
Horst Kronstorfer
d30011bf61 mkenvimage: Fix some typos
Signed-off-by: Horst Kronstorfer <hkronsto@frequentis.com>
2011-12-20 23:51:20 +01:00
Kyle Moffett
a7b3918533 tools/setlocalversion: Update from the Linux Kernel
Several bugfixes have occurred upstream since this script was imported
into U-Boot.  In particular, the script currently in U-Boot does not
describe commit f8bbb4dad0 correctly,
resulting in a version of "2011.09" instead of "2011.09-01460-gf8bbb4d".

With that commit checked out, the command "git name-rev --tags HEAD"
gives this result:
  HEAD tags/v2011.12-rc1~30^2

Then the "changes" regex does not match because of the trailing '^2':
  grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$'

The new version of tools/setlocalversion in the kernel correctly handles
those situations by using different plumbing commands.

The version from the kernel is not directly usable as it does not append
the full GIT version that U-Boot expects unless the right config options
are set (CONFIG_LOCALVERSION_AUTO=y).  Other than a few minor changes
for Kconfig, the imported version is very similar to Linux v3.2-rc4.

Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-12-17 20:58:48 +01:00
Aneesh V
28a181ff81 omap: Improve PLL parameter calculation tool
Improve the tool that finds multiplier and divider for PLLs:
The previous algorithm could get stuck on local maxima
and required the user to specify the tolerance. Improve
the algorithm to go through the entire search space and find
the optimal solution.

Signed-off-by: Aneesh V <aneesh@ti.com>
2011-12-06 23:59:34 +01:00
Igor Grinberg
73f94ed403 tools/envcrc: fix compile breakage
When ENV_IS_EMBEDDED is not set, but CONFIG_BUILD_ENVCRC is set,
the environment.h file does not get included resulting in unrecognized
env_t type.
Fix this by moving the include directive.

Reported-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Tested-by: Mike Frysinger <vapier@gentoo.org>
2011-12-06 22:11:25 +01:00
Simon Glass
94e9d4c3e8 Fix tsize warning in tools/aisimage.c
This fixes the following warning with gcc 4.4.3.

aisimage.c: In function 'aisimage_generate':
aisimage.c:365: warning: 'tsize' may be used uninitialized in this function

Signed-off-by: Simon Glass <sjg@chromium.org>
2011-12-05 23:05:04 +01:00
Andreas Bießmann
6f26185435 tools/os_support: add OS X Lion support
OS X Lion's c-library implements getline(), therefore prevent including the old
helper implementation for __DARWIN_C_LEVEL < 200809L.

Without this patch following error occours:

---8<---
In file included from os_support.h:32,
                 from img2srec.c:55:
getline.h:1: error: conflicting types for ‘getline’
/usr/include/stdio.h:449: error: previous declaration of ‘getline’ was
here
--->8---

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
2011-12-02 10:56:21 +01:00
Stephen Warren
b9b50e89d3 image: Implement IH_TYPE_KERNEL_NOLOAD
The legacy uImage format includes an absolute load and entry-point
address. When bootm operates on a kernel uImage in memory that isn't
loaded at the address in the image's load address, U-Boot will copy
the image to its address in the header.

Some kernel images can actually be loaded and used at any arbitrary
address. An example is an ARM Linux kernel zImage file. To represent
this capability, IH_TYPE_KERNEL_NOLOAD is implemented, which operates
just like IH_TYPE_KERNEL, except that the load address header is
ignored, and U-Boot does not copy the image to its load address, but
rather uses it in-place.

This is useful when sharing a single (uImage-wrapped) zImage across
multiple boards with different memory layouts; in this case, a specific
load address need not be picked when creating the uImage, but instead
is selected by the board-specific U-Boot environment used to load and
boot that image.

v2: Rename from IH_TYPE_KERNEL_ANYLOAD to IH_TYPE_KERNEL_NOLOAD.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Stefan Roese <sr@denx.de>
2011-12-01 09:45:35 +01:00
Mike Frysinger
ca8a30ec6a ignore new mkenvimage tool
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-11-27 15:44:41 +01:00
Andreas Bießmann
dca61f0128 tools/env: use lib/crc32.c directly
Instead of linking the file into $(obj) tree use directly the source file.
This also prevents littered source tree if building not out-of-tree.

Signed-off-by: Andreas Bießmann <biessmann@corscience.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-11-22 08:49:21 +01:00
Igor Grinberg
994bc671cf env: move extern environment[] to environment.h
Extract all extern declarations for environment out of c files
into the environment.h header.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2011-11-22 08:39:25 +01:00
David Wagner
a6337e6ffd new tool mkenvimage: generates an env image from an arbitrary config file
This tool takes a key=value configuration file (same as would a `printenv' show)
and generates the corresponding environment image, ready to be flashed.

use case: flash the environment with an external tool

Signed-off-by: David Wagner <david.wagner@free-electrons.com>
Acked-by; Mike Frysinger <vapier@gentoo.org>
Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2011-11-22 08:39:24 +01:00
Joe Hershberger
05622191e5 tools: checkpatch.pl from Linux added to tools
Added from Linux - commit 30ecad51849ae132dc6ef6ddb62d499c7257515b

Include config file to ignore common false-positives

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Wolfgang Denk <wd@denx.de>
2011-11-17 14:27:11 +01:00
Wolfgang Denk
9dfa8da709 Merge branch 'master' of git://git.denx.de/u-boot-video
* 'master' of git://git.denx.de/u-boot-video:
  api: export LCD device to external apps
  font: split font data from video_font.h
  tools: logo: split bmp arrays from bmp_logo.h
  lcd: add clear and draw bitmap declaration
  VIDEO: mx3fb: GCC4.6 fix build warnings
  Powerpc/DIU: Fixed the 800x600 and 1024x768 resolution bug
2011-11-16 20:44:03 +01:00
Che-Liang Chiou
c270730f58 tools: logo: split bmp arrays from bmp_logo.h
The generated header bmp_logo.h is useful even outside common/lcd.c for
the logo dimension.  However, the problem is, the generated bmp_logo.h
cannot be included multiple times because bmp_logo_palette[] and
bmp_logo_bitmap[] are defined in the bmp_logo.h.

This patch fixes this by defining these arrays in another header
bmp_logo_data.h and in bmp_logo.h only declaring these arrays.

Signed-off-by: Che-Liang Chiou <clchiou@chromium.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
2011-11-15 23:58:26 +01:00
Marek Vasut
f29f7e02ce iMX28: Add image header generator tool
This tool can now generate proper image for "BootStream" files.

NOTE: This tool now works only for NAND.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Stefano Babic <sbabic@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Detlev Zundel <dzu@denx.de>
2011-11-11 11:36:57 +01:00
Heiko Schocher
4dd834906d arm, davinci: add cam_enc_4xx support
- DM368 SOC
- booting with spl not with UBL from TI
- before loading u-boot from NAND into RAM, test
  the RAM with the post memory test. If error
  is found, switch all LEDs on and halt system.
- SPI Flash
  Dataflash Typ: M25PE80
- Ethernet DM9161BI
- MMC
- USB

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Sandeep Paulraj <s-paulraj@ti.com>
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
Cc: Igor Grinberg <grinberg@compulab.co.il>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2011-11-03 22:56:25 +01:00
Stefano Babic
4962e38e9a mkimage: adding support for Davinci AIS image
Some Davinci processors supports the Application
Image Script (AIS) boot process. The patch adds the generation
of the AIS image inside the mkimage tool to make possible
to generate a bootable U-boot without external tools
(TI Davinci AIS Generator).

Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Wolfgang Denk <wd@denx.de>
2011-10-23 23:34:21 +02:00
Joe Hershberger
b3f44c21ea common: cosmetic: CONFIG_BOOTFILE checkpatch compliance
Remove MK_STR from places that consume CONFIG_BOOTFILE to force all definitions to be string literals.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-10-22 01:21:35 +02:00
Joe Hershberger
8b3637c662 common: cosmetic: CONFIG_ROOTPATH checkpatch compliance
Remove MK_STR from places that consume CONFIG_ROOTPATH to force all definitions to be string literals.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
Cc: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-10-22 01:21:15 +02:00
Stephen Warren
712fbcf384 checkpatch whitespace cleanups
This avoids the following checkpatch warning in later patches:

ERROR: "(foo*)" should be "(foo *)"
ERROR: space required before the open brace '{'
ERROR: space prohibited before that close parenthesis ')'
ERROR: spaces required around that '||' (ctx:WxV)
WARNING: space prohibited between function name and open parenthesis '('
WARNING: line over 80 characters

This fixes all the white-space warnings/errors in my subsequent patch,
and within this current patch. A number of other checkpatch warnings
and errors are still present in this patch itself, but are beyond simple
whitespace fixes, so are not solved by this patch.

v2: New patch

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Simon Glass <sjg@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
2011-10-22 01:13:35 +02:00
Luka Perkov
8603b69b8b fix compile warning for env tools
Patch fixes this issue:

fw_env.c: In function ‘fw_setenv’:
fw_env.c:492:5: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 3 has type ‘size_t’ [-Wformat]
fw_env.c: In function ‘flash_write_buf’:
fw_env.c:806:6: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 3 has type ‘size_t’ [-Wformat]

Signed-off-by: Luka Perkov <lists@lukaperkov.net>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-10-22 00:16:29 +02:00
Loïc Minier
9f87658054 ublimage: NAND block size isn't set at build-time
mkimage's ublimage support can't depend of build-time board configs;
instead, this should be set in ublimage.cfg.  Since currently no configs
in u-boot override the NAND block size, hardcode it as such in
ublimage.h to fix a build failure with "make tools":
gcc [...] -o ublimage.o ublimage.c -c
In file included from ublimage.c:37:0:
ublimage.h:31:20: fatal error: config.h: No such file or directory

Cc: Heiko Schocher <hs@denx.de>
Cc: patches@linaro.org
Signed-off-by: Loïc Minier <loic.minier@linaro.org>
Acked-by: Heiko Schocher <hs@denx.de>
2011-10-06 20:21:16 +02:00
Stefano Babic
f0662105b6 mkimage: Add variable lenght header support
Some images have not a header of fix lenght. The patch will be
used for the generation of AIS images, because this header has
a variable lenght. The patch adds also the parameter "-s" (skip)
to not copy automatically the passed image file.

Signed-off-by: Stefano Babic <sbabic@denx.de>
2011-10-05 22:03:12 +02:00
Stefano Babic
163967905f mkimage: ublimage must return if the header is not verified
Each image handler must return a not-zero velue if the
header is not recognized to allow the main program to
iterate to the next handler.

Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Heiko Schocher <hs@denx.de>
Acked-by: Heiko Schocher <hs@denx.de>
2011-10-05 22:03:11 +02:00
Dirk Behme
8fcf5959a8 mkimage: Fix 'Unknown OMAP image type - 5'
Using mkimage with e.g.

tools/mkimage -A arm -T firmware -O u-boot -d u-boot.bin foo.img

gives a warning

"Unknown OMAP image type - 5"

while it seems that the image itself is created successfully.

This does come from the patch "mkimage: Add OMAP boot image support".

The method check_image_type in image_type_params is supposed to just
return success or failure.  However, for omap it also calls fprintf:

static int omapimage_check_image_types(uint8_t type)
{
	if (type == IH_TYPE_OMAPIMAGE)
		return EXIT_SUCCESS;
	else {
		fprintf(stderr, "Unknown OMAP image type - %x", type);
		return EXIT_FAILURE;
	}
}

All the other image checkers and no others have this, so the fix is to
simply remove the fprintf.

Signed-off-by: Dirk Behme <dirk.behme@googlemail.com>
CC: John Rigby <john.rigby@linaro.org>
CC: Aneesh V <aneesh@ti.com>
CC: Sandeep Paulraj <s-paulraj@ti.com>
2011-09-04 11:34:00 +02:00