From patchwork Wed Jun 1 15:03:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Gardiner X-Patchwork-Id: 840532 Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p51F687A019153 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 1 Jun 2011 15:06:29 GMT Received: from canuck.infradead.org ([134.117.69.58]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1QRmxY-0005nF-HW; Wed, 01 Jun 2011 15:03:48 +0000 Received: from localhost ([127.0.0.1] helo=canuck.infradead.org) by canuck.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1QRmxY-0005ZX-3Q; Wed, 01 Jun 2011 15:03:48 +0000 Received: from na3sys009aog103.obsmtp.com ([74.125.149.71]) by canuck.infradead.org with smtps (Exim 4.76 #1 (Red Hat Linux)) id 1QRmxK-0005Xl-AN for linux-arm-kernel@lists.infradead.org; Wed, 01 Jun 2011 15:03:35 +0000 Received: from mail-qy0-f181.google.com ([209.85.216.181]) (using TLSv1) by na3sys009aob103.postini.com ([74.125.148.12]) with SMTP ID DSNKTeZUw0X+G/elxQ3oegJtC93+1r/eKMLp@postini.com; Wed, 01 Jun 2011 08:03:34 PDT Received: by mail-qy0-f181.google.com with SMTP id 14so3565541qyg.5 for ; Wed, 01 Jun 2011 08:03:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nanometrics.ca; s=google; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=60HUtqZsNaFBRVVcQ1wrwEs60mZP1kit6M0iLNgFQ1k=; b=WxdMo68EqOCqopJmmohwkyLTyur71YLNkTD/WY6+savpQ2DEyCFZCI3W2PW/bRrjhq lVAmPpapfEoNSe9M3nC685slKBQXMSAbWmr9jT+N1jy293RGrcHYKTXiJLSuAKzHOhzp VXGAAvB6yt+I89MXe2vJPgOKpykAQz3RbLmqI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=nanometrics.ca; s=google; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=nrZS7EUW/qUB0Z2xTZtnfwYWJeNx4/9USPmIdOZ7ZPDtP38gFgn2aqDDdDpNhp4Ngz 6w4bdN0lcPJOr1MRg5zC7V70v9ZxRbBfJYQKlLtZB/zo7BHi/3eVtC4jPqGLXeyqQE4p YzLA7pCh/CcNwWa3efsgXB7ATC9fSRARdjE1w= Received: by 10.224.195.133 with SMTP id ec5mr5480197qab.100.1306940610967; Wed, 01 Jun 2011 08:03:30 -0700 (PDT) Received: from localhost.localdomain ([206.191.47.130]) by mx.google.com with ESMTPS id f16sm714512qck.33.2011.06.01.08.03.28 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 01 Jun 2011 08:03:29 -0700 (PDT) From: Ben Gardiner To: Sekhar Nori , davinci-linux-open-source@linux.davincidsp.com Subject: [PATCH 1/3] [v3] davinci: sram: ioremap the davinci_soc_info specified sram regions Date: Wed, 1 Jun 2011 11:03:23 -0400 Message-Id: <0787ab1fe2a1db4f18feb4b45f6ba44f90e9da59.1306940448.git.bengardiner@nanometrics.ca> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: References: <20110601051753.GA5153@game.jcrosoft.org> X-CRM114-Version: 20090807-BlameThorstenAndJenny ( TRE 0.7.6 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20110601_110334_655692_3EA72B57 X-CRM114-Status: GOOD ( 17.19 ) X-Spam-Score: -2.4 (--) X-Spam-Report: SpamAssassin version 3.3.1 on canuck.infradead.org summary: Content analysis details: (-2.4 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, medium trust [74.125.149.71 listed in list.dnswl.org] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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: Subhasish Ghosh , Jean-Christophe PLAGNIOL-VILLARD , Russell King - ARM Linux , Sergei Shtylyov , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.12 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 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 01 Jun 2011 15:06:29 +0000 (UTC) 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 CC: Sekhar Nori Acked-by: Jean-Christophe PLAGNIOL-VILLARD --- Changes since v2: * Added Jean-Christophe PLAGNIOL-VILLARD's Ack Changes since v1: * return -ENOMEM if ioremap fails (Sekhar Nori) --- arch/arm/mach-davinci/sram.c | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-davinci/sram.c b/arch/arm/mach-davinci/sram.c index 2c53db2..68b05d5 100644 --- a/arch/arm/mach-davinci/sram.c +++ b/arch/arm/mach-davinci/sram.c @@ -8,6 +8,7 @@ * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. */ +#include #include #include @@ -25,6 +26,7 @@ EXPORT_SYMBOL_GPL(davinci_gen_pool); */ static int __init sram_init(void) { + void *addr; unsigned len = davinci_soc_info.sram_len; if (!len) @@ -36,8 +38,12 @@ static int __init sram_init(void) if (!davinci_gen_pool) return -ENOMEM; - WARN_ON(gen_pool_add_virt(davinci_gen_pool, SRAM_VIRT, - davinci_soc_info.sram_phys, len, -1)); + addr = ioremap(davinci_soc_info.sram_phys, len); + if (!addr) + return -ENOMEM; + if(WARN_ON(gen_pool_add_virt(davinci_gen_pool, addr, + davinci_soc_info.sram_phys, len, -1))) + iounmap(addr); return 0; }