9
0
Fork 0
Commit Graph

120 Commits

Author SHA1 Message Date
Sascha Hauer e0d23ec7c8 ARM: update string functions from Linux Kernel
The newer versions contain fixes for Thumb-2 mode.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-02 15:00:28 +01:00
Jean-Christophe PLAGNIOL-VILLARD de8c4de5ef ARM: import memcpy_from/toio and memset_io from linux
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-02 12:08:24 +01:00
Sascha Hauer 56ddc233e4 ARM zImage: fix missing setting of load_address
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-21 11:33:39 +01:00
Sascha Hauer d4e5c6b8a0 bootm: use new uimage code
This switches the bootm code to the new uimage code. Also
bootm can now handle other types of images than uImages.
Currently the only architecture making use of this is
arm which allows to boot zImages, raw images and barebox
images.
I intended to make a more bisectable series from this but
I failed becuase there are many dependencies and no matter
how I tried the patches grew bigger and and bigger. So I
decided to put this all in a single patch.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-15 11:07:11 +01:00
Sascha Hauer 296cd8d638 ARM: call start_linux directly with initrd start/size and oftree
whoever calls this function is not necessarily aware of a struct
image_data, so remove the dependency from the function.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-15 10:26:03 +01:00
Sascha Hauer 6cd0c4a358 Merge branch 'pu/resources' into next 2011-12-05 17:54:37 +01:00
Sascha Hauer 3a7dc44d93 add armlinux specific magicvar descriptions
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-05 17:53:32 +01:00
Sascha Hauer 70f7691d41 fix malloc space sizes
end is start + size - 1, not start + size.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-03 10:09:29 +01:00
Sascha Hauer a5f5945c79 arm bootm: remove unnecessary include
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 21:07:10 +01:00
Sascha Hauer 42a691328e armlinux: remove unnecessary include
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 21:07:10 +01:00
Sascha Hauer d4950552f5 bootm: use initrd_address and initrd_size
Make these fields in struct image_data the reference for image handlers

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 21:03:17 +01:00
Sascha Hauer 351058fa51 bootm: push relocate_image up to the generic command
All handlers used to just relocate the image without any checks, so
we are doomed if we write outside of SDRAM or will overwrite ourselves.
Move the relocation up to the generic part where we have a chance
of catching these issues.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 20:59:56 +01:00
Sascha Hauer d1595f140f ARM bootm: remove now obsolete args
Now that the arch_number and system_rev variables can be set from
the environment we don't need the old bootm command line switch
mechanism anymore.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 20:55:50 +01:00
Sascha Hauer 06656eb05e armlinux: cleanup linux vars
arch_number is currently exported to the environment but not read back
on boot time which is rather confusing. system_rev and system_serial
are not exported to the environment but can be set in board specific
code.
This patch exports all these variables to the environment and reads them
back on boot time. All variables get a armlinux_ prefix, so the
arch_number environment variable gets renamed.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 20:55:50 +01:00
Sascha Hauer 020a30be0d add magicvar command
The magicvar command gives an overview about all environment variables
with a special meaning.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 20:51:31 +01:00
Sascha Hauer 6b8503baab Merge branch 'master' into next 2011-10-23 13:38:39 +02:00
Sascha Hauer ed8e58d77c ARM Linux: Add device tree support
If the user has parsed a tree, we start Linux using the
device tree, otherwise we use the traditional ATAG
mechanism.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-10-19 10:09:50 +02:00
Juergen Beisert 2b5d8792ac Really fix the 'bootz' command
Running the 'bootz' command always fails with

could not read <some file>

due to wrong usage of pointers and structures. This is the second try to fix
the 'bootz' command. At least on my target it is now be able again to load a
kernel without any error.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-10-18 09:17:35 +02:00
Juergen Beisert c66af9fe05 'bootz' command fails to load the zImage's header
Running the 'bootz' command always fails with

could not read <some file>

due to it loads only a size of a pointer, instead of the size of the expected
header structure.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-10-14 14:14:45 +02:00
Jean-Christophe PLAGNIOL-VILLARD a0746e71c2 arm/bootm: enable multi uimage support
tested on imx53 loco board with a Multi uImage file

generate like this

mkimage -A arm -O linux -T multi -C none -a 0x70008000 -e 0x70008000 -n Linux-2.6.35.3-00745-gce4c61a-dirty -d zImage:rootfs.cpio.lzma uImage.Multi

and boot via bootm

bootm -r @1 -L 0x72000000 /dev/ram0.kernel

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-10-09 11:35:42 +02:00
Sascha Hauer deef916d9c ARM: switch to generic memory banks
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-23 16:32:49 +02:00
Sascha Hauer 0fc7fb6b4f rename include/mem_malloc.h to include/memory.h
Which is a better name and also better to collect other
things.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-23 16:32:48 +02:00
Jean-Christophe PLAGNIOL-VILLARD 902ba4df03 arm: export arch_number to env
so we can dynamise the boot depending on the machine

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-20 21:12:45 +02:00
Sascha Hauer e064ad3628 ARM linux: support Linux images with CONFIG_AUTO_ZRELADDR
These images have to be located in the first 128MB of SDRAM, so
use the following strategy:

