summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/include/vboot_api.h3
-rw-r--r--firmware/lib/vboot_api_kernel.c9
2 files changed, 12 insertions, 0 deletions
diff --git a/firmware/include/vboot_api.h b/firmware/include/vboot_api.h
index 9c040c06..a818a7ca 100644
--- a/firmware/include/vboot_api.h
+++ b/firmware/include/vboot_api.h
@@ -230,6 +230,9 @@ typedef struct VbCommonParams {
/* Set when we are calling VbInit() before loading Option ROMs */
#define VB_INIT_FLAG_BEFORE_OPROM_LOAD 0x00002000
+/* Allow USB boot on transition to dev */
+#define VB_INIT_FLAG_ALLOW_USB_BOOT 0x00004000
+
/*
* Output flags for VbInitParams.out_flags. Used to indicate potential boot
* paths and configuration to the calling firmware early in the boot process,
diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c
index 4769089e..b28d4388 100644
--- a/firmware/lib/vboot_api_kernel.c
+++ b/firmware/lib/vboot_api_kernel.c
@@ -41,6 +41,12 @@ static void VbSetRecoveryRequest(uint32_t recovery_request)
VbNvSet(&vnc, VBNV_RECOVERY_REQUEST, recovery_request);
}
+static void VbAllowUsbBoot(void)
+{
+ VBDEBUG(("%s\n", __func__));
+ VbNvSet(&vnc, VBNV_DEV_BOOT_USB, 1);
+}
+
/**
* Checks GBB flags against VbExIsShutdownRequested() shutdown request to
* determine if a shutdown is required.
@@ -587,6 +593,9 @@ VbError_t VbBootRecovery(VbCommonParams *cparams, LoadKernelParams *p)
return VBERROR_TPM_SET_BOOT_MODE_STATE;
VBDEBUG(("%s() Reboot so it will take "
"effect\n", __func__));
+ if (VbExGetSwitches
+ (VB_INIT_FLAG_ALLOW_USB_BOOT))
+ VbAllowUsbBoot();
return VBERROR_TPM_REBOOT_REQUIRED;
case -1:
VBDEBUG(("%s() - Shutdown requested\n",