9
0
Fork 0
Commit Graph

115 Commits

Author SHA1 Message Date
Sascha Hauer fd5cd6084a ARM: remove ARCH_HAS_LOWLEVEL_INIT
This is unused now and not needed. We have a board_init_lowlevel. If a
board needs some architecture setup it can always call it from its
board_init_lowlevel.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-25 09:40:55 +02:00
Sascha Hauer 77322aa896 Treewide: remove address of the Free Software Foundation
The FSF address has changed in the past. Instead of updating it
each time the address changes, just drop it completely treewide.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-17 10:57:41 +02:00
Sascha Hauer 2e368eec07 ARM lowlevel: Use get_runtime_offset
The current approach to get the offset between link and runtime address
is fragile. It requires a big fat comment to put no code above it and it
requires an extra linker section. Instead use a small assembler function.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-09 18:25:49 +02:00
Sascha Hauer cc27564e4c ARM: Add assembler function to get runtime offset
This function returns the offset between the address barebox is linked at
and the address barebox is currently running at.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-09 18:25:20 +02:00
Sascha Hauer bed1a6ffab Merge branch 'for-next/pbl' 2012-09-05 12:59:29 +02:00
Sascha Hauer d5b6012ac1 create a common ARM flush_icache function
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-08-13 20:27:43 +02:00
Jean-Christophe PLAGNIOL-VILLARD bbe683b1e4 arm introduce CONFIG_MACH_ARM_HEAD option to allow custom head
This is needed by at91 to specify the size of the binary to load from the
bootrom when booting for non nor flash.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-08-03 15:50:01 +02:00
Sascha Hauer b0927fc95c ARM: let armlinux_set_* depend on the correct option
We need inline versions of armlinux_set* exactly when
CONFIG_ARM_LINUX is not set, because this is the symbol
used to compile the non inline versions.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-07-25 09:27:27 +02:00
Marc Kleine-Budde f98ebf91d6 ARM mmu: add dma_alloc
dma_alloc() allocates memory aligned to cache lines. We have to use
cache line aligned buffers if a driver calls dma_inv_range on the
buffer.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-06-30 12:46:25 +02:00
Krzysztof Halasa 3ad4b670a9 ARM: put a valid "barebox" signature in the header on big-endian systems.
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-10 14:30:28 +02:00
Krzysztof Halasa 14ec1f6d4b ARM: remove unused struct param_struct and related info.
Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-06 19:19:08 +02:00
Sascha Hauer 104a6a7ccf ARM: Allow to compile in thumb-2 mode
This shrinks the resulting binary size by ~25%. Exceptions
are still handled in arm mode, so we have to explicitely
put .arm directives into the exception code. Thumb-2 mode
has been tested on i.MX51 Babbage board.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-03-06 09:37:59 +01:00
Sascha Hauer cb1bd905dc ARM: get runtime offset of board_init_lowlevel_return by using separate section
We used to get the runtime offset of the board_init_lowlevel_return
by doing a &board_init_lowlevel_return. This does not work in thumb-2
mode, so use a separate linker section for this function instead.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-28 09:55:04 +01:00
Sascha Hauer 2c2d00a281 ARM: move exception vectors away from start of binary
Traditionally U-Boot and barebox have the exception vectors at
the start of the binary. There is no real reason in doing so,
because in the majority of cases this data will not be at 0x0
where it could be used as vectors directly anyway.
This patch puts the vectors into a separate linker section and
defines an head function which is placed at the start of the
image instead. Putting this in a separate function also has
the advantage that it can be placed at the start of images
which require an additional header like several Freescale i.MX
images. As the head function contains the barebox arm magic
those images can now also be detected as barebox images.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-02-28 09:55:02 +01:00
Sascha Hauer 79c2f03aee Add dump_stack function
At least ARM allows us to dump the stack, but we currently
have no prototype for this. Add a dump_stack prototype and
provide a static inline function for architectures without
stack dump support. Also, call dump_stack() in panic() to
provide more information in the case of a panic.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-26 14:12:08 +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
Robert Jarzmik 0a9083d929 arch/arm: mmu: add map_io_range()
Add a function to remap an IO range into a virtual addresses
range. This is particulary usefull for the few devices
mapped at physical address 0, as the MTD boot devices.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-21 11:15:31 +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 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 b4e4684958 ARM mmu: find second level descriptors by walking the page table
By doing this we can remove the ptes field in struct arm_memory
which won't be present in a generic memory bank structure anymore.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-23 16:32:48 +02:00
Sascha Hauer 0d53f3c584 arm: use asm-generic/io.h
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-09-22 19:27:29 +02:00
Sascha Hauer 5e25c6f975 ARM: add missing volatile in get_cr()
Without it, the compiler optimizes away subsequent reads of the
control register.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-08-07 18:53:06 +02:00
Sascha Hauer 46a16b72a0 Merge branch 'pu-mmu' into next 2011-08-04 09:03:34 +02:00
Sascha Hauer 628434ae50 Merge branch 'pu-remove-gd_t' into next 2011-08-03 09:20:29 +02:00
Sascha Hauer a6c333c7f2 ARM boards: remove now unnecessary mmu calls
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-08-03 09:11:16 +02:00
Sascha Hauer 3100ea1466 ARM: rework MMU support
In barebox we used 1MiB sections to map our SDRAM cachable. This
has the drawback that we have to map our sdram twice: cached for
normal sdram and uncached for DMA operations. As address space gets
sparse on newer systems we are sometines unable to find a suitably
big enough area for the dma coherent space.

