Commit Graph

109 Commits

Author SHA1 Message Date
Albert ARIBAUD 7528cf5f01 Merge branch 'u-boot-imx/master' into 'u-boot-arm/master' 2013-01-08 14:59:37 +01:00
Fabio Estevam 1411fb37b5 tools: imximage: Load a size that is multiple of 512
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>
2013-01-05 18:09:00 +01:00
Joe Hershberger ec8a252cd4 env: Use getenv_yesno() more generally
Move the getenv_yesno() to env_common.c and change most checks for
'y' or 'n' to use this helper.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-12-13 11:46:55 -07:00
Gabe Black d95f6ec733 fdt: Add option to default to most compatible conf in a fit image
When booting a fit image with multiple configurations, the user either has to
specify which configuration to use explicitly, or there has to be a default
defined which is chosen automatically. This change adds an option to change
that behavior so that a configuration can be selected explicitly, or the
configuration which has the device tree that claims to be compatible with the
earliest item in U-Boot's device tree.

In other words, if U-Boot claimed to be compatible with A, B, and then C, and
the configurations claimed to be compatible with A, D and B, D and D, E, the
first configuration, A, D, would be chosen. Both the first and second
configurations match, but the first one matches a more specific entry in
U-Boot's device tree. The order in the kernel's device tree is ignored.

Signed-off-by: Gabe Black <gabeblack@google.com>

Commit-Ready: Gabe Black <gabeblack@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
2012-11-12 23:14:57 -05:00
Kim Phillips 2f220500a4 include/image.h: sparse fixes
include/image.h:378:1: warning: cast to restricted __be32
include/image.h:381:1: warning: cast to restricted __be32
include/image.h:382:1: warning: cast to restricted __be32
include/image.h:383:1: warning: cast to restricted __be32

fix by annotating image header integers big endian.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
2012-11-04 11:00:35 -07:00
Joe Hershberger 8ac88f2d28 fdt: Check for a token to skip auto-hash validation
Allow the itb file to declare to u-boot that its hash should not be
checked automatically on bootm or iminfo.  This allows an image to
either be checked automatically or to include a script which may
check it otherwise (such as after part of the itb has been relocated
to RAM by the script).

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
2012-10-15 19:20:32 -04:00
Shaohui Xie 5d898a00f3 powerpc/CoreNet: add tool to support pbl image build.
Provides a tool to build boot Image for PBL(Pre boot loader) which is
used on Freescale CoreNet SoCs, PBL can be used to load some instructions
and/or data for pre-initialization. The default output image is u-boot.pbl,
for more details please refer to doc/README.pblimage.

Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>
Signed-off-by: Andy Fleming <afleming@freescale.com>
2012-08-23 10:24:16 -05:00
Mike Frysinger 314f634b48 image/fit: drop inline markings on parser code
Putting "inline" on extern funcs makes no sense, so drop them.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-04-30 16:38:54 +02:00
Simon Schwarz 1648a37505 Add cmd_spl command
This adds a spl command to the u-boot.

Related config:
CONFIG_CMD_SPL
	activate/deactivate the command
CONFIG_CMD_SPL_NAND_OFS
	Offset in NAND to use

Signed-off-by: Simon Schwarz <simonschwarzcor@gmail.com>
Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Tom Rini <tom.rini@gmail.com>
CC: Wolfgang Denk <wd@denx.de>
2012-03-27 22:05:28 +02:00
Stefan Kristiansson 3ddcaccda3 openrisc: Add architecture image support
Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
2012-01-13 21:16:40 +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
Stefan Kristiansson f52138ae87 Fix clash between IH_ARCH_NDS32 and IH_ARCH_SANDBOX
NDS32 and SANDBOX architecture were sharing the same IH_ARCH number

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Acked-by: Macpaul Lin <macpaul@andestech.com>
Acked-by: Marek Vasut <marek.vasut@gmail.com>
2011-11-23 14:06:28 +08:00
Thierry Reding 7566832a88 image: Fix inverted logic in architecture check.
Commit 476af29 broke this check when the ifdef lists we consolidated.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-10-27 23:53:58 +02: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
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
Macpaul Lin 64d614617f nds32: common bdinfo, bootm, image support
Add support of NDS32 to common commands bdinfo, bootm, and image format.

