aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Pitre <nico@fluxnic.net>2009-12-10 20:21:57 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2009-12-14 09:53:21 -0500
commitccaf5f05b218e5eb41e2f5cdfd26b18dce4a0218 (patch)
treef4de2fb21cc45716c2dbcb98acb176c4295a551c
parent3067e02f8f3ae2f3f02ba76400d03b8bcb4942b0 (diff)
ARM: 5848/1: kill flush_ioremap_region()
There is not enough users to warrant its existence, and it is actually an obstacle to progress with the new DMA API which cannot cover this case properly. To keep backward compatibility, let's perform the necessary custom cache maintenance locally in the only driver affected. Signed-off-by: Nicolas Pitre <nico@marvell.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/include/asm/cacheflush.h7
-rw-r--r--arch/arm/mm/proc-syms.c1
-rw-r--r--drivers/mtd/maps/pxa2xx-flash.c13
3 files changed, 11 insertions, 10 deletions
diff --git a/arch/arm/include/asm/cacheflush.h b/arch/arm/include/asm/cacheflush.h
index 73eceb87e588..3db7acd39a62 100644
--- a/arch/arm/include/asm/cacheflush.h
+++ b/arch/arm/include/asm/cacheflush.h
@@ -465,13 +465,6 @@ static inline void flush_kernel_dcache_page(struct page *page)
465 */ 465 */
466#define flush_icache_page(vma,page) do { } while (0) 466#define flush_icache_page(vma,page) do { } while (0)
467 467
468static inline void flush_ioremap_region(unsigned long phys, void __iomem *virt,
469 unsigned offset, size_t size)
470{
471 const void *start = (void __force *)virt + offset;
472 dmac_inv_range(start, start + size);
473}
474
475/* 468/*
476 * flush_cache_vmap() is used when creating mappings (eg, via vmap, 469 * flush_cache_vmap() is used when creating mappings (eg, via vmap,
477 * vmalloc, ioremap etc) in kernel space for pages. On non-VIPT 470 * vmalloc, ioremap etc) in kernel space for pages. On non-VIPT
diff --git a/arch/arm/mm/proc-syms.c b/arch/arm/mm/proc-syms.c
index ac5c80062b70..f604aa8acae9 100644
--- a/arch/arm/mm/proc-syms.c
+++ b/arch/arm/mm/proc-syms.c
@@ -28,7 +28,6 @@ EXPORT_SYMBOL(__cpuc_flush_user_all);
28EXPORT_SYMBOL(__cpuc_flush_user_range); 28EXPORT_SYMBOL(__cpuc_flush_user_range);
29EXPORT_SYMBOL(__cpuc_coherent_kern_range); 29EXPORT_SYMBOL(__cpuc_coherent_kern_range);
30EXPORT_SYMBOL(__cpuc_flush_dcache_page); 30EXPORT_SYMBOL(__cpuc_flush_dcache_page);
31EXPORT_SYMBOL(dmac_inv_range); /* because of flush_ioremap_region() */
32#else 31#else
33EXPORT_SYMBOL(cpu_cache); 32EXPORT_SYMBOL(cpu_cache);
34#endif 33#endif
diff --git a/drivers/mtd/maps/pxa2xx-flash.c b/drivers/mtd/maps/pxa2xx-flash.c
index 74fa075c838a..b13f6417b5b2 100644
--- a/drivers/mtd/maps/pxa2xx-flash.c
+++ b/drivers/mtd/maps/pxa2xx-flash.c
@@ -20,14 +20,23 @@
20 20
21#include <asm/io.h> 21#include <asm/io.h>
22#include <mach/hardware.h> 22#include <mach/hardware.h>
23#include <asm/cacheflush.h>
24 23
25#include <asm/mach/flash.h> 24#include <asm/mach/flash.h>
26 25
26#define CACHELINESIZE 32
27
27static void pxa2xx_map_inval_cache(struct map_info *map, unsigned long from, 28static void pxa2xx_map_inval_cache(struct map_info *map, unsigned long from,
28 ssize_t len) 29 ssize_t len)
29{ 30{
30 flush_ioremap_region(map->phys, map->cached, from, len); 31 unsigned long start = (unsigned long)map->cached + from;
32 unsigned long end = start + len;
33
34 start &= ~(CACHELINESIZE - 1);
35 while (start < end) {
36 /* invalidate D cache line */
37 asm volatile ("mcr p15, 0, %0, c7, c6, 1" : : "r" (start));
38 start += CACHELINESIZE;
39 }
31} 40}
32 41
33struct pxa2xx_flash_info { 42struct pxa2xx_flash_info {