Yeah, that's true.
You can add some codes into examples/hello_world.c as following that can be
used to test RAM.
It will stop when there is somethting wrong with ram.
printf ("Hello World, test ddr ram\n");
unsigned int s = 0x82000000;
unsigned int e = 0x87000000;
start = (unsigned long *)s;
end = (unsigned long *)e;
unsigned int pattern = 0x12345678;
int incr = 1;
unsigned int val;
unsigned readback;
for (;;) {
printf ("\nPattern %08lX Writing..."
"%12s"
"\b\b\b\b\b\b\b\b\b\b",
pattern, "");
for (addr=start,val=pattern; addr<end; addr++) {
*addr = val;
val += incr;
}
puts ("Reading...");
for (addr=start,val=pattern; addr<end; addr++) {
readback = *addr;
if (readback != val) {
while(1)
printf ("\nMem error @ 0x%08X: "
"found %08lX, expected %08lX\n",
(uint)addr, readback, val);
}
val += incr;
}
/*
* Flip the pattern each time to make lots of zeros and
* then, the next time, lots of ones. We decrement
* the "negative" patterns and increment the "positive"
* patterns to preserve this feature.
*/
if(pattern & 0x80000000) {
pattern = -pattern; /* complement & increment */
}
else {
pattern = ~pattern;
}
//incr = -incr;
}
----- Original Message -----
From: Lori Gao
To: [email protected]
Sent: Monday, March 09, 2009 5:09 PM
Subject: The mtest command in u-boot
Dear all:
When i was testing the RAM using the mtest command like this "mtest 80700000
80700100 ff", i found the system began to loop and could't stop, until i press
ctrl + c.
Could anyone give me some advice?
Lori Gao
R&D center(Shanghai)
Rayco (Shanghai) Medical Products Company Limited
Carestream Health Inc.
------------------------------------------------------------------------------
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source