From patchwork Tue Sep 23 20:38:57 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 1173 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 50957DE776 for ; Wed, 24 Sep 2008 06:39:20 +1000 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from www.tglx.de (www.tglx.de [62.245.132.106]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 0FA87DE578 for ; Wed, 24 Sep 2008 06:39:06 +1000 (EST) Received: from www.tglx.de (www.tglx.de [127.0.0.1]) by www.tglx.de (8.13.8/8.13.8/TGLX-2007100201) with ESMTP id m8NKcvdE020936 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 23 Sep 2008 22:38:57 +0200 Received: (from bigeasy@localhost) by www.tglx.de (8.13.8/8.13.8/Submit) id m8NKcvaq020935 for linuxppc-dev@ozlabs.org; Tue, 23 Sep 2008 22:38:57 +0200 Date: Tue, 23 Sep 2008 22:38:57 +0200 From: Sebastian Siewior To: linuxppc-dev@ozlabs.org Subject: [RFC] powerpc/boot: compare _start against ei.loadsize instead ei.memsize Message-ID: <20080923203857.GB10935@www.tglx.de> Mime-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.4.2.2i X-Key-Id: 97C4700B X-Key-Fingerprint: 09E2 D1F3 9A3A FF13 C3D3 961C 0688 1C1E 97C4 700B X-Virus-Scanned: ClamAV 0.93.2/8314/Tue Sep 23 02:50:20 2008 on www.tglx.de X-Virus-Status: Clean X-Spam-Status: No, score=-1.4 required=5.0 tests=ALL_TRUSTED, AWL autolearn=ham version=3.2.4 X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on www.tglx.de X-BeenThere: linuxppc-dev@ozlabs.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org My mylinux binary incl. bss is ~5 MiB without bss less than 4 MiB. Therefore I though that I could replace ei.memsize with ei.loadsize. It didn't work. I'm not sure why it did not work but I guess that the memset() of bss in the initial kernel code overwrote the cuimage code which is required for some reason. Maybe some device-tree callbacks. My current (working) solution is to move cuImage from 4 MiB to 8 MiB. Something similar has been done for pSeries in 9b09c6d "powerpc: Change the default link address for pSeries zImage kernels". Would it be appropriate to move initial address to 64 MiB as the default loading address or do we have here some boards which have only 64 MiB of memory? Does someone have another idea? --- a/arch/powerpc/boot/main.c +++ b/arch/powerpc/boot/main.c @@ -56,7 +56,7 @@ static struct addr_range prep_kernel(void) if (platform_ops.vmlinux_alloc) { addr = platform_ops.vmlinux_alloc(ei.memsize); } else { - if ((unsigned long)_start < ei.memsize) + if ((unsigned long)_start < ei.loadsize) fatal("Insufficient memory for kernel at address 0!" " (_start=%p)\n\r", _start); } -- --- a/arch/powerpc/boot/wrapper +++ b/arch/powerpc/boot/wrapper @@ -138,7 +138,7 @@ objflags=-S tmp=$tmpdir/zImage.$$.o ksection=.kernel:vmlinux.strip isection=.kernel:initrd -link_address='0x400000' +link_address='0x800000' case "$platform" in pseries)