Commit Graph

772 Commits

Author SHA1 Message Date
Marian Balakowicz
d985c8498c [new uImage] Remove unnecessary arguments passed to ramdisk routines
boot_get_ramdisk() and image_get_ramdisk() do not need all
cmdtp, flag, argc and argv arguments. Simplify routines definition.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-03-12 10:14:38 +01:00
Marian Balakowicz
c87796483b [new uImage] Add new uImage format support for ramdisk handling
This patch updates boot_get_ramdisk() routine adding format
verification and handling for new (FIT) uImages.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-03-12 10:12:37 +01:00
Marian Balakowicz
6986a38567 [new uImage] Add new uImage format support for kernel booting
New format uImages are recognized by the bootm command,
validity of specified kernel component image is checked and
its data section located and used for further processing
(uncompress, load, etc.)

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-03-12 10:01:05 +01:00
Marian Balakowicz
e32fea6adb [new uImage] Add new uImage format support for imls and iminfo commands
imls and iminfo can now recognize nad print out contents of the new (FIT)
format uImages.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-03-11 12:35:20 +01:00
Marian Balakowicz
5dfb521386 [new uImage] New uImage low-level API
Add FDT-based functions for handling new format component images,
configurations, node operations, property get/set, etc.

fit_        - routines handling global new format uImage operations
              like get/set top level property, process all nodes, etc.
fit_image_  - routines handling component images subnodes
fit_conf_   - routines handling configurations node

Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-03-10 17:51:07 +01:00
Marian Balakowicz
df6f1b895c [new uImage] Fix component handling for legacy multi component images
Use uint32_t when accessing size table in image_multi_count() and
image_multi_getimg() for multi component images.

Add missing uimage_to_cpu() endianness conversion.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-02-29 16:00:06 +01:00
Marian Balakowicz
570abb0ad1 [new uImage] Share common uImage code between mkimage and U-boot
This patch adds the following common routines:

1) Dedicated mkimage print_header() is replaced with common
image_print_contents()
image_print_contents_noindent()

2) Common os/arch/type/comp fields name <--> id translation routines
genimg_get_os_name()
genimg_get_arch_name()
genimg_get_type_name()
genimg_get_comp_name()
genimg_get_os_id()
genimg_get_arch_id()
genimg_get_type_id()
genimg_get_comp_id()

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-02-29 15:59:59 +01:00
Marian Balakowicz
9a4daad0a3 [new uImage] Update naming convention for bootm/uImage related code
This patch introduces the following prefix convention for the
image format handling and bootm related code:

genimg_		- dual format shared code
image_		- legacy uImage format specific code
fit_		- new uImage format specific code
boot_		- booting process related code

Related routines are renamed and a few pieces of code are moved around and
re-grouped.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-02-29 14:58:34 +01:00
Marian Balakowicz
e18489e8c2 Merge branch 'master' of git://www.denx.de/git/u-boot into new-image 2008-02-29 13:56:44 +01:00
Kumar Gala
d3f2fa0d27 [new uImage] Provide ability to restrict region used for boot images
Allow the user to set 'bootm_low' and 'bootm_size' env vars as a way
to restrict what memory range is used for bootm.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Marian Balakowicz <m8@semihalf.com>
2008-02-29 13:15:56 +01:00
Kumar Gala
e822d7fc4d [new uImage] Use lmb for bootm allocations
Convert generic ramdisk_high(), get_boot_cmdline(), get_boot_kbd()
functions over to using lmb for allocation of the ramdisk, command line
and kernel bd info.

Convert PPC specific fdt_relocate() to use lmb for allocation of the device
tree.

Provided a weak function that board code can call to do additional
lmb reserves if needed.

