Commit Graph

98680 Commits

Author SHA1 Message Date
Simon Glass
4470f4f729 scripts: build-qemu: Move virtiofsd code into the helper
Move this code into the helper so that build-efi can use it too.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-08 15:59:43 -06:00
Simon Glass
2a6a7e9716 scripts: build-qemu: Move qemu program-name to the helper
Put this in the helper so that we can (later) have it show the correct
error when the virtiofs daemon fails.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-08 15:59:43 -06:00
Simon Glass
a783a7ea64 scripts: build-qemu: Move memory size to the helper
Move this field to the helper so we can (later) have it set up the
virtiofs daemon.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-08 15:59:43 -06:00
Simon Glass
68ec2401ad scripts: Adjust EFI script to support an OS
At present the OS disk conflicts with the boot disk used to hold the
app (or payload). Number the OS disk after that.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-08 14:47:39 -06:00
Simon Glass
091ac902b1 Merge branch 'loadh' into 'master'
efi: Support video output on ARM

See merge request u-boot/u-boot!147
2025-08-05 19:41:40 +00:00
Simon Glass
b65c86177e boot: Enable the VBE-OS bootmeth for EFI app and payload
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>
2025-08-05 11:49:30 -06:00
Simon Glass
725d2c8c89 dm: core: Provide oftree_dispose() when OF_LIVE is disabled
This function is only defined if CONFIG_OF_LIVE is enabled. Provide a
static inline to handle it being disabled.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-05 11:49:30 -06:00
Simon Glass
7b25e5e9ff efi: Support bootstd and video with ARM app
We need CONFIG_BOARD_EARLY_INIT_R to enable block devices. Enable
bootstd as well, so that booting is supported. Provide the 'lsblk'
command to allow listing block devices.

Use white-on-black as this is a little easier on the eyes.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-05 11:49:30 -06:00
Simon Glass
f7a683d3f3 scripts: Adjust EFI script to support a root disk
At present the root disk conflicts with the boot disk used to hold the
app (or payload). Use virtio for this disk and number the others after
that.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-05 11:49:30 -06:00
Simon Glass
636ec26bc4 efi: Add an enum for the GOP blt operation
Create an enum for the 'operation' argument, so that drivers can make
use of this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-05 11:49:30 -06:00
Simon Glass
c494a7e5e9 efi: Support the EFI GOP blit method
With arm64 we generally use the virtio-gpu driver, which does not
support direct access to a framebuffer. Add support for this, so that
the display works as expected.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-05 11:49:30 -06:00
Simon Glass
3d1ff42987 video: efi: Store the GOP in priv data
At present the EFI GOP is read in the probe() method but is not stored,
so it is not possible to use it later.

With the EFI app we need to be able to access it after probing, when
blitting is used. Create a struct to hold it. Store the framebuffer
pointer in there as well, to simplify the code.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-05 11:49:30 -06:00
Simon Glass
9179000b50 Merge branch 'loadg' into 'master'
boot: Enhance VBE to support a separate devicetree FIT

See merge request u-boot/u-boot!146
2025-08-04 21:16:41 +00:00
Simon Glass
7d92da0eef boot: Add documentation for the VBE-OS bootmeth
Add some information about this new bootmeth, including how to enable it
and how it works.

Series-to: concept
Cover-letter:
boot: Enhance VBE to support a separate devicetree FIT
It is sometimes desirable to have the devicetrees packaged with firware,
or in a different FIT from the OS. This series adds support for this,
including a test.

The new bootmeth can automatically locate a state file and use that to
decide what images to use when booting. The OS must update the file
before rebooting, if a different selection is required.

For now there is no logic to deal with boot failures.
END

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 14:40:00 -06:00
Simon Glass
07f5b96985 boot: test: Add a test for the VBE OS flow
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>
2025-08-04 14:40:00 -06:00
Simon Glass
68c0c6f27e boot: Add support for VBE for the OS
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>
2025-08-04 14:40:00 -06:00
Simon Glass
324a3ac00a boot: Add comments for struct pxe_label
Some members are not commented. Add the missing comments and tidy up the
style a little.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 14:40:00 -06:00
Simon Glass
53b02e1015 boot: Support restarting a bootm sequence from PXE
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>
2025-08-04 14:40:00 -06:00
Simon Glass
8af19e54f7 boot: Use provided filename with bootmeth_alloc_other()
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>
2025-08-04 14:40:00 -06:00
Simon Glass
129a820581 boot: pxe: Add a token for FIT
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>
2025-08-04 14:40:00 -06:00
Simon Glass
74c9ceb22a boot: Remove blank lines in pxe_parse
This file has quite a few more blank lines than is usual in the U-Boot
code base. Remove them.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 14:40:00 -06:00
Simon Glass
cd8057dd58 boot: Move PXE-parsing logic out to a separate file
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>
2025-08-04 14:40:00 -06:00
Simon Glass
e0588c48f1 test: Drop double removal of the FS image on failure
We already have a cleanup function which removes the filesystem, so drop
the unnecessary try...except for this. It results in an error on the
error path, as we try to remove the filesystem twice.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 14:40:00 -06:00
Simon Glass
9680c3f2d7 test: Allow inspection of input filesystems
At present a temporary directory is used to hold the files before
placing them in the filesystem. Use a suitably named directory inside
the persistent-data directory, so that it is easy to take a look at what
was produced.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 14:40:00 -06:00
Simon Glass
812c9f2a20 mkimage: Set the timestamp with -f auto
When creating a FIT, ensure that a timestamp is added, even if there is
no OS image present.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 14:39:59 -06:00
Simon Glass
037a9c0b7f mkimage: Support a load-only FIT
Support creation of a load-only FIT (where there is no OS), with a new
--load-only option. Allow FITs to be created without an OS image.