This patch changes the MMU code to use second level page tables.
With it we can implement dma_alloc_coherent as normal malloc, we
just have to remap the allocated area uncached afterwards and map
it cached again after free().

This makes arm_create_section(), setup_dma_coherent() and mmu_enable()
noops.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-08-03 09:11:10 +02:00
Sascha Hauer 8ba794abd4 ARM: pass size to dma_free_coherent
We'll need it later once we remap dma memory.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-08-01 21:49:34 +08:00
Sascha Hauer d77ef33347 ARM l2x0: make init function static inline if l2 is not available
So that the ifdeffery can be moved out of the board code.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-08-01 21:49:33 +08: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
Jean-Christophe PLAGNIOL-VILLARD 95067e23ac arm: introduce arm_add_mem_device to register dram device
this will automaticaly register the device to armlinux_add_dram

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
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
Sascha Hauer e7ccf3c979 ARM dma_alloc_coherent: Fix alignment for !MMU case
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-07-28 12:07:39 +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 cf76694df6 ARM: Add missing parameter name in armlinux_set_serial
Also, make it a static inline function if compiled without
arm linux support.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-04-04 16:26:44 +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 92c1c6cfb1 add sections.h header file
The file location and variable names from the Linux Kernel have been
used here.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-17 11:04:24 +01:00
Jean-Christophe PLAGNIOL-VILLARD be4146161b import swab.h arch implementation form linux v2.3.37
this will avoid __bswapsi2 issue see with 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 643ffef5f4 Thumb-2: Add macros for the unified assembler syntax
from linux kernel v2.6.37

This patch adds various C and assembler macros that help with using
the unified assembler syntax for compiling files to either ARM or
Thumb-2 modes.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-01-17 08:27:26 +01:00
Krzysztof Halasa c5baa0edc4 Fix error handling with malloc, memalign etc. Introduce xmemalign().
The idea is to panic() when there is no memory available for normal
operation. Exception: code which can consume arbitrary amount of RAM
(example: files allocated in ramfs) must report error instead of panic().

This patch also fixes code which didn't check for NULL from malloc() etc.

Usage: malloc(), memalign() return NULL when out of RAM.
xmalloc(), xmemalign() always return non-NULL or panic().

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
Alexey Zaytsev adcebd48f6 Add basic support from ARM Versatile/PB
tested with qemu only

qemu-system-arm -M versatilepb -monitor null -kernel barebox -net nic -net user -tftp "<uImage-path>/" -serial stdio

add -nographic if you do not want the lcd via sdl

Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>

update:
 - use default env
 - move arm_timer.h as in the kernel
 - add nor flash support
 - udpate defconfig
 - fix copyright copy from linux
 - fix ARCH_TEXT_BASE

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-12-12 09:26:50 +01:00
Jean-Christophe PLAGNIOL-VILLARD 6186a85515 arm: move clkdev to drivers/clk
as refer in this patch "arm & sh: factorised duplicated clkdev.c"

factorise some generic infrastructure to assist looking up struct clks
for the ARM & SH architecture.

as the code is identical at 99% in linux

move it also as preparing for the SH adding

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-09-20 08:56:42 +02:00
Jean-Christophe PLAGNIOL-VILLARD 55819d58d4 types.h: move __kernel_dev_t to include/linux/types.h
no need to have a arch specific type

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-09-17 10:56:24 +08:00
Jean-Christophe PLAGNIOL-VILLARD 67bb65ad2f arm: move mach-types.h to include/generated/
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-09-17 10:56:24 +08:00
Jean-Christophe PLAGNIOL-VILLARD 37d6cbca5f move include/unaligned to include/linux/unaligned/
as originally in linux

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-30 14:36:08 +02:00
Michael Grzeschik 7911dbcaf6 armlinux: bugfix add parameter name into inline function
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-18 08:43:40 +02:00
Jean-Christophe PLAGNIOL-VILLARD dfcdce8eec arm: add common clkdev
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: Andrea GALLO <andrea.gallo@stericsson.com>
Cc: Gael SALLES <gael.salles@stericsson.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-08-06 19:09:38 +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
Jean-Christophe PLAGNIOL-VILLARD d8c86961b3 move boards to arch/<architecure>/boards
this will allow each arch to handle the boards more simply and depending on
there need

