Linux Samsung SOC development
 help / color / mirror / Atom feed
From: Jeongtae Park <jtp.park@samsung.com>
To: linux-media@vger.kernel.org, linux-samsung-soc@vger.kernel.org
Cc: k.debski@samsung.com, jaeryul.oh@samsung.com,
	kgene.kim@samsung.com, ben-linux@fluff.org,
	jonghun.han@samsung.com, Jeongtae Park <jtp.park@samsung.com>
Subject: [PATCH 6/9] ARM: S5PV310: Add CMA support for MFC v5.1 on SMDKV310
Date: Wed, 22 Dec 2010 20:54:42 +0900	[thread overview]
Message-ID: <1293018885-15239-7-git-send-email-jtp.park@samsung.com> (raw)
In-Reply-To: <1293018885-15239-6-git-send-email-jtp.park@samsung.com>

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

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

diff --git a/arch/arm/mach-s5pv310/mach-smdkv310.c b/arch/arm/mach-s5pv310/mach-smdkv310.c
index e29df7f..bdc19ba 100644
--- a/arch/arm/mach-s5pv310/mach-smdkv310.c
+++ b/arch/arm/mach-s5pv310/mach-smdkv310.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 smdkv310_smsc911x_init(void)
 		     (0x1 << S5PV310_SROM_BCX__TACS__SHIFT), S5PV310_SROM_BC1);
 }
 
+static void __init smdkv310_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 smdkv310_map_io(void)
 {
 	s5p_init_io(NULL, 0, S5P_VA_CHIPID);
@@ -326,4 +358,7 @@ MACHINE_START(SMDKV310, "SMDKV310")
 	.map_io		= smdkv310_map_io,
 	.init_machine	= smdkv310_machine_init,
 	.timer		= &s5pv310_timer,
+#ifdef CONFIG_CMA
+	.reserve	= &smdkv310_reserve_cma,
+#endif
 MACHINE_END
-- 
1.6.2.5

  reply	other threads:[~2010-12-22 11:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-22 11:54 [PATCH 0/9] Multi Format Codec 5.1 driver for S5PC210 SoC Jeongtae Park
2010-12-22 11:54 ` [PATCH 1/9] media: Changes in include/linux/videodev2.h for MFC 5.1 Jeongtae Park
2010-12-22 11:54   ` [PATCH 2/9] ARM: S5PV310: Add clock support for MFC v5.1 Jeongtae Park
2010-12-22 11:54     ` [PATCH 3/9] ARM: S5PV310: Add memory map " Jeongtae Park
2010-12-22 11:54       ` [PATCH 4/9] ARM: S5P: Add platform " Jeongtae Park
2010-12-22 11:54         ` [PATCH 5/9] ARM: S5PV310: Add CMA support for MFC v5.1 on SMDKC210 Jeongtae Park
2010-12-22 11:54           ` Jeongtae Park [this message]
2010-12-22 11:54             ` [PATCH 7/9] media: MFC: Add MFC v5.1 V4L2 driver Jeongtae Park
2010-12-22 11:54               ` [PATCH 8/9] ARM: S5PV310: Add MFC v5.1 platform device support for SMDKC210 Jeongtae Park
2010-12-22 11:54                 ` [PATCH 9/9] ARM: S5PV310: Add MFC v5.1 platform device support for SMDKV310 Jeongtae Park
2010-12-22 13:01               ` [PATCH 7/9] media: MFC: Add MFC v5.1 V4L2 driver Hans Verkuil
2010-12-31 10:20                 ` Kamil Debski
2010-12-22 13:08               ` Marek Szyprowski
2010-12-27  8:13               ` Jonghun Han
2011-01-05 15:45                 ` Kamil Debski
2011-01-07  0:51                   ` Jonghun Han
2010-12-22 12:42   ` [PATCH 1/9] media: Changes in include/linux/videodev2.h for MFC 5.1 Hans Verkuil
2010-12-27 16:27     ` Kamil Debski
2010-12-28  8:24       ` Jaeryul Oh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1293018885-15239-7-git-send-email-jtp.park@samsung.com \
    --to=jtp.park@samsung.com \
    --cc=ben-linux@fluff.org \
    --cc=jaeryul.oh@samsung.com \
    --cc=jonghun.han@samsung.com \
    --cc=k.debski@samsung.com \
    --cc=kgene.kim@samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox