From b68640501703dab98681916c8bef02a25548cbf9 Mon Sep 17 00:00:00 2001 From: Yu-Ping Wu Date: Mon, 18 Nov 2019 15:58:25 +0800 Subject: vboot: Add vb2_context_flags VB2_CONTEXT_DETACHABLE_UI Currently VB_SALK_INFLAGS_ENABLE_DETACHABLE_UI in VbSelectAndLoadKernelParams.inflags controls whether to enable detachable ui. However, it doesn't have much to do with the specifics of "loading a kernel", and would fit better in vb2_context.flags, which is also passed to VbSelectAndLoadKernel(). This patch replaces the usage of VB_SALK_INFLAGS_ENABLE_DETACHABLE_UI with vb2_context_flags VB2_CONTEXT_DETACHABLE_UI, which is set from depthcharge. BRANCH=none BUG=chromium:953656 TEST=emerge-kukui depthcharge vboot_reference Cq-Depend: chromium:1918868 Change-Id: Iafe0f9fe0a90bcb5a7fa557fac75e0856796769d Signed-off-by: Yu-Ping Wu Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1921769 Reviewed-by: Julius Werner Reviewed-by: Joel Kitching Commit-Queue: Joel Kitching --- firmware/2lib/include/2api.h | 3 +++ firmware/include/vboot_api.h | 5 ----- firmware/lib/vboot_api_kernel.c | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/firmware/2lib/include/2api.h b/firmware/2lib/include/2api.h index 43595c84..50ebc1bc 100644 --- a/firmware/2lib/include/2api.h +++ b/firmware/2lib/include/2api.h @@ -194,6 +194,9 @@ enum vb2_context_flags { * Caller should *not* set this when FWMP is available but invalid. */ VB2_CONTEXT_NO_SECDATA_FWMP = (1 << 21), + + /* Enable detachable menu ui (volume up/down + power). */ + VB2_CONTEXT_DETACHABLE_UI = (1 << 22), }; /* Helper for aligning fields in vb2_context. */ diff --git a/firmware/include/vboot_api.h b/firmware/include/vboot_api.h index f34f219b..fb191bf6 100644 --- a/firmware/include/vboot_api.h +++ b/firmware/include/vboot_api.h @@ -132,11 +132,6 @@ typedef struct VbSelectAndLoadKernelParams { */ } VbSelectAndLoadKernelParams; -/* Flag to indicate using detachable menu ui (arrow up/down+power) - * instead of traditional FW screens with ctrl+D, ctrl+U, etc. - */ -#define VB_SALK_INFLAGS_ENABLE_DETACHABLE_UI (1 << 0) - /* Flag to indicate that the vendor data is not set and the vendor data * UI should be enabled. */ diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c index a2062ff3..7567010f 100644 --- a/firmware/lib/vboot_api_kernel.c +++ b/firmware/lib/vboot_api_kernel.c @@ -407,7 +407,7 @@ vb2_error_t VbSelectAndLoadKernel(struct vb2_context *ctx, /* Select boot path */ if (ctx->flags & VB2_CONTEXT_RECOVERY_MODE) { /* Recovery boot. This has UI. */ - if (kparams->inflags & VB_SALK_INFLAGS_ENABLE_DETACHABLE_UI) + if (ctx->flags & VB2_CONTEXT_DETACHABLE_UI) rv = VbBootRecoveryMenu(ctx); else rv = VbBootRecovery(ctx); @@ -433,7 +433,7 @@ vb2_error_t VbSelectAndLoadKernel(struct vb2_context *ctx, ctx->flags |= VB2_CONTEXT_VENDOR_DATA_SETTABLE; /* Developer boot. This has UI. */ - if (kparams->inflags & VB_SALK_INFLAGS_ENABLE_DETACHABLE_UI) + if (ctx->flags & VB2_CONTEXT_DETACHABLE_UI) rv = VbBootDeveloperMenu(ctx); else rv = VbBootDeveloper(ctx); -- cgit v1.2.1