From patchwork Fri Sep 19 08:50:10 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Korsgaard X-Patchwork-Id: 589 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 50B7ADDF59 for ; Fri, 19 Sep 2008 18:50:47 +1000 (EST) X-Original-To: linuxppc-dev@ozlabs.org Delivered-To: linuxppc-dev@ozlabs.org Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.159]) by ozlabs.org (Postfix) with ESMTP id 22D42DDD0B for ; Fri, 19 Sep 2008 18:50:16 +1000 (EST) Received: by fg-out-1718.google.com with SMTP id d23so528346fga.39 for ; Fri, 19 Sep 2008 01:50:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:to:cc:subject :date:message-id:x-mailer:sender; bh=V0LV/HRKTRuNLFNRp+M4a6LprVSJdQve20ycGbx44BQ=; b=I92f51xMNg8542UdrLjSQ9iQ4G0/URRMYi018Cd/8hXrfBR6SgNJL9CfhY0xZ79jF2 URBhfb0+8qHbur1EAgcqehaeTpkpeBTITzqoZojp7vii6iTpSsaGxioMyc1vrpwVLOkq J3AJRImp3cRa7QM2Yaii+uI+Dps7p55cJ77Ig= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:sender; b=dfdNm47GqaEPMq0Dl74V65GlkmJZa+u6A1zmArzvuh+akIYowdV8VoF866eL3yYncC nm3VZ5F/vm2oByWeXFbAo47YYF1LXmT89VUHYqq1DwJxkfCS3lzv5ggfGNLdaYFQnobQ 3sAPEOBrAYmZvoJpJBkHxWMj7QlT2FzRb2+hs= Received: by 10.86.98.14 with SMTP id v14mr1632547fgb.74.1221814214576; Fri, 19 Sep 2008 01:50:14 -0700 (PDT) Received: from macbook.be.48ers.dk ( [194.78.207.191]) by mx.google.com with ESMTPS id d4sm1527064fga.5.2008.09.19.01.50.12 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 19 Sep 2008 01:50:13 -0700 (PDT) Received: by macbook.be.48ers.dk (Postfix, from userid 1000) id ED76E98CD12; Fri, 19 Sep 2008 10:50:10 +0200 (CEST) From: Peter Korsgaard To: linuxppc-dev@ozlabs.org, grant.likely@secretlab.ca Subject: [PATCH v2] bootwrapper: support u-boot multi component images Date: Fri, 19 Sep 2008 10:50:10 +0200 Message-Id: <1221814210-4738-1-git-send-email-jacmet@sunsite.dk> X-Mailer: git-send-email 1.5.6.3 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: , MIME-Version: 1.0 Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@ozlabs.org From: peter Korsgaard Support uImage., which are U-Boot multi component images containing a kernel, dtb and possibly an initrd. Signed-off-by: Peter Korsgaard Acked-by: Grant Likely diff --git a/Documentation/powerpc/bootwrapper.txt b/Documentation/powerpc/bootwrapper.txt index d60fced..fa2e014 100644 --- a/Documentation/powerpc/bootwrapper.txt +++ b/Documentation/powerpc/bootwrapper.txt @@ -91,6 +91,10 @@ Currently, the following image format targets exist: a device tree to the kernel at boot. If using an older version of U-Boot, then you need to use a cuImage instead. + uImage.%: U-Boot multi component image. Similar to uImage, + except device tree blob is embedded inside the + image together with the kernel (and potentially + an initrd). zImage.%: Image format which does not embed a device tree. Used by OpenFirmware and other firmware interfaces which are able to supply a device tree. This image diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 717a3bc..8d2e789 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile @@ -282,8 +282,9 @@ image-y += $(subst ",,$(CONFIG_EXTRA_TARGETS)) initrd- := $(patsubst zImage%, zImage.initrd%, $(image-n) $(image-)) initrd-y := $(patsubst zImage%, zImage.initrd%, \ $(patsubst dtbImage%, dtbImage.initrd%, \ + $(patsubst uImage.%, uImage.initrd.%, \ $(patsubst simpleImage%, simpleImage.initrd%, \ - $(patsubst treeImage%, treeImage.initrd%, $(image-y))))) + $(patsubst treeImage%, treeImage.initrd%, $(image-y)))))) initrd-y := $(filter-out $(image-y), $(initrd-y)) targets += $(image-y) $(initrd-y) @@ -316,6 +317,12 @@ $(obj)/zImage.iseries: vmlinux $(obj)/uImage: vmlinux $(wrapperbits) $(call if_changed,wrap,uboot) +$(obj)/uImage.initrd.%: vmlinux $(wrapperbits) $(obj)/%.dtb + $(call if_changed,wrap,uboot-$*,,$(obj)/$*.dtb,$(obj)/ramdisk.image.gz) + +$(obj)/uImage.%: vmlinux $(wrapperbits) $(obj)/%.dtb + $(call if_changed,wrap,uboot-$*,,$(obj)/$*.dtb) + $(obj)/cuImage.%: vmlinux $(obj)/%.dtb $(wrapperbits) $(call if_changed,wrap,cuboot-$*,,$(obj)/$*.dtb) @@ -352,7 +359,7 @@ install: $(CONFIGURE) $(addprefix $(obj)/, $(image-y)) clean-files += $(image-) $(initrd-) cuImage.* dtbImage.* treeImage.* \ zImage zImage.initrd zImage.chrp zImage.coff zImage.holly \ zImage.iseries zImage.miboot zImage.pmac zImage.pseries \ - otheros.bld *.dtb + otheros.bld uImage* *.dtb # clean up files cached by wrapper clean-kernel := vmlinux.strip vmlinux.bin diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper index 965c237..548b087 100755 --- a/arch/powerpc/boot/wrapper +++ b/arch/powerpc/boot/wrapper @@ -153,7 +153,7 @@ coff) lds=$object/zImage.coff.lds link_address='0x500000' ;; -miboot|uboot) +miboot|uboot*) # miboot and U-boot want just the bare bits, not an ELF binary ext=bin objflags="-O binary" @@ -262,6 +262,24 @@ uboot) fi exit 0 ;; +uboot-*) + rm -f "$ofile" + # we always need an initrd - create a dummy initrd if none provided + if [ ! -f "initrd" ]; then + initrd="$tmpdir/dummy.initrd" + echo -n fill >$initrd + fi + mkimage -A ppc -O linux -T multi -C gzip -a $membase -e $membase \ + $uboot_version -d "$vmz:$initrd:$dtb" "$ofile" + if [ "$initrd" == "$tmpdir/dummy.initrd" ]; then + rm $initrd; + fi + if [ -z "$cacheit" ]; then + rm -f "$vmz" + fi + exit 0 + ;; + esac addsec() {