summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Tikhonov <yur@emcraft.com>2008-04-29 13:32:45 +0200
committerWolfgang Denk <wd@denx.de>2008-04-29 14:48:50 +0200
commit138105efe1d2b1a40a3a97b4c1f85c2111bea2d8 (patch)
tree4e2459d4bb355cc9d997bd7b7bba6c75a0c3a0d8
parent18ec19e4aa1a045dfbf2c7c2e33963488e92d757 (diff)
downloadu-boot-imx-138105efe1d2b1a40a3a97b4c1f85c2111bea2d8.zip
u-boot-imx-138105efe1d2b1a40a3a97b4c1f85c2111bea2d8.tar.gz
u-boot-imx-138105efe1d2b1a40a3a97b4c1f85c2111bea2d8.tar.bz2
ppc flush_cache: add watch-dog triggering into the loops.
Some boards (e.g. lwmon5) need rather a frequent watch-dog kicking. Since the time it takes for the flush_cache() function to complete its job depends on the size of data being flushed, one may encounter watch-dog resets on such boards when, for example, download big files over ethernet. Signed-off-by: Yuri Tikhonov <yur@emcraft.com>
-rw-r--r--lib_ppc/cache.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib_ppc/cache.c b/lib_ppc/cache.c
index 27e1a82..5bfb220 100644
--- a/lib_ppc/cache.c
+++ b/lib_ppc/cache.c
@@ -23,6 +23,7 @@
#include <common.h>
#include <asm/cache.h>
+#include <watchdog.h>
void flush_cache (ulong start_addr, ulong size)
{
@@ -35,6 +36,7 @@ void flush_cache (ulong start_addr, ulong size)
addr < end_addr;
addr += CFG_CACHELINE_SIZE) {
asm ("dcbst 0,%0": :"r" (addr));
+ WATCHDOG_RESET();
}
asm ("sync"); /* Wait for all dcbst to complete on bus */
@@ -42,6 +44,7 @@ void flush_cache (ulong start_addr, ulong size)
addr < end_addr;
addr += CFG_CACHELINE_SIZE) {
asm ("icbi 0,%0": :"r" (addr));
+ WATCHDOG_RESET();
}
}
asm ("sync"); /* Always flush prefetch queue in any case */