Signed-off-by: Macpaul Lin <macpaul@andestech.com>
2011-10-22 00:54:06 +02:00
Simon Glass 65bf1d39f4 sandbox: Add architecture image support
We won't actually load an image with this architecture, but we still need to
define it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2011-10-17 22:46:38 +02:00
Mike Frysinger 476af299b0 image: push default arch values to arch headers
This pushes the ugly duplicated arch ifdef lists we maintain in various
image related files out to the arch headers themselves.

Acked-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Tested-by: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-10-05 22:22:15 +02:00
John Rigby 3decb14abe mkimage: Add OMAP boot image support
- Add mkimage support for OMAP boot image
- Add support for OMAP boot image(MLO) generation in the new
  SPL framework

Signed-off-by: John Rigby <john.rigby@linaro.org>
Signed-off-by: Aneesh V <aneesh@ti.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
2011-08-03 12:49:20 +02:00
Heiko Schocher 7816f2cf81 mkimage: add UBL header support for booting davinci cpus
creating an u-boot.ubl file, which contains the UBL Header
needed for booting from NAND with the RBL from TI. For more
information read doc/README.ublimage.

Signed-off-by: Heiko Schocher <hs@denx.de>
2011-07-28 16:52:41 +02:00
Grant Likely 55b0a39314 Respect memreserve regions specified in the device tree
If a regions is reserved in the fdt, then it should not be used.  Add
the memreserve regions to the lmb so that u-boot doesn't use them to
store the initrd.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
2011-04-25 21:11:21 -04:00
Grant Likely c3624e6ed0 Default to bootm_size() when CONFIG_SYS_BOOTMAPSZ is not defined
This patch adds a function getenv_bootm_mapsize() for obtaining the
size of the early mapped region accessible by the kernel during early
boot.  It defaults to CONFIG_SYS_BOOTMAPSZ, or if not defined,
defaults to getenv_bootm_size(), which in turn defaults to the size of
RAM.

getenv_bootm_mapsize() can also be overridden with a "bootm_mapsize"
environmental variable.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
2011-04-25 21:11:20 -04:00
Grant Likely 590d3cacb9 Stop passing around bootmem_base value.
For the calls to boot_relocate_fdt(), boot_get_cmdline(), and
boot_get_kbd(), the value of bootmem_base is always obtained by
calling getenv_bootm_low().  Since the value always comes from the
same source, the calling signature for those functions can be
simplified by making them call getenv_bootm_low() directly.

Signed-off-by: Grant Likely <grant.likely@linaro.org>
2011-04-25 21:11:19 -04:00
Mike Frysinger 7edb186fcf image: constify lookup tables
These are pure lookup tables -- no need to be writable.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-11-28 21:58:27 +01:00
John Rigby fca43cc801 boot: change some arch ifdefs to feature ifdefs
The routines boot_ramdisk_high, boot_get_cmdline and boot_get_kbd
are currently enabled by various combinations of CONFIG_M68K,
CONFIG_POWERPC and CONFIG_SPARC.

Use CONFIG_SYS_BOOT_<FEATURE> defines instead.

CONFIG_SYS_BOOT_RAMDISK_HIGH
CONFIG_SYS_BOOT_GET_CMDLINE
CONFIG_SYS_BOOT_GET_KBD

Define these as appropriate in arch/include/asm/config.h files.

Signed-off-by: John Rigby <john.rigby@linaro.org>
Acked-by: Wolfgang Denk <wd@denx.de>
2010-10-18 22:53:32 +02:00
Torkel Lundgren 3df6195793 Add support for operating system OSE
Add OSE as operating system for mkimage and bootm.

Signed-off-by: Torkel Lundgren <torkel.lundgren@enea.com>
2010-09-28 14:42:26 +02:00
Wolfgang Denk 54841ab50c Make sure that argv[] argument pointers are not modified.
The hush shell dynamically allocates (and re-allocates) memory for the
argument strings in the "char *argv[]" argument vector passed to
commands.  Any code that modifies these pointers will cause serious
corruption of the malloc data structures and crash U-Boot, so make
sure the compiler can check that no such modifications are being done
by changing the code into "char * const argv[]".

