summaryrefslogtreecommitdiff
path: root/firmware/2lib/2api.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/2lib/2api.c')
-rw-r--r--firmware/2lib/2api.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/firmware/2lib/2api.c b/firmware/2lib/2api.c
index 707f2027..1556c997 100644
--- a/firmware/2lib/2api.c
+++ b/firmware/2lib/2api.c
@@ -37,9 +37,11 @@ void vb2api_fail(struct vb2_context *ctx, uint8_t reason, uint8_t subcode)
int vb2api_fw_phase1(struct vb2_context *ctx)
{
int rv;
+ struct vb2_shared_data *sd;
/* Initialize the vboot context if it hasn't been yet */
vb2_init_context(ctx);
+ sd = vb2_get_sd(ctx);
/* Initialize NV context */
vb2_nv_init(ctx);
@@ -97,6 +99,21 @@ int vb2api_fw_phase1(struct vb2_context *ctx)
return rv;
}
+ /*
+ * Check for possible reasons to ask the firmware to make display
+ * available. sd->recovery_reason may have been set above by
+ * vb2_check_recovery. VB2_SD_FLAG_DEV_MODE_ENABLED may have been set
+ * above by vb2_check_dev_switch.
+ */
+ if (!(ctx->flags & VB2_CONTEXT_DISPLAY_INIT) &&
+ (vb2_nv_get(ctx, VB2_NV_OPROM_NEEDED) ||
+ sd->flags & VB2_SD_FLAG_DEV_MODE_ENABLED ||
+ sd->recovery_reason))
+ ctx->flags |= VB2_CONTEXT_DISPLAY_INIT;
+ /* Mark display as available for downstream vboot and vboot callers. */
+ if (ctx->flags & VB2_CONTEXT_DISPLAY_INIT)
+ sd->flags |= VB2_SD_FLAG_DISPLAY_AVAILABLE;
+
/* Return error if recovery is needed */
if (ctx->flags & VB2_CONTEXT_RECOVERY_MODE) {
/* Always clear RAM when entering recovery mode */