9
0
Fork 0
Commit Graph

115 Commits

Author SHA1 Message Date
Michel Stam 4d94f56c6c common: Allow for I/O mapped I/O
Rework the current framework so that I/O mapped I/O resources are
also possible.

Signed-off-by: Michel Stam <michel@reverze.net>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-04-08 08:17:55 +02:00
Antony Pavlov 74f0803993 import _AC and UL macros from linux kernel
This macros are used in exported from linux TI DaVinci code.
Also this macros are used in MIPS cache support code.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-03-18 17:28:11 +01:00
Sascha Hauer 0644d1da7f ARM: Make ENTRY_FUNCTION more robust
An entry function should begin with a exception header. For this to work
properly the entry function should not contain any code which gcc might
put before the header. To make this sure change the ENTRY_FUNCTION macro
so that it generates one function which only contains the exception header
and a second function which contains the original body of the entry function.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-12-10 14:35:33 +01:00
Sascha Hauer d5929e6ffe ARM: remove asm/hardware.h
asm/hardware.h does not have any content except including mach/hardware.h.
include mach/hardware.h directly where needed and get rid of asm/hardware.h

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-11-08 15:44:13 +01:00
Sascha Hauer e0be72d3cd ARM: invalidate caches thoroughly
The data caches should be invalided once during startup. This should
also be done when we do not have the MMU enabled in barebox because
the Kernel does not invalidate the caches during start.

To make this sure this patch enables the arm_early_mmu_cache_invalidate
function even if MMU support is disabled. Additionally this patch adds
calls to arm_early_mmu_cache_invalidate in start.c and uncompress.c.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-09-21 10:00:00 +02:00
Sascha Hauer 8f9d4007c5 Merge branch 'for-next/arm-gpio' 2013-09-05 10:38:53 +02:00
Sascha Hauer 8c1180c3ed ARM: remove include of mach/gpio.h for gpiolib users
gpiolib user have nothing to define in their machine
specific gpio.h, so do not include it.

The only thing they could define would be ARCH_NR_GPIOS,
but currently no architecture defines it. Should an architecure
feel the need to do it this would be a good opportunity to
get rid of this limitation.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-16 15:58:33 +02:00
Sascha Hauer 20e9bc17d4 ARM: Create an assembly arm_cpu_lowlevel_init function
To avoid the code duplication between the static inline C
function and the assembly macro.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-08-07 08:48:36 +02:00
Sascha Hauer 2078438662 Add multi images support
This adds the make infrastructure to build multiple SoC or
board specific images from a single barebox binary.

The basic idea is that we no longer have a single pbl, but instead
multiple pbls, one per image if necessary. Each pbl is defined
by its entry function so that each pbl can do exactly what a given
board needs. Additionally the pbls together with a self extracting
barebox binary can be encapsulated in specific image formats.

squashed in build fixes from Lucas Stach for make version >= 3.82:

Split Multimage Makefile rule in explicit and implicit parts

Fixes build with make version >=3.82

Frome the make 3.82 NEWS file:
* WARNING: Backward-incompatibility!
  In previous versions of make it was acceptable to list one or more explicit
  targets followed by one or more pattern targets in the same rule and it
  worked "as expected".  However, this was not documented as acceptable and if
  you listed any explicit targets AFTER the pattern targets, the entire rule
  would be mis-parsed.  This release removes this ability completely: make
  will generate an error message if you mix explicit and pattern targets in
  the same rule.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Lucas Stach <dev@lynxeye.de>
2013-07-01 10:13:12 +02:00
Sascha Hauer dc7d63b3cc ARM: split barebox_arm_head in two separate functions
This adds a new function __barebox_arm_head() which defines an
the regular barebox ARM header, but which jumps to the end of
the function so that this can be embedded into another function.
barebox_arm_head() now just uses it and jumps to barebox_arm_reset_vector
just like it did before.

This makes it possible to define board specific entry points.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-26 18:21:03 +02:00
Sascha Hauer 76571ed68d ARM: Allow to pass a devicetree via boarddata
Addionally to having a builtin DTB provide the possibility for
the board to provide a dtb via boarddata.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-06-26 18:20:53 +02:00
Sascha Hauer 2827883911 ARM: invalidate data caches during early init
Some SoCs come up with invalid entries in the data cache. This can
lead to memory corruption when we enable them later, so invalidate
the caches early.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Lucas Stach <l.stach@pengutronix.de>
2013-05-23 09:29:52 +02:00
Lucas Stach 431d8a247d arm: properly init alignment trap bit
On ARMv7 the intention is to disable the alignment trap to be able to
use hardware assisted unaligned load/stores. Fix the init to do the
right thing.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-05-23 09:29:36 +02:00
Sascha Hauer dd9f6d08a2 Merge branch 'for-next/relocate'
Conflicts:
	arch/arm/lib/barebox.lds.S