This modification is the result of debugging a strange crash caused
after adding a new command, which used the following argument
processing code which has been working perfectly fine in all Unix
systems since version 6 - but not so in U-Boot:

int main (int argc, char **argv)
{
	while (--argc > 0 && **++argv == '-') {
/* ====> */	while (*++*argv) {
			switch (**argv) {
			case 'd':
				debug++;
				break;
			...
			default:
				usage ();
			}
		}
	}
	...
}

The line marked "====>" will corrupt the malloc data structures and
usually cause U-Boot to crash when the next command gets executed by
the shell.  With the modification, the compiler will prevent this with
an
	error: increment of read-only location '*argv'

N.B.: The code above can be trivially rewritten like this:

	while (--argc > 0 && **++argv == '-') {
		char *arg = *argv;
		while (*++arg) {
			switch (*arg) {
			...

Signed-off-by: Wolfgang Denk <wd@denx.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2010-07-04 23:55:42 +02:00
Wolfgang Denk 178e26d752 image.h: remove bogus ';' after function declarations
ISO C does not allow extra ';' outside of a function

Signed-off-by: Wolfgang Denk <wd@denx.de>
2010-06-29 21:52:55 +02:00
Thomas Chou 1117cbf2ad nios: remove nios-32 arch
The nios-32 arch is obsolete and broken. So it is removed.

Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
2010-05-28 10:56:04 -04:00
Stefano Babic 8edcde5e4e mkimage: Add Freescale imx Boot Image support (imximage)
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>
2010-01-25 23:58:29 +01:00
Mike Frysinger 5daa1c18b6 image.h: avoid command.h for host tools
The u-boot command structures don't get used with host systems, so don't
bother including it when building host code.  This avoids an implicit need
on config.h in the process.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-01-21 22:58:49 +01:00
Mike Frysinger a16028da63 lmb: only force on arches that use it
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-01-21 22:26:00 +01:00
Mike Frysinger dac4d7e884 sha1: add dedicated config option
The sha1 code is currently compiled for everyone, but in reality, it's
only used by the FIT code.  So make it optional just like MD5.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-01-21 22:21:22 +01:00
Wolfgang Denk 2a49bf3149 Merge branch 'master' into next
Conflicts:
	board/esd/plu405/plu405.c
	drivers/rtc/ftrtc010.c

Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-12-05 02:11:59 +01:00
Peter Korsgaard 20dde48bca add lzop decompression support
Add lzop decompression support to the existing lzo bitstream handling
(think gzip versus zlib), and support it for uImage decompression if
CONFIG_LZO is enabled.

Lzop doesn't compress as good as gzip (~10% worse), but decompression
is very fast (~0.7s faster here on a slow ppc). The lzop decompression
code is based on Albin Tonnerre's recent ARM Linux lzo support patch.

Cc: albin.tonnerre@free-electrons.com
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2009-12-05 01:30:23 +01:00
Remy Bohmer b25e38fc36 Repair build fail in case CONFIG_PPC=n and CONFIG_FIT=y
Signed-off-by: Remy Bohmer <linux@bohmer.net>
2009-11-24 22:40:20 +01:00
Prafulla Wadaskar aa0c7a86cd mkimage: Add Kirkwood Boot Image support (kwbimage)
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>
2009-09-10 22:58:48 +02:00
Prafulla Wadaskar b029dddc9a mkimage: Make table_entry code global
- make get_table_entry_id() global
- make get_table_entry_name() global
- move struct table_entry to image.h

Currently this code is used by image.c only.

This patch makes this API global so it can be used by other parts of
code, too.

Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com>
Acked-by: Ron Lee <ron.debian.org>

Edit comments and commit message.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-09-10 22:58:48 +02:00
Prafulla Wadaskar f666dea8ab mkimage: Make genimg_print_size() global
Currently it is used by image.c only, but the the function can be
used to support additional mkimage types like for example kwbimage,
so make this function globally visible.

Signed-off-by: Prafulla Wadaskar <prafulla@marvell.com>

Edited commit message.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-09-10 22:58:48 +02:00
Wolfgang Denk 3a2003f61e tools/mkimage: fix compiler warnings, use "const"
This fixes some compiler warnings:
tools/default_image.c:141: warning: initialization from incompatible pointer type
tools/fit_image.c:202: warning: initialization from incompatible pointer type
and changes to code to use "const" attributes in a few places where
it's appropriate.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-09-10 22:58:48 +02:00
Mike Frysinger 3756609076 compiler.h: unify system ifdef cruft here
Shove a lot of the HOSTCC and related #ifdef checking crap into the new
compiler.h header so that we can keep all other headers nice and clean.

Also introduce custom uswap functions so we don't have to rely on the non
standard implementations that a host may (or may not in the case of OS X)
provide.  This allows mkimage to finally build cleanly on an OS X system.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-19 21:41:46 +02:00
Peter Tyser 2f8d396b93 Add support for building native win32 tools
Add support for compiling the host tools in the tools directory using
the MinGW toolchain.  This produces executables which can be used on
standard Windows computers without requiring cygwin.

One must specify the MinGW compiler and strip utilities as if they
were the host toolchain in order to build win32 executables, eg:

make HOSTCC=i586-mingw32msvc-gcc HOSTSTRIP=i586-mingw32msvc-strip tools

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2009-04-04 01:21:02 +02:00
Petri Lehtinen f05fa9205e include/image.h: Ease grepping of image_* functions
Because the functions have been defined using macros, grepping for
their definitions is not possible. This patch adds the real function
names in comments.

Signed-off-by: Petri Lehtinen <petri.lehtinen@inoi.fi>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2009-02-18 00:48:42 +01:00
Jean-Christophe PLAGNIOL-VILLARD cd6734510a Fix FIT and FDT support to have CONFIG_OF_LIBFDT and CONFIG_FIT independent
FDT support is used for both FIT style images and for architectures
that can pass a fdt blob to an OS (ppc, m68k, sparc).

For other architectures and boards which do not pass a fdt blob to an
OS but want to use the new uImage format, we just need FIT support.

Now we can have the 4 following configurations :

1) FIT only             CONFIG_FIT
2) fdt blob only        CONFIG_OF_LIBFDT
3) both                 CONFIG_OF_LIBFDT & CONFIG_FIT
4) none                 none

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-12-13 23:31:49 +01:00
Kumar Gala 49c3a861d1 bootm: Add subcommands
Add the ability to break the steps of the bootm command into several
subcommands: start, loados, ramdisk, fdt, bdt, cmdline, prep, go.

