|
@@ -631,7 +631,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
|
vu_long *addr, *start, *end;
|
|
vu_long *addr, *start, *end;
|
|
ulong val;
|
|
ulong val;
|
|
ulong readback;
|
|
ulong readback;
|
|
- int rcode = 0;
|
|
|
|
|
|
+ ulong errs = 0;
|
|
int iterations = 1;
|
|
int iterations = 1;
|
|
int iteration_limit;
|
|
int iteration_limit;
|
|
|
|
|
|
@@ -698,9 +698,9 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
|
|
|
|
|
|
|
|
|
if (iteration_limit && iterations > iteration_limit) {
|
|
if (iteration_limit && iterations > iteration_limit) {
|
|
- printf("Tested %d iteration(s) without errors.\n",
|
|
|
|
- iterations-1);
|
|
|
|
- return 0;
|
|
|
|
|
|
+ printf("Tested %d iteration(s) with %lu errors.\n",
|
|
|
|
+ iterations-1, errs);
|
|
|
|
+ return errs != 0;
|
|
}
|
|
}
|
|
|
|
|
|
printf("Iteration: %6d\r", iterations);
|
|
printf("Iteration: %6d\r", iterations);
|
|
@@ -732,9 +732,14 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
|
*dummy = ~val; /* clear the test data off of the bus */
|
|
*dummy = ~val; /* clear the test data off of the bus */
|
|
readback = *addr;
|
|
readback = *addr;
|
|
if(readback != val) {
|
|
if(readback != val) {
|
|
- printf ("FAILURE (data line): "
|
|
|
|
|
|
+ printf ("FAILURE (data line): "
|
|
"expected %08lx, actual %08lx\n",
|
|
"expected %08lx, actual %08lx\n",
|
|
val, readback);
|
|
val, readback);
|
|
|
|
+ errs++;
|
|
|
|
+ if (ctrlc()) {
|
|
|
|
+ putc ('\n');
|
|
|
|
+ return 1;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
*addr = ~val;
|
|
*addr = ~val;
|
|
*dummy = val;
|
|
*dummy = val;
|
|
@@ -743,6 +748,11 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
|
printf ("FAILURE (data line): "
|
|
printf ("FAILURE (data line): "
|
|
"Is %08lx, should be %08lx\n",
|
|
"Is %08lx, should be %08lx\n",
|
|
readback, ~val);
|
|
readback, ~val);
|
|
|
|
+ errs++;
|
|
|
|
+ if (ctrlc()) {
|
|
|
|
+ putc ('\n');
|
|
|
|
+ return 1;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -808,7 +818,11 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
|
printf ("\nFAILURE: Address bit stuck high @ 0x%.8lx:"
|
|
printf ("\nFAILURE: Address bit stuck high @ 0x%.8lx:"
|
|
" expected 0x%.8lx, actual 0x%.8lx\n",
|
|
" expected 0x%.8lx, actual 0x%.8lx\n",
|
|
(ulong)&start[offset], pattern, temp);
|
|
(ulong)&start[offset], pattern, temp);
|
|
- return 1;
|
|
|
|
|
|
+ errs++;
|
|
|
|
+ if (ctrlc()) {
|
|
|
|
+ putc ('\n');
|
|
|
|
+ return 1;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
start[test_offset] = pattern;
|
|
start[test_offset] = pattern;
|
|
@@ -826,7 +840,11 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
|
printf ("\nFAILURE: Address bit stuck low or shorted @"
|
|
printf ("\nFAILURE: Address bit stuck low or shorted @"
|
|
" 0x%.8lx: expected 0x%.8lx, actual 0x%.8lx\n",
|
|
" 0x%.8lx: expected 0x%.8lx, actual 0x%.8lx\n",
|
|
(ulong)&start[offset], pattern, temp);
|
|
(ulong)&start[offset], pattern, temp);
|
|
- return 1;
|
|
|
|
|
|
+ errs++;
|
|
|
|
+ if (ctrlc()) {
|
|
|
|
+ putc ('\n');
|
|
|
|
+ return 1;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
start[test_offset] = pattern;
|
|
start[test_offset] = pattern;
|
|
@@ -864,7 +882,11 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
|
printf ("\nFAILURE (read/write) @ 0x%.8lx:"
|
|
printf ("\nFAILURE (read/write) @ 0x%.8lx:"
|
|
" expected 0x%.8lx, actual 0x%.8lx)\n",
|
|
" expected 0x%.8lx, actual 0x%.8lx)\n",
|
|
(ulong)&start[offset], pattern, temp);
|
|
(ulong)&start[offset], pattern, temp);
|
|
- return 1;
|
|
|
|
|
|
+ errs++;
|
|
|
|
+ if (ctrlc()) {
|
|
|
|
+ putc ('\n');
|
|
|
|
+ return 1;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
anti_pattern = ~pattern;
|
|
anti_pattern = ~pattern;
|
|
@@ -882,7 +904,11 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
|
printf ("\nFAILURE (read/write): @ 0x%.8lx:"
|
|
printf ("\nFAILURE (read/write): @ 0x%.8lx:"
|
|
" expected 0x%.8lx, actual 0x%.8lx)\n",
|
|
" expected 0x%.8lx, actual 0x%.8lx)\n",
|
|
(ulong)&start[offset], anti_pattern, temp);
|
|
(ulong)&start[offset], anti_pattern, temp);
|
|
- return 1;
|
|
|
|
|
|
+ errs++;
|
|
|
|
+ if (ctrlc()) {
|
|
|
|
+ putc ('\n');
|
|
|
|
+ return 1;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
start[offset] = 0;
|
|
start[offset] = 0;
|
|
}
|
|
}
|
|
@@ -897,9 +923,9 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
|
}
|
|
}
|
|
|
|
|
|
if (iteration_limit && iterations > iteration_limit) {
|
|
if (iteration_limit && iterations > iteration_limit) {
|
|
- printf("Tested %d iteration(s) without errors.\n",
|
|
|
|
- iterations-1);
|
|
|
|
- return 0;
|
|
|
|
|
|
+ printf("Tested %d iteration(s) with %lu errors.\n",
|
|
|
|
+ iterations-1, errs);
|
|
|
|
+ return errs != 0;
|
|
}
|
|
}
|
|
++iterations;
|
|
++iterations;
|
|
|
|
|
|
@@ -923,7 +949,11 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
|
printf ("\nMem error @ 0x%08X: "
|
|
printf ("\nMem error @ 0x%08X: "
|
|
"found %08lX, expected %08lX\n",
|
|
"found %08lX, expected %08lX\n",
|
|
(uint)addr, readback, val);
|
|
(uint)addr, readback, val);
|
|
- rcode = 1;
|
|
|
|
|
|
+ errs++;
|
|
|
|
+ if (ctrlc()) {
|
|
|
|
+ putc ('\n');
|
|
|
|
+ return 1;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
val += incr;
|
|
val += incr;
|
|
}
|
|
}
|
|
@@ -943,7 +973,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
|
|
incr = -incr;
|
|
incr = -incr;
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
- return rcode;
|
|
|
|
|
|
+ return 0; /* not reached */
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|