Skip to content

Add explicit support for multi-step loading #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion source/chapter2-source-file-format.rst
Original file line number Diff line number Diff line change
Expand Up @@ -574,10 +574,15 @@ Mandatory properties
description
Textual configuration description.

Conditionally mandatory property
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

kernel or firmware
Unit name of the corresponding :index:`kernel` or :index:`firmware`
(u-boot, op-tee, etc) image. If both "kernel" and "firmware" are specified,
control is passed to the firmware image.
control is passed to the firmware image. For `load_only`_ images, these two
properties are optional.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This contradicts the description of load_only below which states that load-only must not contain an executable image.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I fixed that statement above



Optional properties
~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -621,6 +626,14 @@ compatible
Note that U-Boot requires the :index:`CONFIG_FIT_BEST_MATCH` option to be
enabled for this matching to work.

.. _load_only:

load-only
Indicates that this configuration does not necessarily contain an executable
image, i.e. kernel or firmware. The configuration's images may be loaded
into memory for use by the executable image, which comes from another
configuration or FIT. See see :ref:`multi_step`.

The FDT blob is required to properly boot FDT-based kernel, so the minimal
configuration for 2.6 FDT kernel is (kernel, fdt) pair.

Expand Down
30 changes: 30 additions & 0 deletions source/chapter3-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,36 @@ before SPL), then TPL will only load images with a phase of "spl". This allows
all images to be provided in a single FIT, with each phase pulling out what is
needed as the boot proceeds.

.. _multi_step:

Multi-step loading
------------------

The most common use of a FIT is where each configuration contains everything
needed to boot. For example, on ARM systems a configuration contains a kernel,
devicetree(s) and a ramdisk if needed. This approach is widely used on embedded
systems.

This approach is not always desirable, however, particularly when the firmware
and the OS are supplied by different parties. In that case, the devicetree may
be provided by the firmware with the other pieces coming from the OS. This
means that FIT may omit the devicetree images.

With devicetree in particular, it is common for the OS to provide its own
version, or perhaps a devicetree overlay to add some new nodes and properties.

Obviously if the OS has to provide a devicetree for every device, the OS files
would become very large. A middle path could be that the hardware vendor
provides a FIT on a boot partition, containing devicetrees for hardware
supported by that vendor. Then the bootloader can load that FIT to get just the
devicetree, followed by the main FIT to load the OS.

To enable this last case, add a :ref:`load_only` property to the configuration.
This signals to the bootloader that it should not require an executable (i.e.
kernel or firmware), nor should it try to boot with this configuration. Booting
then becomes a two-step process: load one FIT to obtain the devicetree, then
another to obtain the OS. Only the second FIT is booted.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obviously if a configuration does not contain anything executable it can not be executed. The new property load_only is not needed to describe a device-tree only FIT image configuration. What is the use case for the property?

How would the discovery of the multiple FIT images work? Will there be an extra configuration file in the firmware specifying locations of FIT images and the configurations to be used? Where would the format of such a file be defined?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the first point, it must be determinisitic, so we know whether the boot can proceed or not, as noted above.

For the second point, I haven't figured that out yet. Within U-Boot it will need to be part of the bootmeth, perhaps with a separate file, etc.

Security
--------

Expand Down