2013-04-04 14:20:42 +02:00
Sascha Hauer 45b87922a6 Merge branch 'for-next/misc-arm' 2013-04-04 14:20:32 +02:00
Sascha Hauer 8f2c6a3d2b Merge branch 'for-next/misc' 2013-04-04 14:20:32 +02:00
Sascha Hauer da718ca89d Merge branch 'for-next/imx-external-nand-boot' 2013-04-04 12:03:20 +02:00
Sascha Hauer eb84709192 clk: remove unused __clk_[get|put]
This is some unused code resulting from copying stuff from the
kernel. Remove it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-04-03 17:22:11 +02:00
Alexander Shiyan a093309d57 ARM: Add CPU detection macros for ARM720
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-15 08:27:31 +01:00
Sascha Hauer d8910405cb ARM: head: Add some space behind the image header
This adds 32bytes of space behind the image header (exception table
+ barebox magic) for board/SoC specific use. This can be used for
example to embed some extra information in a flashed image.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-12 11:04:33 +01:00
Sascha Hauer 4271263e0d ARM: Add missing barebox_arm_boarddata function
The comment above barebox_arm_entry promises to preserve the boarddata
variable passed to it which can then later get back with
barebox_arm_boarddata(). This function was missing so far, add it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-10 11:11:30 +01:00
Sascha Hauer a81ec0225f ARM: Add relocatable binary support
For making the same binary executable on different SoCs which have
different DRAM addresses we have to be independent of the compile
time link address.

This patch adds relocatable binary support for the ARM architecture.
With this two new functions are available. relocate_to_current_adr
will fixup the binary to continue executing from the current position.
relocate_to_adr will copy the binary to a given address, fixup the
binary and continue executing from there.

For the PBL and the real image relocatable support can be enabled
independently. This is done to (hopefully) better cope with setups
where the PBL runs from SRAM or ROM and the real binary does not.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-07 12:38:01 +01:00
Sascha Hauer b08e08506b ARN: fixup vector addresses for relocatable binaries
With relocatable binaries the vector addresses cannot be supplied by
the linker. This adds support for fixing them up during runtime.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-07 12:38:01 +01:00
Sascha Hauer 74d44e7b2a ARM: provide accessor functions for linker variables
With relocatable binaries the linker is not able to supply absolute
addresses. These only get available when the relocation function is
being run. Since for early initialization we need some variables
before relocation, we supply them relatively to some known address
in the binary. This means that the variables have to be converted
to absolute addresses during runtime.

This patch adds a C macro and an assembly macro to calculate the
variables during runtime.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-07 10:56:37 +01:00
Sascha Hauer ae59bd9fca ARM: add early mmu cache flush function and use it in setup_c
Since recently with MMU_EARLY support it may happen that setup_c
runs with data caches enabled, so we have to make sure the caches
are flushed before we jump to the new binary.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-04 12:02:10 +01:00
Sascha Hauer 82eb0b547a ARM: make cpu architecture detection available as static inline function
When we have multi cpu support compiled in we need the cpu architecture
early so that we can pick the correct cacheflush function. Make it available
as static inline function and add a comment above it that this function
normally should not be used.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-04 12:02:10 +01:00
Sascha Hauer 13b4e37c1c Merge branch 'for-next/vexpress' 2013-03-04 09:21:54 +01:00
Jean-Christophe PLAGNIOL-VILLARD 2738f72352 arm: add vexpress board support
detect the cpu model to dynamise the periphs mapping

currently only tested on qemu but should work on real hardware

Cortex-A9

if you use 1GiB of ram you can run the same barebox on Cortex-A15 or Cortex-A9
otherwise use vexpress_ca9_defconfig where the TEXT_BASE is at 0x63f00000

when we will add the relocation support this defconfig will be drop

qemu/arm-softmmu/qemu-system-arm -M vexpress-a9 -m 1024 -smp 1 -kernel build/vexpress/barebox -pflash build/vexpress/flash0 -nographic

Cortex-A15

qemu/arm-softmmu/qemu-system-arm -M vexpress-a15 -m 1024 -smp 1 -kernel build/vexpress/barebox -pflash build/vexpress/flash0 -nographic

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-12 08:49:27 +01:00
Jean-Christophe PLAGNIOL-VILLARD 489f947086 arm: cache-l2x0 update sync define with Linux 3.5
Drop copy in cache-l2x0

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-11 21:08:24 +01:00
Jean-Christophe PLAGNIOL-VILLARD 19905efac5 arm: add macro cpu_is_xxx
so we can detect

ARM920
ARM926
ARM1176

PXA250
PXA255
PXA270

