summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-10-23 11:06:56 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2015-11-03 07:27:44 +0100
commitb792124a7dd30f03b9ad0e06589b5b58ed930d3b (patch)
tree9811bbbc0b5bb5baade7d32309ced5b3c59046df /drivers
parent6b127d4f189c03f4417f6185de1aeb55b1706f94 (diff)
downloadbarebox-b792124a7dd30f03b9ad0e06589b5b58ed930d3b.tar.gz
barebox-b792124a7dd30f03b9ad0e06589b5b58ed930d3b.tar.xz
rework remap_range
remap_range is for remapping regions with different cache attributes. It is implemented for ARM and PowerPC only, the other architectures only provide stubs. Currently the new cache attributes are passed in an architecture specific way and the attributes have to be retrieved by calls to mmu_get_pte_cached_flags() and mmu_get_pte_uncached_flags(). Make this simpler by providing architecture independent flags which can be directly passed to remap_range() Also provide a MAP_ARCH_DEFAULT flag and a arch_can_remap() function. The MAP_ARCH_DEFAULT defaults to whatever caching type the architecture has as default. the arch_can_remap() function returns true if the architecture can change the cache attributes, false otherwise. This allows the memtest code to better find out what it has to do. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/imx-ipu-fb.c5
-rw-r--r--drivers/video/omap.c5
-rw-r--r--drivers/video/stm.c5
3 files changed, 6 insertions, 9 deletions
diff --git a/drivers/video/imx-ipu-fb.c b/drivers/video/imx-ipu-fb.c
index a87e720d96..03d191a331 100644
--- a/drivers/video/imx-ipu-fb.c
+++ b/drivers/video/imx-ipu-fb.c
@@ -27,7 +27,7 @@
#include <malloc.h>
#include <errno.h>
#include <asm-generic/div64.h>
-#include <asm/mmu.h>
+#include <mmu.h>
#include <mach/imx-ipu-fb.h>
#include <linux/clk.h>
#include <linux/err.h>
@@ -1030,8 +1030,7 @@ static int imxfb_probe(struct device_d *dev)
fbi->info.screen_base = pdata->framebuffer;
if (fbi->info.screen_base) {
remap_range(fbi->info.screen_base,
- fbi->info.screen_size,
- mmu_get_pte_uncached_flags());
+ fbi->info.screen_size, MAP_UNCACHED);
} else {
fbi->info.screen_base = dma_alloc_coherent(fbi->info.screen_size,
DMA_ADDRESS_BROKEN);
diff --git a/drivers/video/omap.c b/drivers/video/omap.c
index 3603ad2ccb..884365f609 100644
--- a/drivers/video/omap.c
+++ b/drivers/video/omap.c
@@ -35,7 +35,7 @@
#include <mach/omap4-silicon.h>
#include <mach/omap-fb.h>
-#include <asm/mmu.h>
+#include <mmu.h>
#include "omap.h"
@@ -487,8 +487,7 @@ static int omapfb_probe(struct device_d *dev)
(void __iomem *)pdata->screen->start;
fbi->prealloc_screen.size = resource_size(pdata->screen);
remap_range(fbi->prealloc_screen.addr,
- fbi->prealloc_screen.size,
- mmu_get_pte_uncached_flags());
+ fbi->prealloc_screen.size, MAP_UNCACHED);
}
rc = omapfb_reset(fbi);
diff --git a/drivers/video/stm.c b/drivers/video/stm.c
index 1b42a18356..e5c1ef3974 100644
--- a/drivers/video/stm.c
+++ b/drivers/video/stm.c
@@ -25,7 +25,7 @@
#include <xfuncs.h>
#include <io.h>
#include <dma.h>
-#include <asm/mmu.h>
+#include <mmu.h>
#include <stmp-device.h>
#include <linux/clk.h>
#include <linux/err.h>
@@ -332,8 +332,7 @@ static int stmfb_activate_var(struct fb_info *fb_info)
fb_info->screen_base = fbi->fixed_screen;
fbi->memory_size = fbi->fixed_screen_size;
remap_range(fbi->fixed_screen,
- fbi->fixed_screen_size,
- mmu_get_pte_uncached_flags());
+ fbi->fixed_screen_size, MAP_UNCACHED);
} else {
fb_info->screen_base = dma_alloc_coherent(size, NULL);
if (!fb_info->screen_base)