]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
microblaze: Implement flush_dcache_page macro
authorMichal Simek <monstr@monstr.eu>
Fri, 4 Jun 2010 11:00:31 +0000 (13:00 +0200)
committerMichal Simek <monstr@monstr.eu>
Wed, 4 Aug 2010 08:22:09 +0000 (10:22 +0200)
flush_dcache_page macro is necessary to implement for
JFFS2 rootfs support on WB system.

Signed-off-by: Michal Simek <monstr@monstr.eu>
arch/microblaze/include/asm/cacheflush.h

index a6edd356cd08c583807fb278913f943172f7ae20..e9bb567e1b0ea749d7a0660778a7413fb5b14d41 100644 (file)
@@ -17,6 +17,7 @@
 
 /* Somebody depends on this; sigh... */
 #include <linux/mm.h>
+#include <linux/io.h>
 
 /* Look at Documentation/cachetlb.txt */
 
@@ -60,7 +61,6 @@ void microblaze_cache_init(void);
 #define invalidate_icache()                            mbc->iin();
 #define invalidate_icache_range(start, end)            mbc->iinr(start, end);
 
-
 #define flush_icache_user_range(vma, pg, adr, len)     flush_icache();
 #define flush_icache_page(vma, pg)                     do { } while (0)
 
@@ -72,9 +72,15 @@ void microblaze_cache_init(void);
 #define flush_dcache()                                 mbc->dfl();
 #define flush_dcache_range(start, end)                 mbc->dflr(start, end);
 
-#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0
-/* D-cache aliasing problem can't happen - cache is between MMU and ram */
-#define flush_dcache_page(page)                        do { } while (0)
+#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 1
+/* MS: We have to implement it because of rootfs-jffs2 issue on WB */
+#define flush_dcache_page(page) \
+do { \
+       unsigned long addr = (unsigned long) page_address(page); /* virtual */ \
+       addr = (u32)virt_to_phys((void *)addr); \
+       flush_dcache_range((unsigned) (addr), (unsigned) (addr) + PAGE_SIZE); \
+} while (0);
+
 #define flush_dcache_mmap_lock(mapping)                do { } while (0)
 #define flush_dcache_mmap_unlock(mapping)      do { } while (0)