powerpc/bootwrapper: Add documentation of boot wrapper targets
Subsystems (2)
PATCH 1/1 powerpc/bootwrapper: Add documentation of boot wrapper targets
From: Grant Likely <[email protected]>
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.
---
Documentation/powerpc/bootwrapper.txt | 78 +++++++++++++++++++++++++++++++++ arch/powerpc/Makefile | 15 ++++++ arch/powerpc/boot/wrapper | 4 ++ 3 files changed, 96 insertions(+), 1 deletions(-)
Documentation/powerpc/bootwrapper.txt new file +78 -0
@@ -0,0 +1,78 @@ +The PowerPC boot wrapper +------------------------ +Copyright (C) Secret Lab Technologies Ltd. + +PowerPC image targets compresses and wraps the kernel image (vmlinux) with +a boot wrapper to make it usable by the system firmware. There is no +standard PowerPC firmware interface, so the boot wrapper is designed to +be adaptable for each kind of image that needs to be built. + +The boot wrapper can be found in the arch/powerpc/boot/ directory. The +Makefile in that directory has targets for all the available image types. +Currently, the following image targets exist: + + cuImage.%: Backwards compatible uImage for older version of + U-Boot (for versions that don't understand the device + tree). This image embeds a device tree blob inside + the image. + dtbImage.%: Similar to zImage, except device tree blob is embedded + inside the image. + simpleImage.%: Firmware independent compressed image that does not + depend on any particular firmware interface and embeds + a device tree blob. This image can be loaded to any + location in RAM and jumped to. Firmware cannot pass + any configuration data to the kernel with this image + type and the kernel depends on the device tree to + determine its console device. + treeImage.%; Image format for some versions of ppc4xx firmware (non + U-Boot firmware). This image embeds a device tree + blob inside the image. + uImage: Native image format used by U-Boot. The uImage target + does not add any boot code. It just wraps a compressed + vmlinux in the uImage data structure. + zImage.%: Image usable by OpenFirmware. Image expects firmware + to provide the device tree using OpenFirmware + interfaces. Typically general purpose hardware uses + this image format. + +Image types which embed a device tree blob (simpleImage, dtbImage, treeImage, +and cuImage) all generate the device tree blob from a file in the +arch/powerpc/boot/dts/ directory. The Makefile selects the correct device +tree source based on the name of the target. Therefore, if the kernel is +built with 'make treeImage.walnut simpleImage.virtex405-ml403', then the +build system will use arch/powerpc/boot/dts/walnut.dts to build +treeImage.walnut and arch/powerpc/boot/dts/virtex405-ml403.dts to build +the simpleImage.virtex405-ml403. + +Two special targets called 'zImage' and 'zImage.initrd' also exist. These +targets build all the default images as selected by the kernel configuration. +Default images are selected by the boot wrapper Makefile +(arch/powerpc/boot/Makefile) by adding targets to the $image-y variable. Look +at the Makefile to see which default image targets are available. + +How it is built +--------------- +arch/powerpc is designed to support multiplatform kernels, which means +that a single vmlinux image can be booted on many different target boards. +It also means that the boot wrapper must be able to wrap for many kinds of +images on a single build. The design decision was made to not use any +conditional compilation code (#ifdef, etc) in the boot wrapper source code. +All of the boot wrapper pieces are buildable at any time regardless of the +kernel configuration. Building all the wrapper bits on every kernel build +also ensures that obscure parts of the wrapper are at the very least compile +tested in a large variety of environments. + +The wrapper is adapted for different image types at link time by linking in +just the wrapper bits that are appropriate for the image type. The 'wrapper' +script (found in arch/powerpc/boot/wrapper) is called by the Makefile and +is responsible for selecting the correct wrapper bits for the image type. +The arguments are well documented in the script's comment block, so they +are not repeated here. However, it is worth mentioning that the script +uses the -p (platform) argument as the main method of deciding which wrapper +bits to compile in. Look for the large 'case "$platform" in' block in the +middle of the script. This is also the place where platform specific fixups +can be selected by changing the link order. + +In particular, care should be taken when working with cuImages. cuImage +wrapper bits are very board specific and care should be taken to make sure +the target you are trying to build is supported by the wrapper bits.
arch/powerpc/Makefile +14 -1
@@ -169,12 +169,25 @@ bootwrapper_install %.dtb: $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) define archhelp - @echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage.*)' + @echo '* zImage - Build default images selected by kernel config' + @echo ' zImage.* - Compressed kernel image (arch/$(ARCH)/boot/zImage.*)' + @echo ' uImage - U-Book native image format' + @echo ' cuImage.<dt> - Backwards compatible U-Boot image for older' + @echo ' versions which do not support device trees' + @echo ' dtbImage.<dt> - zImage with an embedded device tree blob' + @echo ' simpleImage.<dt> - Firmware independant image.' + @echo ' treeImage.<dt> - Support for older IBM 4xx firmware (not U-Boot)' @echo ' install - Install kernel using' @echo ' (your) ~/bin/installkernel or' @echo ' (distribution) /sbin/installkernel or' @echo ' install to $$(INSTALL_PATH) and run lilo' @echo ' *_defconfig - Select default config from arch/$(ARCH)/configs' + @echo '' + @echo ' Targets with <dt> embed a device tree blob inside the image' + @echo ' These targets support board with firmware that does not' + @echo ' support passing a device tree directly. Replace <dt> with the' + @echo ' name of a dts file from the arch/$(ARCH)/boot/dts/ directory' + @echo ' (minus the .dts extension).' endef install:
arch/powerpc/boot/wrapper +4 -0
@@ -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"
Oops, sent to the wrong address for the mailing list...
From: Grant Likely <[email protected]>
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.
---
Documentation/powerpc/bootwrapper.txt | 78 +++++++++++++++++++++++++++++++++ arch/powerpc/Makefile | 15 ++++++ arch/powerpc/boot/wrapper | 4 ++ 3 files changed, 96 insertions(+), 1 deletions(-)
(quoted diff) +0 -0
b/Documentation/powerpc/bootwrapper.txt
new file mode 100644
index 0000000..8dcb560
Documentation/powerpc/bootwrapper.txt new file +27 -0
@@ -0,0 +1,78 @@ +The PowerPC boot wrapper +------------------------ +Copyright (C) Secret Lab Technologies Ltd. + +PowerPC image targets compresses and wraps the kernel image (vmlinux) with +a boot wrapper to make it usable by the system firmware. There is no +standard PowerPC firmware interface, so the boot wrapper is designed to +be adaptable for each kind of image that needs to be built. + +The boot wrapper can be found in the arch/powerpc/boot/ directory. The +Makefile in that directory has targets for all the available image types. +Currently, the following image targets exist: + + cuImage.%: Backwards compatible uImage for older version of + U-Boot (for versions that don't understand the device + tree). This image embeds a device tree blob inside + the image. + dtbImage.%: Similar to zImage, except device tree blob is embedded + inside the image. + simpleImage.%: Firmware independent compressed image that does not + depend on any particular firmware interface and embeds + a device tree blob. This image can be loaded to any + location in RAM and jumped to. Firmware cannot pass + any configuration data to the kernel with this image + type and the kernel depends on the device tree to + determine its console device. + treeImage.%; Image format for some versions of
ppc4xx firmware (non
+ U-Boot firmware). This image embeds a device tree + blob inside the image. + uImage: Native image format used by U-Boot. The uImage target + does not add any boot code. It just wraps a compressed + vmlinux in the uImage data structure. + zImage.%: Image usable by OpenFirmware. Image expects firmware + to provide the device tree using OpenFirmware + interfaces. Typically general purpose hardware uses + this image format.
+
+Image types which embed a device tree blob (simpleImage, dtbImage, treeImage, +and cuImage) all generate the device tree blob from a file in the +arch/powerpc/boot/dts/ directory. The Makefile selects the correct device +tree source based on the name of the target. Therefore, if the kernel is +built with 'make treeImage.walnut simpleImage.virtex405-ml403', then the +build system will use arch/powerpc/boot/dts/walnut.dts to build +treeImage.walnut and arch/powerpc/boot/dts/virtex405-ml403.dts to build +the simpleImage.virtex405-ml403.
+
+Two special targets called 'zImage' and 'zImage.initrd' also exist. These +targets build all the default images as selected by the kernel configuration. +Default images are selected by the boot wrapper Makefile +(arch/powerpc/boot/Makefile) by adding targets to the $image-y variable. Look +at the Makefile to see which default image targets are available. +
+How it is built
+---------------
+arch/powerpc is designed to support multiplatform kernels, which means +that a single vmlinux image can be booted on many different target boards. +It also means that the boot wrapper must be able to wrap for many kinds of +images on a single build. The design decision was made to not use any +conditional compilation code (#ifdef, etc) in the boot wrapper source code. +All of the boot wrapper pieces are buildable at any time regardless of the +kernel configuration. Building all the wrapper bits on every kernel build +also ensures that obscure parts of the wrapper are at the very least compile +tested in a large variety of environments.
+
+The wrapper is adapted for different image types at link time by linking in +just the wrapper bits that are appropriate for the image type. The 'wrapper' +script (found in arch/powerpc/boot/wrapper) is called by the Makefile and +is responsible for selecting the correct wrapper bits for the image type. +The arguments are well documented in the script's comment block, so they +are not repeated here. However, it is worth mentioning that the script +uses the -p (platform) argument as the main method of deciding which wrapper +bits to compile in. Look for the large 'case "$platform" in' block in the +middle of the script. This is also the place where platform specific fixups +can be selected by changing the link order.
+
+In particular, care should be taken when working with cuImages. cuImage +wrapper bits are very board specific and care should be taken to make sure +the target you are trying to build is supported by the wrapper bits.
arch/powerpc/Makefile +0 -1
@@ -169,12 +169,25 @@ bootwrapper_install %.dtb: $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@) define archhelp - @echo '* zImage - Compressed kernel image
(arch/$(ARCH)/boot/zImage.*)'
+ @echo '* zImage - Build default images selected by kernel config' + @echo ' zImage.* - Compressed kernel image (arch/$(ARCH)/boot/zImage.*)' + @echo ' uImage - U-Book native image format' + @echo ' cuImage.<dt> - Backwards compatible U-Boot image for older' + @echo ' versions which do not support device trees' + @echo ' dtbImage.<dt> - zImage with an embedded device tree blob' + @echo ' simpleImage.<dt> - Firmware independant image.' + @echo ' treeImage.<dt> - Support for older IBM 4xx firmware (not U-Boot)' @echo ' install - Install kernel using' @echo ' (your) ~/bin/installkernel or' @echo ' (distribution) /sbin/installkernel or' @echo ' install to $$(INSTALL_PATH) and run lilo' @echo ' *_defconfig - Select default config from arch/$(ARCH)/configs' + @echo '' + @echo ' Targets with <dt> embed a device tree blob inside the image' + @echo ' These targets support board with firmware that does not' + @echo ' support passing a device tree directly. Replace <dt> with the' + @echo ' name of a dts file from the arch/$(ARCH)/boot/dts/ directory' + @echo ' (minus the .dts extension).'
endef
install:
arch/powerpc/boot/wrapper +4 -0
@@ -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"
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
Thanks Grant, that's a great start for helping us to better understand the bootwrapper.
The wrapper is somewhat complex and hard to get your head around, or at least my head ;).
-- John
-----Original Message-----
From: Grant Likely [mailto:[email protected]] =
Sent: Wednesday, June 25, 2008 2:21 PM
To: John Linn; Stephen Neuendorffer; [email protected]; [email protected]
Cc: [email protected]
Subject: [PATCH] powerpc/bootwrapper: Add documentation of boot wrapper targets
From: Grant Likely <[email protected]>
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.
---
Documentation/powerpc/bootwrapper.txt | 78 +++++++++++++++++++++++++++++++++ arch/powerpc/Makefile | 15 ++++++ arch/powerpc/boot/wrapper | 4 ++ 3 files changed, 96 insertions(+), 1 deletions(-)
(quoted diff) +0 -0
b/Documentation/powerpc/bootwrapper.txt
new file mode 100644
index 0000000..8dcb560
Documentation/powerpc/bootwrapper.txt new file +5 -0
@@ -0,0 +1,78 @@ +The PowerPC boot wrapper +------------------------ +Copyright (C) Secret Lab Technologies Ltd. + +PowerPC image targets compresses and wraps the kernel image (vmlinux)
with
+a boot wrapper to make it usable by the system firmware. There is no +standard PowerPC firmware interface, so the boot wrapper is designed to +be adaptable for each kind of image that needs to be built. +
+The boot wrapper can be found in the arch/powerpc/boot/ directory. The +Makefile in that directory has targets for all the available image types.
+Currently, the following image targets exist:
+
+ cuImage.%: Backwards compatible uImage for older version of
+ U-Boot (for versions that don't understand the
device
+ tree). This image embeds a device tree blob
inside
+ the image.
+ dtbImage.%: Similar to zImage, except device tree blob is
embedded
+ inside the image.
+ simpleImage.%: Firmware independent compressed image that does
not
+ depend on any particular firmware interface and
embeds
+ a device tree blob. This image can be loaded to
any
+ location in RAM and jumped to. Firmware cannot
pass
+ any configuration data to the kernel with this
image
+ type and the kernel depends on the device tree
to
+ determine its console device.
+ treeImage.%; Image format for some versions of ppc4xx
firmware (non
+ U-Boot firmware). This image embeds a device
tree
+ blob inside the image.
+ uImage: Native image format used by U-Boot. The uImage
target
+ does not add any boot code. It just wraps a
compressed
+ vmlinux in the uImage data structure.
+ zImage.%: Image usable by OpenFirmware. Image expects
firmware
+ to provide the device tree using OpenFirmware
+ interfaces. Typically general purpose hardware
uses
+ this image format.
+
+Image types which embed a device tree blob (simpleImage, dtbImage, treeImage,
+and cuImage) all generate the device tree blob from a file in the +arch/powerpc/boot/dts/ directory. The Makefile selects the correct device
+tree source based on the name of the target. Therefore, if the kernel is
+built with 'make treeImage.walnut simpleImage.virtex405-ml403', then the
+build system will use arch/powerpc/boot/dts/walnut.dts to build +treeImage.walnut and arch/powerpc/boot/dts/virtex405-ml403.dts to build +the simpleImage.virtex405-ml403.
+
+Two special targets called 'zImage' and 'zImage.initrd' also exist. These
+targets build all the default images as selected by the kernel configuration.
+Default images are selected by the boot wrapper Makefile +(arch/powerpc/boot/Makefile) by adding targets to the $image-y variable. Look
+at the Makefile to see which default image targets are available. +
+How it is built
+---------------
+arch/powerpc is designed to support multiplatform kernels, which means +that a single vmlinux image can be booted on many different target boards.
+It also means that the boot wrapper must be able to wrap for many kinds of
+images on a single build. The design decision was made to not use any +conditional compilation code (#ifdef, etc) in the boot wrapper source code.
+All of the boot wrapper pieces are buildable at any time regardless of the
+kernel configuration. Building all the wrapper bits on every kernel build
+also ensures that obscure parts of the wrapper are at the very least compile
+tested in a large variety of environments.
+
+The wrapper is adapted for different image types at link time by linking in
+just the wrapper bits that are appropriate for the image type. The 'wrapper'
+script (found in arch/powerpc/boot/wrapper) is called by the Makefile and
+is responsible for selecting the correct wrapper bits for the image type.
+The arguments are well documented in the script's comment block, so they
+are not repeated here. However, it is worth mentioning that the script +uses the -p (platform) argument as the main method of deciding which wrapper
+bits to compile in. Look for the large 'case "$platform" in' block in the
+middle of the script. This is also the place where platform specific fixups
+can be selected by changing the link order.
+
+In particular, care should be taken when working with cuImages. cuImage
+wrapper bits are very board specific and care should be taken to make sure
+the target you are trying to build is supported by the wrapper bits.
arch/powerpc/Makefile +0 -0
@@ -169,12 +169,25 @@ bootwrapper_install %.dtb: $(Q)$(MAKE) ARCH=3Dppc64 $(build)=3D$(boot) $(patsubst
%,$(boot)/%,$@)
=
define archhelp
- @echo '* zImage - Compressed kernel image
(arch/$(ARCH)/boot/zImage.*)'
+ @echo '* zImage - Build default images selected by kernel
config'
+ @echo ' zImage.* - Compressed kernel image
(arch/$(ARCH)/boot/zImage.*)'
+ @echo ' uImage - U-Book native image format' + @echo ' cuImage.<dt> - Backwards compatible U-Boot image for older' + @echo ' versions which do not support device trees' + @echo ' dtbImage.<dt> - zImage with an embedded device tree blob' + @echo ' simpleImage.<dt> - Firmware independant image.' + @echo ' treeImage.<dt> - Support for older IBM 4xx firmware (not U-Boot)' @echo ' install - Install kernel using' @echo ' (your) ~/bin/installkernel or' @echo ' (distribution) /sbin/installkernel or' @echo ' install to $$(INSTALL_PATH) and run lilo' @echo ' *_defconfig - Select default config from arch/$(ARCH)/configs' + @echo '' + @echo ' Targets with <dt> embed a device tree blob inside the image' + @echo ' These targets support board with firmware that does not' + @echo ' support passing a device tree directly. Replace <dt> with
the'
+ @echo ' name of a dts file from the arch/$(ARCH)/boot/dts/ directory'
+ @echo ' (minus the .dts extension).'
endef
=
install:
arch/powerpc/boot/wrapper +4 -0
@@ -203,6 +203,10 @@ simpleboot-virtex405-*) platformo=3D"$object/virtex405-head.o $object/simpleboot.o" binary=3Dy ;; +simpleboot-*) + platformo=3D"$object/simpleboot.o" + binary=3Dy + ;; esac =
vmz=3D"$tmpdir/basename \"$kernel\".$ext"
This email and any attachments are intended for the sole use of the named r= ecipient(s) and contain(s) confidential information that may be proprietary= , privileged or copyrighted under applicable law. If you are not the intend= ed recipient, do not read, copy, or forward this email message or any attac= hments. Delete this email message and any attachments immediately.
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 4 lines
-----Original Message-----
From: Grant Likely [mailto:[email protected]]
Sent: Wednesday, June 25, 2008 1:21 PM
To: John Linn; Stephen Neuendorffer; [email protected];
Quoted 2 lines
Cc: [email protected]
Subject: [PATCH] powerpc/bootwrapper: Add documentation of boot
wrapper targets
Quoted 10 lines
=
From: Grant Likely <[email protected]>
=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. =
Quoted 5 lines
Signed-off-by Grant Likely <[email protected]>---
=Documentation/powerpc/bootwrapper.txt | 78
+++++++++++++++++++++++++++++++++
Review
Quoted 6 lines
arch/powerpc/Makefile | 15 ++++++ arch/powerpc/boot/wrapper | 4 ++ 3 files changed, 96 insertions(+), 1 deletions(-)=
(quoted diff) +0
-0
b/Documentation/powerpc/bootwrapper.txt
Documentation/powerpc/bootwrapper.txt line 5
Quoted 10 lines
new file mode 100644
index 0000000..8dcb560Documentation/powerpc/bootwrapper.txt new file +5
-0@@ -0,0 +1,78 @@ +The PowerPC boot wrapper +------------------------ +Copyright (C) Secret Lab Technologies Ltd. + +PowerPC image targets compresses and wraps the kernel image (vmlinux)
with
Documentation/powerpc/bootwrapper.txt line 7
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +2
-0+a boot wrapper to make it usable by the system firmware. There is no +standard PowerPC firmware interface, so the boot wrapper is designed
to
Documentation/powerpc/bootwrapper.txt
Quoted 3 lines
Documentation/powerpc/bootwrapper.txt new file +3
-0+be adaptable for each kind of image that needs to be built. + +The boot wrapper can be found in the arch/powerpc/boot/ directory.
The
Documentation/powerpc/bootwrapper.txt line 11
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+Makefile in that directory has targets for all the available image
types.
Documentation/powerpc/bootwrapper.txt
Quoted 3 lines
Documentation/powerpc/bootwrapper.txt new file +3
-0+Currently, the following image targets exist: + + cuImage.%: Backwards compatible uImage for older
version of
Documentation/powerpc/bootwrapper.txt line 15
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+ U-Boot (for versions that don't understand the
device
Documentation/powerpc/bootwrapper.txt line 16
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+ tree). This image embeds a device tree blob
inside
Documentation/powerpc/bootwrapper.txt line 18
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +2
-0+ the image. + dtbImage.%: Similar to zImage, except device tree
blob is embedded
Documentation/powerpc/bootwrapper.txt line 20
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +2
-0+ inside the image. + simpleImage.%: Firmware independent compressed image that does
not
Documentation/powerpc/bootwrapper.txt line 21
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+ depend on any particular firmware interface and
embeds
Documentation/powerpc/bootwrapper.txt line 22
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+ a device tree blob. This image can be loaded to
any
Documentation/powerpc/bootwrapper.txt line 23
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+ location in RAM and jumped to. Firmware cannot
pass
Documentation/powerpc/bootwrapper.txt line 24
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+ any configuration data to the kernel with this
image
Documentation/powerpc/bootwrapper.txt line 25
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+ type and the kernel depends on the device tree
to
Documentation/powerpc/bootwrapper.txt line 27
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +2
-0+ determine its console device. + treeImage.%; Image format for some versions of ppc4xx
firmware (non
Documentation/powerpc/bootwrapper.txt line 28
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+ U-Boot firmware). This image embeds a device
tree
Documentation/powerpc/bootwrapper.txt line 30
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +2
-0+ blob inside the image. + uImage: Native image format used by U-Boot. The uImage
target
Documentation/powerpc/bootwrapper.txt line 31
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+ does not add any boot code. It just wraps a
compressed
Documentation/powerpc/bootwrapper.txt line 33
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +2
-0+ vmlinux in the uImage data structure. + zImage.%: Image usable by OpenFirmware. Image expects
firmware
Documentation/powerpc/bootwrapper.txt line 35
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +2
-0+ to provide the device tree using OpenFirmware + interfaces. Typically general purpose hardware
uses
Documentation/powerpc/bootwrapper.txt
Quoted 3 lines
Documentation/powerpc/bootwrapper.txt new file +3
-0+ this image format. + +Image types which embed a device tree blob (simpleImage, dtbImage,
treeImage,
Documentation/powerpc/bootwrapper.txt line 40
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +2
-0+and cuImage) all generate the device tree blob from a file in the +arch/powerpc/boot/dts/ directory. The Makefile selects the correct
device
Documentation/powerpc/bootwrapper.txt line 41
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+tree source based on the name of the target. Therefore, if the
kernel is
Documentation/powerpc/bootwrapper.txt line 42
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+built with 'make treeImage.walnut simpleImage.virtex405-ml403', then
the
Documentation/powerpc/bootwrapper.txt line 44
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +2
-0+build system will use arch/powerpc/boot/dts/walnut.dts to build +treeImage.walnut and arch/powerpc/boot/dts/virtex405-ml403.dts to
build
Documentation/powerpc/bootwrapper.txt
Quoted 3 lines
Documentation/powerpc/bootwrapper.txt new file +3
-0+the simpleImage.virtex405-ml403. + +Two special targets called 'zImage' and 'zImage.initrd' also exist.
These
Documentation/powerpc/bootwrapper.txt line 48
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+targets build all the default images as selected by the kernel
configuration.
Documentation/powerpc/bootwrapper.txt line 50
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +2
-0+Default images are selected by the boot wrapper Makefile +(arch/powerpc/boot/Makefile) by adding targets to the $image-y
variable. Look
Documentation/powerpc/bootwrapper.txt
Quoted 5 lines
Documentation/powerpc/bootwrapper.txt new file +5
-0+at the Makefile to see which default image targets are available. + +How it is built +--------------- +arch/powerpc is designed to support multiplatform kernels, which
means
Documentation/powerpc/bootwrapper.txt line 56
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+that a single vmlinux image can be booted on many different target
boards.
Documentation/powerpc/bootwrapper.txt line 57
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+It also means that the boot wrapper must be able to wrap for many
kinds of
Documentation/powerpc/bootwrapper.txt line 58
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+images on a single build. The design decision was made to not use
any
Documentation/powerpc/bootwrapper.txt line 59
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+conditional compilation code (#ifdef, etc) in the boot wrapper source
code.
Documentation/powerpc/bootwrapper.txt line 60
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+All of the boot wrapper pieces are buildable at any time regardless
of the
Documentation/powerpc/bootwrapper.txt line 61
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+kernel configuration. Building all the wrapper bits on every kernel
build
Documentation/powerpc/bootwrapper.txt line 62
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+also ensures that obscure parts of the wrapper are at the very least
compile
Documentation/powerpc/bootwrapper.txt
Quoted 3 lines
Documentation/powerpc/bootwrapper.txt new file +3
-0+tested in a large variety of environments. + +The wrapper is adapted for different image types at link time by
linking in
Documentation/powerpc/bootwrapper.txt line 66
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+just the wrapper bits that are appropriate for the image type. The
'wrapper'
Documentation/powerpc/bootwrapper.txt line 67
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+script (found in arch/powerpc/boot/wrapper) is called by the Makefile
and
Documentation/powerpc/bootwrapper.txt line 68
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+is responsible for selecting the correct wrapper bits for the image
type.
Documentation/powerpc/bootwrapper.txt line 69
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+The arguments are well documented in the script's comment block, so
they
Documentation/powerpc/bootwrapper.txt line 70
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+are not repeated here. However, it is worth mentioning that the
script
Documentation/powerpc/bootwrapper.txt line 71
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+uses the -p (platform) argument as the main method of deciding which
wrapper
Documentation/powerpc/bootwrapper.txt line 72
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+bits to compile in. Look for the large 'case "$platform" in' block
in the
Documentation/powerpc/bootwrapper.txt line 73
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+middle of the script. This is also the place where platform specific
fixups
Documentation/powerpc/bootwrapper.txt
Quoted 3 lines
Documentation/powerpc/bootwrapper.txt new file +3
-0+can be selected by changing the link order. + +In particular, care should be taken when working with cuImages.
cuImage
Documentation/powerpc/bootwrapper.txt line 77
Quoted 1 line
Documentation/powerpc/bootwrapper.txt new file +1
-0+wrapper bits are very board specific and care should be taken to make
sure
arch/powerpc/Makefile bootwrapper_install %.dtb: · line 169
Quoted 7 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+the target you are trying to build is supported by the wrapper bits.arch/powerpc/Makefile +0
-0@@ -169,12 +169,25 @@ bootwrapper_install %.dtb: $(Q)$(MAKE) ARCH=3Dppc64 $(build)=3D$(boot) $(patsubst
%,$(boot)/%,$@)
Quoted 4 lines
=
define archhelp
- @echo '* zImage - Compressed kernel image
(arch/$(ARCH)/boot/zImage.*)'
Quoted 1 line
+ @echo '* zImage - Build default images selected by kernel
config'
Quoted 1 line
+ @echo ' zImage.* - Compressed kernel image
(arch/$(ARCH)/boot/zImage.*)'
arch/powerpc/Makefile
Quoted 2 lines
arch/powerpc/Makefile +2
-0+ @echo ' uImage - U-Book native image format' + @echo ' cuImage.<dt> - Backwards compatible U-Boot image for
older'
Quoted 1 line
+ @echo ' versions which do not support device
trees'
Quoted 1 line
+ @echo ' dtbImage.<dt> - zImage with an embedded device tree
blob'
arch/powerpc/Makefile
Quoted 2 lines
arch/powerpc/Makefile +2
-0+ @echo ' simpleImage.<dt> - Firmware independant image.' + @echo ' treeImage.<dt> - Support for older IBM 4xx firmware (not
U-Boot)'
Quoted 4 lines
@echo ' install - Install kernel using' @echo ' (your) ~/bin/installkernel or' @echo ' (distribution) /sbin/installkernel or' @echo ' install to $$(INSTALL_PATH) and run
lilo'
Quoted 1 line
@echo '
*_defconfig- Select default config from
arch/$(ARCH)/configs'
arch/powerpc/Makefile
Quoted 2 lines
arch/powerpc/Makefile +2
-0+ @echo '' + @echo ' Targets with <dt> embed a device tree blob inside the
image'
arch/powerpc/Makefile
Quoted 2 lines
arch/powerpc/Makefile +2
-0+ @echo ' These targets support board with firmware that does not' + @echo ' support passing a device tree directly. Replace <dt> with
the'
Quoted 1 line
+ @echo ' name of a dts file from the arch/$(ARCH)/boot/dts/
directory'
Quoted 20 lines
+ @echo ' (minus the .dts extension).'
endef
=install:
arch/powerpc/boot/wrapper +4
-0@@ -203,6 +203,10 @@ simpleboot-virtex405-*) platformo=3D"$object/virtex405-head.o $object/simpleboot.o" binary=3Dy ;; +simpleboot-*) + platformo=3D"$object/simpleboot.o" + binary=3Dy + ;; esac=
Quoted 2 lines
vmz=3D"$tmpdir/
basename \"$kernel\".$ext"
=
This email and any attachments are intended for the sole use of the named r= ecipient(s) and contain(s) confidential information that may be proprietary= , privileged or copyrighted under applicable law. If you are not the intend= ed recipient, do not read, copy, or forward this email message or any attac= hments. Delete this email message and any attachments immediately.
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
Quoted 351 lines · Stephen Neuendorffer
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 5 lines
-----Original Message-----
From: Grant Likely [mailto:[email protected]]
Sent: Wednesday, June 25, 2008 1:21 PM
To: John Linn; Stephen Neuendorffer; [email protected];Quoted 3 lines
Cc: [email protected]
Subject: [PATCH] powerpc/bootwrapper: Add documentation of bootwrapper targets
Quoted 11 lines
From: Grant Likely <[email protected]>
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 <[email protected]>---
Documentation/powerpc/bootwrapper.txt | 78+++++++++++++++++++++++++++++++++
Review
Quoted 6 lines
arch/powerpc/Makefile | 15 ++++++ arch/powerpc/boot/wrapper | 4 ++ 3 files changed, 96 insertions(+), 1 deletions(-)(quoted diff) +0
-0
b/Documentation/powerpc/bootwrapper.txtDocumentation/powerpc/bootwrapper.txt line 5
Quoted 11 lines
new file mode 100644
index 0000000..8dcb560Documentation/powerpc/bootwrapper.txt new file +5
-0@@ -0,0 +1,78 @@ +The PowerPC boot wrapper +------------------------ +Copyright (C) Secret Lab Technologies Ltd. + +PowerPC image targets compresses and wraps the kernel image (vmlinux)with
Documentation/powerpc/bootwrapper.txt line 7
Quoted 3 lines
Documentation/powerpc/bootwrapper.txt new file +2
-0+a boot wrapper to make it usable by the system firmware. There is no +standard PowerPC firmware interface, so the boot wrapper is designedto
Documentation/powerpc/bootwrapper.txt
Quoted 4 lines
Documentation/powerpc/bootwrapper.txt new file +3
-0+be adaptable for each kind of image that needs to be built. + +The boot wrapper can be found in the arch/powerpc/boot/ directory.The
Documentation/powerpc/bootwrapper.txt line 11
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+Makefile in that directory has targets for all the available imagetypes.
Documentation/powerpc/bootwrapper.txt
Quoted 4 lines
Documentation/powerpc/bootwrapper.txt new file +3
-0+Currently, the following image targets exist: + + cuImage.%: Backwards compatible uImage for olderversion of
Documentation/powerpc/bootwrapper.txt line 15
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+ U-Boot (for versions that don't understand thedevice
Documentation/powerpc/bootwrapper.txt line 16
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+ tree). This image embeds a device tree blobinside
Documentation/powerpc/bootwrapper.txt line 18
Quoted 3 lines
Documentation/powerpc/bootwrapper.txt new file +2
-0+ the image. + dtbImage.%: Similar to zImage, except device treeblob is embedded
Documentation/powerpc/bootwrapper.txt line 20
Quoted 3 lines
Documentation/powerpc/bootwrapper.txt new file +2
-0+ inside the image. + simpleImage.%: Firmware independent compressed image that doesnot
Documentation/powerpc/bootwrapper.txt line 21
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+ depend on any particular firmware interface andembeds
Documentation/powerpc/bootwrapper.txt line 22
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+ a device tree blob. This image can be loaded toany
Documentation/powerpc/bootwrapper.txt line 23
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+ location in RAM and jumped to. Firmware cannotpass
Documentation/powerpc/bootwrapper.txt line 24
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+ any configuration data to the kernel with thisimage
Documentation/powerpc/bootwrapper.txt line 25
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+ type and the kernel depends on the device treeto
Documentation/powerpc/bootwrapper.txt line 27
Quoted 3 lines
Documentation/powerpc/bootwrapper.txt new file +2
-0+ determine its console device. + treeImage.%; Image format for some versions of ppc4xxfirmware (non
Documentation/powerpc/bootwrapper.txt line 28
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+ U-Boot firmware). This image embeds a devicetree
Documentation/powerpc/bootwrapper.txt line 30
Quoted 3 lines
Documentation/powerpc/bootwrapper.txt new file +2
-0+ blob inside the image. + uImage: Native image format used by U-Boot. The uImagetarget
Documentation/powerpc/bootwrapper.txt line 31
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+ does not add any boot code. It just wraps acompressed
Documentation/powerpc/bootwrapper.txt line 33
Quoted 3 lines
Documentation/powerpc/bootwrapper.txt new file +2
-0+ vmlinux in the uImage data structure. + zImage.%: Image usable by OpenFirmware. Image expectsfirmware
Documentation/powerpc/bootwrapper.txt line 35
Quoted 3 lines
Documentation/powerpc/bootwrapper.txt new file +2
-0+ to provide the device tree using OpenFirmware + interfaces. Typically general purpose hardwareuses
Documentation/powerpc/bootwrapper.txt
Quoted 4 lines
Documentation/powerpc/bootwrapper.txt new file +3
-0+ this image format. + +Image types which embed a device tree blob (simpleImage, dtbImage,treeImage,
Documentation/powerpc/bootwrapper.txt line 40
Quoted 3 lines
Documentation/powerpc/bootwrapper.txt new file +2
-0+and cuImage) all generate the device tree blob from a file in the +arch/powerpc/boot/dts/ directory. The Makefile selects the correctdevice
Documentation/powerpc/bootwrapper.txt line 41
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+tree source based on the name of the target. Therefore, if thekernel is
Documentation/powerpc/bootwrapper.txt line 42
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+built with 'make treeImage.walnut simpleImage.virtex405-ml403', thenthe
Documentation/powerpc/bootwrapper.txt line 44
Quoted 3 lines
Documentation/powerpc/bootwrapper.txt new file +2
-0+build system will use arch/powerpc/boot/dts/walnut.dts to build +treeImage.walnut and arch/powerpc/boot/dts/virtex405-ml403.dts tobuild
Documentation/powerpc/bootwrapper.txt
Quoted 4 lines
Documentation/powerpc/bootwrapper.txt new file +3
-0+the simpleImage.virtex405-ml403. + +Two special targets called 'zImage' and 'zImage.initrd' also exist.These
Documentation/powerpc/bootwrapper.txt line 48
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+targets build all the default images as selected by the kernelconfiguration.
Documentation/powerpc/bootwrapper.txt line 50
Quoted 3 lines
Documentation/powerpc/bootwrapper.txt new file +2
-0+Default images are selected by the boot wrapper Makefile +(arch/powerpc/boot/Makefile) by adding targets to the $image-yvariable. Look
Documentation/powerpc/bootwrapper.txt
Quoted 6 lines
Documentation/powerpc/bootwrapper.txt new file +5
-0+at the Makefile to see which default image targets are available. + +How it is built +--------------- +arch/powerpc is designed to support multiplatform kernels, whichmeans
Documentation/powerpc/bootwrapper.txt line 56
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+that a single vmlinux image can be booted on many different targetboards.
Documentation/powerpc/bootwrapper.txt line 57
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+It also means that the boot wrapper must be able to wrap for manykinds of
Documentation/powerpc/bootwrapper.txt line 58
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+images on a single build. The design decision was made to not useany
Documentation/powerpc/bootwrapper.txt line 59
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+conditional compilation code (#ifdef, etc) in the boot wrapper sourcecode.
Documentation/powerpc/bootwrapper.txt line 60
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+All of the boot wrapper pieces are buildable at any time regardlessof the
Documentation/powerpc/bootwrapper.txt line 61
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+kernel configuration. Building all the wrapper bits on every kernelbuild
Documentation/powerpc/bootwrapper.txt line 62
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+also ensures that obscure parts of the wrapper are at the very leastcompile
Documentation/powerpc/bootwrapper.txt
Quoted 4 lines
Documentation/powerpc/bootwrapper.txt new file +3
-0+tested in a large variety of environments. + +The wrapper is adapted for different image types at link time bylinking in
Documentation/powerpc/bootwrapper.txt line 66
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+just the wrapper bits that are appropriate for the image type. The'wrapper'
Documentation/powerpc/bootwrapper.txt line 67
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+script (found in arch/powerpc/boot/wrapper) is called by the Makefileand
Documentation/powerpc/bootwrapper.txt line 68
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+is responsible for selecting the correct wrapper bits for the imagetype.
Documentation/powerpc/bootwrapper.txt line 69
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+The arguments are well documented in the script's comment block, sothey
Documentation/powerpc/bootwrapper.txt line 70
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+are not repeated here. However, it is worth mentioning that thescript
Documentation/powerpc/bootwrapper.txt line 71
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+uses the -p (platform) argument as the main method of deciding whichwrapper
Documentation/powerpc/bootwrapper.txt line 72
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+bits to compile in. Look for the large 'case "$platform" in' blockin the
Documentation/powerpc/bootwrapper.txt line 73
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+middle of the script. This is also the place where platform specificfixups
Documentation/powerpc/bootwrapper.txt
Quoted 4 lines
Documentation/powerpc/bootwrapper.txt new file +3
-0+can be selected by changing the link order. + +In particular, care should be taken when working with cuImages.cuImage
Documentation/powerpc/bootwrapper.txt line 77
Quoted 2 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+wrapper bits are very board specific and care should be taken to makesure
arch/powerpc/Makefile bootwrapper_install %.dtb: · line 170
Quoted 8 lines
Documentation/powerpc/bootwrapper.txt new file +1
-0+the target you are trying to build is supported by the wrapper bits.arch/powerpc/Makefile +0
-0@@ -169,12 +169,25 @@ bootwrapper_install %.dtb: $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst%,$(boot)/%,$@)
arch/powerpc/Makefile bootwrapper_install %.dtb: · line 192
Quoted 3 lines
arch/powerpc/Makefile +0
-1define archhelp - @echo '* zImage - Compressed kernel image(arch/$(ARCH)/boot/zImage.*)'
arch/powerpc/Makefile bootwrapper_install %.dtb: · line 174
Quoted 2 lines
arch/powerpc/Makefile +1
-0+ @echo '* zImage - Build default images selected by kernelconfig'
arch/powerpc/Makefile bootwrapper_install %.dtb: · line 176
Quoted 2 lines
arch/powerpc/Makefile +1
-0+ @echo ' zImage.* - Compressed kernel image(arch/$(ARCH)/boot/zImage.*)'
arch/powerpc/Makefile bootwrapper_install %.dtb: · line 192
Quoted 3 lines
arch/powerpc/Makefile +2
-0+ @echo ' uImage - U-Book native image format' + @echo ' cuImage.<dt> - Backwards compatible U-Boot image forolder'
arch/powerpc/Makefile bootwrapper_install %.dtb: · line 181
Quoted 2 lines
arch/powerpc/Makefile +1
-0+ @echo ' versions which do not support devicetrees'
arch/powerpc/Makefile bootwrapper_install %.dtb: · line 183
Quoted 2 lines
arch/powerpc/Makefile +1
-0+ @echo ' dtbImage.<dt> - zImage with an embedded device treeblob'
arch/powerpc/Makefile bootwrapper_install %.dtb: · line 192
Quoted 3 lines
arch/powerpc/Makefile +2
-0+ @echo ' simpleImage.<dt> - Firmware independant image.' + @echo ' treeImage.<dt> - Support for older IBM 4xx firmware (notU-Boot)'
arch/powerpc/Makefile bootwrapper_install %.dtb:
Quoted 5 lines
arch/powerpc/Makefile +0
-0@echo ' install - Install kernel using' @echo ' (your) ~/bin/installkernel or' @echo ' (distribution) /sbin/installkernel or' @echo ' install to $$(INSTALL_PATH) and runlilo'
Quoted 2 lines
@echo '
*_defconfig- Select default config fromarch/$(ARCH)/configs'
arch/powerpc/Makefile
Quoted 3 lines
arch/powerpc/Makefile +2
-0+ @echo '' + @echo ' Targets with <dt> embed a device tree blob inside theimage'
arch/powerpc/Makefile
Quoted 3 lines
arch/powerpc/Makefile +2
-0+ @echo ' These targets support board with firmware that does not' + @echo ' support passing a device tree directly. Replace <dt> withthe'
Quoted 2 lines
+ @echo ' name of a dts file from the arch/$(ARCH)/boot/dts/
directory'
Quoted 18 lines
arch/powerpc/Makefile +1
-0+ @echo ' (minus the .dts extension).' endef install:arch/powerpc/boot/wrapper +4
-0@@ -203,6 +203,10 @@ simpleboot-virtex405-*) platformo="$object/virtex405-head.o $object/simpleboot.o" binary=y ;; +simpleboot-*) + platformo="$object/simpleboot.o" + binary=y + ;; esac
Quoted 9 lines
arch/powerpc/boot/wrapper simpleboot-virtex405-*) · line 212
Quoted 3 lines
arch/powerpc/boot/wrapper +0
-0vmz="$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.
Quoted 6 lines · Stephen Neuendorffer
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?
They are all needed to deal with different firmwares.
treeImage is for OpenBIOS based boards (Ebony, Walnut, some boards running PIBS can also use this). This firmware requires a special header on the image file.
cuImage is for boards running an older U-Boot that does not understand device trees.
uImage is for device-tree aware U-Boot versions
dtbImage is used for boards that can take an ELF zImage, but still need a dtb provided.
simpleImage, not sure here.
josh
RE: [PATCH] powerpc/bootwrapper: Add documentation of boot wrappertargets
Quoted 7 lines
-----Original Message-----
From: Josh Boyer [mailto:[email protected]]
Sent: Thursday, June 26, 2008 12:07 PM
To: Stephen Neuendorffer
Cc: [email protected]; John Linn; [email protected];
Quoted 2 lines
[email protected]
Subject: RE: [PATCH] powerpc/bootwrapper: Add documentation of boot
wrappertargets
Quoted 6 lines
=
Quoted 3 lines · Stephen Neuendorffer
My unanswered questions:
1) Why are there 4 different types of targets that embed a device
tree?
Quoted 1 line
Quoted 1 line
I assume they differ in how they are started loaded, but
(unfortunately)
Quoted 1 line
Quoted 1 line
the names are meaningless (With the exception of cuImage, which is
only
Quoted 1 line
Quoted 1 line
cryptic.. :) If I'm adding support for a new board, which should I
use?
Quoted 3 lines
=
They are all needed to deal with different firmwares.
Where 'firmware' really means 'method of invoking the kernel'
Quoted 3 lines
treeImage is for OpenBIOS based boards (Ebony, Walnut, some boards running PIBS can also use this). This firmware requires a special header on the image file.
So it's not an elf? or it is an .elf? maybe it should be 'openBiosImage'?
=
Quoted 2 lines
cuImage is for boards running an older U-Boot that does not understand device trees.
Forgive my ignorance here, but what specifically does this imply? As far as I can tell, generally speaking, some of the board-specific information is passed into the boot wrapper, which then stuffs it into the device tree.
Quoted 1 line
uImage is for device-tree aware U-Boot versions
And this differs from above because it gets a device tree passed in, which uboot has already stuffed correctly.
Quoted 1 line
dtbImage is used for boards that can take an ELF zImage, but still
need
Quoted 4 lines
a dtb provided.
=simpleImage, not sure here.
So both of these are elfs... but how do they differ? Is it only in how the right head.s file gets picked up?
Steve
This email and any attachments are intended for the sole use of the named r= ecipient(s) and contain(s) confidential information that may be proprietary= , privileged or copyrighted under applicable law. If you are not the intend= ed recipient, do not read, copy, or forward this email message or any attac= hments. Delete this email message and any attachments immediately.
Re: [PATCH] powerpc/bootwrapper: Add documentation of boot wrappertargets
Quoted 7 lines · Stephen Neuendorffer
Quoted 2 lines
cuImage is for boards running an older U-Boot that does not understand device trees.
Forgive my ignorance here, but what specifically does this imply? As far as I can tell, generally speaking, some of the board-specific information is passed into the boot wrapper, which then stuffs it into the device tree.
It implies that the binary is in uImage format, targets older u-boot (as opposed to some other bootloader entirely, which might be targeted with a dtbImage -- see adder875, for example), and has a device tree embedded.
Quoted 4 lines
Quoted 1 line
uImage is for device-tree aware U-Boot versions
And this differs from above because it gets a device tree passed in, which uboot has already stuffed correctly.
Yes.
Quoted 8 lines
Quoted 1 line
dtbImage is used for boards that can take an ELF zImage, but still
need
Quoted 3 lines
a dtb provided.
simpleImage, not sure here.
So both of these are elfs... but how do they differ? Is it only in how the right head.s file gets picked up?
Neither is necessarily an ELF. The only simpleboot target I see is a flat binary, as are some of the dtbImage targets (adder875, ep88xc, ep405, etc). simpleboot is more of a platform than an image type; it's a platform that assumes nothing about the firmware that loaded it, and gets all information from the embedded device tree.
-Scott
Documentation/powerpc/bootwrapper.txt line 36
Quoted 4 lines · Grant Likely
Documentation/powerpc/bootwrapper.txt new file +4
-0+ zImage.%: Image usable by OpenFirmware. Image expects firmware + to provide the device tree using OpenFirmware + interfaces. Typically general purpose hardware uses + this image format.
Is it really specific to Open Firmware? I'd say something like: "Image format usable by the firmware natively shipped on the board, if not covered by another image type. A device tree is not embedded into the image."
-Scott
Re: [PATCH] powerpc/bootwrapper: Add documentation of boot wrappertargets
In reply to Stephen NeuendorfferQuoted 4 lines · Stephen Neuendorffer
Forgive my ignorance here, but what specifically does this imply? As far as I can tell, generally speaking, some of the board-specific information is passed into the boot wrapper, which then stuffs it into the device tree.
Yes, you are correct. I'll fill out the documentation more here.
Quoted 4 lines
Quoted 1 line
uImage is for device-tree aware U-Boot versions
And this differs from above because it gets a device tree passed in, which uboot has already stuffed correctly.
Correct.
Quoted 8 lines
Quoted 1 line
dtbImage is used for boards that can take an ELF zImage, but still
need
Quoted 3 lines
a dtb provided.
simpleImage, not sure here.
So both of these are elfs... but how do they differ? Is it only in how the right head.s file gets picked up?
simpleImage is not an elf. Its a raw position-independent binary which can be loaded anywhere in RAM.
Some dtbImages are elfs; but there are a flat binaries. The main difference is that all simpleImages assume that firmware provides nothing interesting; but the flat dtbImages have custom code for extracting a little bit of data out of the boards firmware.
It's all a bit of a confusing mess. It might be a good idea to rework all the image names to stuff not so non-obvious, but I'm not sure the best way to go about it. There is a lot of historical stuff in there where the various 'zImage.*' targets grew and morphed over time in ways that are hard to follow. It may make more sense to change the flat-binary dtbImages to be simpleImages instead with overrides for specific boards (just like is done for virtex405-*). ps3 is the other major user of dtbImage. I created the whole dtbImage stuff in the first place to eliminate overloaded makefile targets where some zImage% target were providing a device tree and other zImage% targets were not. Splitting dtb-provided from dtb-not-provided targets clarified the Makefile quite a bit. dtbImage is not a fantastic name, but I needed something different from zImage for images with an embedded device tree.
Looking at the Makefile, dtbImage and simpleImage targets are virtually identical. Perhaps it would be best to merge the targets and deal with all the differences in the wrapper script (with the default to just use simpleboot.S as the init code). Thoughts?
Cheers,
g.
Signature · 2 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd.
RE: [PATCH] powerpc/bootwrapper: Add documentation of boot wrappertargets
simpleImage should also create an .elf (for xmd or systemAce loading) If dtbImage and simpleImage could be merged, I'd be all for it...
At some point of course, I need to figure merge the Device Tree in BRAM code that I've been using, which would be a simpleImage which wouldn't need a device tree. However, I don't see this happening before August.
Steve
-----Original Message-----
From: [email protected] on behalf of Grant Likely
Sent: Fri 6/27/2008 9:22 PM
To: Stephen Neuendorffer
Cc: Josh Boyer; John Linn; [email protected]; [email protected]; [email protected]; Scott Wood; Geoff Levand
Subject: Re: [PATCH] powerpc/bootwrapper: Add documentation of boot wrappertargets
Quoted 4 lines · Stephen Neuendorffer
Forgive my ignorance here, but what specifically does this imply? As far as I can tell, generally speaking, some of the board-specific information is passed into the boot wrapper, which then stuffs it into the device tree.
Yes, you are correct. I'll fill out the documentation more here.
Quoted 4 lines
Quoted 1 line
uImage is for device-tree aware U-Boot versions
And this differs from above because it gets a device tree passed in, which uboot has already stuffed correctly.
Correct.
Quoted 8 lines
Quoted 1 line
dtbImage is used for boards that can take an ELF zImage, but still
need
Quoted 3 lines
a dtb provided.
simpleImage, not sure here.
So both of these are elfs... but how do they differ? Is it only in how the right head.s file gets picked up?
simpleImage is not an elf. Its a raw position-independent binary which can be loaded anywhere in RAM.
Some dtbImages are elfs; but there are a flat binaries. The main difference is that all simpleImages assume that firmware provides nothing interesting; but the flat dtbImages have custom code for extracting a little bit of data out of the boards firmware.
It's all a bit of a confusing mess. It might be a good idea to rework all the image names to stuff not so non-obvious, but I'm not sure the best way to go about it. There is a lot of historical stuff in there where the various 'zImage.*' targets grew and morphed over time in ways that are hard to follow. It may make more sense to change the flat-binary dtbImages to be simpleImages instead with overrides for specific boards (just like is done for virtex405-*). ps3 is the other major user of dtbImage. I created the whole dtbImage stuff in the first place to eliminate overloaded makefile targets where some zImage% target were providing a device tree and other zImage% targets were not. Splitting dtb-provided from dtb-not-provided targets clarified the Makefile quite a bit. dtbImage is not a fantastic name, but I needed something different from zImage for images with an embedded device tree.
Looking at the Makefile, dtbImage and simpleImage targets are virtually identical. Perhaps it would be best to merge the targets and deal with all the differences in the wrapper script (with the default to just use simpleboot.S as the init code). Thoughts?
Cheers,
g.
Signature · 7 lines
Grant Likely, B.Sc., P.Eng. Secret Lab Technologies Ltd. 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.