[U-Boot-Users] PATCH for cmd_mem.c:do_mem_mtest()

Jerry Van Baren gerald.vanbaren at smiths-aerospace.com
Tue Sep 13 20:43:35 CEST 2005


Wolfgang Denk wrote:
> In message <c166aa9f05091309552efac7d at mail.gmail.com> you wrote:
> 
>>Not on MIPS (unless someone was daft enough to map it
>>with the TLB).  The code causes a TLB store miss exception.
>>Since this is in 'common' code, I think it's a bug.
> 
> 
> OK.
> 
> But all you need to do is #define CFG_MEMTEST_SCRATCH in  your  board
> config file, right?
> 
> 
>>With a static define of the scratch address I can't test one of the
>>memories correctly becuase the scratch address is pointing to the
>>other memory, so the scratch writes don't serve their purpose.
> 
> 
> OK, but this is a special case, isn't it? 
> 
> Would it be acceptable for you if we just move the initialization
> 
> 	dummy = (vu_long*)CFG_MEMTEST_SCRATCH;
> 
> below the computation of "end", so that you can use
> 
> 	#define CFG_MEMTEST_SCRATCH (--end)
> 
> in your board config file?
> 
> Best regards,
> 
> Wolfgang Denk

I'm not sure you want that, exactly.  You are affecting the variable 
"end" as a side effect in a macro which is generally a bad idea.  A no 
side effect version would be:
#define CFG_MEMTEST_SCRATCH (end - 1)

You are also making assumptions on the type of end (the variable, that 
is).  I'm assuming this is a 32 bit wide memory test, sorry for not 
verifying that.  You may want to coerce "end" to make sure the "- 1" 
subtracts the proper number of bytes:
#define CFG_MEMTEST_SCRATCH ((void *)end - 1)

gvb




More information about the U-Boot mailing list