Update the auto-generated FIT description to make this clear.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 14:39:59 -06:00
Simon Glass
449c65e028 mkimage: Add compatible strings to configuration node
When using '-f auto', mkimage automatically creates a FIT given the
images. For devicetree files, FIT expects that the compatible string
from each is copied to its corresponding configuration node.

Implement this in mkimage, so far only for uncompressed devicetrees.

This requires a few more fields in struct content_info, so take this
opportunity to comment it properly.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 14:39:59 -06:00
Simon Glass
b600baba39 mkimage: Remove an unused argument from fdt_property_file()
This function does not actually use the 'name' argument. Drop it and use
FIT_DATA_PROP instead, to avoid confusion.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 14:39:59 -06:00
Simon Glass
49a901f18c sandbox: Enable FIT best-match
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>
2025-08-04 14:39:59 -06:00
Simon Glass
40fd6b04b9 boot: Show compatible strings with FIT information
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>
2025-08-04 14:39:59 -06:00
Simon Glass
08676cf417 boot: Add a constant for the FIT-configuration compatible
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>
2025-08-04 14:39:59 -06:00
Simon Glass
3a370b854e boot: Show messages when using FIT best-match
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>
2025-08-04 14:39:59 -06:00
Simon Glass
329cdd4db2 boot: Use a common index in fit_conf_print
Rather than using two variables for the stringlist index, use one.
Simplify the i == 0 expression.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 14:39:59 -06:00
Simon Glass
0bc0fc2d00 boot: Tidy up fit_get_desc()
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>
2025-08-04 14:39:59 -06:00
Simon Glass
13f55a2812 sandbox: Increase the number of bootstage records
When running boot tests involving FIT, 30 is not enough. Increase the
limit to 50.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 14:39:59 -06:00
Simon Glass
ca9613a721 test: Rename test_vboot() to test_vboot_base()
At present it isn't easy to run just the base vboot tests. Rename it to
make this easier.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 14:39:59 -06:00
Simon Glass
ca30385c61 Correct implementation of Spawn() in ConsoleBase
Now that this base-class function is called, it can produce an error on
test failure, since it passes an empty list for the arguments.

Rename the reset() function to prepare_for_spawn() and use that instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 14:39:59 -06:00
Simon Glass
455cee2b6d Merge branch 'ci' into 'master'
buildman: Introduce some order to config fragments

See merge request u-boot/u-boot!145
2025-08-04 19:40:19 +00:00
Simon Glass
2242f545a0 Provide a basic .buildman file
Add a file containing a few extended boards to illustrate this new
buildman feature.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 19:37:20 +00:00
Simon Glass
d8faec6cbf buildman: Support building an extended board
Adjust the build logic to automatically deal with adding config
fragments to an existing board, to fully support the -X option.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 19:37:20 +00:00
Simon Glass
4f10b36306 buildman: Add a option to include extended boards
Provide a new -X option which uses any available .buildman files to
augment the list of boards supported by U-Boot with 'extended boards',
which consist of a base board with one or more config fragments.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 19:37:20 +00:00
Simon Glass
f1f83b0097 qconfig: Allow buildman to obtain the qconfig database
Provided a convenient function for buildman to use, which builds the
database if needed, then returns it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 19:37:20 +00:00
Simon Glass
b9c322c2d7 qconfig: Document cmdline args used by some functions
It might better to use separate arguments for each item, but for now,
document which args are used by Slot, Slots and move_config()

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 19:37:20 +00:00
Simon Glass
c3cab1a459 qconfig: Drop args from KconfigParser
This class does not actually use the program arguments, so don't pass
them in.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 19:37:20 +00:00
Simon Glass
4af4293392 qconfig: Rename do_build_db()
This function does not actually build the database; it just adds a board
to the datbase. Rename it to do_add_to_db() to reflect that.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 19:37:20 +00:00
Simon Glass
833474ba87 qconfig: Refactor to allow buildman to read the database
The qconfig tool has the ability to search for CONFIGs used by boards.
Refactor the code slightly so that buildman obtain the database.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 19:37:20 +00:00
Simon Glass
fa8c24964b buildman: Add a parser for the extended-board file
We wish to support .buildman files in the config/ directory which can
associate boards with config fragments. Add a parser for this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 19:37:20 +00:00
Simon Glass
d97dc10ebf buildman: Document the format for extended boards
It has become more common to use config fragments to extend or adjust
the functionality of boards in U-Boot.

Add some documentation for how to use this with buildman.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-08-04 19:37:20 +00:00
Heinrich Schuchardt
dc239a4337 doc/buildman: describe using fragments
Describe the new --fragments parameter

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-08-04 19:37:20 +00:00
Heinrich Schuchardt
831836a2ab buildman: unit test for configuration fragments
Check that configuration fragments provided to buildman as comma-
separated list are passed on to the make command of the builder.

In the %_defconfig: target of scripts/kconfig/Makefile the defconfig
file and the fragments are combined via the gcc preprocessor.
Modeling this step in the buildman testbench without invoking the actual
Makefile would not provide better test coverage.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2025-08-04 19:37:20 +00:00