
Am 14/04/2012 17:28, schrieb Fabio Estevam:
On Sat, Apr 14, 2012 at 12:24 PM, Fabio Estevam festevam@gmail.com wrote:
Something like the patch below? (Build tested only - no hardware handy right now)
Sorry, I meant the patch below:
--- a/common/cmd_mem.c +++ b/common/cmd_mem.c @@ -40,6 +40,8 @@ #define PRINTF(fmt,args...) #endif
+DECLARE_GLOBAL_DATA_PTR;
static int mod_mem(cmd_tbl_t *, int, int, int, char * const []);
/* Display values from last command. @@ -656,8 +658,10 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, cha
if (argc > 1) start = (ulong *)simple_strtoul(argv[1], NULL, 16);
else
else { start = (ulong *)CONFIG_SYS_MEMTEST_START;
end = (ulong *)(gd->relocaddr -1 );
Something like this, but not exactly this. After sending my answer I remembered that the stack is *before* u-boot code, and not after as I wrote - using gd->relocaddr is wrong. We should subtract the memory reserve for stack and heap from this value.
Stefano