diff options
Diffstat (limited to 'drivers/mtd/maps/pxa2xx-flash.c')
-rw-r--r-- | drivers/mtd/maps/pxa2xx-flash.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/mtd/maps/pxa2xx-flash.c b/drivers/mtd/maps/pxa2xx-flash.c index 74fa075c838a..91dc6331053f 100644 --- a/drivers/mtd/maps/pxa2xx-flash.c +++ b/drivers/mtd/maps/pxa2xx-flash.c | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
14 | #include <linux/slab.h> | ||
14 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
15 | #include <linux/init.h> | 16 | #include <linux/init.h> |
16 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
@@ -20,14 +21,23 @@ | |||
20 | 21 | ||
21 | #include <asm/io.h> | 22 | #include <asm/io.h> |
22 | #include <mach/hardware.h> | 23 | #include <mach/hardware.h> |
23 | #include <asm/cacheflush.h> | ||
24 | 24 | ||
25 | #include <asm/mach/flash.h> | 25 | #include <asm/mach/flash.h> |
26 | 26 | ||
27 | #define CACHELINESIZE 32 | ||
28 | |||
27 | static void pxa2xx_map_inval_cache(struct map_info *map, unsigned long from, | 29 | static void pxa2xx_map_inval_cache(struct map_info *map, unsigned long from, |
28 | ssize_t len) | 30 | ssize_t len) |
29 | { | 31 | { |
30 | flush_ioremap_region(map->phys, map->cached, from, len); | 32 | unsigned long start = (unsigned long)map->cached + from; |
33 | unsigned long end = start + len; | ||
34 | |||
35 | start &= ~(CACHELINESIZE - 1); | ||
36 | while (start < end) { | ||
37 | /* invalidate D cache line */ | ||
38 | asm volatile ("mcr p15, 0, %0, c7, c6, 1" : : "r" (start)); | ||
39 | start += CACHELINESIZE; | ||
40 | } | ||
31 | } | 41 | } |
32 | 42 | ||
33 | struct pxa2xx_flash_info { | 43 | struct pxa2xx_flash_info { |