summaryrefslogtreecommitdiff
path: root/boot/vbe_simple_fw.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-10-21 03:23:18 +0300
committerTom Rini <trini@konsulko.com>2022-10-31 18:04:00 +0300
commitd8b7c34f98a7ff957e6921954eee3b7834576291 (patch)
tree2ebffc848bf73eafd60afe68dd81d4de04e3d3ae /boot/vbe_simple_fw.c
parent2a5c67f50a438b266dc72c9401e578ec8b81db16 (diff)
downloadu-boot-d8b7c34f98a7ff957e6921954eee3b7834576291.tar.xz
vbe: Record which phases loaded using VBE
We expect VPL and SPL to load using VBE. Add a record of this so we can check it in U-Boot proper. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot/vbe_simple_fw.c')
-rw-r--r--boot/vbe_simple_fw.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/boot/vbe_simple_fw.c b/boot/vbe_simple_fw.c
index fc05e9e2bd..0a49d28670 100644
--- a/boot/vbe_simple_fw.c
+++ b/boot/vbe_simple_fw.c
@@ -9,6 +9,7 @@
#define LOG_CATEGORY LOGC_BOOT
#include <common.h>
+#include <bloblist.h>
#include <bootdev.h>
#include <bootflow.h>
#include <bootmeth.h>
@@ -154,11 +155,17 @@ static int simple_load_from_image(struct spl_image_info *spl_image,
struct udevice *meth, *bdev;
struct simple_priv *priv;
struct bootflow bflow;
+ struct vbe_handoff *handoff;
int ret;
if (spl_phase() != PHASE_VPL && spl_phase() != PHASE_SPL)
return -ENOENT;
+ ret = bloblist_ensure_size(BLOBLISTT_VBE, sizeof(struct vbe_handoff),
+ 0, (void **)&handoff);
+ if (ret)
+ return log_msg_ret("ro", ret);
+
vbe_find_first_device(&meth);
if (!meth)
return log_msg_ret("vd", -ENODEV);
@@ -190,6 +197,9 @@ static int simple_load_from_image(struct spl_image_info *spl_image,
/* this is not used from now on, so free it */
bootflow_free(&bflow);
+ /* Record that VBE was used in this phase */
+ handoff->phases |= 1 << spl_phase();
+
return 0;
}
SPL_LOAD_IMAGE_METHOD("vbe_simple", 5, BOOT_DEVICE_VBE,