summaryrefslogtreecommitdiffstats
path: root/include/image.h
Commit message (Collapse)AuthorAgeFilesLines
* image: Implement IH_TYPE_KERNEL_NOLOADStephen Warren2011-12-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix clash between IH_ARCH_NDS32 and IH_ARCH_SANDBOXStefan Kristiansson2011-11-231-1/+1
| | | | | | | | 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>
* image: Fix inverted logic in architecture check.Thierry Reding2011-10-271-1/+1
| | | | | | | 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>
* mkimage: adding support for Davinci AIS imageStefano Babic2011-10-231-0/+1
| | | | | | | | | | | 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>
* checkpatch whitespace cleanupsStephen Warren2011-10-221-115/+115
| | | | | | | | | | | | | | | | | | | | | | 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>
* nds32: common bdinfo, bootm, image supportMacpaul Lin2011-10-221-0/+1
| | | | | | Add support of NDS32 to common commands bdinfo, bootm, and image format. Signed-off-by: Macpaul Lin <macpaul@andestech.com>
* sandbox: Add architecture image supportSimon Glass2011-10-171-0/+1
| | | | | | | 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>
* image: push default arch values to arch headersMike Frysinger2011-10-051-55/+4
| | | | | | | | | 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>
* mkimage: Add OMAP boot image supportJohn Rigby2011-08-031-0/+1
| | | | | | | | | | - 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>
* mkimage: add UBL header support for booting davinci cpusHeiko Schocher2011-07-281-0/+1
| | | | | | | | 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>
* Respect memreserve regions specified in the device treeGrant Likely2011-04-251-0/+1
| | | | | | | | 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>
* Default to bootm_size() when CONFIG_SYS_BOOTMAPSZ is not definedGrant Likely2011-04-251-0/+1
| | | | | | | | | | | | | 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>
* Stop passing around bootmem_base value.Grant Likely2011-04-251-5/+3
| | | | | | | | | | 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>
* image: constify lookup tablesMike Frysinger2010-11-281-2/+2
| | | | | | These are pure lookup tables -- no need to be writable. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* boot: change some arch ifdefs to feature ifdefsJohn Rigby2010-10-181-3/+6
| | | | | | | | | | | | | | | | | 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>
* Add support for operating system OSETorkel Lundgren2010-09-281-0/+1
| | | | | | Add OSE as operating system for mkimage and bootm. Signed-off-by: Torkel Lundgren <torkel.lundgren@enea.com>
* Make sure that argv[] argument pointers are not modified.Wolfgang Denk2010-07-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* image.h: remove bogus ';' after function declarationsWolfgang Denk2010-06-291-22/+22
| | | | | | ISO C does not allow extra ';' outside of a function Signed-off-by: Wolfgang Denk <wd@denx.de>
* nios: remove nios-32 archThomas Chou2010-05-281-5/+0
| | | | | | The nios-32 arch is obsolete and broken. So it is removed. Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
* mkimage: Add Freescale imx Boot Image support (imximage)Stefano Babic2010-01-251-0/+1
| | | | | | | | | | | | 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>
* image.h: avoid command.h for host toolsMike Frysinger2010-01-211-2/+1
| | | | | | | | 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>
* lmb: only force on arches that use itMike Frysinger2010-01-211-1/+1
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sha1: add dedicated config optionMike Frysinger2010-01-211-0/+1
| | | | | | | 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>
* Merge branch 'master' into nextWolfgang Denk2009-12-051-2/+0
|\ | | | | | | | | | | | | | | Conflicts: board/esd/plu405/plu405.c drivers/rtc/ftrtc010.c Signed-off-by: Wolfgang Denk <wd@denx.de>
| * Repair build fail in case CONFIG_PPC=n and CONFIG_FIT=yRemy Bohmer2009-11-241-2/+0
| | | | | | | | Signed-off-by: Remy Bohmer <linux@bohmer.net>
* | add lzop decompression supportPeter Korsgaard2009-12-051-0/+1
|/ | | | | | | | | | | | | 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>
* mkimage: Add Kirkwood Boot Image support (kwbimage)Prafulla Wadaskar2009-09-101-0/+1
| | | | | | | | | | | | | | 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>
* mkimage: Make table_entry code globalPrafulla Wadaskar2009-09-101-0/+24
| | | | | | | | | | | | | | | | | | - 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>
* mkimage: Make genimg_print_size() globalPrafulla Wadaskar2009-09-101-0/+1
| | | | | | | | | | | | 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>
* tools/mkimage: fix compiler warnings, use "const"Wolfgang Denk2009-09-101-17/+17
| | | | | | | | | | 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>
* compiler.h: unify system ifdef cruft hereMike Frysinger2009-07-191-8/+5
| | | | | | | | | | | 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>
* Add support for building native win32 toolsPeter Tyser2009-04-041-0/+2
| | | | | | | | | | | | | 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>
* include/image.h: Ease grepping of image_* functionsPetri Lehtinen2009-02-181-22/+22
| | | | | | | | | 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>
* Fix FIT and FDT support to have CONFIG_OF_LIBFDT and CONFIG_FIT independentJean-Christophe PLAGNIOL-VILLARD2008-12-131-4/+0
| | | | | | | | | | | | | | | | | 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>
* bootm: Add subcommandsKumar Gala2008-10-291-1/+19
| | | | | | | | | | | | | | 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>
* FDT: don't use private kernel header filesWolfgang Denk2008-10-211-9/+11
| | | | | | | | | | | | | | 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>
* Add support for LZMA uncompression algorithm.Luigi 'Comio' Mantellini2008-09-131-0/+1
| | | | | Signed-off-by: Luigi 'Comio' Mantellini <luigi.mantellini@idf-hit.com> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* FIT: add ability to check hashes of all images in FIT, improve outputBartlomiej Sieka2008-09-091-0/+1
| | | | | | | | - 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>
* Add support for booting of INTEGRITY operating system uImagesPeter Tyser2008-09-091-0/+1
| | | | Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
* bootm: refactor image detection and os load stepsKumar Gala2008-08-261-0/+9
| | | | | | | | | | | | | | 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>
* bootm: move lmb into the bootm_headers_t structureKumar Gala2008-08-261-1/+3
| | | | | | | | To allow for persistent state between future bootm subcommands we need the lmb to exist in a global state. Moving it into the bootm_headers_t allows us to do that. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* bootm: refactor fdt locating and relocation codeKumar Gala2008-08-261-0/+13
| | | | | | | Move the code that handles finding a device tree blob and relocating it (if needed) into common code so all arch's have access to it. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* bootm: refactor ramdisk locating codeKumar Gala2008-08-261-0/+2
| | | | | | | | Move determing if we have a ramdisk and where its located into the common code. Keep track of the ramdisk start and end in the bootm_headers_t image struct. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* bootm: refactor entry point codeKumar Gala2008-08-261-0/+2
| | | | | | | Move entry point code out of each arch and into common code. Keep the entry point in the bootm_headers_t images struct. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* Revert "[new uImage] Add autostart flag to bootm_headers structure"Wolfgang Denk2008-08-101-1/+0
| | | | | | | | | | | | | | | | | This reverts commit f5614e7926863bf0225ec860d9b319741a9c4004. The commit was based on a misunderstanding of the (documented) meaning of the 'autostart' environment variable. It might cause boards to hang if 'autostart' was used, with the potential to brick them. Go back to the documented behaviour. Conflicts: common/cmd_bootm.c common/image.c include/image.h Signed-off-by: Wolfgang Denk <wd@denx.de>
* Change lmb to use phys_size_t/phys_addr_tBecky Bruce2008-06-121-1/+1
| | | | | | | | | | | This updates the lmb code to use phys_size_t and phys_addr_t instead of unsigned long. Other code which interacts with this code, like getenv_bootm_size() is also updated. Booted on MPC8641HPCN, build-tested ppc, arm, mips. Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
* Use watchdog-aware functions when calculating hashes of images - take twoBartlomiej Sieka2008-04-251-2/+15
| | | | | | | | | Some files didn't get updated properly with the "Use watchdog-aware functions when calculating hashes of images" commit, this commit fixes this. Signed-off-by: Bartlomiej Sieka <tur@semihalf.com> Signed-off-by: Wolfgang Denk <wd@denx.de>
* Memory footprint optimizationsBartlomiej Sieka2008-04-241-6/+3
| | | | | | | | | | As suggested by Wolfgang Denk: - image printing functions: - remove wrappers - remove indentation prefix from functions' signatures - merge getenv_verify and getenv_autostart into one parametrized function Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
* Restore the ability to continue booting after legacy image overwriteMarian Balakowicz2008-04-171-1/+2
| | | | | | | | | | | Before new uImage code was merged, bootm code allowed for the kernel image to get overwritten during decompresion. new uImage introduced a check for image overwrites and refused to boot the image that got overwritten. This patch restores the old behavior. It also adds a warning when the image overwriten is a multi-image file, because in such case accessing componentes other than the first one will fail. Signed-off-by: Marian Balakowicz <m8@semihalf.com>
* SPARC: added SPARC support for new uimage in common code.Daniel Hellstrom2008-04-081-0/+4
| | | | Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
OpenPOWER on IntegriCloud