From e9b737deb2c30125362d20e24170617476026e94 Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Mon, 5 Jan 2009 13:29:32 +0100 Subject: microblaze: Add cache flush --- lib_microblaze/cache.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'lib_microblaze/cache.c') diff --git a/lib_microblaze/cache.c b/lib_microblaze/cache.c index a2f7493b61..4b2e8e3790 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"); } -- cgit v1.2.1