diff options
author | Joel Kitching <kitching@google.com> | 2019-05-29 15:22:54 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-06-07 20:09:44 +0000 |
commit | 451813ef0c12ebf31b68e7a29c2752d882879ab6 (patch) | |
tree | 65fe8c3e0f7a125c258715ae04678c2de57dc574 /firmware | |
parent | efd0dc23e855c8ec5a4cd4e0bb08b4ae1e40bfb3 (diff) | |
download | vboot-451813ef0c12ebf31b68e7a29c2752d882879ab6.tar.gz |
vboot: don't use VB2_NV_DISPLAY_REQUEST for diagnostic mode
Display initialization code now directly checks
VB2_NV_DIAG_REQUEST. There is no need for diagnostic mode flow
to set VB2_NV_DISPLAY_REQUEST.
BUG=b:124141368, chromium:948592, chromium:967298, b:133175864
TEST=make clean && make runtests
BRANCH=none
Change-Id: I9748bf03c11c5698c181c177634d73fb34fd2d59
Signed-off-by: Joel Kitching <kitching@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1634452
Commit-Queue: Jason Clinton <jclinton@chromium.org>
Tested-by: Jason Clinton <jclinton@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/lib/vboot_api_kernel.c | 41 | ||||
-rw-r--r-- | firmware/lib/vboot_ui.c | 2 |
2 files changed, 15 insertions, 28 deletions
diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c index e32c9500..35f33813 100644 --- a/firmware/lib/vboot_api_kernel.c +++ b/firmware/lib/vboot_api_kernel.c @@ -414,33 +414,22 @@ VbError_t VbSelectAndLoadKernel( retval = VbBootRecovery(ctx); VbExEcEnteringMode(0, VB_EC_RECOVERY); } else if (DIAGNOSTIC_UI && vb2_nv_get(ctx, VB2_NV_DIAG_REQUEST)) { - /* If display is unavailable and was not requested, request it - and reboot. This is not a normal state. */ - if (!(vb2_get_sd(ctx)->flags & VB2_SD_FLAG_DISPLAY_AVAILABLE) && - !vb2_nv_get(ctx, VB2_NV_DISPLAY_REQUEST)) { - VB2_DEBUG("ERROR: Diagnostic mode needs a display " - "request; rebooting\n"); - vb2_nv_set(ctx, VB2_NV_DISPLAY_REQUEST, 1); + vb2_nv_set(ctx, VB2_NV_DIAG_REQUEST, 0); + + /* + * Diagnostic boot. This has a UI but only power button + * is used for input so no detachable-specific UI is + * needed. This mode is also 1-shot so it's placed + * before developer mode. + */ + retval = VbBootDiagnostic(ctx); + /* + * The diagnostic menu should either boot a rom, or + * return either of reboot or shutdown. The following + * check is a safety precaution. + */ + if (!retval) retval = VBERROR_REBOOT_REQUIRED; - } else { - vb2_nv_set(ctx, VB2_NV_DISPLAY_REQUEST, 0); - vb2_nv_set(ctx, VB2_NV_DIAG_REQUEST, 0); - - /* - * Diagnostic boot. This has a UI but only power button - * is used for input so no detachable-specific UI is - * needed. This mode is also 1-shot so it's placed - * before developer mode. - */ - retval = VbBootDiagnostic(ctx); - /* - * The diagnostic menu should either boot a rom, or - * return either of reboot or shutdown. The following - * check is a safety precaution. - */ - if (!retval) - retval = VBERROR_REBOOT_REQUIRED; - } } else if (ctx->flags & VB2_CONTEXT_DEVELOPER_MODE) { if (kparams->inflags & VB_SALK_INFLAGS_VENDOR_DATA_SETTABLE) ctx->flags |= VB2_CONTEXT_VENDOR_DATA_SETTABLE; diff --git a/firmware/lib/vboot_ui.c b/firmware/lib/vboot_ui.c index 8321fbbb..7fc7a307 100644 --- a/firmware/lib/vboot_ui.c +++ b/firmware/lib/vboot_ui.c @@ -392,8 +392,6 @@ static VbError_t vb2_check_diagnostic_key(struct vb2_context *ctx, uint32_t key) { if (DIAGNOSTIC_UI && (key == VB_KEY_CTRL('C') || key == VB_KEY_F(12))) { VB2_DEBUG("Diagnostic mode requested, rebooting\n"); - if (!(vb2_get_sd(ctx)->flags & VB2_SD_FLAG_DISPLAY_AVAILABLE)) - vb2_nv_set(ctx, VB2_NV_DISPLAY_REQUEST, 1); vb2_nv_set(ctx, VB2_NV_DIAG_REQUEST, 1); return VBERROR_REBOOT_REQUIRED; |