From patchwork Wed Oct 3 14:55:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matt Porter X-Patchwork-Id: 1541891 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 642FF3FD9C for ; Wed, 3 Oct 2012 14:57:46 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TJQMG-0000uX-6Q; Wed, 03 Oct 2012 14:55:32 +0000 Received: from mail-ie0-f177.google.com ([209.85.223.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TJQLv-0000ki-DK for linux-arm-kernel@lists.infradead.org; Wed, 03 Oct 2012 14:55:12 +0000 Received: by ieje14 with SMTP id e14so18534001iej.36 for ; Wed, 03 Oct 2012 07:55:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=N9lrGIQ7BHHXuQPsXsveNVf7OZaMTr+XiteBtIP8QWU=; b=g3YIjZQQNBA01Ni4oFdaafPiY2QCqjjDrf4j3PSdtcivV4Bd/HHXmR3gB4WuOtyC2N S5KaVsYj9weGlNmyTv7haWnw6HXr2fdtMEs2F3XqvCGXE5FbcIaUX0Y//66EfRF1WLvX SBGpLoEiU9d8tB5dU2FHnuyIpjOAhYM+8MbEDmdfg85UXR7k554P+LOox9MtQwQpwxL1 /BsiW8bSQac06Y7luiGcIMjFFR0zszS7lnahksS66h90H3c+xXWFSe6LE1Io4sRVYFB3 SvR4VJWEwlWG22UF+pdmkGUGYiRnFI5z0RC/coh9PnTWR+H0qq5waz51ATRILSq9XBNR 0YuA== Received: by 10.50.169.34 with SMTP id ab2mr2046629igc.68.1349276110880; Wed, 03 Oct 2012 07:55:10 -0700 (PDT) Received: from beef.ohporter.com (cpe-24-166-64-7.neo.res.rr.com. [24.166.64.7]) by mx.google.com with ESMTPS id mi10sm3462058igc.16.2012.10.03.07.55.09 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 03 Oct 2012 07:55:10 -0700 (PDT) From: Matt Porter To: Greg Kroah-Hartman , "Hans J. Koch" , Sekhar Nori Subject: [PATCH v3 1/6] ARM: davinci: sram: ioremap the davinci_soc_info specified sram regions Date: Wed, 3 Oct 2012 10:55:28 -0400 Message-Id: <1349276133-26408-2-git-send-email-mporter@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1349276133-26408-1-git-send-email-mporter@ti.com> References: <1349276133-26408-1-git-send-email-mporter@ti.com> X-Spam-Note: CRM114 invocation failed 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.223.177 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (ohiomdp[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Ben Gardiner , Linux DaVinci Kernel List , Russell King , Linux Kernel Mailing List , Linux ARM Kernel List 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 From: Ben Gardiner The current davinci init sets up SRAM in iotables. There has been an observed failure to boot a da850 with 128K specified in the iotable. Make the davinci sram allocator -- now based on RMK's consolidated SRAM support -- do an ioremap of the region specified by the entries in davinci_soc_info before registering with gen_pool_add_virt(). This commit breaks runtime of davinci boards since the regions that the sram init is now trying to ioremap have been iomapped by their iotable entries. The iotable entries will be removed in the patches to come. Signed-off-by: Ben Gardiner [rebased to mainline as the consolidated SRAM support was dropped] Signed-off-by: Matt Porter --- arch/arm/mach-davinci/sram.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-davinci/sram.c b/arch/arm/mach-davinci/sram.c index db0f778..0e8ca4f 100644 --- a/arch/arm/mach-davinci/sram.c +++ b/arch/arm/mach-davinci/sram.c @@ -10,6 +10,7 @@ */ #include #include +#include #include #include @@ -32,7 +33,7 @@ void *sram_alloc(size_t len, dma_addr_t *dma) return NULL; if (dma) - *dma = dma_base + (vaddr - SRAM_VIRT); + *dma = gen_pool_virt_to_phys(sram_pool, vaddr); return (void *)vaddr; } @@ -53,8 +54,10 @@ EXPORT_SYMBOL(sram_free); */ static int __init sram_init(void) { + phys_addr_t phys = davinci_soc_info.sram_dma; unsigned len = davinci_soc_info.sram_len; int status = 0; + void *addr; if (len) { len = min_t(unsigned, len, SRAM_SIZE); @@ -62,8 +65,16 @@ static int __init sram_init(void) if (!sram_pool) status = -ENOMEM; } - if (sram_pool) - status = gen_pool_add(sram_pool, SRAM_VIRT, len, -1); + + if (sram_pool) { + addr = ioremap(phys, len); + if (!addr) + return -ENOMEM; + if((status = gen_pool_add_virt(sram_pool, (unsigned)addr, + phys, len, -1))) + iounmap(addr); + } + WARN_ON(status < 0); return status; }