[U-Boot] [PATCH 6/7] nand_spl_simple: store temp data at CONFIG_SPL_NAND_WORKSPACE
Ilya Yanok
yanok at emcraft.com
Tue Oct 18 01:33:52 CEST 2011
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 dd1de27..e40cbf0 100644
--- a/drivers/mtd/nand/nand_spl_simple.c
+++ b/drivers/mtd/nand/nand_spl_simple.c
@@ -158,8 +158,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
+ ecc_calc = (u_char *)CONFIG_SPL_NAND_WORKSPACE;
ecc_code = ecc_calc + 0x100;
oob_data = ecc_calc + 0x200;
--
1.7.6.4
More information about the U-Boot
mailing list