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: 1541941 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by patchwork1.kernel.org (Postfix) with ESMTP id A28103FD9C for ; Wed, 3 Oct 2012 14:57:52 +0000 (UTC) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id q93EuHS7001866; Wed, 3 Oct 2012 09:56:17 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id q93EuHSL030830; Wed, 3 Oct 2012 09:56:17 -0500 Received: from dlelxv24.itg.ti.com (172.17.1.199) by dfle73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.1.323.3; Wed, 3 Oct 2012 09:56:17 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id q93EuHPO025374; Wed, 3 Oct 2012 09:56:17 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id E59908062F; Wed, 3 Oct 2012 09:56:16 -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 2DDFE8062A for ; Wed, 3 Oct 2012 09:55:12 -0500 (CDT) Received: from white.ext.ti.com (white.ext.ti.com [192.94.93.38]) by dflp53.itg.ti.com (8.13.8/8.13.8) with ESMTP id q93EtBJs007900 for ; Wed, 3 Oct 2012 09:55:11 -0500 (CDT) Received: from psmtp.com (na3sys009amx216.postini.com [74.125.149.56]) by white.ext.ti.com (8.13.7/8.13.7) with SMTP id q93EtBvk014439 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 3 Oct 2012 09:55:11 -0500 Received: from mail-ie0-f173.google.com ([209.85.223.173]) (using TLSv1) by na3sys009amx216.postini.com ([74.125.148.10]) with SMTP; Wed, 03 Oct 2012 14:55:11 GMT Received: by mail-ie0-f173.google.com with SMTP id 17so16358094iea.4 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-pstn-neptune: 0/0/0.00/0 X-pstn-levels: (S:72.41586/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-dkim: 1 skipped:not-enabled X-pstn-settings: 2 (0.5000:0.0050) s cv GT3 gt2 gt1 r p m c X-pstn-addresses: from [82/3] CC: Linux DaVinci Kernel List , Russell King , Linux Kernel Mailing List , Linux ARM Kernel List 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: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com 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; }