linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: festevam@gmail.com (Fabio Estevam)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] ARM: mx27_3ds: Add VPU support
Date: Wed, 10 Oct 2012 00:29:30 -0300	[thread overview]
Message-ID: <1349839770-13848-2-git-send-email-festevam@gmail.com> (raw)
In-Reply-To: <1349839770-13848-1-git-send-email-festevam@gmail.com>

From: Fabio Estevam <fabio.estevam@freescale.com>

mx27 has a VPU (Video Processing Unit) block that allows doing H264/MPEG4
decoding and encoding in hardware.

Add support for it.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 arch/arm/mach-imx/mach-mx27_3ds.c |   18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index d3b9a60..3ef8548 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
@@ -500,6 +500,21 @@ static void __init mx27pdk_init_camera(void)
 		return;
 }
 
+static void __init mx27pdk_init_vpu(void)
+{
+	struct platform_device *pdev;
+	int dma;
+
+	pdev = imx27_add_coda();
+	dma = dma_declare_coherent_memory(&pdev->dev,
+					  mx2_camera_base + MX27PDK_CAM_BUF_SIZE,
+					  mx2_camera_base + MX27PDK_CAM_BUF_SIZE,
+					  MX27PDK_CAM_BUF_SIZE,
+					  DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE);
+	if (!(dma & DMA_MEMORY_MAP))
+		return;
+}
+
 static const struct imxi2c_platform_data mx27_3ds_i2c0_data __initconst = {
 	.bitrate = 100000,
 };
@@ -553,6 +568,7 @@ static void __init mx27pdk_init(void)
 	imx27_add_imx_ssi(0, &mx27_3ds_ssi_pdata);
 
 	imx_add_platform_device("imx_mc13783", 0, NULL, 0, NULL, 0);
+	mx27pdk_init_vpu();
 }
 
 static void __init mx27pdk_timer_init(void)
@@ -567,7 +583,7 @@ static struct sys_timer mx27pdk_timer = {
 static void __init mx27pdk_reserve(void)
 {
 	/* reserve MX27_3DS_CAMERA_BUF_SIZE bytes for mx2-camera */
-	mx2_camera_base = arm_memblock_steal(MX27PDK_CAM_BUF_SIZE,
+	mx2_camera_base = arm_memblock_steal(3 * MX27PDK_CAM_BUF_SIZE,
 						MX27PDK_CAM_BUF_SIZE);
 }
 
-- 
1.7.9.5

  reply	other threads:[~2012-10-10  3:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-10  3:29 [PATCH 1/2] ARM: mx27_3ds: Reserve memory for camera usage Fabio Estevam
2012-10-10  3:29 ` Fabio Estevam [this message]
2012-10-10  6:51 ` Gaëtan Carlier
2012-10-10  7:52 ` Sascha Hauer
2012-10-16  4:08   ` Fabio Estevam
2012-10-16  7:13     ` Sascha Hauer

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=1349839770-13848-2-git-send-email-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).