From patchwork Tue May 17 21:41:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Gardiner X-Patchwork-Id: 792412 Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4HLiIqT007589 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 17 May 2011 21:44:39 GMT Received: from dlep35.itg.ti.com ([157.170.170.118]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id p4HLhLWO015530 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 17 May 2011 16:43:21 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep35.itg.ti.com (8.13.7/8.13.7) with ESMTP id p4HLhJPo013724; Tue, 17 May 2011 16:43:20 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id C7AF78062C; Tue, 17 May 2011 16:43:19 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp53.itg.ti.com (dflp53.itg.ti.com [128.247.5.6]) by linux.omap.com (Postfix) with ESMTP id 7DC6180627 for ; Tue, 17 May 2011 16:42:13 -0500 (CDT) Received: from neches.ext.ti.com (localhost [127.0.0.1]) by dflp53.itg.ti.com (8.13.8/8.13.8) with ESMTP id p4HLgCtw026999 for ; Tue, 17 May 2011 16:42:12 -0500 (CDT) Received: from psmtp.com (na3sys009amx239.postini.com [74.125.149.123]) by neches.ext.ti.com (8.13.7/8.13.7) with SMTP id p4HLgCKx011909 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 17 May 2011 16:42:12 -0500 Received: from na3sys009aog114.obsmtp.com ([209.85.213.44]) (using TLSv1) by na3sys009amx239.postini.com ([74.125.148.10]) with SMTP; Tue, 17 May 2011 14:42:12 PDT Received: from mail-yw0-f44.google.com ([209.85.213.44]) (using TLSv1) by na3sys009aob114.postini.com ([74.125.148.12]) with SMTP ID DSNKTdLrs3HdStk9D1+wqXsh39ZutUj795R8@postini.com; Tue, 17 May 2011 14:42:12 PDT Received: by mail-yw0-f44.google.com with SMTP id 31so376275ywp.31 for ; Tue, 17 May 2011 14:42:11 -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=9XdvHxURCW1bFLwZA09iwUzwzml0cSft+UaHGQFDO/8=; b=ezBbgiWCO+V1dt6v4xWusnJlStdaN5rqJv8ylDAnMCIbEX49iOvVEEKEwOCkEI2IC/ YzbyIYTuJpflPuqYtfXquk82YWNdZFJ6VP9izBd4yowgwxC6tHktYZdVWGK1F454u9Qx Z3++W2kiv1ctTWT4IbJ2DhPkp2wBO8cCGfHZc= 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=LHqmWKlDLtFcw54fcIcMVgMpAT/tXb7Lbngb6Xo4nGH9lkEbrsOtfuDva5LuB7uzKV 3WOdG0NAlRS/r2mLJGYOFsBzkTL0KA7c0ExTf4C177Lv2DaYPFtUMRbucNrvvXHpSFOw nTM+pLLoSmK3VUDo7nZf4HtpwSdilqAKtVgvc= Received: by 10.150.59.13 with SMTP id h13mr296718yba.35.1305668531790; Tue, 17 May 2011 14:42:11 -0700 (PDT) Received: from localhost.localdomain ([206.191.47.130]) by mx.google.com with ESMTPS id s18sm459367ybg.10.2011.05.17.14.42.09 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 May 2011 14:42:10 -0700 (PDT) From: Ben Gardiner To: Sekhar Nori , davinci-linux-open-source@linux.davincidsp.com Subject: [PATCH 2/9] davinci: sram: ioremap the davinci_soc_info specified sram regions Date: Tue, 17 May 2011 17:41:58 -0400 Message-Id: <80c0c2ff5a39baf6140c08460c2691b178c038c0.1305668470.git.bengardiner@nanometrics.ca> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: References: X-pstn-neptune: 0/0/0.00/0 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 , Russell King - ARM Linux , 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@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Greylist: Sender succeeded STARTTLS authentication, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 17 May 2011 21:44:40 +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 pv_pool_create(). 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 --- arch/arm/mach-davinci/sram.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-davinci/sram.c b/arch/arm/mach-davinci/sram.c index 219d4c5..96026df 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 #include @@ -26,16 +27,23 @@ EXPORT_SYMBOL_GPL(davinci_pv_pool); */ static int __init sram_init(void) { + void *addr; unsigned len = davinci_soc_info.sram_len; int status = 0; if (len) { len = min_t(unsigned, len, SRAM_SIZE); - davinci_pv_pool = pv_pool_create((void *)SRAM_VIRT, + addr = ioremap(davinci_soc_info.sram_phys, len); + if (!addr) + return -EIO; + + davinci_pv_pool = pv_pool_create(addr, davinci_soc_info.sram_phys, len, ilog2(SRAM_GRANULARITY)); - if (!davinci_pv_pool) + if (!davinci_pv_pool) { + iounmap(addr); status = -ENOMEM; + } } return status; }