Cortex-A8
Cortex-A5
Cortex-A7
Cortex-A9
Cortex-A15

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-11 21:01:24 +01:00
Jean-Christophe PLAGNIOL-VILLARD c49819d903 arm: rename reset and common_reset to barebox_arm_reset_vector and arm_cpu_lowlevel_init
reset is confusing with the cpu reset and impossible to grep

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-08 09:35:40 +01:00
Sascha Hauer 8e19ee94ab ARM: Setup stack at end of SDRAM
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-04 15:52:41 +01:00
Sascha Hauer 86db57509c ARM start: pickup parameters from pbl
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-04 15:52:41 +01:00
Sascha Hauer 5cd60cb217 ARM: add __noreturn to board_init_lowlevel_return
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-04 15:52:38 +01:00
Sascha Hauer 5b03b8148f ARM: Add new entry point for barebox
Memory is a precious resource, so it makes sense to make it available as
early as possible. By definition the lowlevel init code already knows where
to find memory because it's the lowlevel init code which sets up the memory.
Until all boards are converted this new entry is just a fallback to the old
entry point.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-04 15:52:38 +01:00
Sascha Hauer cfb14ce242 Merge branch 'for-next/omap' 2013-02-04 15:49:07 +01:00
Vicente Bergas 53f1d60627 feature_list: a way to pass hardware info to the kernel
Hi Sascha,
I've made the changes you suggested in this resent patch.

Everything related to custom ATAGs has been moved to the board
directory.

The generic code does not make any references to feature lists or
bootloader versions.

About the setup_feature_list prototype:
 it has been renamed to atag_appender
 it's not a function, it's a pointer to a function. Can it have a
prototype other than it's own declaration?

All non-related changes has been dropped. They were checkpatch.pl
warnings unrelated to this patch.

Regards,
  Vicente.

Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-21 09:09:11 +01:00
Alexander Aring 47326f80a9 remap_range: make function 'remap_range' global
Change function remap_range in arm architecture to make it
global accessable. For example command 'memtest' can change
pte flags to enable or disable cache.

Add dummy function for others architectures that doesn't
have mmu or pte support.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-18 08:28:20 +01:00
Sascha Hauer ab4e9edf86 ARM startup: Ensure CR_A flag is cleared on architectures >= ARMv6
We allow unaligned accesses on ARMv6 onwards, make sure the CR_A
flag is cleared so that unaligned accesses do not trap.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-08 17:50:03 +01:00
Sascha Hauer 7787010e9b Merge branch 'for-next/arm-start' into for-next/arm 2012-10-17 08:48:14 +02:00
Vicente Bergas 525bb0c377 ARM: add rename PSR bits to match linux names
Signed-off-by: Vicente Bergas <vicencb@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-15 09:18:34 +02:00
Sascha Hauer 8b609af14c ARM: introduce arm_setup_stack function and use it
We have enough places which setup0 a stack to justify
a static inline function for it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-13 14:17:31 +02:00
Sascha Hauer 1dbfd5ed82 ARM: Support multiple ARM architectures
The different ARM architectures need different cache functions. This
patch makes them selectable during runtime.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-13 11:19:13 +02:00
Sascha Hauer 01525288b0 ARM: Add cpu_architecture() function
Once we run on multiple SoCs we must know which arm architecture we
are on. Add cpu_architecture() from the kernel to detect it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-10 09:10:28 +02:00
Sascha Hauer 1fcc223e9f ARM: add assembly function for setting up C environment
Sometimes Assembler beats C. In this case a small assembler
function called without parameters can:

- copy a binary to its link address
- clear the bss
- return to the same position in the copied binary

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-05 18:39:19 +02:00
Sascha Hauer 638e059aba Merge branch 'for-next/arm-board-reset'
Conflicts:
	arch/arm/cpu/start-reset.c
	arch/arm/include/asm/barebox-arm.h
	arch/arm/mach-omap/Kconfig
	arch/arm/mach-omap/omap3_core.S
2012-10-03 21:19:30 +02:00
Sascha Hauer 6021818e3d Merge branch 'for-next/arm-remove-arch-init-ll'
Conflicts:
	arch/arm/include/asm/barebox-arm.h
2012-10-03 21:13:31 +02:00
Sascha Hauer d1e65d2a7b Merge branch 'for-next/remove-fsf-address'
Conflicts:
	drivers/net/miidev.c
	include/miidev.h
2012-10-03 21:12:48 +02:00
Jan Luebbe faf7b7af6e ARM: give boards control of the reset entry point
On some SoCs (for example AM35xx), the ROM bootloader passes useful
information in r0 when jumping to barebox.

To avoid overwriting this in the generic reset code, we introduce
common_reset as a C function and as an assembler macro. This is then
called form the reset entry point (either in common or in board code).

This patch is based on code by Sascha Hauer <s.hauer@pengutronix.de>.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-27 19:30:04 +02:00
Sascha Hauer cc1602604d 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-27 19:30:04 +02:00