This method is useful for locating an OS using the VBE approach. Enable
it for the app and payload, for both x86 and ARM.
Series-to: concept
Series-cc: heinrich
Cover-letter:
efi: Support video output on ARM
So far the EFI app supports video on x86 but not ARM. This series adds
this feature, using EFI GOP's 'blt' feature.
Support for bootstd is enabled at the same time, so that the app can
boot an OS automatically.
END
Signed-off-by: Simon Glass <sjg@chromium.org>
Create two new images (vbe0 and vbe1) containing the two types of VBE-OS
setups: with and without an OEM FIT. Put this in a new img/ subdirectory
since the test_ut.py file is getting quite large.
Most of the test is in C, with just the image-setup done in Python.
Enable the test for non-SPL sandbox builds.
Signed-off-by: Simon Glass <sjg@chromium.org>
When booting an OS it is useful to be able to read devicetrees provided
by the OEM, from a separate FIT to the OS.
Add a new method which supports this, along with the usual A/B/recovery
flows, using a state file on the boot device.
Signed-off-by: Simon Glass <sjg@chromium.org>
If a load-only FIT has already provided a devicetree, PXE boot may need
to restart the bootm sequence, rather than starting an entirely new one,
so that the devicetree is preserved and used for booting.
Add support for this by adding a new field in the context and updating
extlinux_boot() to receive the value as a new parameter.
Signed-off-by: Simon Glass <sjg@chromium.org>
Rather than using bflow->fname, which assumes that it is the same as the
passed-in filename, use the passed in filename. This can be different in
some cases.
Signed-off-by: Simon Glass <sjg@chromium.org>
It is not obvious that PXE supports FIT, but it does, by detecting
whether an image is a FIT or not.
In many cases a FIT is more convenient than using separate files for
the kernel, initrd and devicetree.
Really we should promote FIT as an important format, rather than
silentily dealing with it if detected.
Add a new 'fit' token which indicates that a FIT is being used.
When the 'fit' token is used, the expectation is that the devicetree
is within the FIT, but this is not required, for now.
Signed-off-by: Simon Glass <sjg@chromium.org>
The pxe_utils.c file is quite large and has a mix of parsing and booting
code. Split out the parsing into a new 'pxe_parse.c' file.
Add function prototypes for parse_pxefile_top() and label_destroy(), the
two functions used by pxe_utils.c
Signed-off-by: Simon Glass <sjg@chromium.org>
Enable this feature so that it can be tested on sandbox.
Update the vboot FDT to avoid having it match on conf-1 instead of
conf-1
Signed-off-by: Simon Glass <sjg@chromium.org>
The compatible strings used by each configuration comprise useful
information about how the system will boot. Show these after the current
configuration-node information.
Swap the order of the desc argument in its caller, fit_image_print()
since it is easier to read.
Signed-off-by: Simon Glass <sjg@chromium.org>
This property is part of the configuration node, so add a constant for
it, instead of open-coding the value. This allows easy searching for
places in U-Boot where the configuration node's compatible string is
used.
Signed-off-by: Simon Glass <sjg@chromium.org>
This matching happens silently at present, which can lead one to wonder
if U-Boot has been built without the feature. Add a few basic messages.
Signed-off-by: Simon Glass <sjg@chromium.org>
This should return a constant pointer, since modifying the description
within a devicetree node is not allowed. Also there is no need to set
the return value unless there is actually a description.
Update the function and move the docs to the header file while we are
here.
Signed-off-by: Simon Glass <sjg@chromium.org>
Create two new images (vbe0 and vbe1) containing the two types of VBE-OS
setups: with and without an OEM FIT. Put this in a new img/ subdirectory
since the test_ut.py file is getting quite large.
Most of the test is in C, with just the image-setup done in Python.
Signed-off-by: Simon Glass <sjg@chromium.org>
When booting an OS it is useful to be able to read devicetrees provided
by the OEM, from a separate FIT to the OS.
Add a new method which supports this, along with the usual A/B/recovery
flows, using a state file on the boot device.
Signed-off-by: Simon Glass <sjg@chromium.org>
If a load-only FIT has already provided a devicetree, PXE boot may need
to restart the bootm sequence, rather than starting an entirely new one,
so that the devicetree is preserved and used for booting.
Add support for this by adding a new field in the context and updating
extlinux_boot() to receive the value as a new parameter.
Signed-off-by: Simon Glass <sjg@chromium.org>
Rather than using bflow->fname, which assumes that it is the same as the
passed-in filename, use the passed in filename. This can be different in
some cases.
Signed-off-by: Simon Glass <sjg@chromium.org>
It is not obvious that PXE supports FIT, but it does, by detecting
whether an image is a FIT or not.
In many cases a FIT is more convenient than using separate files for
the kernel, initrd and devicetree.
Really we should promote FIT as an important format, rather than
silentily dealing with it if detected.
Add a new 'fit' token which indicates that a FIT is being used.
When the 'fit' token is used, the expectation is that the devicetree
is within the FIT, but this is not required, for now.
Signed-off-by: Simon Glass <sjg@chromium.org>
The pxe_utils.c file is quite large and has a mix of parsing and booting
code. Split out the parsing into a new 'pxe_parse.c' file.
Add function prototypes for parse_pxefile_top() and label_destroy(), the
two functions used by pxe_utils.c
Signed-off-by: Simon Glass <sjg@chromium.org>
Enable this feature so that it can be tested on sandbox.
Update the vboot FDT to avoid having it match on conf-1 instead of
conf-1
Signed-off-by: Simon Glass <sjg@chromium.org>
The compatible strings used by each configuration comprise useful
information about how the system will boot. Show these after the current
configuration-node information.
Swap the order of the desc argument in its caller, fit_image_print()
since it is easier to read.
Signed-off-by: Simon Glass <sjg@chromium.org>
This property is part of the configuration node, so add a constant for
it, instead of open-coding the value. This allows easy searching for
places in U-Boot where the configuration node's compatible string is
used.
Signed-off-by: Simon Glass <sjg@chromium.org>
This matching happens silently at present, which can lead one to wonder
if U-Boot has been built without the feature. Add a few basic messages.
Signed-off-by: Simon Glass <sjg@chromium.org>
This should return a constant pointer, since modifying the description
within a devicetree node is not allowed. Also there is no need to set
the return value unless there is actually a description.
Update the function and move the docs to the header file while we are
here.
Signed-off-by: Simon Glass <sjg@chromium.org>
This shows a message for the user. Implement it to keep the user
informed.
Series-to: u-boot
pxe: Support an automatic localboot
It seems that extlinux expects that boards know how to boot a local OS
from attached media. U-Boot currently assumes that boards define a
"localcmd" environment variable to support this. None does.
Provide an automatic means to find a kernel and ramdisk, using common
filenames. This addresses booting on MAAS, at least.
END
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
The current localboot implementation assumes that a 'localcmd'
environment variable is provided, with the instructions to follow. This
may not be included, so provide a fallback in that case.
Add a test image and test as well.
Signed-off-by: Simon Glass <sjg@chromium.org>
The devicetree file may not be provided, so avoid a failure in that
case.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Normally bootm proceeds sequentially through the various states, from
'start' to 'go'.
In some cases we want to load the devicetree from one FIT and the kernel
and ramdisk from another. This requires two bootm commands.
Of course it is possible to just do a second 'bootm start' to load the
kernel. But that removes all record of the devicetree from the
boot_images information, so it is then not provided to the OS.
Add a 'restart' subcommand which allows more images to be loaded,
without erasing those already loaded.
If an error is returned, leave the return arguments alone. There is no
point in setting them to zero, since the caller already knows (from the
error code) that they are not being returned.
This makes things simpler for callers which have an existing devicetree.
Signed-off-by: Simon Glass <sjg@chromium.org>
Tidy up the function comment. Shorten the names of the return arguments
since it is clear that they relate to devicetree.
Signed-off-by: Simon Glass <sjg@chromium.org>
If an error is returned, leave the return arguments alone. There is no
point in setting them to zero, since the caller already knows (from the
error code) that they are not being returned.
This makes things simpler for callers which have an existing ramdisk.
Handle the -ENOPKG error code in bootm_find_images()
Signed-off-by: Simon Glass <sjg@chromium.org>
This function returns 1 on error (at least in some cases). Change it to
use an error code, so that more information can be provided. For now it
mostly returns either 0 or -ENOPKG
Rename the return arguments, dropping the rd_ prefix and adding a 'p'
(for pointer) suffix to return arguments so that is clear that this is
what they are.
Update the comments for clarity and to fit with the usual style. Avoid
documenting the return arguments in two places.
Provide a common path for all error returns.
Signed-off-by: Simon Glass <sjg@chromium.org>
The load-only property in a configuration node indicates that there is
not necessarily a kernel or firmware image in the configuration. Handle
this case and return an error code.
Fix the 'NOEXEC' typo while here.
Signed-off-by: Simon Glass <sjg@chromium.org>
This function has a comment in both C and header files. Drop the one in
the C file and tweak the header-file one for clarity.
Signed-off-by: Simon Glass <sjg@chromium.org>
This code is complicated enough that it deserves its own function. Split
it out.
Fix up a missing argument from the select_image() docs while here.
Signed-off-by: Simon Glass <sjg@chromium.org>
Since 'select' is already assigned in the declarations for this
function, there is no need to do it again. Drop the duplicate
assignment.
Signed-off-by: Simon Glass <sjg@chromium.org>
The v1 series was applied instead of v2. This has a bug in
select_image(). Bring in the v2 patch.
Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: 782cfbb259 ("image: Introduce fit_image_load() to load images from FITs")
Arrange these so that they look a little nicer.
Series-to: u-boot
Cover-letter:
boot: Make fit_image_load() easier to maintain
Before fit_image_load() was created, The code to load kernels, ramdisks
and devicetrees from a FIT was spread around many functions. By
combining most of the code in one place, it became possible to add more
features in a consistent way. The 'loadables' feature much easier to
plumb in, for example.
While fit_image_load() was a substantial advance, it has never been a
svelte function and the passing years have not been entirely kind. With
a few new features on the horizon, this is a good time to improve the
implementation.
This series splits much of the code from fit_image_load() into a number
of smaller functions. Most of the changes are fairly mechanical, with
just a few renames and tweaks here and there.
This should make the function much easier to maintain. It may also
encourage someone to take a look at its callers, which could also use
some attention.
END
Signed-off-by: Simon Glass <sjg@chromium.org>
Decompress is really part of loading, so simplify the code slightly by
moving decompression out of the top-level fit_image_load() function.
Signed-off-by: Simon Glass <sjg@chromium.org>
Move handling of decompression (or perhaps relocation) of the image into
a separate function, to slim down fit_image_load() a little more.
Move the bootstage_mark() call in there too.
Signed-off-by: Simon Glass <sjg@chromium.org>