This allows us to do things like manipulate device trees before
they are passed to a booting kernel or setup memory for a secondary
core in multicore situations.

Not all OS types support all subcommands (currently only start, loados,
ramdisk, fdt, and go are supported).

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2008-10-29 00:59:50 +01:00
Wolfgang Denk def0819e92 FDT: don't use private kernel header files
On some systems (for example Fedora Core 4) U-Boot builds with the
following wanrings only:

...
In file included from /home/wd/git/u-boot/include/libfdt_env.h:33,
                 from fdt.c:51:
		 /usr/include/asm/byteorder.h:6:2: warning: #warning using private kernel header; include <endian.h> instead!

This patch fixes this problem.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-10-21 21:35:44 +02:00
Luigi 'Comio' Mantellini fc9c1727b5 Add support for LZMA uncompression algorithm.
Signed-off-by: Luigi 'Comio' Mantellini <luigi.mantellini@idf-hit.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-09-13 01:59:07 +02:00
Bartlomiej Sieka 919f550dc1 FIT: add ability to check hashes of all images in FIT, improve output
- add function fit_all_image_check_hashes() that verifies if all
  hashes of all images in the FIT are valid
- improve output of fit_image_check_hashes() when the hash check fails

Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
2008-09-09 15:58:11 +02:00
Peter Tyser f5ed9e3908 Add support for booting of INTEGRITY operating system uImages
Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2008-09-09 15:54:10 +02:00
Kumar Gala 396f635b8f bootm: refactor image detection and os load steps
Created a bootm_start() that handles the parsing and detection of all
the images that will be used by the bootm command (OS, ramdisk, fdt).
As part of this we now tract all the relevant image offsets in the
bootm_headers_t struct. This will allow us to have all the needed
state for future sub-commands and lets us reduce a bit of arch
specific code on SPARC.

Created a bootm_load_os() that deals with decompression and loading
the OS image.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2008-08-26 23:41:43 +02:00