2016-02-06 03:30:11 +00:00
|
|
|
U-Boot new uImage source file format (bindings definition)
|
2008-03-12 11:13:13 +00:00
|
|
|
==========================================================
|
|
|
|
|
|
|
|
Author: Marian Balakowicz <m8@semihalf.com>
|
2016-02-23 05:55:53 +00:00
|
|
|
External data additions, 25/1/16 Simon Glass <sjg@chromium.org>
|
2008-03-12 11:13:13 +00:00
|
|
|
|
|
|
|
1) Introduction
|
|
|
|
---------------
|
|
|
|
|
|
|
|
Evolution of the 2.6 Linux kernel for embedded PowerPC systems introduced new
|
|
|
|
booting method which requires that hardware description is available to the
|
|
|
|
kernel in the form of Flattened Device Tree.
|
|
|
|
|
|
|
|
Booting with a Flattened Device Tree is much more flexible and is intended to
|
|
|
|
replace direct passing of 'struct bd_info' which was used to boot pre-FDT
|
|
|
|
kernels.
|
|
|
|
|
2016-02-06 03:30:11 +00:00
|
|
|
However, U-Boot needs to support both techniques to provide backward
|
2008-03-12 11:13:13 +00:00
|
|
|
compatibility for platforms which are not FDT ready. Number of elements
|
|
|
|
playing role in the booting process has increased and now includes the FDT
|
|
|
|
blob. Kernel image, FDT blob and possibly ramdisk image - all must be placed
|
|
|
|
in the system memory and passed to bootm as a arguments. Some of them may be
|
|
|
|
missing: FDT is not present for legacy platforms, ramdisk is always optional.
|
|
|
|
Additionally, old uImage format has been extended to support multi sub-images
|
|
|
|
but the support is limited by simple format of the legacy uImage structure.
|
2022-09-07 02:26:52 +00:00
|
|
|
Single binary header 'struct legacy_img_hdr' is not flexible enough to cover all
|
2008-03-12 11:13:13 +00:00
|
|
|
possible scenarios.
|
|
|
|
|
|
|
|
All those factors combined clearly show that there is a need for new, more
|
|
|
|
flexible, multi component uImage format.
|
|
|
|
|
|
|
|
|
|
|
|
2) New uImage format assumptions
|
|
|
|
--------------------------------
|
|
|
|
|
|
|
|
a) Implementation
|
|
|
|
|
|
|
|
Libfdt has been selected for the new uImage format implementation as (1) it
|
|
|
|
provides needed functionality, (2) is actively maintained and developed and
|
2016-02-06 03:30:11 +00:00
|
|
|
(3) increases code reuse as it is already part of the U-Boot source tree.
|
2008-03-12 11:13:13 +00:00
|
|
|
|
|
|
|
b) Terminology
|
|
|
|
|
|
|
|
This document defines new uImage structure by providing FDT bindings for new
|
2016-02-06 03:30:11 +00:00
|
|
|
uImage internals. Bindings are defined from U-Boot perspective, i.e. describe
|
|
|
|
final form of the uImage at the moment when it reaches U-Boot. User
|
2008-03-12 11:13:13 +00:00
|
|
|
perspective may be simpler, as some of the properties (like timestamps and
|
2016-02-06 03:30:11 +00:00
|
|
|
hashes) will need to be filled in automatically by the U-Boot mkimage tool.
|
2008-03-12 11:13:13 +00:00
|
|
|
|
|
|
|
To avoid confusion with the kernel FDT the following naming convention is
|
|
|
|
proposed for the new uImage format related terms:
|
|
|
|
|
|
|
|
FIT - Flattened uImage Tree
|
|
|
|
|
|
|
|
FIT is formally a flattened device tree (in the libfdt meaning), which
|
|
|
|
conforms to bindings defined in this document.
|
|
|
|
|
|
|
|
.its - image tree source
|
2016-03-23 22:44:17 +00:00
|
|
|
.itb - flattened image tree blob
|
2008-03-12 11:13:13 +00:00
|
|
|
|
|
|
|
c) Image building procedure
|
|
|
|
|
|
|
|
The following picture shows how the new uImage is prepared. Input consists of
|
|
|
|
image source file (.its) and a set of data files. Image is created with the
|
2016-02-06 03:30:11 +00:00
|
|
|
help of standard U-Boot mkimage tool which in turn uses dtc (device tree
|
2013-09-13 11:28:21 +00:00
|
|
|
compiler) to produce image tree blob (.itb). Resulting .itb file is the
|
2008-03-12 11:13:13 +00:00
|
|
|
actual binary of a new uImage.
|
|
|
|
|
|
|
|
|
|
|
|
tqm5200.its
|
|
|
|
+
|
2008-03-26 10:48:46 +00:00
|
|
|
vmlinux.bin.gz mkimage + dtc xfer to target
|
2008-03-12 11:13:13 +00:00
|
|
|
eldk-4.2-ramdisk --------------> tqm5200.itb --------------> bootm
|
2008-03-26 10:48:46 +00:00
|
|
|
tqm5200.dtb /|\
|
|
|
|
... |
|
|
|
|
'new uImage'
|
2008-03-12 11:13:13 +00:00
|
|
|
|
|
|
|
- create .its file, automatically filled-in properties are omitted
|
|
|
|
- call mkimage tool on a .its file
|
|
|
|
- mkimage calls dtc to create .itb image and assures that
|
|
|
|
missing properties are added
|
|
|
|
- .itb (new uImage) is uploaded onto the target and used therein
|
|
|
|
|
|
|
|
|
|
|
|
d) Unique identifiers
|
|
|
|
|
|
|
|
To identify FIT sub-nodes representing images, hashes, configurations (which
|
|
|
|
are defined in the following sections), the "unit name" of the given sub-node
|
|
|
|
is used as it's identifier as it assures uniqueness without additional
|
|
|
|
checking required.
|
|
|
|
|
|
|
|
|
|
|
|
3) Root node properties
|
|
|
|
-----------------------
|
|
|
|
|
|
|
|
Root node of the uImage Tree should have the following layout:
|
|
|
|
|
|
|
|
/ o image-tree
|
|
|
|
|- description = "image description"
|
|
|
|
|- timestamp = <12399321>
|
|
|
|
|- #address-cells = <1>
|
|
|
|
|
|
|
|
|
o images
|
|
|
|
| |
|
2017-12-04 02:05:07 +00:00
|
|
|
| o image-1 {...}
|
|
|
|
| o image-2 {...}
|
2008-03-12 11:13:13 +00:00
|
|
|
| ...
|
|
|
|
|
|
|
|
|
o configurations
|
2017-12-04 02:05:07 +00:00
|
|
|
|- default = "conf-1"
|
2008-03-12 11:13:13 +00:00
|
|
|
|
|
2017-12-04 02:05:07 +00:00
|
|
|
o conf-1 {...}
|
|
|
|
o conf-2 {...}
|
2008-03-12 11:13:13 +00:00
|
|
|
...
|
|
|
|
|
|
|
|
|
|
|
|
Optional property:
|
|
|
|
- description : Textual description of the uImage
|
|
|
|
|
|
|
|
Mandatory property:
|
|
|
|
- timestamp : Last image modification time being counted in seconds since
|
|
|
|
1970-01-01 00:00:00 - to be automatically calculated by mkimage tool.
|
|
|
|
|
|
|
|
Conditionally mandatory property:
|
|
|
|
- #address-cells : Number of 32bit cells required to represent entry and
|
|
|
|
load addresses supplied within sub-image nodes. May be omitted when no
|
|
|
|
entry or load addresses are used.
|
|
|
|
|
doc: FIT image: Clarify format and simplify syntax
** Introduction
There are currently four ways to load an OS image with u-boot
1. SPL -> u-boot -> bootm
2. SPL blue falcon mode
3. "Basic" FIT image (CONFIG_LOAD_FIT)
4. "Full-featured" FIT image (CONFIG_LOAD_FIT_FULL)
These four code paths were developed independently, and share very
little code. (3) and (4), behave very differently, are littered with
special cases. They even have different DTS syntax and properties.
The cause of this divergence is that the FIT format specification
leaves a number of things open to interpretation. The purpose of this
change is to enable the reduction of code size, duplication, and
complexity by updating and streamlining the FIT format.
We are only marginally concerned with backwards compatibility, because
we don't have inter-compatibility. For example, CONFIG_LOAD_FIT is
able to load images that CONFIG_LOAD_FIT_FULL won't. This is a direct
result of the incompatible syntax between the two implementations.
Ideally, these changes would enable "simple" FIT to be a subset of the
"full" fit implementation, and share most code. These changes should
also eliminate the need for falcon mode (although we are not
advocating for the removal of falcon mode at this time).
** Description of changes
* The "configurations" node is now mandatory
Guessing how to load components based on their "os" and "type" invites
confusion and superfluous heuristics. Instead, require each FIT image
to be explicit on how components should be loaded.
* Eliminate "ramdisk", "setup", "standalone", and "fpga" properties
Having too many special purpose properties requires special-casing
FIT loading code. When a special property can be handled by another
property, it is redundant.
- A "ramdisk" is identical to a loadable. Thus ramdisk images should
be placed under "loadables".
- A "setup" node can be achieved by using a "kernel" or "firmware"
property instead.
- "standalone" is used for u-boot nodes. The correct property to use
in this case is "firmware".
- "fpga" is a loadable
* Prioritize control between "firmware" and "kernel"
"firmware" and "kernel" are special nodes in that control is passed
to the "entry-point" of the image. Both can be present, for example,
an OP-TEE firmware with a linux kernel. When both are present,
control is passed to the "firmware" image.
** Further generalizations (not included herein)
The "firmware" and "kernel" properties could be generalized as a
"next-boot-stage", or similar name. This "next" stage would be special
in that it is both executable, and is the stage that is passed
control. For example, "next-stage" could be an op-tee image, with
linux as a loadable, or a u-boot image.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2020-12-15 19:15:43 +00:00
|
|
|
Mandatory nodes:
|
2008-03-12 11:13:13 +00:00
|
|
|
- images : This node contains a set of sub-nodes, each of them representing
|
|
|
|
single component sub-image (like kernel, ramdisk, etc.). At least one
|
|
|
|
sub-image is required.
|
|
|
|
- configurations : Contains a set of available configuration nodes and
|
|
|
|
defines a default configuration.
|
|
|
|
|
|
|
|
|
|
|
|
4) '/images' node
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
This node is a container node for component sub-image nodes. Each sub-node of
|
|
|
|
the '/images' node should have the following layout:
|
|
|
|
|
2017-12-04 02:05:07 +00:00
|
|
|
o image-1
|
2008-03-12 11:13:13 +00:00
|
|
|
|- description = "component sub-image description"
|
|
|
|
|- data = /incbin/("path/to/data/file.bin")
|
|
|
|
|- type = "sub-image type name"
|
|
|
|
|- arch = "ARCH name"
|
|
|
|
|- os = "OS name"
|
|
|
|
|- compression = "compression name"
|
|
|
|
|- load = <00000000>
|
|
|
|
|- entry = <00000000>
|
|
|
|
|
|
2017-12-04 02:05:07 +00:00
|
|
|
o hash-1 {...}
|
|
|
|
o hash-2 {...}
|
2008-03-12 11:13:13 +00:00
|
|
|
...
|
|
|
|
|
|
|
|
Mandatory properties:
|
|
|
|
- description : Textual description of the component sub-image
|
|
|
|
- type : Name of component sub-image type, supported types are:
|
2017-07-18 18:14:19 +00:00
|
|
|
"standalone", "kernel", "kernel_noload", "ramdisk", "firmware", "script",
|
|
|
|
"filesystem", "flat_dt" and others (see uimage_type in common/image.c).
|
2008-03-12 11:13:13 +00:00
|
|
|
- data : Path to the external file which contains this node's binary data.
|
|
|
|
- compression : Compression used by included data. Supported compressions
|
|
|
|
are "gzip" and "bzip2". If no compression is used compression property
|
2018-07-30 10:53:18 +00:00
|
|
|
should be set to "none". If the data is compressed but it should not be
|
|
|
|
uncompressed by U-Boot (e.g. compressed ramdisk), this should also be set
|
|
|
|
to "none".
|
2008-03-12 11:13:13 +00:00
|
|
|
|
|
|
|
Conditionally mandatory property:
|
doc: FIT image: Clarify format and simplify syntax
** Introduction
There are currently four ways to load an OS image with u-boot
1. SPL -> u-boot -> bootm
2. SPL blue falcon mode
3. "Basic" FIT image (CONFIG_LOAD_FIT)
4. "Full-featured" FIT image (CONFIG_LOAD_FIT_FULL)
These four code paths were developed independently, and share very
little code. (3) and (4), behave very differently, are littered with
special cases. They even have different DTS syntax and properties.
The cause of this divergence is that the FIT format specification
leaves a number of things open to interpretation. The purpose of this
change is to enable the reduction of code size, duplication, and
complexity by updating and streamlining the FIT format.
We are only marginally concerned with backwards compatibility, because
we don't have inter-compatibility. For example, CONFIG_LOAD_FIT is
able to load images that CONFIG_LOAD_FIT_FULL won't. This is a direct
result of the incompatible syntax between the two implementations.
Ideally, these changes would enable "simple" FIT to be a subset of the
"full" fit implementation, and share most code. These changes should
also eliminate the need for falcon mode (although we are not
advocating for the removal of falcon mode at this time).
** Description of changes
* The "configurations" node is now mandatory
Guessing how to load components based on their "os" and "type" invites
confusion and superfluous heuristics. Instead, require each FIT image
to be explicit on how components should be loaded.
* Eliminate "ramdisk", "setup", "standalone", and "fpga" properties
Having too many special purpose properties requires special-casing
FIT loading code. When a special property can be handled by another
property, it is redundant.
- A "ramdisk" is identical to a loadable. Thus ramdisk images should
be placed under "loadables".
- A "setup" node can be achieved by using a "kernel" or "firmware"
property instead.
- "standalone" is used for u-boot nodes. The correct property to use
in this case is "firmware".
- "fpga" is a loadable
* Prioritize control between "firmware" and "kernel"
"firmware" and "kernel" are special nodes in that control is passed
to the "entry-point" of the image. Both can be present, for example,
an OP-TEE firmware with a linux kernel. When both are present,
control is passed to the "firmware" image.
** Further generalizations (not included herein)
The "firmware" and "kernel" properties could be generalized as a
"next-boot-stage", or similar name. This "next" stage would be special
in that it is both executable, and is the stage that is passed
control. For example, "next-stage" could be an op-tee image, with
linux as a loadable, or a u-boot image.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2020-12-15 19:15:43 +00:00
|
|
|
- os : OS name, mandatory for types "kernel". Valid OS names are:
|
|
|
|
"openbsd", "netbsd", "freebsd", "4_4bsd", "linux", "svr4", "esix",
|
2015-01-15 04:37:33 +00:00
|
|
|
"solaris", "irix", "sco", "dell", "ncr", "lynxos", "vxworks", "psos", "qnx",
|
2020-08-07 17:13:31 +00:00
|
|
|
"u-boot", "rtems", "unity", "integrity".
|
2008-03-12 11:13:13 +00:00
|
|
|
- arch : Architecture name, mandatory for types: "standalone", "kernel",
|
|
|
|
"firmware", "ramdisk" and "fdt". Valid architecture names are: "alpha",
|
|
|
|
"arm", "i386", "ia64", "mips", "mips64", "ppc", "s390", "sh", "sparc",
|
2014-10-20 03:11:23 +00:00
|
|
|
"sparc64", "m68k", "microblaze", "nios2", "blackfin", "avr32", "st200",
|
|
|
|
"sandbox".
|
2008-03-12 11:13:13 +00:00
|
|
|
- entry : entry point address, address size is determined by
|
doc: FIT image: Clarify format and simplify syntax
** Introduction
There are currently four ways to load an OS image with u-boot
1. SPL -> u-boot -> bootm
2. SPL blue falcon mode
3. "Basic" FIT image (CONFIG_LOAD_FIT)
4. "Full-featured" FIT image (CONFIG_LOAD_FIT_FULL)
These four code paths were developed independently, and share very
little code. (3) and (4), behave very differently, are littered with
special cases. They even have different DTS syntax and properties.
The cause of this divergence is that the FIT format specification
leaves a number of things open to interpretation. The purpose of this
change is to enable the reduction of code size, duplication, and
complexity by updating and streamlining the FIT format.
We are only marginally concerned with backwards compatibility, because
we don't have inter-compatibility. For example, CONFIG_LOAD_FIT is
able to load images that CONFIG_LOAD_FIT_FULL won't. This is a direct
result of the incompatible syntax between the two implementations.
Ideally, these changes would enable "simple" FIT to be a subset of the
"full" fit implementation, and share most code. These changes should
also eliminate the need for falcon mode (although we are not
advocating for the removal of falcon mode at this time).
** Description of changes
* The "configurations" node is now mandatory
Guessing how to load components based on their "os" and "type" invites
confusion and superfluous heuristics. Instead, require each FIT image
to be explicit on how components should be loaded.
* Eliminate "ramdisk", "setup", "standalone", and "fpga" properties
Having too many special purpose properties requires special-casing
FIT loading code. When a special property can be handled by another
property, it is redundant.
- A "ramdisk" is identical to a loadable. Thus ramdisk images should
be placed under "loadables".
- A "setup" node can be achieved by using a "kernel" or "firmware"
property instead.
- "standalone" is used for u-boot nodes. The correct property to use
in this case is "firmware".
- "fpga" is a loadable
* Prioritize control between "firmware" and "kernel"
"firmware" and "kernel" are special nodes in that control is passed
to the "entry-point" of the image. Both can be present, for example,
an OP-TEE firmware with a linux kernel. When both are present,
control is passed to the "firmware" image.
** Further generalizations (not included herein)
The "firmware" and "kernel" properties could be generalized as a
"next-boot-stage", or similar name. This "next" stage would be special
in that it is both executable, and is the stage that is passed
control. For example, "next-stage" could be an op-tee image, with
linux as a loadable, or a u-boot image.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2020-12-15 19:15:43 +00:00
|
|
|
'#address-cells' property of the root node.
|
|
|
|
Mandatory for types: "firmware", and "kernel".
|
2008-03-12 11:13:13 +00:00
|
|
|
- load : load address, address size is determined by '#address-cells'
|
doc: FIT image: Clarify format and simplify syntax
** Introduction
There are currently four ways to load an OS image with u-boot
1. SPL -> u-boot -> bootm
2. SPL blue falcon mode
3. "Basic" FIT image (CONFIG_LOAD_FIT)
4. "Full-featured" FIT image (CONFIG_LOAD_FIT_FULL)
These four code paths were developed independently, and share very
little code. (3) and (4), behave very differently, are littered with
special cases. They even have different DTS syntax and properties.
The cause of this divergence is that the FIT format specification
leaves a number of things open to interpretation. The purpose of this
change is to enable the reduction of code size, duplication, and
complexity by updating and streamlining the FIT format.
We are only marginally concerned with backwards compatibility, because
we don't have inter-compatibility. For example, CONFIG_LOAD_FIT is
able to load images that CONFIG_LOAD_FIT_FULL won't. This is a direct
result of the incompatible syntax between the two implementations.
Ideally, these changes would enable "simple" FIT to be a subset of the
"full" fit implementation, and share most code. These changes should
also eliminate the need for falcon mode (although we are not
advocating for the removal of falcon mode at this time).
** Description of changes
* The "configurations" node is now mandatory
Guessing how to load components based on their "os" and "type" invites
confusion and superfluous heuristics. Instead, require each FIT image
to be explicit on how components should be loaded.
* Eliminate "ramdisk", "setup", "standalone", and "fpga" properties
Having too many special purpose properties requires special-casing
FIT loading code. When a special property can be handled by another
property, it is redundant.
- A "ramdisk" is identical to a loadable. Thus ramdisk images should
be placed under "loadables".
- A "setup" node can be achieved by using a "kernel" or "firmware"
property instead.
- "standalone" is used for u-boot nodes. The correct property to use
in this case is "firmware".
- "fpga" is a loadable
* Prioritize control between "firmware" and "kernel"
"firmware" and "kernel" are special nodes in that control is passed
to the "entry-point" of the image. Both can be present, for example,
an OP-TEE firmware with a linux kernel. When both are present,
control is passed to the "firmware" image.
** Further generalizations (not included herein)
The "firmware" and "kernel" properties could be generalized as a
"next-boot-stage", or similar name. This "next" stage would be special
in that it is both executable, and is the stage that is passed
control. For example, "next-stage" could be an op-tee image, with
linux as a loadable, or a u-boot image.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2020-12-15 19:15:43 +00:00
|
|
|
property of the root node.
|
|
|
|
Mandatory for types: "firmware", and "kernel".
|
|
|
|
- compatible : compatible method for loading image.
|
|
|
|
Mandatory for types: "fpga", and images that do not specify a load address.
|
2022-07-22 14:16:13 +00:00
|
|
|
Supported compatible methods:
|
|
|
|
"u-boot,fpga-legacy" - the generic fpga loading routine.
|
|
|
|
"u-boot,zynqmp-fpga-ddrauth" - signed non-encrypted FPGA bitstream for
|
|
|
|
Xilinx Zynq UltraScale+ (ZymqMP) device.
|
2022-07-22 14:16:14 +00:00
|
|
|
"u-boot,zynqmp-fpga-enc" - encrypted FPGA bitstream for Xilinx Zynq
|
|
|
|
UltraScale+ (ZynqMP) device.
|
2022-10-21 00:23:03 +00:00
|
|
|
- phase : U-Boot phase for which the image is intended.
|
|
|
|
"spl" - image is an SPL image
|
|
|
|
"u-boot" - image is a U-Boot image
|
2008-03-12 11:13:13 +00:00
|
|
|
|
|
|
|
Optional nodes:
|
2017-12-04 02:05:07 +00:00
|
|
|
- hash-1 : Each hash sub-node represents separate hash or checksum
|
2008-03-12 11:13:13 +00:00
|
|
|
calculated for node's data according to specified algorithm.
|
|
|
|
|
|
|
|
|
|
|
|
5) Hash nodes
|
|
|
|
-------------
|
|
|
|
|
2017-12-04 02:05:07 +00:00
|
|
|
o hash-1
|
2008-03-12 11:13:13 +00:00
|
|
|
|- algo = "hash or checksum algorithm name"
|
|
|
|
|- value = [hash or checksum value]
|
|
|
|
|
|
|
|
Mandatory properties:
|
|
|
|
- algo : Algorithm name, supported are "crc32", "md5" and "sha1".
|
|
|
|
- value : Actual checksum or hash value, correspondingly 4, 16 or 20 bytes
|
|
|
|
long.
|
|
|
|
|
|
|
|
|
|
|
|
6) '/configurations' node
|
|
|
|
-------------------------
|
|
|
|
|
doc: FIT image: Clarify format and simplify syntax
** Introduction
There are currently four ways to load an OS image with u-boot
1. SPL -> u-boot -> bootm
2. SPL blue falcon mode
3. "Basic" FIT image (CONFIG_LOAD_FIT)
4. "Full-featured" FIT image (CONFIG_LOAD_FIT_FULL)
These four code paths were developed independently, and share very
little code. (3) and (4), behave very differently, are littered with
special cases. They even have different DTS syntax and properties.
The cause of this divergence is that the FIT format specification
leaves a number of things open to interpretation. The purpose of this
change is to enable the reduction of code size, duplication, and
complexity by updating and streamlining the FIT format.
We are only marginally concerned with backwards compatibility, because
we don't have inter-compatibility. For example, CONFIG_LOAD_FIT is
able to load images that CONFIG_LOAD_FIT_FULL won't. This is a direct
result of the incompatible syntax between the two implementations.
Ideally, these changes would enable "simple" FIT to be a subset of the
"full" fit implementation, and share most code. These changes should
also eliminate the need for falcon mode (although we are not
advocating for the removal of falcon mode at this time).
** Description of changes
* The "configurations" node is now mandatory
Guessing how to load components based on their "os" and "type" invites
confusion and superfluous heuristics. Instead, require each FIT image
to be explicit on how components should be loaded.
* Eliminate "ramdisk", "setup", "standalone", and "fpga" properties
Having too many special purpose properties requires special-casing
FIT loading code. When a special property can be handled by another
property, it is redundant.
- A "ramdisk" is identical to a loadable. Thus ramdisk images should
be placed under "loadables".
- A "setup" node can be achieved by using a "kernel" or "firmware"
property instead.
- "standalone" is used for u-boot nodes. The correct property to use
in this case is "firmware".
- "fpga" is a loadable
* Prioritize control between "firmware" and "kernel"
"firmware" and "kernel" are special nodes in that control is passed
to the "entry-point" of the image. Both can be present, for example,
an OP-TEE firmware with a linux kernel. When both are present,
control is passed to the "firmware" image.
** Further generalizations (not included herein)
The "firmware" and "kernel" properties could be generalized as a
"next-boot-stage", or similar name. This "next" stage would be special
in that it is both executable, and is the stage that is passed
control. For example, "next-stage" could be an op-tee image, with
linux as a loadable, or a u-boot image.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2020-12-15 19:15:43 +00:00
|
|
|
The 'configurations' node creates convenient, labeled boot configurations,
|
|
|
|
which combine together kernel images with their ramdisks and fdt blobs.
|
2008-03-12 11:13:13 +00:00
|
|
|
|
|
|
|
The 'configurations' node has has the following structure:
|
|
|
|
|
|
|
|
o configurations
|
|
|
|
|- default = "default configuration sub-node unit name"
|
|
|
|
|
|
2017-12-04 02:05:07 +00:00
|
|
|
o config-1 {...}
|
|
|
|
o config-2 {...}
|
2008-03-12 11:13:13 +00:00
|
|
|
...
|
|
|
|
|
|
|
|
|
|
|
|
Optional property:
|
|
|
|
- default : Selects one of the configuration sub-nodes as a default
|
|
|
|
configuration.
|
|
|
|
|
|
|
|
Mandatory nodes:
|
|
|
|
- configuration-sub-node-unit-name : At least one of the configuration
|
|
|
|
sub-nodes is required.
|
|
|
|
|
|
|
|
|
|
|
|
7) Configuration nodes
|
|
|
|
----------------------
|
|
|
|
|
|
|
|
Each configuration has the following structure:
|
|
|
|
|
2017-12-04 02:05:07 +00:00
|
|
|
o config-1
|
2008-03-12 11:13:13 +00:00
|
|
|
|- description = "configuration description"
|
|
|
|
|- kernel = "kernel sub-node unit name"
|
2017-09-04 20:12:17 +00:00
|
|
|
|- fdt = "fdt sub-node unit-name" [, "fdt overlay sub-node unit-name", ...]
|
2015-05-21 13:52:47 +00:00
|
|
|
|- loadables = "loadables sub-node unit-name"
|
2022-12-12 19:12:11 +00:00
|
|
|
|- script = "
|
2019-07-25 02:37:56 +00:00
|
|
|
|- compatible = "vendor,board-style device tree compatible string"
|
2008-03-12 11:13:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
Mandatory properties:
|
|
|
|
- description : Textual configuration description.
|
doc: FIT image: Clarify format and simplify syntax
** Introduction
There are currently four ways to load an OS image with u-boot
1. SPL -> u-boot -> bootm
2. SPL blue falcon mode
3. "Basic" FIT image (CONFIG_LOAD_FIT)
4. "Full-featured" FIT image (CONFIG_LOAD_FIT_FULL)
These four code paths were developed independently, and share very
little code. (3) and (4), behave very differently, are littered with
special cases. They even have different DTS syntax and properties.
The cause of this divergence is that the FIT format specification
leaves a number of things open to interpretation. The purpose of this
change is to enable the reduction of code size, duplication, and
complexity by updating and streamlining the FIT format.
We are only marginally concerned with backwards compatibility, because
we don't have inter-compatibility. For example, CONFIG_LOAD_FIT is
able to load images that CONFIG_LOAD_FIT_FULL won't. This is a direct
result of the incompatible syntax between the two implementations.
Ideally, these changes would enable "simple" FIT to be a subset of the
"full" fit implementation, and share most code. These changes should
also eliminate the need for falcon mode (although we are not
advocating for the removal of falcon mode at this time).
** Description of changes
* The "configurations" node is now mandatory
Guessing how to load components based on their "os" and "type" invites
confusion and superfluous heuristics. Instead, require each FIT image
to be explicit on how components should be loaded.
* Eliminate "ramdisk", "setup", "standalone", and "fpga" properties
Having too many special purpose properties requires special-casing
FIT loading code. When a special property can be handled by another
property, it is redundant.
- A "ramdisk" is identical to a loadable. Thus ramdisk images should
be placed under "loadables".
- A "setup" node can be achieved by using a "kernel" or "firmware"
property instead.
- "standalone" is used for u-boot nodes. The correct property to use
in this case is "firmware".
- "fpga" is a loadable
* Prioritize control between "firmware" and "kernel"
"firmware" and "kernel" are special nodes in that control is passed
to the "entry-point" of the image. Both can be present, for example,
an OP-TEE firmware with a linux kernel. When both are present,
control is passed to the "firmware" image.
** Further generalizations (not included herein)
The "firmware" and "kernel" properties could be generalized as a
"next-boot-stage", or similar name. This "next" stage would be special
in that it is both executable, and is the stage that is passed
control. For example, "next-stage" could be an op-tee image, with
linux as a loadable, or a u-boot image.
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
2020-12-15 19:15:43 +00:00
|
|
|
- kernel or firmware: Unit name of the corresponding kernel or firmware
|
|
|
|
(u-boot, op-tee, etc) image. If both "kernel" and "firmware" are specified,
|
|
|
|
control is passed to the firmware image.
|
2008-03-12 11:13:13 +00:00
|
|
|
|
|
|
|
Optional properties:
|
|
|
|
- fdt : Unit name of the corresponding fdt blob (component image node of a
|
2017-09-04 20:12:17 +00:00
|
|
|
"fdt type"). Additional fdt overlay nodes can be supplied which signify
|
|
|
|
that the resulting device tree blob is generated by the first base fdt
|
|
|
|
blob with all subsequent overlays applied.
|
2016-05-17 11:58:44 +00:00
|
|
|
- fpga : Unit name of the corresponding fpga bitstream blob
|
|
|
|
(component image node of a "fpga type").
|
2015-05-21 13:52:47 +00:00
|
|
|
- loadables : Unit name containing a list of additional binaries to be
|
|
|
|
loaded at their given locations. "loadables" is a comma-separated list
|
2016-11-29 22:33:20 +00:00
|
|
|
of strings. U-Boot will load each binary at its given start-address and
|
2019-11-14 02:18:03 +00:00
|
|
|
may optionally invoke additional post-processing steps on this binary based
|
2016-11-29 22:33:20 +00:00
|
|
|
on its component image node type.
|
2022-12-12 19:12:11 +00:00
|
|
|
- script : The image to use when loading a U-Boot script (for use with the
|
|
|
|
source command).
|
2019-07-25 02:37:56 +00:00
|
|
|
- compatible : The root compatible string of the U-Boot device tree that
|
|
|
|
this configuration shall automatically match when CONFIG_FIT_BEST_MATCH is
|
|
|
|
enabled. If this property is not provided, the compatible string will be
|
|
|
|
extracted from the fdt blob instead. This is only possible if the fdt is
|
|
|
|
not compressed, so images with compressed fdts that want to use compatible
|
|
|
|
string matching must always provide this property.
|
2008-03-12 11:13:13 +00:00
|
|
|
|
|
|
|
The FDT blob is required to properly boot FDT based kernel, so the minimal
|
|
|
|
configuration for 2.6 FDT kernel is (kernel, fdt) pair.
|
|
|
|
|
|
|
|
Older, 2.4 kernel and 2.6 non-FDT kernel do not use FDT blob, in such cases
|
|
|
|
'struct bd_info' must be passed instead of FDT blob, thus fdt property *must
|
|
|
|
not* be specified in a configuration node.
|
|
|
|
|
|
|
|
|
2016-02-23 05:55:53 +00:00
|
|
|
8) External data
|
|
|
|
----------------
|
|
|
|
|
|
|
|
The above format shows a 'data' property which holds the data for each image.
|
|
|
|
It is also possible for this data to reside outside the FIT itself. This
|
|
|
|
allows the FIT to be quite small, so that it can be loaded and scanned
|
|
|
|
without loading a large amount of data. Then when an image is needed it can
|
|
|
|
be loaded from an external source.
|
|
|
|
|
|
|
|
In this case the 'data' property is omitted. Instead you can use:
|
|
|
|
|
|
|
|
- data-offset : offset of the data in a separate image store. The image
|
|
|
|
store is placed immediately after the last byte of the device tree binary,
|
|
|
|
aligned to a 4-byte boundary.
|
|
|
|
- data-size : size of the data in bytes
|
|
|
|
|
2016-06-10 02:38:02 +00:00
|
|
|
The 'data-offset' property can be substituted with 'data-position', which
|
|
|
|
defines an absolute position or address as the offset. This is helpful when
|
2017-12-05 05:20:59 +00:00
|
|
|
booting U-Boot proper before performing relocation. Pass '-p [offset]' to
|
|
|
|
mkimage to enable 'data-position'.
|
2016-02-23 05:55:53 +00:00
|
|
|
|
2017-08-15 18:14:44 +00:00
|
|
|
Normal kernel FIT image has data embedded within FIT structure. U-Boot image
|
|
|
|
for SPL boot has external data. Existence of 'data-offset' can be used to
|
|
|
|
identify which format is used.
|
|
|
|
|
2020-03-30 03:56:24 +00:00
|
|
|
For FIT image with external data, it would be better to align each blob of data
|
|
|
|
to block(512 byte) for block device, so that we don't need to do the copy when
|
|
|
|
read the image data in SPL. Pass '-B 0x200' to mkimage to align the FIT
|
|
|
|
structure and data to 512 byte, other values available for other align size.
|
|
|
|
|
2016-02-23 05:55:53 +00:00
|
|
|
9) Examples
|
2008-03-12 11:13:13 +00:00
|
|
|
-----------
|
|
|
|
|
2008-03-20 22:10:19 +00:00
|
|
|
Please see doc/uImage.FIT/*.its for actual image source files.
|