diff options
author | Hsin-Te Yuan <yuanhsinte@google.com> | 2022-07-08 16:55:54 +0800 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-07-15 07:11:44 +0000 |
commit | a975eed306e16947c30b48ccd25ab67a37295742 (patch) | |
tree | 47c71250e1c5d9d1b841fade2ad8e69632f9cef9 /firmware/2lib/2kernel.c | |
parent | b68529526ab82d1da99b58155620beaa8aa3f487 (diff) | |
download | vboot-a975eed306e16947c30b48ccd25ab67a37295742.tar.gz |
2kernel.c: check display request in vb2api_kernel_phase2stabilize-14989.85.Bstabilize-14989.107.Brelease-R105-14989.B
In preparation for moving VbTryLoadKernel to depthcharge, move the
VB2_NV_DISPLAY_REQUEST check from vb2api_normal_boot to
vb2api_kernel_phase2.
BUG=b:172339016
BRANCH=none
TEST=make runtests
Signed-off-by: Hsin-Te Yuan <yuanhsinte@google.com>
Change-Id: I3629d8dbbcaba23220152543ba77558c8bbcdc7b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3752431
Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-by: Hsuan Ting Chen <roccochen@chromium.org>
Diffstat (limited to 'firmware/2lib/2kernel.c')
-rw-r--r-- | firmware/2lib/2kernel.c | 37 |
1 files changed, 7 insertions, 30 deletions
diff --git a/firmware/2lib/2kernel.c b/firmware/2lib/2kernel.c index 30d6bbe6..41764ef1 100644 --- a/firmware/2lib/2kernel.c +++ b/firmware/2lib/2kernel.c @@ -12,31 +12,6 @@ #include "2secdata.h" #include "vboot_api.h" -/** - * Reset any NVRAM requests. - * - * @param ctx Vboot context - * @return 1 if a reboot is required, 0 otherwise. - */ -static int vb2_reset_nv_requests(struct vb2_context *ctx) -{ - int need_reboot = 0; - - if (vb2_nv_get(ctx, VB2_NV_DISPLAY_REQUEST)) { - VB2_DEBUG("Unset display request (undo display init)\n"); - vb2_nv_set(ctx, VB2_NV_DISPLAY_REQUEST, 0); - need_reboot = 1; - } - - if (vb2_nv_get(ctx, VB2_NV_DIAG_REQUEST)) { - VB2_DEBUG("Unset diagnostic request (undo display init)\n"); - vb2_nv_set(ctx, VB2_NV_DIAG_REQUEST, 0); - need_reboot = 1; - } - - return need_reboot; -} - vb2_error_t vb2api_normal_boot(struct vb2_context *ctx, VbSelectAndLoadKernelParams *kparams) { @@ -47,11 +22,6 @@ vb2_error_t vb2api_normal_boot(struct vb2_context *ctx, /* Boot from fixed disk only */ VB2_DEBUG("Entering\n"); - if (vb2_reset_nv_requests(ctx)) { - VB2_DEBUG("Normal mode: reboot to reset NVRAM requests\n"); - return VB2_REQUEST_REBOOT; - } - vb2_error_t rv = VbTryLoadKernel(ctx, VB_DISK_FLAG_FIXED, kparams); VB2_DEBUG("Checking if TPM kernel version needs advancing\n"); @@ -277,7 +247,14 @@ vb2_error_t vb2api_kernel_phase2(struct vb2_context *ctx) break; case VB2_BOOT_MODE_DIAGNOSTICS: case VB2_BOOT_MODE_DEVELOPER: + break; case VB2_BOOT_MODE_NORMAL: + if (vb2_nv_get(ctx, VB2_NV_DISPLAY_REQUEST)) { + vb2_nv_set(ctx, VB2_NV_DISPLAY_REQUEST, 0); + VB2_DEBUG("Normal mode: " + "reboot to unset display request\n"); + return VB2_REQUEST_REBOOT; + } break; default: return VB2_ERROR_ESCAPE_NO_BOOT; |