This patch adds CMA support for MFC v5.1. It includes CMA region
definition and reserve callback addition.

Reviewed-by: Peter Oh <jaeryul...@samsung.com>
Signed-off-by: Jeongtae Park <jtp.p...@samsung.com>
---
 arch/arm/mach-s5pv310/mach-smdkc210.c |   35 +++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-s5pv310/mach-smdkc210.c 
b/arch/arm/mach-s5pv310/mach-smdkc210.c
index 6a1d3a1..7de3092 100644
--- a/arch/arm/mach-s5pv310/mach-smdkc210.c
+++ b/arch/arm/mach-s5pv310/mach-smdkc210.c
@@ -18,6 +18,9 @@
 #include <linux/smsc911x.h>
 #include <linux/io.h>
 #include <linux/lcd.h>
+#ifdef CONFIG_CMA
+#include <linux/cma.h>
+#endif
 
 #include <asm/mach/arch.h>
 #include <asm/mach-types.h>
@@ -296,6 +299,35 @@ static void __init smdkc210_smsc911x_init(void)
                     (0x1 << S5PV310_SROM_BCX__TACS__SHIFT), S5PV310_SROM_BC1);
 }
 
+static void __init smdkc210_reserve_cma(void)
+{
+       static struct cma_region regions[] = {
+               {
+                       .name           = "fw",
+                       .size           =   1 << 20,
+                       { .alignment    = 128 << 10 },
+                       .start          = 0x42000000,
+               },
+               {
+                       .name           = "b1",
+                       .size           =  32 << 20,
+                       .start          = 0x43000000,
+               },
+               {
+                       .name           = "b2",
+                       .size           =  16 << 20,
+                       .start          = 0x51000000,
+               },
+               {}
+       };
+
+       static const char map[] __initconst =
+               "s5p-mfc/f=fw;s5p-mfc/a=b1;s5p-mfc/b=b2;*=b1,b2";
+
+       cma_set_defaults(regions, map);
+       cma_early_regions_reserve(NULL);
+}
+
 static void __init smdkc210_map_io(void)
 {
        s5p_init_io(NULL, 0, S5P_VA_CHIPID);
@@ -325,4 +357,7 @@ MACHINE_START(SMDKC210, "SMDKC210")
        .map_io         = smdkc210_map_io,
        .init_machine   = smdkc210_machine_init,
        .timer          = &s5pv310_timer,
+#ifdef CONFIG_CMA
+       .reserve        = &smdkc210_reserve_cma,
+#endif
 MACHINE_END
-- 
1.6.2.5

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to