summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Poselenov <sposelenov@emcraft.com>2008-04-09 16:09:41 +0200
committerWolfgang Denk <wd@denx.de>2008-04-22 15:21:37 +0200
commita6e6fc610e39dec41b79680413d4ed38145bd3c8 (patch)
tree35fcacb2bf3a634c84fac166a16d0c4ce3f935f4
parentd32a874b9b4c1e949ee38be7790f6bf6d6143451 (diff)
Added watchdog triggering calls in the "mtest" test function.
Signed-off-by: Sergei Poselenov <sposelenov@emcraft.com>
-rw-r--r--common/cmd_mem.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index 4262e26a61..4740664173 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -35,6 +35,7 @@
#ifdef CONFIG_HAS_DATAFLASH
#include <dataflash.h>
#endif
+#include <watchdog.h>
#if defined(CONFIG_CMD_MEMORY) \
|| defined(CONFIG_CMD_I2C) \
@@ -868,6 +869,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
}
}
start[test_offset] = pattern;
+ WATCHDOG_RESET();
/*
* Check for addr bits stuck low or shorted.
@@ -905,6 +907,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
* Fill memory with a known pattern.
*/
for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
+ WATCHDOG_RESET();
start[offset] = pattern;
}
@@ -912,6 +915,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
* Check each location and invert it for the second pass.
*/
for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
+ WATCHDOG_RESET();
temp = start[offset];
if (temp != pattern) {
printf ("\nFAILURE (read/write) @ 0x%.8lx:"
@@ -928,6 +932,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
* Check each location for the inverted pattern and zero it.
*/
for (pattern = 1, offset = 0; offset < num_words; pattern++, offset++) {
+ WATCHDOG_RESET();
anti_pattern = ~pattern;
temp = start[offset];
if (temp != anti_pattern) {
@@ -954,6 +959,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
pattern, "");
for (addr=start,val=pattern; addr<end; addr++) {
+ WATCHDOG_RESET();
*addr = val;
val += incr;
}
@@ -961,6 +967,7 @@ int do_mem_mtest (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
puts ("Reading...");
for (addr=start,val=pattern; addr<end; addr++) {
+ WATCHDOG_RESET();
readback = *addr;
if (readback != val) {
printf ("\nMem error @ 0x%08X: "