Also introduce the concept of bootmap_base to specify the offset in
physical memory that the bootmap is located at.  This is used for
allocations of the cmdline, kernel bd, and device tree as they should
be contained within bootmap_base and bootmap_base + CFG_BOOTMAPSZ.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2008-02-29 13:15:56 +01:00
Kumar Gala
f5614e7926 [new uImage] Add autostart flag to bootm_headers structure
The autostart env variable was dropped as part of the initial new uImage
cleanup.  Add it back here so the arch specific code can decide if it
wants to really boot or not.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Marian Balakowicz <m8@semihalf.com>
2008-02-29 13:15:56 +01:00
Kumar Gala
4ed6552f71 [new uImage] Introduce lmb from linux kernel for memory mgmt of boot images
Introduce the LMB lib used on PPC in the kernel as a clean way to manage
the memory spaces used by various boot images and structures.  This code
will allow us to simplify the code in bootm and its support functions.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2008-02-29 13:15:55 +01:00
Kumar Gala
274cea2bdd [new uImage] rework error handling so common functions don't reset
Changed image_get_ramdisk() to just return NULL on error and have
get_ramdisk() propogate that error to the caller.  It's left to the
caller to call do_reset() if it wants to.

Also moved calling do_reset() in get_fdt() and fdt_relocate() on ppc
to a common location.  In the future we will change get_fdt() and
fdt_relocate() to return success/failure and not call do_reset() at all.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Marian Balakowicz <m8@semihalf.com>
2008-02-29 12:32:50 +01:00
Kumar Gala
a6612bdfe7 [new uImage] Don't pass kdb to ramdisk_high since we may not have one
We don't actually need the kdb param as we are just using it to get
bd->bi_memsize which we can get from gd->bd->bi_memsize.  Also, if we
boot via OF we might not actually fill out a kdb.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Marian Balakowicz <m8@semihalf.com>
2008-02-29 12:27:21 +01:00
Marian Balakowicz
4efbe9dbb1 [new uImage] Correct raw FDT blob handlig when CONFIG_FIT is disabled
Dual format image code must properly handle all three FDT passing methods:
- raw FDT blob passed
- FDT blob embedded in the legacy uImage
- FDT blob embedded in the new uImage

This patch enables proper raw FDT handling when no FIT imaeg support
is compiled in. This is a bit tricky as we must dected FIT format even
when FIT uImage handling is not enabled as both FIT uImages and raw FDT
blobs use tha same low level format (libfdt).

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-02-27 11:02:26 +01:00
Marian Balakowicz
1efd43601f [new uImage] Add image_get_kernel() routine
Legacy image specific verification is factored out to a separate helper
routine to keep get_kernel() generic and simple.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
2008-02-27 11:02:07 +01:00
Marian Balakowicz
8a5ea3e616 [new uImage] Move image verify flag to bootm_headers structure
Do not pass image verification flag directly to related routines.
Simplify argument passing and move it to the bootm_header structure which
contains curently processed image specific data and is already being passed
on the argument list.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
2008-02-27 11:01:04 +01:00
Marian Balakowicz
6f0f9dfc4e [new uImage] Optimize gen_get_image() flow control
When CONFIG_HAS_DATAFLASH is not defined gen_get_image() routine has nothing
to do, update its control flow to better reflect that simple case.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
2008-02-27 11:00:47 +01:00
Marian Balakowicz
d5934ad775 [new uImage] Add dual format uImage support framework
This patch adds framework for dual format images. Format detection is added
and the bootm controll flow is updated to include cases for new FIT format
uImages.

When the legacy (image_header based) format is detected appropriate
legacy specific handling is invoked. For the new (FIT based) format uImages
dual boot framework has a minial support, that will only print out a
corresponding debug messages. Implementation of the FIT specific handling will
be added in following patches.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-02-25 15:53:49 +01:00
Jean-Christophe PLAGNIOL-VILLARD
00b48a4842 ENV: remove saveenv when CFG_ENV_IS_NOWHERE is selected
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-02-23 20:37:59 +01:00
Marian Balakowicz
5583cbf736 [new uImage] Fix erroneous use of image_get_magic() in fdc/usb cmds
Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-02-21 17:27:49 +01:00
Marian Balakowicz
2242f53698 [new uImage] Rename and move print_image_hdr() routine
Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-02-21 17:27:41 +01:00
Marian Balakowicz
f50433d670 [new uImage] Add fit_parse_conf() and fit_parse_subimage() routines
Introducing routines for parsing new uImage format bootm arguments:
[<addr>]#<conf>		- configuration specification
[<addr>]:<subimg>	- subimage specification

