[U-Boot] [PATCH V2] nand_spl_simple: store ecc data on the stack

Tom Rini
2011-12-13T15:58:02Z

On Tue, Dec 13, 2011 at 4:30 AM, Stefano Babic <sbabic@denx.de> wrote:
> Currently nand_spl_simple puts it's temp data at 0x10000 offset in SDRAM
> which is likely to contain already loaded data.
> The patch saves the oob data and the ecc on the stack replacing
> the fixed address in RAM.

OK, I think we need some convenience defines in nand_spl_simple.c:

> + ? ? ? u_char ecc_calc[CONFIG_SYS_NAND_ECCSTEPS * CONFIG_SYS_NAND_ECCBYTES];

This is long and used in a lot of places. Furthermore...

> ?#define CONFIG_SYS_NAND_ECCSTEPS ? ? ? (CONFIG_SYS_NAND_PAGE_SIZE / \
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?CONFIG_SYS_NAND_ECCSIZE)

Is what everyone does. So if we replace ECCSTEPS with
(PAGE_SIZE/ECCSIZE) it gets eve longer. We should probably #define
SYS_NAND_ECCSTEPS, SYS_NAND_ECCTOTAL up top and go with it.

--
Tom