[U-Boot] [PATCH 11/13] nand_spl_simple: store temp data at CONFIG_SPL_NAND_WORKSPACE

Stefano Babic sbabic at denx.de
Wed Dec 7 10:06:22 CET 2011


On 28/11/2011 17:37, Ilya Yanok wrote:
> Currently nand_spl_simple puts it's temp data at 0x10000 offset in SDRAM
> which is likely to contain already loaded data. I can't see any way to
> determine some safe address automagically so make it up to board porter
> to provide the safe-to-use address via CONFIG_SPL_NAND_WORKSPACE value.
> 
> Signed-off-by: Ilya Yanok <yanok at emcraft.com>
> ---
>  drivers/mtd/nand/nand_spl_simple.c |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/mtd/nand/nand_spl_simple.c b/drivers/mtd/nand/nand_spl_simple.c
> index ed821f2..70f3cfe 100644

Hi Ilya,

> --- a/drivers/mtd/nand/nand_spl_simple.c
> +++ b/drivers/mtd/nand/nand_spl_simple.c
> @@ -199,8 +199,13 @@ static int nand_read_page(int block, int page, void *dst)
>  
>  	/* No malloc available for now, just use some temporary locations
>  	 * in SDRAM
> +	 * Please provide some safe value for CONFIG_SPL_NAND_WORKSPACE in
> +	 * your board configuration, this is just a guess!!
>  	 */
> -	ecc_calc = (u_char *)(CONFIG_SYS_SDRAM_BASE + 0x10000);
> +#ifndef CONFIG_SPL_NAND_WORKSPACE
> +#define CONFIG_SPL_NAND_WORKSPACE	(CONFIG_SYS_SDRAM_BASE + 0x10000)
> +#endif

Maybe it is better to not have a default value somewhere in the SDRAM
and to get a compile error. If we do not want to fix also the related
boards, we could at least use a #warn message to advise at compile time
that a default value is taken (and at the end, to force the board
maintainers to fix it...).

Best regards,
Stefano Babic

-- 
=====================================================================
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================


More information about the U-Boot mailing list