New format images can contain multiple subimages of the same type. For example
a single new format image file can contain three kernels, two ramdisks and a
couple of FDT blobs. Subimage and configuration specifications are extensions
to bootm (and other image-related commands) arguments' syntax that allow to
specify which particular subimage should be operated on.

Subimage specification is used to denote a particular subimage. Configurations
are a bit more complex -- they are used to define a particualr booting setup,
for example a (kernel, fdt blob) pair, or a (kernel, ramdisk, fdt blob) tuple,
etc.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-02-21 17:20:20 +01:00
Marian Balakowicz
fff888a199 [new uImage] Add gen_get_image() routine
This routine assures that image (whether legacy or FIT) is not
in a special dataflash storage.

If image address is a dataflash address image is moved to system RAM.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-02-21 17:20:19 +01:00
Marian Balakowicz
20c9395933 Merge branch 'master' of /home/git/u-boot 2008-02-21 17:18:01 +01:00
Peter Pearse
ae92069abe Merge branch '080116_at91cap9' of git://linux-arm.org/u-boot-armdev 2008-02-15 12:59:15 +00:00
Guennadi Liakhovetski
6f4abee789 Fix wrong memory limit calculation in memory-test
If the length of the memory address range passed to the "mtest" command is
not of the form 2^x - 1, not all address lines are tested. This bug is
inherited from the original software at
http://www.netrino.com/Embedded-Systems/How-To/Memory-Test-Suite-C. Fix
this.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
2008-02-15 00:51:02 +01:00
Wolfgang Denk
9e04a81388 Merge branch 'master' of git://www.denx.de/git/u-boot-mpc86xx
Conflicts:

	common/cmd_reginfo.c

Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-02-15 00:26:52 +01:00
Wolfgang Denk
6f99eec3dc Merge branch 'master' of git://www.denx.de/git/u-boot-blackfin
Conflicts:

	Makefile
	doc/README.standalone

Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-02-15 00:06:18 +01:00
Guennadi Liakhovetski
1f780aa6f1 Fix return value of mtest when CFG_ALT_MEMTEST set
Fix a missing return statement from a non-void function.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
2008-02-14 23:37:13 +01:00
Shinya Kuribayashi
26c7bab81e common/miiphyutil.c: Cleanup MII_DEBUG and debug()
Current MII_DEBUG is confusing in two ways. One is useless define-then-
undef at the top of the file. The other is there is only one debug() in
this file, and that doesn't seem worthwhile to bother having MII_DEBUG.
While there are many useful printf()/puts() debug codes, but they are for
DEBUG, not for MII_DEBUG.

This patch tries to put them all together into MII_DEBUG and debug().

Signed-off-by: Shinya Kuribayashi <skuribay@ruby.dti.ne.jp>
2008-02-14 22:10:38 +01:00
Jon Loeliger
746c4b9490 Merge commit 'wd/master' 2008-02-14 14:07:21 -06:00
Stelian Pop
9604b6e53d AT91CAP9 support
---------------------------------

read_dataflash() takes a signed char pointer as a parameter. Silence a
few warnings dues to incorrect parameter types in env_dataflash.c.

