From patchwork Tue May 31 21:46:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Gardiner X-Patchwork-Id: 834042 Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p4VLmn6W010177 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 31 May 2011 21:49:11 GMT Received: from dlep34.itg.ti.com ([157.170.170.115]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id p4VLlhui021454 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 31 May 2011 16:47:43 -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 p4VLlgK8012580; Tue, 31 May 2011 16:47:42 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id D893980626; Tue, 31 May 2011 16:47:42 -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 38A4280626 for ; Tue, 31 May 2011 16:46:49 -0500 (CDT) Received: from medina.ext.ti.com (medina.ext.ti.com [192.91.81.31]) by dflp53.itg.ti.com (8.13.8/8.13.8) with ESMTP id p4VLknVv025790 for ; Tue, 31 May 2011 16:46:49 -0500 (CDT) Received: from psmtp.com (na3sys009amx218.postini.com [74.125.149.58]) by medina.ext.ti.com (8.13.7/8.13.7) with SMTP id p4VLkm46017554 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 31 May 2011 16:46:48 -0500 Received: from na3sys009aog112.obsmtp.com ([209.85.216.46]) (using TLSv1) by na3sys009amx218.postini.com ([74.125.148.10]) with SMTP; Tue, 31 May 2011 14:46:48 PDT Received: from mail-qw0-f46.google.com ([209.85.216.46]) (using TLSv1) by na3sys009aob112.postini.com ([74.125.148.12]) with SMTP ID DSNKTeVhyIBY/gHmcuWwFRFi6ZAJ6iOVj/sc@postini.com; Tue, 31 May 2011 14:46:48 PDT Received: by mail-qw0-f46.google.com with SMTP id 3so3181971qwk.5 for ; Tue, 31 May 2011 14:46:48 -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=Jsk+gEEPvX+O8pU0jUJ7B6MROLmd7H0ozAaXyADcUMY=; b=lq/tosRNqFtVssDxST2lkcLxayom+okgn0Ty8g9xcIWsfiK5CAeq9unJVgjqXpOLxa bNRO4goBbR0ItGwFJF/4l3GDOqJrMpkKHo4jX6gH06y3A3QLyGVDEgjwtlGN5Bj70LdK dd5IfrfZUIjmPo4OuUr+mcC5CyQzpKzl9/qnc= 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=ApcI28RTEZ/peVwh0NjygRvgK0T3XBdCgrhJeQbL+V28z4KNI4067G28p6WBRIfJ3T ytSmddYhk9fLyy09tKWiFQx4PErLWKCcSWVbxVE9knJ9wBKGwFL5qxSi9RCq2r45w81/ aOkXVNylnzQESVjIVzptXmvLmClWzbizlxaj0= Received: by 10.224.181.142 with SMTP id by14mr4653128qab.122.1306878407803; Tue, 31 May 2011 14:46:47 -0700 (PDT) Received: from localhost.localdomain ([206.191.47.130]) by mx.google.com with ESMTPS id t28sm292996qcs.5.2011.05.31.14.46.45 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 31 May 2011 14:46:46 -0700 (PDT) From: Ben Gardiner To: Sekhar Nori , davinci-linux-open-source@linux.davincidsp.com Subject: [PATCH 1/3] [v2] davinci: sram: ioremap the davinci_soc_info specified sram regions Date: Tue, 31 May 2011 17:46:41 -0400 Message-Id: <3406118d1598e5e279108dd94c63ced1fa8d02bc.1306877621.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 , 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@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, 31 May 2011 21:49:11 +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 CC: Sekhar Nori --- 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; }