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.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/firmware/2lib/2api.c b/firmware/2lib/2api.c
index c041d8ac..9184b23d 100644
--- a/firmware/2lib/2api.c
+++ b/firmware/2lib/2api.c
@@ -72,26 +72,21 @@ vb2_error_t vb2api_fw_phase1(struct vb2_context *ctx)
*/
vb2_check_recovery(ctx);
+ /* Decide the boot mode */
+ vb2_set_boot_mode(ctx);
+
/*
- * Check for possible reasons to ask the firmware to make display
- * available. VB2_CONTEXT_RECOVERY_MODE 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. VB2_NV_DIAG_REQUEST may have been
- * set during the last boot in recovery mode.
+ * Initialize display if VB2_NV_DISPLAY_REQUEST is set or in non-normal
+ * boot mode.
*/
- if (!(ctx->flags & VB2_CONTEXT_DISPLAY_INIT) &&
- (vb2_nv_get(ctx, VB2_NV_DISPLAY_REQUEST) ||
- sd->flags & VB2_SD_FLAG_DEV_MODE_ENABLED ||
- ctx->flags & VB2_CONTEXT_RECOVERY_MODE ||
- vb2_nv_get(ctx, VB2_NV_DIAG_REQUEST)))
+ if (vb2_nv_get(ctx, VB2_NV_DISPLAY_REQUEST) ||
+ ctx->boot_mode != VB2_BOOT_MODE_NORMAL)
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;
- /* Decide the boot mode */
- vb2_set_boot_mode(ctx);
-
/* Return error if recovery is needed */
if (ctx->flags & VB2_CONTEXT_RECOVERY_MODE) {
/* Always clear RAM when entering recovery mode */