[PATCH 1/4] ppc: fix memory layout to prevent corruption during memtest

Sascha Hauer s.hauer at pengutronix.de
Thu Feb 27 15:09:02 EST 2014


Hi Renaud,

On Thu, Feb 27, 2014 at 01:46:56PM +0000, Renaud Barbier wrote:
> Memory regions on PPC boards are incorrectly defined leading to
> corruption when running memory tests. This patch updates the memory
> layout of PPC boards so that critical memory regions can be correctly
> reserved during the memory test.

I think you are better off disabling CONFIGURABLE_MEMORY_LAYOUT for ppc
and doing the memory layout completely on your own. You will have more
freedom selecting suitable base/sizes for stack and malloc area.

> diff --git a/include/asm-generic/memory_layout.h b/include/asm-generic/memory_layout.h
> index 45e0ed8..7a23db1 100644
> --- a/include/asm-generic/memory_layout.h
> +++ b/include/asm-generic/memory_layout.h
> @@ -2,9 +2,13 @@
>  #define __ASM_GENERIC_MEMORY_LAYOUT_H
>  
>  #ifdef CONFIG_MEMORY_LAYOUT_DEFAULT
> +#ifdef CONFIG_PPC
> +#define STACK_BASE ((unsigned long)&_stext - CONFIG_STACK_SIZE)
> +#else

Plus I don't really want to broaden the use of STACK_BASE, even less
when you have to special case it for PPC.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list