summaryrefslogtreecommitdiff
path: root/firmware/lib/vboot_ui.c
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2019-12-19 13:51:25 +0800
committerCommit Bot <commit-bot@chromium.org>2019-12-24 14:05:27 +0000
commitd9ddac88c99d8df5b7dde618e43807f3c0dd6080 (patch)
tree195b4f616f23d92703c7a34d2fb33253dde6a521 /firmware/lib/vboot_ui.c
parent1df08718b7c18a0454240f78bdb80359116fc295 (diff)
downloadvboot-d9ddac88c99d8df5b7dde618e43807f3c0dd6080.tar.gz
vboot: change USB_BOOT_ON_DEV to use build flag
Instead of calling VbExGetSwitches to essentially retrieve a compile-time config value from depthcharge, send this config value to vboot_reference as a build flag. Add a test based on the value of USB_BOOT_ON_DEV. BUG=b:124141368, chromium:1035761 TEST=make clean && make runtests TEST=Add CONFIG_USB_BOOT_ON_DEV to defconfig and flash to device Switch to dev mode and confirm dev_boot_usb with crossystem BRANCH=none Change-Id: I70a2e3fcd8c5cc252ca3d0eed81490a08503d7b3 Cq-Depend: chromium:1975346 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1975450 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org>
Diffstat (limited to 'firmware/lib/vboot_ui.c')
-rw-r--r--firmware/lib/vboot_ui.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/firmware/lib/vboot_ui.c b/firmware/lib/vboot_ui.c
index b0c67d22..c48478d8 100644
--- a/firmware/lib/vboot_ui.c
+++ b/firmware/lib/vboot_ui.c
@@ -35,12 +35,6 @@ void vb2_init_ui(void)
power_button_state = POWER_BUTTON_HELD_SINCE_BOOT;
}
-static void VbAllowUsbBoot(struct vb2_context *ctx)
-{
- VB2_DEBUG(".");
- vb2_nv_set(ctx, VB2_NV_DEV_BOOT_USB, 1);
-}
-
/**
* Checks GBB flags against VbExIsShutdownRequested() shutdown request to
* determine if a shutdown is required.
@@ -877,9 +871,8 @@ static vb2_error_t recovery_ui(struct vb2_context *ctx)
if (VB2_SUCCESS != vb2_enable_developer_mode(ctx))
return VBERROR_TPM_SET_BOOT_MODE_STATE;
VB2_DEBUG("Reboot so it will take effect\n");
- if (VbExGetSwitches
- (VB_SWITCH_FLAG_ALLOW_USB_BOOT))
- VbAllowUsbBoot(ctx);
+ if (USB_BOOT_ON_DEV)
+ vb2_nv_set(ctx, VB2_NV_DEV_BOOT_USB, 1);
return VBERROR_EC_REBOOT_TO_RO_REQUIRED;
case -1:
VB2_DEBUG("Shutdown requested\n");