9
0
Fork 0
Commit Graph

36 Commits

Author SHA1 Message Date
Antony Pavlov 8e89bc594a treewide: remove address of the Free Software Foundation
The FSF address has changed; The FSF site says that
address is

  Free Software Foundation
  51 Franklin Street, Fifth Floor
  Boston, MA 02110-1301
  USA

(see http://www.fsf.org/about/contact/)

Instead of updating it each time the address changes,
just drop it completely treewide.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-06-11 08:35:25 +02:00
Lucas Stach 4f381b1aaa ARM: change signature of barebox_arm_entry
Mostly to make it clear that boarddata needs to be
something we can dereference.

As this is a pretty invasive change, use the opportunity
to make the signature 64bit safe.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-05-05 15:09:09 +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
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 7f2f5dce49 ARM pbl: inline decompress function
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-04 15:52:41 +01:00
Sascha Hauer b7bcba8b65 ARM: Enable mmu early
This optionally enabled the MMU in the PBL or during early startup for
the non PBL case. The regular MMU init code will pickup the already enabled
MMU later. This might complicate debugging early code, so this has been
made optional.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-04 15:52:41 +01:00
Sascha Hauer 93ef44fc4e ARM: Factor out early mmu code
Move early mmu code to a separate file so that it can be
used from the pbl and the regular image. Disabling the mmu
can be dropped since the regular mmu code is now able to
pickup an enabled mmu.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-04 15:52:41 +01:00
Sascha Hauer d2a7bed927 ARM pbl: Use dynamic parameters for early malloc space
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-04 15:52:41 +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 fbf7653ea7 ARM start-pbl: call uncompressed binary with arguments
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-04 15:52:41 +01:00
Sascha Hauer c030487301 ARM start-pbl: make board_init_lowlevel_return static
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-04 15:52:40 +01:00
Sascha Hauer 91493b1b5d ARM: remove now unused MACH_[HAS|DO]_LOWLEVEL_INIT
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2013-02-04 15:52:40 +01:00
Sascha Hauer 028ae2ba6e ARM i.MX: Add i.MX specific entry point for barebox
Additionally to the generic entry point the i.MX specific ones
calculate the SDRAM size automatically so the boards do not have
to care.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-02-04 15:52:38 +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
Jean-Christophe PLAGNIOL-VILLARD f73a37aa78 pbl: factorise decompressor
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-30 22:32:13 +01:00
Antony Pavlov 227f19b747 ARM: start-pbl.c: unifify path to lib/decompress_*.c
It's three levels up, not four.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-20 08:22:57 +01:00
Antony Pavlov 1cfcd044f7 ARM: start-pbl.c: make errorfn() static
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-19 11:31:02 +01:00
Sascha Hauer 7787010e9b Merge branch 'for-next/arm-start' into for-next/arm 2012-10-17 08:48:14 +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 91bafe9290 ARM: cleanup piggydata copy check
Replace to gotos with a single if().

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-05 18:39: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 6bb06524d6 ARM pbl: actually create cached mappings in the decompressor
We called create_sections with 4096MB as size argument, but create_sections
expected the argument in bytes, so create sections was completely optimized
away due to the size >>= 20. This patch changes the size argument to be in
megabytes and adjusts map_cachable to pass the argument in megabytes.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-04 18:30:58 +02:00
Sascha Hauer a86824b5ac ARM pbl: Provide a dummy error function for the decompressor
We can't do anything useful in the error function, so we just hang.
This has the advantage that at least when a JTAG debugger is connected
we can see what happens. Otherwise the code just jumps to NULL in case
of an error.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-04 18:30:58 +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 4a543aa677 Merge branch 'for-next/arm' 2012-10-03 21:10:11 +02:00
Sascha Hauer c05511d6cd ARM: Disable MMU feature in PBL
remap_cache currently does not work, so enabling the MMU in the
PBL currently does not make sense. Disable it for now.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-03 16:10:04 +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 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 f680f893b4 ARM lowlevel: Update function documentation
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-09 11:42:18 +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
Sascha Hauer bdb4093d3d ARM pbl: enable MMU during decompression
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-08-13 20:27:39 +02:00
Jean-Christophe PLAGNIOL-VILLARD 104c39fe82 compressed image: add gzip support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-08-03 18:09:15 +08:00
Jean-Christophe PLAGNIOL-VILLARD 8d29296240 ARM: add early malloc support needed by the decompressor
This is not needed by lzo but by gunzip, xz and others.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-08-03 18:09:15 +08:00
Jean-Christophe PLAGNIOL-VILLARD 5c3db111da Add compressed image support
This allows for creating a lzo compressed binary unsing the pbl.

Only copy the piggydata if needed.

Add CONFIG_PBL_FORCE_PIGGYDATA_COPY option
In some case we need to copy the PIGGYDATA as the link address
as example we run from SRAM and shutdown the SDRAM/DDR for
reconfiguration but most of the time we just need to copy the
executable code.

based on Sascha Hauer
Add compressed image support

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-08-03 18:09:15 +08:00
Jean-Christophe PLAGNIOL-VILLARD 78867e2bbd Add pre-bootloader (pbl) image support
This allows for creating a pre-bootloader binary for
 - nand boot
 - mmc boot
 - compressed image

The pbl will be incharge of the lowlevel init if needed.
The barebox will skip it.

Import string functions from linux 3.4 (arch/arm/boot/compressed/string.c) and
implement a dummy panic.

For now on introduce dummy zbarebox* targets and c code that will contain later
the decompressor. This only implemeted on ARM.

This patch is based on Sascha Hauer <s.hauer@pengutronix.de>
Add compressed image support patch

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-08-03 18:09:13 +08:00