summaryrefslogtreecommitdiff
path: root/lib_microblaze/cache.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2009-01-23 22:47:25 +0100
committerWolfgang Denk <wd@denx.de>2009-01-23 22:47:25 +0100
commit1ca1d3c866709635fc082b0140e02257a742316c (patch)
tree618053ce9979b5620a04b96e5a0b628c4b13262b /lib_microblaze/cache.c
parent4d0b54685c5c656023b826089ef8cc0ea1c5cd9e (diff)
parente7f325be9edeb84bb457301776bbac1f7257dafc (diff)
downloadu-boot-imx-1ca1d3c866709635fc082b0140e02257a742316c.zip
u-boot-imx-1ca1d3c866709635fc082b0140e02257a742316c.tar.gz
u-boot-imx-1ca1d3c866709635fc082b0140e02257a742316c.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-microblaze
Diffstat (limited to 'lib_microblaze/cache.c')
-rw-r--r--lib_microblaze/cache.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib_microblaze/cache.c b/lib_microblaze/cache.c
index a2f7493..4b2e8e3 100644
--- a/lib_microblaze/cache.c
+++ b/lib_microblaze/cache.c
@@ -26,6 +26,18 @@
void flush_cache (ulong addr, ulong size)
{
- /* MicroBlaze have write thruough cache. nothing to do. */
- return;
+ int i;
+ for (i = 0; i < size; i += 4)
+ asm volatile (
+#ifdef CONFIG_ICACHE
+ "wic %0, r0;"
+#endif
+ "nop;"
+#ifdef CONFIG_DCACHE
+ "wdc %0, r0;"
+#endif
+ "nop;"
+ :
+ : "r" (addr + i)
+ : "memory");
}