From patchwork Mon Nov 5 15:59:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martin X-Patchwork-Id: 1699311 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id A2C88E0010 for ; Mon, 5 Nov 2012 16:02:28 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TVP6A-0007UR-7X; Mon, 05 Nov 2012 16:00:26 +0000 Received: from mail-wi0-f169.google.com ([209.85.212.169]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TVP60-0007TW-6J for linux-arm-kernel@lists.infradead.org; Mon, 05 Nov 2012 16:00:18 +0000 Received: by mail-wi0-f169.google.com with SMTP id hq4so2613338wib.0 for ; Mon, 05 Nov 2012 08:00:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=hF9/ZatNKyFMCkC7ihFm38Bs7cY1m1R0HHrkWhWQZI4=; b=OZw7zd+Bk5ebwVk9pGqWEvxCEI9ReiYfmW6M5wyEYXAuGvdeXeDOBIeI144aXaqqNE 47e+QucXZqbkOC/m0GtpawEQ7oLyJPSQOeeEgPMh2uOvgqasizDs/zOS3YwsRLDPRuWX nlAwC7UNUqzVvDdb9X5vFQqSeb6FsUsjKP/gjDyUtWXbM1DVKnJdr0gMRCn1/jGLhF/n CHKjgABpJ1rt3TlQSnvL7ER7I+9NdhO+ga/xLSpTLaK5k7ZypZ79Dt4i5OIfQhmvfVjI t4Yf47Ja+Ln9Zo2r7nGy0vfnnclPMMFXxLKKqxqJ0QNA1vtHYDNZWWhp9IPG94lObEXN ykdg== Received: by 10.181.13.194 with SMTP id fa2mr14043233wid.10.1352131214085; Mon, 05 Nov 2012 08:00:14 -0800 (PST) Received: from piscis.vsilicon.net (149.93.18.95.dynamic.jazztel.es. [95.18.93.149]) by mx.google.com with ESMTPS id j8sm10915175wiy.9.2012.11.05.08.00.12 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 05 Nov 2012 08:00:13 -0800 (PST) From: Javier Martin To: linux-media@vger.kernel.org Subject: [PATCH 2/2] media: coda: Use iram_alloc() for codadx6 too. Date: Mon, 5 Nov 2012 16:59:45 +0100 Message-Id: <1352131185-12079-2-git-send-email-javier.martin@vista-silicon.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1352131185-12079-1-git-send-email-javier.martin@vista-silicon.com> References: <1352131185-12079-1-git-send-email-javier.martin@vista-silicon.com> X-Gm-Message-State: ALoCoQmTMTZ3q6cIEKQD0PlVJ5Wtoj/BwtsSUoJ/0GZG6ki9rGmHEnkEnhOAnlHraOsc5tkmzlLD X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121105_110016_452230_0DBE64A4 X-CRM114-Status: GOOD ( 14.17 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.212.169 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: s.nawrocki@samsung.com, mchehab@infradead.org, Javier Martin , kernel@pengutronix.de, p.zabel@pengutronix.de, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Use this helper function instead of hardcoding the physical address of the IRAM in the i.MX27. Signed-off-by: Javier Martin --- drivers/media/video/Kconfig | 2 +- drivers/media/video/coda.c | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig index ecab6ef..0b5f785 100644 --- a/drivers/media/video/Kconfig +++ b/drivers/media/video/Kconfig @@ -1229,7 +1229,7 @@ config VIDEO_CODA depends on VIDEO_DEV && VIDEO_V4L2 && ARCH_MXC select VIDEOBUF2_DMA_CONTIG select V4L2_MEM2MEM_DEV - select IRAM_ALLOC if SOC_IMX53 + select IRAM_ALLOC ---help--- Coda is a range of video codec IPs that supports H.264, MPEG-4, and other video formats. diff --git a/drivers/media/video/coda.c b/drivers/media/video/coda.c index 7febcd9..96ecb3f 100644 --- a/drivers/media/video/coda.c +++ b/drivers/media/video/coda.c @@ -43,6 +43,7 @@ #define CODA_PARA_BUF_SIZE (10 * 1024) #define CODA_ISRAM_SIZE (2048 * 2) #define CODA7_IRAM_SIZE 0x14000 /* 81920 bytes */ +#define CODADX6_IRAM_SIZE 45056 #define CODA_MAX_FRAMEBUFFERS 2 @@ -1919,6 +1920,8 @@ static int __devinit coda_probe(struct platform_device *pdev) const struct of_device_id *of_id = of_match_device(of_match_ptr(coda_dt_ids), &pdev->dev); const struct platform_device_id *pdev_id; + void __iomem *iram_vaddr; + unsigned long iram_size; struct coda_dev *dev; struct resource *res; int ret, irq; @@ -2016,16 +2019,15 @@ static int __devinit coda_probe(struct platform_device *pdev) } if (dev->devtype->product == CODA_DX6) { - dev->iram_paddr = 0xffff4c00; + iram_size = CODADX6_IRAM_SIZE; } else { - void __iomem *iram_vaddr; + iram_size = CODA7_IRAM_SIZE; + } - iram_vaddr = iram_alloc(CODA7_IRAM_SIZE, - &dev->iram_paddr); - if (!iram_vaddr) { - dev_err(&pdev->dev, "unable to alloc iram\n"); - return -ENOMEM; - } + iram_vaddr = iram_alloc(iram_size, &dev->iram_paddr); + if (!iram_vaddr) { + dev_err(&pdev->dev, "unable to alloc iram\n"); + return -ENOMEM; } platform_set_drvdata(pdev, dev);