linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Booting uncompressed kernel image
@ 2009-01-26 11:17 Matteo Fortini
  2009-01-26 22:36 ` Wolfgang Denk
  0 siblings, 1 reply; 5+ messages in thread
From: Matteo Fortini @ 2009-01-26 11:17 UTC (permalink / raw)
  To: linuxppc-dev@ozlabs.org

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.

Has anyone done the same?

Thanks ,
Matteo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Booting uncompressed kernel image
@ 2009-01-26 11:30 Matteo Fortini
  2009-01-26 15:23 ` Luotao Fu
  0 siblings, 1 reply; 5+ messages in thread
From: Matteo Fortini @ 2009-01-26 11:30 UTC (permalink / raw)
  To: linuxppc-dev@ozlabs.org

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.

Has anyone done the same?

Thanks ,
Matteo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Booting uncompressed kernel image
  2009-01-26 11:30 Matteo Fortini
@ 2009-01-26 15:23 ` Luotao Fu
  0 siblings, 0 replies; 5+ messages in thread
From: Luotao Fu @ 2009-01-26 15:23 UTC (permalink / raw)
  To: Matteo Fortini; +Cc: linuxppc-dev@ozlabs.org

[-- Attachment #1: Type: text/plain, Size: 939 bytes --]

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

-- 
Pengutronix e.K.                           | Dipl.-Ing. Luotao Fu        |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


[-- Attachment #2: make_uncompressed_image.diff --]
[-- Type: text/plain, Size: 2164 bytes --]

Subject: Create an uncomrpessed uImage
From: Luotao Fu <l.fu@pengutronix.de>

This one adds a make target to create an uncomrpessed uImage format for powerpc,
which is usable by uboot. We call the target nuImage for now. We need this to
verify if we can boost up the boot speed.

Signed-off-by: Luotao Fu <l.fu@pengutrnoix.de>

---
 arch/powerpc/Makefile      |    2 +-
 arch/powerpc/boot/Makefile |    3 +++
 arch/powerpc/boot/wrapper  |   15 ++++++++++++++-
 3 files changed, 18 insertions(+), 2 deletions(-)

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)
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Booting uncompressed kernel image
  2009-01-26 11:17 Booting uncompressed kernel image Matteo Fortini
@ 2009-01-26 22:36 ` Wolfgang Denk
  2009-01-27 10:03   ` Matteo Fortini
  0 siblings, 1 reply; 5+ messages in thread
From: Wolfgang Denk @ 2009-01-26 22:36 UTC (permalink / raw)
  To: Matteo Fortini; +Cc: linuxppc-dev@ozlabs.org

Dear Matteo Fortini,

In message <497D9BC8.0@mta.it> you wrote:
>
> I built an uncompressed uImage using mkimage --no-gzip -C none in the 
> wrapper scripts.

Hm... you must be using a funny version of mkimage, then. The cod in
mainline will bail out on "--no-gzip".

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
If I can have honesty, it's easier to overlook mistakes.
	-- Kirk, "Space Seed", stardate 3141.9

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Booting uncompressed kernel image
  2009-01-26 22:36 ` Wolfgang Denk
@ 2009-01-27 10:03   ` Matteo Fortini
  0 siblings, 0 replies; 5+ messages in thread
From: Matteo Fortini @ 2009-01-27 10:03 UTC (permalink / raw)
  To: Wolfgang Denk; +Cc: linuxppc-dev@ozlabs.org

You're right,
to be precise, the --no-gzip option was given to the wrapper script, the 
option I gave to mkimage was -C none.

The change in the wrapper script was adding:
case "$platform" in
ubootraw)
    rm -f "$ofile"
    mkimage -A ppc -O linux -T kernel -C none -a 00000000 -e 00000000 \
    $uboot_version -d "$vmz" "$ofile"
    if [ -z "$cacheit" ]; then
    rm -f "$vmz"
    fi
    exit 0
    ;;
esac


and I called wrapper as
./arch/powerpc/boot/wrapper  -c -o arch/powerpc/boot/uImage -p ubootraw 
-C "powerpc-e300c3-linux-gnu-" --no-gzip vmlinux

Anyway, I'll check the solution given by Luotao, thanks!

Regards,
Matteo

Wolfgang Denk ha scritto:
> Dear Matteo Fortini,
>
> In message <497D9BC8.0@mta.it> you wrote:
>   
>> I built an uncompressed uImage using mkimage --no-gzip -C none in the 
>> wrapper scripts.
>>     
>
> Hm... you must be using a funny version of mkimage, then. The cod in
> mainline will bail out on "--no-gzip".
>
> Best regards,
>
> Wolfgang Denk
>
>   

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-01-27 10:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-26 11:17 Booting uncompressed kernel image Matteo Fortini
2009-01-26 22:36 ` Wolfgang Denk
2009-01-27 10:03   ` Matteo Fortini
  -- strict thread matches above, loose matches on Subject: below --
2009-01-26 11:30 Matteo Fortini
2009-01-26 15:23 ` Luotao Fu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).