ARM: omap: Setup consistent dma size at boot time
authorJon Medhurst <tixy@yxit.co.uk>
Wed, 3 Aug 2011 15:57:19 +0000 (16:57 +0100)
committerJon Medhurst <tixy@yxit.co.uk>
Mon, 22 Aug 2011 12:00:10 +0000 (12:00 +0000)
Signed-off-by: Jon Medhurst <tixy@yxit.co.uk>
CC: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap1/io.c
arch/arm/mach-omap2/io.c
arch/arm/plat-omap/include/plat/io.h
arch/arm/plat-omap/include/plat/memory.h
arch/arm/plat-omap/io.c

index 870886a29594b4c14eb54ef8251772f520d8e1da..1cfa1b6bb62b58de6aaaa2f7b1efc949dfc3ef68 100644 (file)
@@ -121,6 +121,7 @@ void __init omap1_map_common_io(void)
 #endif
 
        omap_sram_init();
+       omap_init_consistent_dma_size();
 }
 
 /*
index 2ce1ce6fb4dbd7e1db81a48ad47f3c709e233c87..d6d01cb7f28a63b2a7bc3ac060cb059a030bf584 100644 (file)
@@ -16,7 +16,6 @@
  * it under the terms of the GNU General Public License version 2 as
  * published by the Free Software Foundation.
  */
-
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/init.h>
@@ -250,6 +249,7 @@ static void __init _omap2_map_common_io(void)
 
        omap2_check_revision();
        omap_sram_init();
+       omap_init_consistent_dma_size();
 }
 
 #ifdef CONFIG_SOC_OMAP2420
index d72ec85c97e66892920b4db0b6ca30e66acb8b87..ebe67ea8d06876e0d753f4670feba3e73e3cd48c 100644 (file)
@@ -309,6 +309,8 @@ extern void omap2_init_common_devices(struct omap_sdrc_params *sdrc_cs0,
 void __iomem *omap_ioremap(unsigned long phys, size_t size, unsigned int type);
 void omap_iounmap(volatile void __iomem *addr);
 
+extern void __init omap_init_consistent_dma_size(void);
+
 #endif
 
 #endif
index e6720aa2d553f8430ae3740f7ed7250948c9a91d..7f9df6f1e1139f5e8acde36a8f12b466d6f3bb99 100644 (file)
 
 #endif /* CONFIG_ARCH_OMAP15XX */
 
-/* Override the ARM default */
-#ifdef CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE
-
-#if (CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE == 0)
-#undef CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE
-#define CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE 2
-#endif
-
-#define CONSISTENT_DMA_SIZE \
-       (((CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE + 1) & ~1) * 1024 * 1024)
-
-#endif
-
 #endif
 
index f1ecfa9fc61d3c4c45a6a145d43bfa202af37176..e9b0e23edd0a556430a364d2e0aec740420c5d05 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/module.h>
 #include <linux/io.h>
 #include <linux/mm.h>
+#include <linux/dma-mapping.h>
 
 #include <plat/omap7xx.h>
 #include <plat/omap1510.h>
@@ -139,3 +140,10 @@ void omap_iounmap(volatile void __iomem *addr)
                __iounmap(addr);
 }
 EXPORT_SYMBOL(omap_iounmap);
+
+void __init omap_init_consistent_dma_size(void)
+{
+#ifdef CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE
+       init_consistent_dma_size(CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE << 20);
+#endif
+}