Commit graph

7 commits

Author SHA1 Message Date
Simon Glass
f1eb367d76 vbe: Add an implementation of VBE-ABrec
So far only VBE-simple is implemented in U-Boot. This supports a single
image which can be updated in situ.

It is often necessary to support two images (A and B) so that the board
is not bricked if the update is interrupted or is bad.

In some cases, a non-updatable recovery image is desirable, so that the
board can be returned to a known-good state in the event of a serious
failure.

Introduce ABrec which provides these features. It supports three
independent images and the logic to select the desired one on boot.

While we are here, fix a debug message to indicate the function it
called. Provide a maintainers entry for VBE.

Note that fwupdated only supports VBE-simple so far, but supports for
ABrec will appear in time.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-02-03 16:01:36 -06:00
Simon Glass
9ecc1cabe1 vbe: Support loading SPL images
VBE needs to load different images from a FIT depending on the xPL phase
in use. The IH_PHASE value is used to select the image to load.

Add the required logic to handle this. For compatibility with the
SPL-loader driver, fill out a struct spl_image_info with the details
needed to boot the next phase.

This is good enough for VBE-simple but ABrec will need the full set of
bootstd features. So add a USE_BOOTMETH define to control this.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-22 09:47:50 -06:00
Simon Glass
ea6cfc55e0 vbe: Split out reading a FIT into the common file
Loading a FIT is useful for other VBE methods, such as ABrec. Create a
new function to handling reading it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-22 09:47:49 -06:00
Simon Glass
0a59dc4199 vbe: Move reading the nvdata into the common file
All VBE methods read non-volatile data, so move this function into a
common file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-22 09:47:49 -06:00
Simon Glass
47e5618508 vbe: Move reading the version into the common file
All VBE methods read a version string, so move this function into a
common file.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-22 09:47:49 -06:00
Simon Glass
190b128252 vbe: Create a common function to get the block device
Add a vbe_get_blk() function and use it to obtain the block device used
by VBE.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-22 09:47:49 -06:00
Simon Glass
20a1e83732 vbe: Start a common header file
Move a few things into a new, common header file so that vbe-simple can
share code with the upcoming abrec.

Put struct simple_nvdata in it and rename it.

Signed-off-by: Simon Glass <sjg@chromium.org>
2025-01-22 09:47:49 -06:00