From patchwork Mon Jan 26 15:23:35 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luotao Fu X-Patchwork-Id: 20290 X-Patchwork-Delegate: grant.likely@secretlab.ca 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 DD58BDE31C for ; Tue, 27 Jan 2009 02:24:14 +1100 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [92.198.50.35]) by ozlabs.org (Postfix) with ESMTP id 13A77DE0D3 for ; Tue, 27 Jan 2009 02:23:42 +1100 (EST) Received: from [2001:6f8:1178:2:219:66ff:fe5b:d078] by metis.ext.pengutronix.de with esmtp (Exim 4.63) (envelope-from ) id 1LRTJI-0004Iz-BK; Mon, 26 Jan 2009 16:23:36 +0100 Message-ID: <497DD577.9040209@pengutronix.de> Date: Mon, 26 Jan 2009 16:23:35 +0100 From: Luotao Fu User-Agent: Mozilla-Thunderbird 2.0.0.12 (X11/20080420) MIME-Version: 1.0 To: Matteo Fortini Subject: Re: Booting uncompressed kernel image References: <497D9EF1.4030403@mta.it> In-Reply-To: <497D9EF1.4030403@mta.it> X-Enigmail-Version: 0.95.0 X-SA-Exim-Connect-IP: 2001:6f8:1178:2:219:66ff:fe5b:d078 X-SA-Exim-Mail-From: l.fu@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linuxppc-dev@ozlabs.org Cc: "linuxppc-dev@ozlabs.org" 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 Matteo Fortini wrote: > Hi all, > I built an uncompressed uImage using mkimage --no-gzip -C none in the > wrapper scripts. > Only, u-boot recognizes it as uncompressed and launches the kernel > properly (it's around 4MB), but in the end linux just prints > OK and stops. Powerpc make compress the bin image with gzip first, before it generates the image header. If the u-boot reads the image header properly doesn't mean that the kernel is really unpacked. > > Has anyone done the same? me ;-) I did it with a mpc5200b board and linux 2.6.23. You can try the patch attached to this mail. It worked for me[TM]. ;-) Cheers Luotao Fu Index: arch/powerpc/boot/wrapper =================================================================== --- arch/powerpc/boot/wrapper.orig +++ arch/powerpc/boot/wrapper @@ -133,7 +133,7 @@ coff) platformo=$object/of.o lds=$object/zImage.coff.lds ;; -miboot|uboot) +miboot|uboot|decuboot) # miboot and U-boot want just the bare bits, not an ELF binary ext=bin objflags="-O binary" @@ -190,6 +190,19 @@ uboot) fi exit 0 ;; +decuboot) + rm -f "$ofile" + vmz_uncomp=`basename $vmz $gzip` + gunzip -c $vmz > $vmz_uncomp + mkimage -A ppc -O linux -T kernel -C none -a 00000000 -e 00000000 \ + $uboot_version -d "$vmz_uncomp" "$ofile" + rm $vmz_uncomp + vmz="$vmz$gzip" + if [ -z "$cacheit" ]; then + rm -f "$vmz" + fi + exit 0 + ;; esac addsec() { Index: arch/powerpc/boot/Makefile =================================================================== --- arch/powerpc/boot/Makefile.orig +++ arch/powerpc/boot/Makefile @@ -195,6 +195,9 @@ $(obj)/zImage.initrd.ps3: vmlinux $(wra $(obj)/uImage: vmlinux $(wrapperbits) $(call if_changed,wrap,uboot) +$(obj)/nuImage: vmlinux $(wrapperbits) + $(call if_changed,wrap,decuboot) + $(obj)/cuImage.%: vmlinux $(dts) $(wrapperbits) $(call if_changed,wrap,cuboot-$*,$(dts)) Index: arch/powerpc/Makefile =================================================================== --- arch/powerpc/Makefile.orig +++ arch/powerpc/Makefile @@ -148,7 +148,7 @@ all: $(KBUILD_IMAGE) CPPFLAGS_vmlinux.lds := -Upowerpc -BOOT_TARGETS = zImage zImage.initrd uImage +BOOT_TARGETS = zImage zImage.initrd uImage nuImage PHONY += $(BOOT_TARGETS)