Commit Graph

158 Commits

Author SHA1 Message Date
Kumar Gala c4f9419c6b bootm: refactor ramdisk locating code
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>
2008-08-26 23:35:24 +02:00
Kumar Gala c160a95447 bootm: refactor entry point code
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>
2008-08-26 23:31:33 +02:00
Kumar Gala fcd69a1a57 Clean up usage of icache_disable/dcache_disable
There is no point in disabling the icache on 7xx/74xx/86xx parts and not
also flushing the icache.  All callers of invalidate_l1_instruction_cache()
call icache_disable() right after.  Make it so icache_disable() calls
invalidate_l1_instruction_cache() for us.

Also, dcache_disable() already calls dcache_flush() so there is no point
in the explicit calls of dcache_flush().

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2008-08-19 00:57:28 +02:00
Kumar Gala 3216ca9692 Fix fallout from autostart revert
The autostart revert caused a bit of duplicated code as well as
code that was using images->autostart that needs to get removed so
we can build again.

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2008-08-12 00:06:34 +02:00
Wolfgang Denk 0bf202ec58 Revert "[new uImage] Add autostart flag to bootm_headers structure"
This reverts commit f5614e7926.

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>
2008-08-10 01:26:26 +02:00
Guennadi Liakhovetski 2e752be39d Uncompressed images loaded to their start address shall set load_end too
Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
Acked-by: Bartlomiej Sieka <tur@semihalf.com>
2008-07-31 17:41:00 +02:00
Stefan Roese ebb86c4ecd cmd_bootm.c: Fix problem with '#if (CONFIG_CMD_USB)'
A recent patch used '#if (CONFIG_CMD_USB)' instead of
'#if defined(CONFIG_CMD_USB)'. This patch fixes this problem and makes
common/bootm.c compile again.

Signed-off-by: Stefan Roese <sr@denx.de>
Acked-by: Markus Klotzbuecher <mk@denx.de>
2008-07-31 10:44:26 +02:00
Jean-Christophe PLAGNIOL-VILLARD 936897d4d1 Fix remaining CFG_CMD_ define, ifdef and comments
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-07-30 00:48:07 +02:00
Wolfgang Denk 699f051255 Prepare v1.3.4-rc1: Code cleanup, update CHANGELOG, sort Makefile
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-07-15 22:22:44 +02:00
Markus Klotzbücher 3d71c81a9b USB: shutdown USB before booting
This patch fixes a potentially serious issue related to USB which was
discouvered by Martin Krause <martin.krause@tqs.de> and fixed for
ARM920T. Martin wrote:

  Turn off USB to prevent the host controller from writing to the
  SDRAM while Linux is booting. This could happen, because the HCCA
  (Host Controller Communication Area) lies within the SDRAM and the
  host controller writes continously to this area (as busmaster!), for
  example to increase the HccaFrameNumber variable, which happens
  every 1 ms.

This is a slightly modified version of the patch in order to shutdown
USB when booting on all architectures.

Signed-off-by: Markus Klotzbuecher <mk@denx.de>
2008-07-10 21:47:44 +02:00
Wolfgang Denk 06c53beae1 Fix some more print() format errors.
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-07-10 13:16:09 +02:00
Becky Bruce 391fd93ab2 Change lmb to use phys_size_t/phys_addr_t
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>
2008-06-12 00:56:39 +02:00
Marian Balakowicz 273c37d843 Fix build errors when CONFIG_LOGBUFFER and CONFIG_FIT are enabled
Recent modifcations to LOGBUFFER handling code were incorrecly
introduced to fit_check_kernel() routine during
"Merge branch 'new-image' of git://www.denx.de/git/u-boot-testing",
commit 27f33e9f45.

