Re: [PATCH] powerpc/bootwrapper: Add documentation of boot wrapper targets
flat view
From: Peter Mendham <hidden>
Date: 2008-06-26 17:21:17
Thanks for this documentation - I found it very illuminating. My question was going to be similar to Stephen's in that I don't find it clear which of the images with an embedded device tree I should be using. This is all in contrast to the Xilinx git tree where I just use zImage with a config option for embedding the device tree... -- Peter Stephen Neuendorffer wrote:
My unanswered questions: 1) Why are there 4 different types of targets that embed a device tree? I assume they differ in how they are started loaded, but (unfortunately) the names are meaningless (With the exception of cuImage, which is only cryptic.. :) If I'm adding support for a new board, which should I use? 2) The simpleImage target is capable of selecting a head.s file to link based on the target name. This needs to be documented.quoted
-----Original Message----- From: Grant Likely [mailto:grant.likely@secretlab.ca] Sent: Wednesday, June 25, 2008 1:21 PM To: John Linn; Stephen Neuendorffer; linuxppc-dev@ozlabs.com;paulus@samba.orgquoted
Cc: petermendham@computing.dundee.ac.uk Subject: [PATCH] powerpc/bootwrapper: Add documentation of bootwrapper targetsquoted
From: Grant Likely <redacted> There have been many questions on and off the mailing list about how exactly the bootwrapper is used for embedded targets. Add some documentation and help text to try and clarify the system. Signed-off-by: Grant Likely <redacted> --- Documentation/powerpc/bootwrapper.txt | 78+++++++++++++++++++++++++++++++++quoted
arch/powerpc/Makefile | 15 ++++++ arch/powerpc/boot/wrapper | 4 ++ 3 files changed, 96 insertions(+), 1 deletions(-)diff --git a/Documentation/powerpc/bootwrapper.txtb/Documentation/powerpc/bootwrapper.txtquoted
new file mode 100644 index 0000000..8dcb560--- /dev/null +++ b/Documentation/powerpc/bootwrapper.txt@@ -0,0 +1,78 @@ +The PowerPC boot wrapper +------------------------ +Copyright (C) Secret Lab Technologies Ltd. + +PowerPC image targets compresses and wraps the kernel image (vmlinux)withquoted
+a boot wrapper to make it usable by the system firmware. There is no +standard PowerPC firmware interface, so the boot wrapper is designedtoquoted
+be adaptable for each kind of image that needs to be built. + +The boot wrapper can be found in the arch/powerpc/boot/ directory.Thequoted
+Makefile in that directory has targets for all the available imagetypes.quoted
+Currently, the following image targets exist: + + cuImage.%: Backwards compatible uImage for olderversion ofquoted
+ U-Boot (for versions that don't understand thedevicequoted
+ tree). This image embeds a device tree blobinsidequoted
+ the image. + dtbImage.%: Similar to zImage, except device treeblob is embeddedquoted
+ inside the image. + simpleImage.%: Firmware independent compressed image that doesnotquoted
+ depend on any particular firmware interface andembedsquoted
+ a device tree blob. This image can be loaded toanyquoted
+ location in RAM and jumped to. Firmware cannotpassquoted
+ any configuration data to the kernel with thisimagequoted
+ type and the kernel depends on the device treetoquoted
+ determine its console device. + treeImage.%; Image format for some versions of ppc4xxfirmware (nonquoted
+ U-Boot firmware). This image embeds a devicetreequoted
+ blob inside the image. + uImage: Native image format used by U-Boot. The uImagetargetquoted
+ does not add any boot code. It just wraps acompressedquoted
+ vmlinux in the uImage data structure. + zImage.%: Image usable by OpenFirmware. Image expectsfirmwarequoted
+ to provide the device tree using OpenFirmware + interfaces. Typically general purpose hardwareusesquoted
+ this image format. + +Image types which embed a device tree blob (simpleImage, dtbImage,treeImage,quoted
+and cuImage) all generate the device tree blob from a file in the +arch/powerpc/boot/dts/ directory. The Makefile selects the correctdevicequoted
+tree source based on the name of the target. Therefore, if thekernel isquoted
+built with 'make treeImage.walnut simpleImage.virtex405-ml403', thenthequoted
+build system will use arch/powerpc/boot/dts/walnut.dts to build +treeImage.walnut and arch/powerpc/boot/dts/virtex405-ml403.dts tobuildquoted
+the simpleImage.virtex405-ml403. + +Two special targets called 'zImage' and 'zImage.initrd' also exist.Thesequoted
+targets build all the default images as selected by the kernelconfiguration.quoted
+Default images are selected by the boot wrapper Makefile +(arch/powerpc/boot/Makefile) by adding targets to the $image-yvariable. Lookquoted
+at the Makefile to see which default image targets are available. + +How it is built +--------------- +arch/powerpc is designed to support multiplatform kernels, whichmeansquoted
+that a single vmlinux image can be booted on many different targetboards.quoted
+It also means that the boot wrapper must be able to wrap for manykinds ofquoted
+images on a single build. The design decision was made to not useanyquoted
+conditional compilation code (#ifdef, etc) in the boot wrapper sourcecode.quoted
+All of the boot wrapper pieces are buildable at any time regardlessof thequoted
+kernel configuration. Building all the wrapper bits on every kernelbuildquoted
+also ensures that obscure parts of the wrapper are at the very leastcompilequoted
+tested in a large variety of environments. + +The wrapper is adapted for different image types at link time bylinking inquoted
+just the wrapper bits that are appropriate for the image type. The'wrapper'quoted
+script (found in arch/powerpc/boot/wrapper) is called by the Makefileandquoted
+is responsible for selecting the correct wrapper bits for the imagetype.quoted
+The arguments are well documented in the script's comment block, sotheyquoted
+are not repeated here. However, it is worth mentioning that thescriptquoted
+uses the -p (platform) argument as the main method of deciding whichwrapperquoted
+bits to compile in. Look for the large 'case "$platform" in' blockin thequoted
+middle of the script. This is also the place where platform specificfixupsquoted
+can be selected by changing the link order. + +In particular, care should be taken when working with cuImages.cuImagequoted
+wrapper bits are very board specific and care should be taken to makesurequoted
+the target you are trying to build is supported by the wrapper bits.diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index b7d4c4c..754c7eb 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile@@ -169,12 +169,25 @@ bootwrapper_install %.dtb: $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst%,$(boot)/%,$@)quoted
define archhelp - @echo '* zImage - Compressed kernel image(arch/$(ARCH)/boot/zImage.*)'quoted
+ @echo '* zImage - Build default images selected by kernelconfig'quoted
+ @echo ' zImage.* - Compressed kernel image(arch/$(ARCH)/boot/zImage.*)'quoted
+ @echo ' uImage - U-Book native image format' + @echo ' cuImage.<dt> - Backwards compatible U-Boot image forolder'quoted
+ @echo ' versions which do not support devicetrees'quoted
+ @echo ' dtbImage.<dt> - zImage with an embedded device treeblob'quoted
+ @echo ' simpleImage.<dt> - Firmware independant image.' + @echo ' treeImage.<dt> - Support for older IBM 4xx firmware (notU-Boot)'quoted
@echo ' install - Install kernel using' @echo ' (your) ~/bin/installkernel or' @echo ' (distribution) /sbin/installkernel or' @echo ' install to $$(INSTALL_PATH) and runlilo'quoted
@echo ' *_defconfig - Select default config fromarch/$(ARCH)/configs'quoted
+ @echo '' + @echo ' Targets with <dt> embed a device tree blob inside theimage'quoted
+ @echo ' These targets support board with firmware that does not' + @echo ' support passing a device tree directly. Replace <dt> withthe'quoted
+ @echo ' name of a dts file from the arch/$(ARCH)/boot/dts/directory'quoted
+ @echo ' (minus the .dts extension).' endef install:diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper index d6c96d9..7cd4182 100755 --- a/arch/powerpc/boot/wrapper +++ b/arch/powerpc/boot/wrapper@@ -203,6 +203,10 @@ simpleboot-virtex405-*) platformo="$object/virtex405-head.o $object/simpleboot.o" binary=y ;; +simpleboot-*) + platformo="$object/simpleboot.o" + binary=y + ;; esac vmz="$tmpdir/`basename \"$kernel\"`.$ext"This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.
The University of Dundee is a Scottish Registered Charity, No. SC015096.