Re: [PATCH] powerpc/bootwrapper: Add documentation of boot wrapper targets

2008-06-27 Thread Scott Wood
On Wed, Jun 25, 2008 at 01:21:04PM -0700, Grant Likely wrote:
 +   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
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


RE: [PATCH] powerpc/bootwrapper: Add documentation of boot wrapper targets

2008-06-26 Thread John Linn
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.

Signed-off-by: Grant Likely [EMAIL PROTECTED]
---

 Documentation/powerpc/bootwrapper.txt |   78
+
 arch/powerpc/Makefile |   15 ++
 arch/powerpc/boot/wrapper |4 ++
 3 files changed, 96 insertions(+), 1 deletions(-)

diff --git a/Documentation/powerpc/bootwrapper.txt
b/Documentation/powerpc/bootwrapper.txt
new file mode 100644
index 000..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)
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 

RE: [PATCH] powerpc/bootwrapper: Add documentation of boot wrapper targets

2008-06-26 Thread 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.

 -Original Message-
 From: Grant Likely [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, June 25, 2008 1: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.
 
 Signed-off-by: Grant Likely [EMAIL PROTECTED]
 ---
 
  Documentation/powerpc/bootwrapper.txt |   78
+
  arch/powerpc/Makefile |   15 ++
  arch/powerpc/boot/wrapper |4 ++
  3 files changed, 96 insertions(+), 1 deletions(-)
 
 diff --git a/Documentation/powerpc/bootwrapper.txt
b/Documentation/powerpc/bootwrapper.txt
 new file mode 100644
 index 000..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)
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

Re: [PATCH] powerpc/bootwrapper: Add documentation of boot wrapper targets

2008-06-26 Thread Peter Mendham
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.

  

-Original Message-
From: Grant Likely [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 25, 2008 1: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.

Signed-off-by: Grant Likely [EMAIL PROTECTED]
---

 Documentation/powerpc/bootwrapper.txt |   78


+
  

 arch/powerpc/Makefile |   15 ++
 arch/powerpc/boot/wrapper |4 ++
 3 files changed, 96 insertions(+), 1 deletions(-)

diff --git a/Documentation/powerpc/bootwrapper.txt


b/Documentation/powerpc/bootwrapper.txt
  

new file mode 100644
index 000..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)


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 

RE: [PATCH] powerpc/bootwrapper: Add documentation of boot wrapper targets

2008-06-26 Thread Josh Boyer
On Thu, 2008-06-26 at 09:48 -0700, 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?

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

___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev


Re: [PATCH] powerpc/bootwrapper: Add documentation of boot wrapper targets

2008-06-25 Thread Grant Likely
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.

Signed-off-by: Grant Likely [EMAIL PROTECTED]
---

 Documentation/powerpc/bootwrapper.txt |   78 +
 arch/powerpc/Makefile |   15 ++
 arch/powerpc/boot/wrapper |4 ++
 3 files changed, 96 insertions(+), 1 deletions(-)

diff --git a/Documentation/powerpc/bootwrapper.txt
b/Documentation/powerpc/bootwrapper.txt
new file mode 100644
index 000..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) 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