diff options
Diffstat (limited to 'src/security/vboot/bootmode.c')
-rw-r--r-- | src/security/vboot/bootmode.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/security/vboot/bootmode.c b/src/security/vboot/bootmode.c index 44149af04830..745af63f04f8 100644 --- a/src/security/vboot/bootmode.c +++ b/src/security/vboot/bootmode.c @@ -52,6 +52,21 @@ static void do_clear_recovery_mode_switch(void *unused) BOOT_STATE_INIT_ENTRY(BS_WRITE_TABLES, BS_ON_ENTRY, do_clear_recovery_mode_switch, NULL); +#if CONFIG(VBOOT_CLEAR_RECOVERY_IN_RAMSTAGE) +static void vboot_clear_recovery_request(void *unused) +{ + struct vb2_context *ctx; + + ctx = vboot_get_context(); + vb2api_clear_recovery(ctx); + save_vbnv(ctx->nvdata); +} + +/* This has to be called before back_up_vbnv_cmos, so BS_ON_ENTRY is used here. */ +BOOT_STATE_INIT_ENTRY(BS_POST_DEVICE, BS_ON_ENTRY, + vboot_clear_recovery_request, NULL); +#endif + int __weak get_recovery_mode_retrain_switch(void) { return 0; |