- first try to map the image. If the pointer is within the first
  128MB of sdram everything is fine.
- if we can't map the image, check for SDRAM being smaller than
  128MB we can use malloc for allocating space for the image.
- As a last fallback we simply put the image to 8MB into SDRAM.
  This is not very clean. We try our best by checking that we
  won't overwrite the malloc space.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-08-24 10:34:44 +02:00
Sascha Hauer 628434ae50 Merge branch 'pu-remove-gd_t' into next 2011-08-03 09:20:29 +02:00
Sascha Hauer 5f56079cd5 ARM: move armlinux_add_dram to location which is always compiled
We want to use the memory banks later in the MMU which is
independent of Linux, so move this to a location which is
always compiled.

Also, make the memory bank list global and add an iterator
for it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-08-01 21:49:33 +08:00
Sascha Hauer 147affbd8d remove unused global_data.h
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-08-01 12:00:59 +02:00
Jean-Christophe PLAGNIOL-VILLARD 522af7074a armlinux: mem tag switch to "struct resource"
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-20 08:25:45 +02:00
Sascha Hauer 64476d2177 ARM: compile in image size and magic into barebox image
This is useful to detect a barebox image and to be able
to copy only the image size if barebox is stored on
raw partitions which are bigger than the image.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-05-06 08:53:26 +02:00
Sascha Hauer 973069dcaf ARM: move bootu code to its own file
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-04 16:27:59 +02:00
Sascha Hauer f103a9843e ARM: move bootz code to its own file
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-04 16:27:58 +02:00
Sascha Hauer bb7fff04af ARM: move bootm code to its own file
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-04 16:27:57 +02:00
Sascha Hauer 4ade5f8670 ARM: factor out a start_linux function
This can be shared between the different boot commands.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-04 16:27:25 +02:00
Sascha Hauer 084df155d3 ARM: Add stack unwinding support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-03-10 14:50:07 +01:00
Sascha Hauer 5b2727d5ab Revert "arm: add __bswapsi2 support"
Reverted upon request of Jean-Christophe. Not needed anymore since:

commit be4146161b
Author: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Date:   Sun Jan 16 12:12:32 2011 +0100

    import swab.h arch implementation form linux v2.3.37

    this will avoid __bswapsi2 issue see with gcc 4.5.1

This reverts commit f68dc40804.
2011-01-19 09:44:00 +01:00
Sascha Hauer 377d6ea1b6 ARM: remove unnecessary include
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-17 11:05:14 +01:00
Sascha Hauer 5a707d6ad8 ARM: provide __bss_stop in linker script
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-17 11:03:07 +01:00
Jean-Christophe PLAGNIOL-VILLARD f68dc40804 arm: add __bswapsi2 support
32-bit endian conversion

needed by gcc 4.5.1

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-17 09:39:16 +01:00
Jean-Christophe PLAGNIOL-VILLARD d62f8241d3 arm: libgcc update to linux v2.6.37
This patch removes the inclusion of libgcc functions into Barebox on the ARM
architecture. Only the really needed functions are provided in the lib_arm
directory. Those implementations are copied from Linux where they are well
proven related to reliably, performance.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-17 08:28:08 +01:00
Krzysztof Halasa ffcdb2796a ARM: support big/little endian switching in "bootX".
Currently implemented only in "bootz".

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-07 10:21:22 +01:00
Eric Bénard 249e653583 armlinux: pass INIRTD tag to the kernel
Signed-off-by: Eric Bénard <eric@eukrea.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-11-02 08:37:40 +01:00
Sascha Hauer 51d4b74789 remove strange flush_cache functions
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-21 22:21:25 +02:00
Sascha Hauer 4b753a306c arm div0: sparse fixes
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-21 22:21:25 +02:00
Sascha Hauer 076056d6fc armlinux: sparse fixes
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-21 22:21:23 +02:00
Sascha Hauer a64c756ad9 image: remove confusing image_check_* functions
The function names do not make it clear what return value
is expected and do not save a single line of code. Put
the code inline and unbreak the wrong checks introduced
with a3c1e5d888.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Eric Bénard <eric@eukrea.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-10-13 17:39:49 +02:00
Jean-Christophe PLAGNIOL-VILLARD a3c1e5d888 Replace direct header access with the API routines
Copied from U-Boot

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-10-08 00:04:28 +08:00
Sascha Hauer f7403928a9 Revert "Replace direct header access with the API routines"
This reverts commit 0ceafe14be.

Conflicts:

	include/image.h

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-07 14:11:38 +02:00
Jean-Christophe PLAGNIOL-VILLARD 0ceafe14be Replace direct header access with the API routines
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-09-24 08:46:22 +02:00
Jean-Christophe PLAGNIOL-VILLARD 0eb8686dc2 arm: allow to overwrite the system_rev via bootm
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Tested-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-09-22 10:32:12 +02:00
Baruch Siach e74f2160e7 arm: add support for the serial ATAG
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-04 09:28:15 +02:00