the env var BOARD will refer to the current board dirent

for sandbox as we have only one board the board dirent is arch/sandbox/board

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-07-23 08:35:25 +02:00
Sascha Hauer 3aa5c839eb ARM: add missing call to arch_init_lowlevel
This got lost during the switch to implement the lowlevel
stuff in C.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-06-23 08:37:34 +02:00
Marc Reilly 0df45f5599 arm: Add revision tag to boot parameters
Revision info required for some boards at boot time.
Only adds if the system_rev has been set to non-zero.

Signed-off-by: Marc Reilly <marc@cpdesign.com.au>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-05-17 10:52:46 +02:00
Sascha Hauer 78104ae181 arm: reimplement startup code in C
Lets translate the startup code to a language we all understand better.
Tested on pcm038 (arm v5) and pcm043 (arm v6).

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-05-03 15:05:38 +02:00
Sascha Hauer 64a6eb6a38 arm: remove unused variables from header file
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-05-03 15:05:38 +02:00
Sascha Hauer 6b8e614bac add arm helper function to determine the program counter
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-05-03 15:05:38 +02:00
Sascha Hauer 1381445eac ARM: Add get_cr/set_cr functions
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-05-03 15:02:03 +02:00
Sascha Hauer be00ed538c add l2x0 cache support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-03-30 14:15:04 +02:00
Sascha Hauer bcaabae0f6 ARM: Add a wrapper around dma_* functions
This is a preparation to add second level cache support.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-03-30 14:15:04 +02:00
Sascha Hauer 6f5a6b591a pass arguments to dma_* as unsigned long as the kernel does
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-03-30 14:15:03 +02:00
Sascha Hauer cf2703a6fb ARM: replace cleanup_before_linux with the generic shutdown_barebox function
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-03-30 14:15:03 +02:00
Sascha Hauer 3348c81992 add unaligned access support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-03-30 14:14:58 +02:00
Marc Kleine-Budde aadc4c2990 io.h: update definitions of __raw_{read,write}*
This patch updates the definitions of the __raw_read and __raw_write
functions so that "sparse" doesn't complain.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2010-02-16 21:49:33 +01:00
Sascha Hauer a3ffa97f40 rename U-Boot-v2 project to barebox
This has been done with the following script:

find -path ./.git -prune -o -type f -print0 | xargs -0 -r sed -i \
	-e 's/u2boot/barebox/g' \
	-e 's/U2Boot/barebox/g' \
	-e 's/U-boot V2/barebox/g' \
	-e 's/u-boot v2/barebox/g' \
	-e 's/U-Boot V2/barebox/g' \
	-e 's/U-Boot-v2/barebox/g' \
	-e 's/U_BOOT/BAREBOX/g' \
	-e 's/UBOOT/BAREBOX/g' \
	-e 's/uboot/barebox/g' \
	-e 's/u-boot/barebox/g' \
	-e 's/u_boot/barebox/g' \
	-e 's/U-Boot/barebox/g' \
	-e 's/U-boot/barebox/g' \
	-e 's/U-BOOT/barebox/g'

find -path ./.git -prune -o \( -name "*u-boot*" -o -name "*uboot*" -o -name "*u_boot*" \) -print0 | \
	xargs -0 -r rename 's/u[-_]?boot/barebox/'

It needs some manual fixup following in the next patch

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2009-12-15 10:18:30 +01:00
Jean-Christophe PLAGNIOL-VILLARD 71306852fd arm: generate mach-types.h instead of static version
mach-types against v2.6.32-rc5

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-11-03 13:01:46 +01:00
Jean-Christophe PLAGNIOL-VILLARD f6a579da9c [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-10-22 14:21:25 +02:00
Jean-Christophe PLAGNIOL-VILLARD 9956bdf77d arm: merge proc-armv/ptrace.h and ptrace.h in one file
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-10-22 12:12:48 +02:00
Jean-Christophe PLAGNIOL-VILLARD 67254a403f [ARM] move include/asm-arm to arch/arm/include/asm
Move platform independent header files to arch/arm/include/asm, leaving
those in asm/arch* and asm/proc* alone.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2009-10-22 12:12:47 +02:00