mirror of
https://xff.cz/git/u-boot/
synced 2025-10-02 07:51:17 +02:00
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>
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
#define LOG_CATEGORY LOGC_BOOT
|
#define LOG_CATEGORY LOGC_BOOT
|
||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
|
#include <bloblist.h>
|
||||||
#include <bootdev.h>
|
#include <bootdev.h>
|
||||||
#include <bootflow.h>
|
#include <bootflow.h>
|
||||||
#include <bootmeth.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 udevice *meth, *bdev;
|
||||||
struct simple_priv *priv;
|
struct simple_priv *priv;
|
||||||
struct bootflow bflow;
|
struct bootflow bflow;
|
||||||
|
struct vbe_handoff *handoff;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (spl_phase() != PHASE_VPL && spl_phase() != PHASE_SPL)
|
if (spl_phase() != PHASE_VPL && spl_phase() != PHASE_SPL)
|
||||||
return -ENOENT;
|
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);
|
vbe_find_first_device(&meth);
|
||||||
if (!meth)
|
if (!meth)
|
||||||
return log_msg_ret("vd", -ENODEV);
|
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 */
|
/* this is not used from now on, so free it */
|
||||||
bootflow_free(&bflow);
|
bootflow_free(&bflow);
|
||||||
|
|
||||||
|
/* Record that VBE was used in this phase */
|
||||||
|
handoff->phases |= 1 << spl_phase();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
SPL_LOAD_IMAGE_METHOD("vbe_simple", 5, BOOT_DEVICE_VBE,
|
SPL_LOAD_IMAGE_METHOD("vbe_simple", 5, BOOT_DEVICE_VBE,
|
||||||
|
@@ -112,6 +112,7 @@ enum bloblist_tag_t {
|
|||||||
*/
|
*/
|
||||||
BLOBLISTT_PROJECT_AREA = 0x8000,
|
BLOBLISTT_PROJECT_AREA = 0x8000,
|
||||||
BLOBLISTT_U_BOOT_SPL_HANDOFF = 0x8000, /* Hand-off info from SPL */
|
BLOBLISTT_U_BOOT_SPL_HANDOFF = 0x8000, /* Hand-off info from SPL */
|
||||||
|
BLOBLISTT_VBE = 0x8001, /* VBE per-phase state */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Vendor-specific tags are permitted here. Projects can be open source
|
* Vendor-specific tags are permitted here. Projects can be open source
|
||||||
|
@@ -25,6 +25,15 @@ enum vbe_phase_t {
|
|||||||
VBE_PHASE_OS,
|
VBE_PHASE_OS,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* struct vbe_handoff - information about VBE progress
|
||||||
|
*
|
||||||
|
* @phases: Indicates which phases used the VBE bootmeth (1 << PHASE_...)
|
||||||
|
*/
|
||||||
|
struct vbe_handoff {
|
||||||
|
u8 phases;
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* vbe_phase() - get current VBE phase
|
* vbe_phase() - get current VBE phase
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user