summaryrefslogtreecommitdiff
path: root/firmware/2lib/include/2api.h
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2021-01-20 17:54:15 +0800
committerCommit Bot <commit-bot@chromium.org>2021-02-27 07:45:46 +0000
commit5b1e2e75b48db4f056dc952616c9a9fecf3535c1 (patch)
treed289d09b20c48aeb214a2bd428e056c1351c7615 /firmware/2lib/include/2api.h
parent6466c58b87e0d6c944bc8aa7dbac3f9f54690b71 (diff)
downloadvboot-5b1e2e75b48db4f056dc952616c9a9fecf3535c1.tar.gz
vboot: standardize legacy boot and altfw terminology
Standardize on the term "altfw" (short form) and "alternate bootloader" (long form) in both code and documentation. Remove the VbAltFwIndex_t enum, and replace with a simple uint32_t. Rename VbExLegacy to vb2ex_run_altfw, and move to vboot2 namespace. Rename crossystem param dev_boot_legacy to dev_boot_altfw, but leave an alias. Rename crossystem param dev_default_boot value from legacy to altfw, but leave an alias. BUG=b:179458327 TEST=make clean && make runtests TEST=emerge vboot_reference and check output for: crossystem dev_boot_legacy=0 crossystem dev_boot_altfw=0 crossystem dev_default_boot=legacy crossystem dev_default_boot=altfw BRANCH=none Cq-Depend: chromium:2641196 Signed-off-by: Joel Kitching <kitching@google.com> Change-Id: I289df63d992a3d9ae3845c59779ecbd115b18ee2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2641346 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Yu-Ping Wu <yupingso@chromium.org>
Diffstat (limited to 'firmware/2lib/include/2api.h')
-rw-r--r--firmware/2lib/include/2api.h29
1 files changed, 20 insertions, 9 deletions
diff --git a/firmware/2lib/include/2api.h b/firmware/2lib/include/2api.h
index 5ea06e2f..2b7fce4a 100644
--- a/firmware/2lib/include/2api.h
+++ b/firmware/2lib/include/2api.h
@@ -875,8 +875,8 @@ enum vb2_dev_default_boot_target {
/* Default to boot from external disk. */
VB2_DEV_DEFAULT_BOOT_TARGET_EXTERNAL = 1,
- /* Default to boot legacy OS. */
- VB2_DEV_DEFAULT_BOOT_TARGET_LEGACY = 2,
+ /* Default to boot altfw. */
+ VB2_DEV_DEFAULT_BOOT_TARGET_ALTFW = 2,
};
/**
@@ -1339,8 +1339,8 @@ enum vb2_screen {
VB2_SCREEN_DEVELOPER_BOOT_EXTERNAL = 0x320,
/* Invalid external disk inserted */
VB2_SCREEN_DEVELOPER_INVALID_DISK = 0x330,
- /* Select alternate bootloader ("legacy boot") */
- VB2_SCREEN_DEVELOPER_SELECT_BOOTLOADER = 0x340,
+ /* Select alternate bootloader ("altfw") */
+ VB2_SCREEN_DEVELOPER_SELECT_ALTFW = 0x340,
/* Diagnostic tools */
VB2_SCREEN_DIAGNOSTICS = 0x400,
/* Storage diagnostic screen */
@@ -1366,11 +1366,11 @@ enum vb2_ui_error {
/* Untrusted confirmation */
VB2_UI_ERROR_UNTRUSTED_CONFIRMATION,
/* Alternate bootloader is disabled */
- VB2_UI_ERROR_ALTERNATE_BOOT_DISABLED,
- /* No bootloader was found */
- VB2_UI_ERROR_NO_BOOTLOADER,
+ VB2_UI_ERROR_ALTFW_DISABLED,
+ /* No alternate bootloader was found */
+ VB2_UI_ERROR_ALTFW_EMPTY,
/* Alternate bootloader failed */
- VB2_UI_ERROR_ALTERNATE_BOOT_FAILED,
+ VB2_UI_ERROR_ALTFW_FAILED,
/* Diagnostics internal failure */
VB2_UI_ERROR_DIAGNOSTICS,
};
@@ -1426,7 +1426,18 @@ uint32_t vb2ex_get_locale_count(void);
*
* @return Number of alternate bootloaders. 0 if none or on error.
*/
-uint32_t vb2ex_get_bootloader_count(void);
+uint32_t vb2ex_get_altfw_count(void);
+
+/**
+ * Run alternate bootloader.
+ *
+ * @param altfw_id ID of alternate bootloader to run, where
+ * altfw_id <= vb2ex_get_altfw_count(). 0 for default,
+ * which corresponds to an alternate bootloader in
+ * the range 1 <= altfw_id <= vb2ex_getfw_count().
+ * @return VB2_SUCCESS, or error code on error.
+ */
+vb2_error_t vb2ex_run_altfw(uint32_t altfw_id);
/**
* Delay for at least the specified number of milliseconds.