diff options
author | Renaud Barbier <renaud.barbier@ge.com> | 2014-02-28 12:58:52 +0000 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2014-03-03 09:07:20 +0100 |
commit | 35c49577dea944f6f8c0546860dd67714e247ffd (patch) | |
tree | 4a65742a0b53dee03d3a61ff1745985484425f8e /arch/ppc/mach-mpc85xx | |
parent | a7dd756dfc79bf9ffcd614b739e8b347b6252bbc (diff) | |
download | barebox-35c49577dea944f6f8c0546860dd67714e247ffd.tar.gz barebox-35c49577dea944f6f8c0546860dd67714e247ffd.tar.xz |
MPC85xx: fix memory layout to prevent corruption during memtest
Memory regions on MPC85xx boards are incorrectly defined leading to
corruption when running memory tests. This patch updates the memory
layout of MPC85xx boards so that critical memory regions can be
correctly reserved during the memory test.
Tested on the P2020RDB and DA923RC.
Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/ppc/mach-mpc85xx')
-rw-r--r-- | arch/ppc/mach-mpc85xx/barebox.lds.S | 8 | ||||
-rw-r--r-- | arch/ppc/mach-mpc85xx/cpu.c | 11 |
2 files changed, 16 insertions, 3 deletions
diff --git a/arch/ppc/mach-mpc85xx/barebox.lds.S b/arch/ppc/mach-mpc85xx/barebox.lds.S index 980359e3a1..87ab7acfe2 100644 --- a/arch/ppc/mach-mpc85xx/barebox.lds.S +++ b/arch/ppc/mach-mpc85xx/barebox.lds.S @@ -32,6 +32,8 @@ PHDRS SECTIONS { . = TEXT_BASE; + _stext = .; + PROVIDE (stext = .); .interp : { *(.interp) } .hash : { *(.hash) } @@ -96,8 +98,6 @@ SECTIONS *(.dynamic*) CONSTRUCTORS } - _edata = .; - PROVIDE (edata = .); . = .; __barebox_cmd_start = .; @@ -118,6 +118,9 @@ SECTIONS __ex_table : { *(__ex_table) } __stop___ex_table = .; + _edata = .; + PROVIDE (edata = .); + . = ALIGN(256); __init_begin = .; .text.init : { *(.text.init) } @@ -130,7 +133,6 @@ SECTIONS .bootpg RESET_VECTOR_ADDRESS - 0xffc : { _text = .; - _stext = .; arch/ppc/cpu-85xx/start.o (.bootpg) } :text = 0xffff diff --git a/arch/ppc/mach-mpc85xx/cpu.c b/arch/ppc/mach-mpc85xx/cpu.c index 17a1c4cb37..4f4f06b044 100644 --- a/arch/ppc/mach-mpc85xx/cpu.c +++ b/arch/ppc/mach-mpc85xx/cpu.c @@ -24,7 +24,10 @@ #include <config.h> #include <common.h> +#include <memory.h> +#include <init.h> #include <asm/fsl_ddr_sdram.h> +#include <asm-generic/memory_layout.h> #include <mach/mmu.h> #include <mach/immap_85xx.h> @@ -81,3 +84,11 @@ phys_size_t fsl_get_effective_memsize(void) return sdram_size; } + +static int fsl_reserve_region(void) +{ + request_sdram_region("stack", _text_base - STACK_SIZE, + STACK_SIZE); + return 0; +} +coredevice_initcall(fsl_reserve_region); |