@@ -33,6 +33,7 @@ extern int omap_vram_alloc(int mtype, size_t size, unsigned long *paddr);
extern int omap_vram_reserve(unsigned long paddr, size_t size);
extern void omap_vram_get_info(unsigned long *vram, unsigned long *free_vram,
unsigned long *largest_free_block);
+extern void __iomem *omap_vram_remap(size_t size, unsigned long paddr);
#ifdef CONFIG_OMAP2_VRAM
extern void omap_vram_set_sdram_vram(u32 size, u32 start);
@@ -1436,7 +1436,7 @@ static int omapfb_alloc_fbmem(struct fb_info *fbi, unsigned long size,
}
if (ofbi->rotation_type != OMAP_DSS_ROT_VRFB) {
- vaddr = ioremap_wc(paddr, size);
+ vaddr = omap_vram_remap(size, paddr);
if (!vaddr) {
dev_err(fbdev->dev, "failed to ioremap framebuffer\n");
@@ -30,6 +30,7 @@
#include <linux/debugfs.h>
#include <linux/jiffies.h>
#include <linux/module.h>
+#include <linux/io.h>
#include <asm/setup.h>
@@ -425,6 +426,15 @@ void omap_vram_get_info(unsigned long *vram,
}
EXPORT_SYMBOL(omap_vram_get_info);
+void __iomem *omap_vram_remap(size_t size, unsigned long paddr)
+{
+ if (region_mem_type(paddr) == OMAP_VRAM_MEMTYPE_SDRAM)
+ return phys_to_virt(paddr);
+
+ return ioremap_wc(paddr, size);
+}
+EXPORT_SYMBOL(omap_vram_remap);
+
#if defined(CONFIG_DEBUG_FS)
static int vram_debug_show(struct seq_file *s, void *unused)
{