Signed-off-by: Stelian Pop <stelian@popies.net>
2008-02-14 09:37:58 +00:00
Kumar Gala
d9ad115bbf Fix building of fdt_support.c if DEBUG set
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2008-02-13 23:58:18 +01:00
Jon Loeliger
d075eec500 Merge commit 'wd/master' 2008-02-13 16:03:20 -06:00
Kumar Gala
69018ce2e0 QE: Move FDT support into a common file
Move the flat device tree setup for QE related devices into
a common file shared between 83xx & 85xx platforms that have QE's.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2008-02-12 00:36:21 +01:00
Marian Balakowicz
5cf746c303 [new uImage] Move kernel data find code to get_kernel() routine
Verification of the kernel image (in old format) and finding kernel
data is moved to a dedicated routine. The routine will also hold
support for, to be added, new image format.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-02-07 01:13:00 +01:00
Marian Balakowicz
b6b0fe6460 [new uImage] Cleanup do_botm_linux() boot allocations
This patch moves common pre-boot allocation steps shared between PPC
and M68K to a helper routines:

common:
- get_boot_sp_limit()
- get_boot_cmline()
- get_boot_kbd()

platform:
- set_clocks_in_mhz()

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-02-07 01:13:00 +01:00
Marian Balakowicz
ceaed2b1e5 [new uImage] Move ramdisk loading to a common routine
Ramdisk loading code, including initrd_high variable handling,
was duplicated for PPC and M68K platforms. This patch creates
common helper routine that is being called from both platform
do_bootm_linux() routines.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-02-07 01:13:00 +01:00
Marian Balakowicz
5ad03eb385 [new uImage] Factor out common image_get_ramdisk() routine
Architecture specific do_bootm_linux() routines share common
ramdisk image processing code. Move this code to a common
helper routine.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-02-07 01:12:59 +01:00
Marian Balakowicz
42b73e8ee0 [new uImage] Factor out common routines for getting os/arch/type/comp names
Move numeric-id to name translation for image os/arch/type/comp header
fields to a helper routines: image_get_os_name(), image_get_arch_name(),
image_get_type_name(), image_get_comp_name().

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-02-07 01:12:58 +01:00
Marian Balakowicz
e99c26694a [new uImage] Remove standalone applications handling from boootm
Standalone applications are supposed to be run using the "go" command.
This patch removes standalone images handling from the do_bootm().

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-02-07 01:12:58 +01:00
Marian Balakowicz
4a2ad5ff64 [new uImage] Remove OF_FLAT_TREE support from PPC bootm code
Support for OF_FLAT_TREE is to be obsoleted in the near future,
remove related code from the bootm routines.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-02-07 01:12:57 +01:00
Marian Balakowicz
7582438c28 [new uImage] Return error on image move/uncompress overwrites
Check for overwrites during image move/uncompress, return with error
when the original image gets corrupted. Report clear message to the user
and prevent further troubles when pointer to the corrupted images is passed
to do_bootm_linux routine.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-02-07 01:12:57 +01:00
Marian Balakowicz
f13e7b2e99 [new uImage] Cleanup image header pointer use in bootm code
- use single image header pointer instead of a set of auxilliary variables.
- add multi component image helper routines: get component size/data address

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-02-07 01:12:57 +01:00
Marian Balakowicz
1ee1180b6e [new uImage] Cleanup cmd_bootm.c
- sort and cleanup headers, declarations, etc.
- group related routines
- cleanup indentation, white spaces

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-02-07 01:12:56 +01:00
Marian Balakowicz
af13cdbc01 [new uImage] Add memmove_wd() common routine
Move common, watchdog sensible memmove code to a helper memmmove_wd() routine.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-02-07 01:12:56 +01:00
Marian Balakowicz
261dcf4624 [new uImage] Remove I386 uImage fake_header() routine
I386 targets are not using a uImage format, instead fake header
is added to ram image before it is further processed by bootm.

Remove this fixup and force proper uImage use for I386.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-02-07 01:12:55 +01:00
Marian Balakowicz
559316faf7 [new uImage] Move CHUNKSZ definition to image.h
CHUNKSZ defined for PPC and M68K is set to the same value of 64K,
move this definition to a common header.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-02-07 01:12:55 +01:00