summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2010-09-13 09:10:34 (GMT)
committerWolfgang Denk <wd@denx.de>2010-10-12 20:50:19 (GMT)
commiteaadb44edf6799099ee73d423bbfd5e33b8ee9ff (patch)
treea851cf95773934c3a9398673636719600489b969
parentc91d456c055237bdadb99a80e198748b8cf32595 (diff)
downloadu-boot-fsl-qoriq-eaadb44edf6799099ee73d423bbfd5e33b8ee9ff.tar.xz
cp/cmp: Add WATCHDOG_RESET in copy and compare loop
On some boards with a very short watchdog timeout, the "cp" and "cmp" commands may reset the board. This patch adds some watchdog resets inside the loops. Otherwise for example the lwmon5 board will reset while doing something like this: => cp.b fc000000 1000000 100000 Signed-off-by: Stefan Roese <sr@denx.de>
-rw-r--r--common/cmd_mem.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/common/cmd_mem.c b/common/cmd_mem.c
index 44834ea..f7a442a 100644
--- a/common/cmd_mem.c
+++ b/common/cmd_mem.c
@@ -337,6 +337,10 @@ int do_mem_cmp (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
ngood++;
addr1 += size;
addr2 += size;
+
+ /* reset watchdog from time to time */
+ if ((count % (64 << 10)) == 0)
+ WATCHDOG_RESET();
}
printf("Total of %ld %s%s were the same\n",
@@ -447,6 +451,10 @@ int do_mem_cp ( cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
*((u_char *)dest) = *((u_char *)addr);
addr += size;
dest += size;
+
+ /* reset watchdog from time to time */
+ if ((count % (64 << 10)) == 0)
+ WATCHDOG_RESET();
}
return 0;
}