From patchwork Thu Apr 8 15:32:56 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rabin Vincent X-Patchwork-Id: 91296 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o38G2bPa015166 for ; Thu, 8 Apr 2010 16:02:38 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932677Ab0DHQCh (ORCPT ); Thu, 8 Apr 2010 12:02:37 -0400 Received: from kelvin.asmallorange.com ([207.210.111.10]:57896 "EHLO kelvin.asmallorange.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932574Ab0DHQCg (ORCPT ); Thu, 8 Apr 2010 12:02:36 -0400 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 08 Apr 2010 16:02:45 +0000 (UTC) X-Greylist: delayed 1725 seconds by postgrey-1.27 at vger.kernel.org; Thu, 08 Apr 2010 12:02:36 EDT Received: from [59.164.193.132] (port=44257 helo=debian) by kelvin.asmallorange.com with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1Nztip-0007mR-7c; Thu, 08 Apr 2010 11:32:48 -0400 Date: Thu, 8 Apr 2010 21:02:56 +0530 From: Rabin Vincent To: Russell King - ARM Linux Cc: linux-arm-kernel@lists.infradead.org, Tony Lindgren , linux-omap@vger.kernel.org Subject: Re: [RFC] Initial attempt to make ARM use LMB Message-ID: <20100408153111.GA2598@debian> References: <20100325233248.GM24984@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100325233248.GM24984@n2100.arm.linux.org.uk> User-Agent: Mutt/1.5.20 (2009-06-14) X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - kelvin.asmallorange.com X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - rab.in X-Source: X-Source-Args: X-Source-Dir: Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c index 8b2853a..8c12214 100644 --- a/arch/arm/mm/init.c +++ b/arch/arm/mm/init.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -32,9 +33,6 @@ #include "mm.h" -static unsigned long phys_initrd_start __initdata = 0; -static unsigned long phys_initrd_size __initdata = 0; - static int __init early_initrd(char *p) { unsigned long start, size; @@ -44,8 +42,8 @@ static int __init early_initrd(char *p) if (*endp == ',') { size = memparse(endp + 1, NULL); - phys_initrd_start = start; - phys_initrd_size = size; + initrd_start = __phys_to_virt(start); + initrd_end = initrd_start + size; } return 0; } @@ -55,8 +53,8 @@ static int __init parse_tag_initrd(const struct tag *tag) { printk(KERN_WARNING "ATAG_INITRD is deprecated; " "please update your bootloader.\n"); - phys_initrd_start = __virt_to_phys(tag->u.initrd.start); - phys_initrd_size = tag->u.initrd.size; + initrd_start = tag->u.initrd.start; + initrd_end = initrd_start + tag->u.initrd.size; return 0; } @@ -64,8 +62,8 @@ __tagtable(ATAG_INITRD, parse_tag_initrd); static int __init parse_tag_initrd2(const struct tag *tag) { - phys_initrd_start = tag->u.initrd.start; - phys_initrd_size = tag->u.initrd.size; + initrd_start = __phys_to_virt(tag->u.initrd.start); + initrd_end = initrd_start + tag->u.initrd.size; return 0; } @@ -284,7 +282,7 @@ void __init arm_lmb_reserve(void) #else lmb_reserve(__pa(_stext), _end - _stext); #endif - lmb_reserve(phys_initrd_start, phys_initrd_size); + lmb_reserve(__pa(initrd_start), initrd_end - initrd_start); arm_mm_lmb_reserve(); }