diff options
Diffstat (limited to 'firmware/lib/vboot_api_kernel.c')
-rw-r--r-- | firmware/lib/vboot_api_kernel.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c index 54447c26..85a8f4b4 100644 --- a/firmware/lib/vboot_api_kernel.c +++ b/firmware/lib/vboot_api_kernel.c @@ -182,13 +182,15 @@ vb2_error_t VbSelectAndLoadKernel(struct vb2_context *ctx, } /* - * If in non-manual recovery mode, save the recovery reason as subcode. + * If in the broken screen, save the recovery reason as subcode. * Otherwise, clear any leftover recovery requests or subcodes. */ vb2_clear_recovery(ctx); /* Select boot path */ - if (ctx->flags & VB2_CONTEXT_RECOVERY_MODE) { + switch (ctx->boot_mode) { + case VB2_BOOT_MODE_MANUAL_RECOVERY: + case VB2_BOOT_MODE_BROKEN_SCREEN: /* If we're in recovery mode just to do memory retraining, all we need to do is reboot. */ if (sd->recovery_reason == VB2_RECOVERY_TRAIN_AND_REBOOT) { @@ -213,12 +215,12 @@ vb2_error_t VbSelectAndLoadKernel(struct vb2_context *ctx, VB2_DEBUG("NO_BOOT in RECOVERY mode\n"); /* Recovery boot. This has UI. */ - if (vb2api_allow_recovery(ctx)) + if (ctx->boot_mode == VB2_BOOT_MODE_MANUAL_RECOVERY) VB2_TRY(vb2ex_manual_recovery_ui(ctx)); else VB2_TRY(vb2ex_broken_screen_ui(ctx)); - } else if (vb2api_diagnostic_ui_enabled(ctx) && - vb2_nv_get(ctx, VB2_NV_DIAG_REQUEST)) { + break; + case VB2_BOOT_MODE_DIAGNOSTICS: /* * Need to clear the request flag and commit nvdata changes * immediately to avoid booting back into diagnostic tool when a @@ -234,12 +236,16 @@ vb2_error_t VbSelectAndLoadKernel(struct vb2_context *ctx, * return either of reboot or shutdown. */ return VB2_REQUEST_REBOOT; - } else if (ctx->flags & VB2_CONTEXT_DEVELOPER_MODE) { + case VB2_BOOT_MODE_DEVELOPER: /* Developer boot. This has UI. */ VB2_TRY(vb2ex_developer_ui(ctx)); - } else { + break; + case VB2_BOOT_MODE_NORMAL: /* Normal boot */ VB2_TRY(vb2_normal_boot(ctx)); + break; + default: + return VB2_ERROR_ESCAPE_NO_BOOT; } /* |