This patch cleans up this merge issue.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-05-10 00:11:25 +02:00
Bartlomiej Sieka edbed247a1 Memory footprint optimizations
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>
2008-04-24 17:21:55 +02:00
Wolfgang Denk 1e01477aea Fix build breakage casued by commit c0559be371
Change env_get_char from a global function ptr to a function.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-04-18 11:44:27 -07:00
Marian Balakowicz cb1c489690 Restore the ability to continue booting after legacy image overwrite
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>
2008-04-17 23:59:05 -07:00
Bartlomiej Sieka 27f33e9f45 Merge branch 'new-image' of git://www.denx.de/git/u-boot-testing
Conflicts:

	common/cmd_bootm.c
	cpu/mpc8xx/cpu.c

Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
2008-03-26 09:38:06 +01:00
Jerry Van Baren 43ddd9c820 Remove deprecated CONFIG_OF_HAS_UBOOT_ENV and CONFIG_OF_HAS_BD_T
These defines embedded the u-boot env variables and/or the bd_t structure
in the fdt blob.  The conclusion of discussion on the u-boot email list
was that embedding these in the fdt blob is not useful: there are better
ways of passing the data (in fact, the fdt blob itself replaces the
bd_t struct).

The only board that enables these is the stxxtc and they don't appear
to be used by linux.

Signed-off-by: Gerald Van Baren <vanbaren@cideas.com>
Acked-by: Kim Phillips <kim.phillips@freescale.com>
2008-03-26 00:22:39 +01:00
Bartlomiej Sieka dafaede8a4 [new uImage] Disable debuging output in preparation for merge with master
Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
2008-03-20 23:20:31 +01:00
Yuri Tikhonov 3d61018643 The patch introduces the alternative configuration of the log buffer for the lwmon5 board: the storage for the log-buffer itself is OCM(on-chip memory), the log-buffer header is moved to six GPT registers (PPC440EPX_GPT0_COMP1, ..., PPC440EPX_GPT0_COMP5).
To enable this, alternative, configuration the U-Boot board configuration
file for lwmon5 includes the definitions of alternative addresses for header
(CONFIG_ALT_LH_ADDR) and buffer (CONFIG_ALT_LB_ADDR).

 The Linux shall be configured with the CONFIG_ALT_LB_LOCATION option set,
and has the BOARD_ALT_LH_ADDR and BOARD_ALT_LB_ADDR constants defined in the
lwmon5 board-specific header (arch/ppc/platforms/4xx/lwmon5.h).

Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
2008-03-18 22:24:48 +01:00
Marian Balakowicz f773bea8e1 [new uImage] Add proper ramdisk/FDT handling when FIT configuration is used
Save FIT configuration provied in the first bootm argument and use it
when to get ramdisk/FDT subimages when second and third (ramdisk/FDT)
arguments are not specified.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-03-12 10:35:46 +01:00
Marian Balakowicz 2682ce8a42 [new uImage] More verbose kernel image uncompress error message
Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-03-12 10:33:01 +01:00
Marian Balakowicz 1372cce2b9 [new uImage] Use show_boot_progress() for new uImage format
This patch allocates a set of show_boot_progress() IDs for new uImage format
and adds show_boot_progress() calls in new uImage format handling code.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-03-12 10:33:01 +01:00
Marian Balakowicz 3dfe110149 [new uImage] Add node offsets for FIT images listed in struct bootm_headers
This patch adds new node offset fields to struct bootm_headers
and updates bootm_headers processing code to make use of them.
Saved node offsets allow to avoid repeating fit_image_get_node() calls.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-03-12 10:32:59 +01:00
Marian Balakowicz a44a269a90 [new uImage] Re-enable interrupts for non automatic booting
Re-enable interrupts if we return from do_bootm_<os> and 'autostart'
environment variable is not set to 'yes'.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-03-12 10:14:57 +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 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
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
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 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
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 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 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 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
Marian Balakowicz 321359f208 [new uImage] Move gunzip() common code to common/gunzip.c
Move gunzip(), zalloc() and zfree() to a separate file.
Share zalloc() and zfree() with cramfs uncompress routine.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-02-07 01:12:55 +01:00
Marian Balakowicz d45d5a18b6 [new uImage] Cleanup OF/FDT #if/#elif/#endif use in do_bootm_linux()
Make CONFIG_OF_LIBFDT and CONFIG_OF_FLAT_TREE use more
readable in PPC variant of do_bootm_linux() routine.

Signed-off-by: Marian Balakowicz <m8@semihalf.com>
2008-02-07 01:12:55 +01:00
Marian Balakowicz 5d3cc55ecb [new uImage] Move PPC do_bootm_linux() to lib_ppc/ppc_linux.c
PPC implementation of do_bootm_linux() routine is moved to
a dedicated file lib_ppc/ppc_linux.c

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