summaryrefslogtreecommitdiff
path: root/firmware/lib/include
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-10-19 20:52:28 -0600
committerchrome-bot <chrome-bot@chromium.org>2018-11-01 02:17:44 -0700
commit0a29eb399a35c4d8e9e0473a448bbe3837e7d89b (patch)
tree524dc3326178af37841379d3e19aca6facc6b871 /firmware/lib/include
parent8ed28879229b62f3860286b2b1985af713d3e05a (diff)
downloadvboot-0a29eb399a35c4d8e9e0473a448bbe3837e7d89b.tar.gz
Pass all calls to VBExLegacy() through a single functionstabilize-11217.B
It is important that we lock the TPM before calling this function. We have several places where the function is called. Reduce the risk that the TPM is no locked by running all calls through a single point. Drop the vb2_exit_altfw() function as it is not needed now. We rely on being able to call RollbackKernelLock() multiple times since it ignores subsequent calls and does not attempt to lock the TPM twice. With the menu UI this causes a small change in behaviour: when starting legacy firmware fails the screen flashes AFTER the beep instead of before. Hopefully this difference is not important. Future work will unify the two UI more. BUG=chromium:837018 BRANCH=none TEST=FEATURES=test emerge-grunt --nodeps vboot_reference Change-Id: I0ee0b52eb57c30c1e1bb4a7e60e11d060025ab17 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1292248 Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'firmware/lib/include')
-rw-r--r--firmware/lib/include/vboot_kernel.h34
-rw-r--r--firmware/lib/include/vboot_ui_common.h10
2 files changed, 10 insertions, 34 deletions
diff --git a/firmware/lib/include/vboot_kernel.h b/firmware/lib/include/vboot_kernel.h
index 15c27101..c3c4585b 100644
--- a/firmware/lib/include/vboot_kernel.h
+++ b/firmware/lib/include/vboot_kernel.h
@@ -88,38 +88,4 @@ uint32_t vb2_get_fwmp_flags(void);
*/
void vb2_nv_commit(struct vb2_context *ctx);
-/**
- * Prepare to start a bootloader
- *
- * Get ready to jump into a bootloader if allowed, calling RollbackKernelLock().
- *
- * @param allowed 1 if allowed, 0 if not allowed (in which case this function
- * prints a debug error)
- * @return 0 if allowed, -1 if not allowed
- *
- */
-int vb2_prepare_alt_fw(int allowed);
-
-/**
- * Tidy up after failing to start a bootloader
- *
- * This beeps twice to indicate failure
- */
-void vb2_exit_altfw(void);
-
-/**
- * Jump to a bootloader if possible
- *
- * This calls vb2_prepare_alt_fw() to check the operation is permitted. If it
- * is, then it jumps to the selected bootloader and execution continues there,
- * never returning.
- *
- * If the operation is not permitted, or it is permitted but the bootloader
- * cannot be found, it calls vb2_exit_altfw() and returns.
- *
- * @allowed 1 if allowed, 0 if not allowed
- * @altfw_num Number of bootloader to start (0=any, 1=first, etc.)
- */
-void vb2_try_alt_fw(int allowed, int altfw_num);
-
#endif /* VBOOT_REFERENCE_VBOOT_KERNEL_H_ */
diff --git a/firmware/lib/include/vboot_ui_common.h b/firmware/lib/include/vboot_ui_common.h
index aa6a67e0..19c3809d 100644
--- a/firmware/lib/include/vboot_ui_common.h
+++ b/firmware/lib/include/vboot_ui_common.h
@@ -18,4 +18,14 @@ enum vb2_beep_type {
*/
void vb2_error_beep(enum vb2_beep_type beep);
+/**
+ * Run alternative firmware if allowed
+ *
+ * This will only return if it is not allowed, or the bootloader fails to
+ * cannot be found / fails to start
+ *
+ * @altfw_num Number of bootloader to start (0=any, 1=first, etc.)
+ */
+void vb2_run_altfw(int altfw_num);
+
#endif /* VBOOT_REFERENCE_VBOOT_UI_COMMON_H_ */