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: 840522 Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p51F3n9Y016496 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 1 Jun 2011 15:04:19 GMT Received: from dlep34.itg.ti.com ([157.170.170.115]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id p51F3iaw019455 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 1 Jun 2011 10:03:48 -0500 Received: from linux.omap.com (smtp-le.itg.ti.com [157.170.170.27]) by dlep34.itg.ti.com (8.13.7/8.13.8) with ESMTP id p51F3feZ029873 for ; Wed, 1 Jun 2011 10:03:43 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 280FF80636 for ; Wed, 1 Jun 2011 10:03:41 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp52.itg.ti.com (dflp52.itg.ti.com [128.247.22.96]) by linux.omap.com (Postfix) with ESMTP id DEBC180626 for ; Wed, 1 Jun 2011 10:03:32 -0500 (CDT) Received: from neches.ext.ti.com (neches.ext.ti.com [192.91.81.29]) by dflp52.itg.ti.com (8.13.7/8.13.8) with ESMTP id p51F3WSF006486 for ; Wed, 1 Jun 2011 10:03:32 -0500 (CDT) Received: from psmtp.com (na3sys009amx207.postini.com [74.125.149.47]) by neches.ext.ti.com (8.13.7/8.13.7) with SMTP id p51F3ViL018034 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 1 Jun 2011 10:03:31 -0500 Received: from na3sys009aog115.obsmtp.com ([209.85.216.176]) (using TLSv1) by na3sys009amx207.postini.com ([74.125.148.10]) with SMTP; Wed, 01 Jun 2011 08:03:31 PDT Received: from mail-qy0-f176.google.com ([209.85.216.176]) (using TLSv1) by na3sys009aob115.postini.com ([74.125.148.12]) with SMTP ID DSNKTeZUw0X+G/elxQ3oegJtC93+1r/eKMLp@postini.com; Wed, 01 Jun 2011 08:03:31 PDT Received: by mail-qy0-f176.google.com with SMTP id 30so3736652qyk.14 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-pstn-levels: (S:99.90000/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-settings: 2 (0.5000:0.0750) s cv GT3 gt2 gt1 r p m c X-pstn-addresses: from [db-null] Cc: Subhasish Ghosh , Jean-Christophe PLAGNIOL-VILLARD , Russell King - ARM Linux , Sergei Shtylyov , linux-arm-kernel@lists.infradead.org X-BeenThere: davinci-linux-open-source@linux.davincidsp.com 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: davinci-linux-open-source-bounces+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces+patchwork-davinci=patchwork.kernel.org@linux.davincidsp.com X-Greylist: Sender succeeded STARTTLS authentication, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 01 Jun 2011 15:04:19 +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; }