summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@google.com>2019-05-22 17:25:35 -0700
committerDuncan Laurie <dlaurie@google.com>2019-05-23 00:38:34 +0000
commit68cca6f0a69645811357e6c2aa91cc7d68978763 (patch)
treef34044f4712e024604b851f64819da8c1f907358
parent3325abf95dd865910f06ed6f344c05200bb442ff (diff)
downloadvboot-68cca6f0a69645811357e6c2aa91cc7d68978763.tar.gz
Revert "vboot: update display init to use vboot2 code"
This reverts commit 3eeb01ffec6b237fb348e4cb85c71194abe05b9a. BUG=none TEST=none Change-Id: Ib8714327847de8d7049f97d2304791c8a3c1a792 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1626768 Reviewed-by: Duncan Laurie <dlaurie@google.com> Commit-Queue: Duncan Laurie <dlaurie@google.com> Tested-by: Duncan Laurie <dlaurie@google.com>
-rw-r--r--firmware/2lib/2api.c2
-rw-r--r--firmware/2lib/2nvstorage.c8
-rw-r--r--firmware/2lib/include/2nvstorage.h15
-rw-r--r--firmware/2lib/include/2nvstorage_fields.h2
-rw-r--r--firmware/include/vboot_api.h5
-rw-r--r--firmware/include/vboot_struct.h6
-rw-r--r--firmware/lib/ec_sync.c2
-rw-r--r--firmware/lib/ec_sync_all.c54
-rw-r--r--firmware/lib/vboot_api_kernel.c43
-rw-r--r--firmware/lib/vboot_ui.c4
-rw-r--r--host/lib/crossystem.c8
-rw-r--r--tests/ec_sync_tests.c37
-rw-r--r--tests/vb2_api_tests.c4
-rw-r--r--tests/vb2_nvstorage_tests.c2
-rw-r--r--tests/vboot_api_kernel2_tests.c22
-rw-r--r--tests/vboot_api_kernel4_tests.c32
-rw-r--r--utility/crossystem.c2
17 files changed, 101 insertions, 147 deletions
diff --git a/firmware/2lib/2api.c b/firmware/2lib/2api.c
index ada229a5..1556c997 100644
--- a/firmware/2lib/2api.c
+++ b/firmware/2lib/2api.c
@@ -106,7 +106,7 @@ int vb2api_fw_phase1(struct vb2_context *ctx)
* above by vb2_check_dev_switch.
*/
if (!(ctx->flags & VB2_CONTEXT_DISPLAY_INIT) &&
- (vb2_nv_get(ctx, VB2_NV_DISPLAY_REQUEST) ||
+ (vb2_nv_get(ctx, VB2_NV_OPROM_NEEDED) ||
sd->flags & VB2_SD_FLAG_DEV_MODE_ENABLED ||
sd->recovery_reason))
ctx->flags |= VB2_CONTEXT_DISPLAY_INIT;
diff --git a/firmware/2lib/2nvstorage.c b/firmware/2lib/2nvstorage.c
index 95d2f6e7..b1669d09 100644
--- a/firmware/2lib/2nvstorage.c
+++ b/firmware/2lib/2nvstorage.c
@@ -176,8 +176,8 @@ uint32_t vb2_nv_get(struct vb2_context *ctx, enum vb2_nv_param param)
case VB2_NV_DISABLE_DEV_REQUEST:
return GETBIT(VB2_NV_OFFS_BOOT, VB2_NV_BOOT_DISABLE_DEV);
- case VB2_NV_DISPLAY_REQUEST:
- return GETBIT(VB2_NV_OFFS_BOOT, VB2_NV_BOOT_DISPLAY_REQUEST);
+ case VB2_NV_OPROM_NEEDED:
+ return GETBIT(VB2_NV_OFFS_BOOT, VB2_NV_BOOT_OPROM_NEEDED);
case VB2_NV_BACKUP_NVRAM_REQUEST:
return GETBIT(VB2_NV_OFFS_BOOT, VB2_NV_BOOT_BACKUP_NVRAM);
@@ -377,8 +377,8 @@ void vb2_nv_set(struct vb2_context *ctx,
SETBIT(VB2_NV_OFFS_BOOT, VB2_NV_BOOT_DISABLE_DEV);
break;
- case VB2_NV_DISPLAY_REQUEST:
- SETBIT(VB2_NV_OFFS_BOOT, VB2_NV_BOOT_DISPLAY_REQUEST);
+ case VB2_NV_OPROM_NEEDED:
+ SETBIT(VB2_NV_OFFS_BOOT, VB2_NV_BOOT_OPROM_NEEDED);
break;
case VB2_NV_BACKUP_NVRAM_REQUEST:
diff --git a/firmware/2lib/include/2nvstorage.h b/firmware/2lib/include/2nvstorage.h
index b51cb6fa..3efa29b6 100644
--- a/firmware/2lib/include/2nvstorage.h
+++ b/firmware/2lib/include/2nvstorage.h
@@ -67,12 +67,15 @@ enum vb2_nv_param {
* virtual.
*/
VB2_NV_DISABLE_DEV_REQUEST,
- /* Set and cleared by vboot to request that display be initialized
- at boot time, so that BIOS screens can be displayed. 0=no, 1=yes. */
- VB2_NV_DISPLAY_REQUEST,
- /* TODO(chromium:948529): Remove VB2_NV_OPROM_NEEDED when unused.
- Renamed to VB2_NV_DISPLAY_REQUEST (above). */
- VB2_NV_OPROM_NEEDED = VB2_NV_DISPLAY_REQUEST,
+ /*
+ * Set and cleared by vboot to request that the video Option ROM be
+ * loaded at boot time, so that BIOS screens can be displayed. 0=no,
+ * 1=yes.
+ */
+ VB2_NV_OPROM_NEEDED,
+ /* TODO(chromium:948529): VB2_NV_OPROM_NEEDED is being renamed to
+ VB2_NV_DISPLAY_REQUEST. */
+ VB2_NV_DISPLAY_REQUEST = VB2_NV_OPROM_NEEDED,
/* Request that the firmware clear the TPM owner on the next boot. */
VB2_NV_CLEAR_TPM_OWNER_REQUEST,
/* Flag that TPM owner was cleared on request. */
diff --git a/firmware/2lib/include/2nvstorage_fields.h b/firmware/2lib/include/2nvstorage_fields.h
index 11a9f8fb..f8e3693a 100644
--- a/firmware/2lib/include/2nvstorage_fields.h
+++ b/firmware/2lib/include/2nvstorage_fields.h
@@ -75,7 +75,7 @@ enum vb2_nv_offset {
/* Fields in VB2_NV_OFFS_BOOT */
#define VB2_NV_BOOT_TRY_COUNT_MASK 0x0f
#define VB2_NV_BOOT_BACKUP_NVRAM 0x10
-#define VB2_NV_BOOT_DISPLAY_REQUEST 0x20
+#define VB2_NV_BOOT_OPROM_NEEDED 0x20
#define VB2_NV_BOOT_DISABLE_DEV 0x40
#define VB2_NV_BOOT_DEBUG_RESET 0x80
diff --git a/firmware/include/vboot_api.h b/firmware/include/vboot_api.h
index 38c5cbda..c5b382ac 100644
--- a/firmware/include/vboot_api.h
+++ b/firmware/include/vboot_api.h
@@ -118,9 +118,8 @@ enum VbErrorPredefined_t {
VBERROR_EC_REBOOT_TO_SWITCH_RW = 0x1001A,
/* Developer has requested a BIOS shell */
VBERROR_BIOS_SHELL_REQUESTED = 0x10020,
- /* Need initialized display and don't have it, or vice-versa.
- Deprecated; should use VBERROR_REBOOT_REQUIRED instead. */
- VBERROR_DEPRECATED_DISPLAY_INIT_MISMATCH = 0x10021,
+ /* Need VGA and don't have it, or vice-versa */
+ VBERROR_VGA_OPROM_MISMATCH = 0x10021,
/* Need EC to reboot to read-only code */
VBERROR_EC_REBOOT_TO_RO_REQUIRED = 0x10022,
/* Invalid region read parameters */
diff --git a/firmware/include/vboot_struct.h b/firmware/include/vboot_struct.h
index ab063475..9c8a3587 100644
--- a/firmware/include/vboot_struct.h
+++ b/firmware/include/vboot_struct.h
@@ -243,11 +243,9 @@ typedef struct VbKernelPreambleHeader {
#define VBSD_BOOT_REC_SWITCH_VIRTUAL 0x00004000
/* Firmware used vboot2 for firmware selection */
#define VBSD_BOOT_FIRMWARE_VBOOT2 0x00008000
-/* Firmware needs VGA Option ROM to display screens
- Deprecated; see chromium:948529 */
+/* Firmware needs VGA Option ROM to display screens */
#define VBSD_OPROM_MATTERS 0x00010000
-/* Firmware has loaded the VGA Option ROM
- Deprecated; see chromium:948529 */
+/* Firmware has loaded the VGA Option ROM */
#define VBSD_OPROM_LOADED 0x00020000
/* Don't try for boot failures */
#define VBSD_NOFAIL_BOOT 0x00040000
diff --git a/firmware/lib/ec_sync.c b/firmware/lib/ec_sync.c
index c486d570..b72403db 100644
--- a/firmware/lib/ec_sync.c
+++ b/firmware/lib/ec_sync.c
@@ -257,7 +257,7 @@ static VbError_t sync_one_ec(struct vb2_context *ctx, int devidx)
VB2_DEBUG("Rebooting to jump to new EC-RW\n");
/* Since we're rebooting, ec_sync_all won't be given a
* chance to clear the flag. Need to clear it here. */
- vb2_nv_set(ctx, VB2_NV_DISPLAY_REQUEST, 0);
+ vb2_nv_set(ctx, VB2_NV_OPROM_NEEDED, 0);
return VBERROR_EC_REBOOT_TO_SWITCH_RW;
}
}
diff --git a/firmware/lib/ec_sync_all.c b/firmware/lib/ec_sync_all.c
index fca9f9b4..6c3fe74f 100644
--- a/firmware/lib/ec_sync_all.c
+++ b/firmware/lib/ec_sync_all.c
@@ -17,22 +17,24 @@
#include "vboot_display.h"
#include "vboot_kernel.h"
-static VbError_t ec_sync_disable_display(struct vb2_context *ctx,
- int need_wait_screen)
+static VbError_t ec_sync_unload_oprom(struct vb2_context *ctx,
+ VbSharedDataHeader *shared,
+ int need_wait_screen)
{
/*
- * Reboot to disable display initialization
- * - we displayed the EC wait screen (otherwise we may be interfering
- * with some other vboot feature requesting display initialization)
- * - vboot requested display to be initialized on this boot
- * - the system is NOT in developer mode (which will also need display)
+ * Reboot to unload VGA Option ROM if:
+ * - we displayed the wait screen
+ * - the system has slow EC update flag set
+ * - the VGA Option ROM was needed and loaded
+ * - the system is NOT in developer mode (that'll also need the ROM)
*/
if (need_wait_screen &&
- vb2_nv_get(ctx, VB2_NV_DISPLAY_REQUEST) &&
- !(vb2_get_sd(ctx)->vbsd->flags & VBSD_BOOT_DEV_SWITCH_ON)) {
- VB2_DEBUG("Reboot to undo display initialization\n");
- vb2_nv_set(ctx, VB2_NV_DISPLAY_REQUEST, 0);
- return VBERROR_REBOOT_REQUIRED;
+ (shared->flags & VBSD_OPROM_MATTERS) &&
+ (shared->flags & VBSD_OPROM_LOADED) &&
+ !(shared->flags & VBSD_BOOT_DEV_SWITCH_ON)) {
+ VB2_DEBUG("Reboot to unload VGA Option ROM\n");
+ vb2_nv_set(ctx, VB2_NV_OPROM_NEEDED, 0);
+ return VBERROR_VGA_OPROM_MISMATCH;
}
return VBERROR_SUCCESS;
}
@@ -40,6 +42,7 @@ static VbError_t ec_sync_disable_display(struct vb2_context *ctx,
VbError_t ec_sync_all(struct vb2_context *ctx)
{
struct vb2_shared_data *sd = vb2_get_sd(ctx);
+ VbSharedDataHeader *shared = sd->vbsd;
VbAuxFwUpdateSeverity_t fw_update;
VbError_t rv;
@@ -53,24 +56,25 @@ VbError_t ec_sync_all(struct vb2_context *ctx)
(fw_update == VB_AUX_FW_SLOW_UPDATE);
/*
- * Check if we need to reboot to initialize the display before we can
+ * Check if we need to reboot to load the VGA Option ROM before we can
* display the WAIT screen.
*
* Do this before we check if ec_sync_phase1() requires a reboot for
* some other reason, since there's no reason to reboot twice.
*/
- int reboot_for_display = (need_wait_screen &&
- !(sd->flags & VB2_SD_FLAG_DISPLAY_AVAILABLE));
- if (reboot_for_display) {
- VB2_DEBUG("Reboot to initialize display\n");
- vb2_nv_set(ctx, VB2_NV_DISPLAY_REQUEST, 1);
+ int reboot_for_oprom = (need_wait_screen &&
+ shared->flags & VBSD_OPROM_MATTERS &&
+ !(shared->flags & VBSD_OPROM_LOADED));
+ if (reboot_for_oprom) {
+ VB2_DEBUG("Reboot to load VGA Option ROM\n");
+ vb2_nv_set(ctx, VB2_NV_OPROM_NEEDED, 1);
}
- /* Reboot if phase 1 needed it, or if we need to initialize display */
+ /* Reboot if phase 1 needed it, or if we need to load VGA Option ROM */
if (phase1_rv)
return VBERROR_EC_REBOOT_TO_RO_REQUIRED;
- if (reboot_for_display)
- return VBERROR_REBOOT_REQUIRED;
+ if (reboot_for_oprom)
+ return VBERROR_VGA_OPROM_MISMATCH;
/* Display the wait screen if we need it */
if (need_wait_screen) {
@@ -86,16 +90,16 @@ VbError_t ec_sync_all(struct vb2_context *ctx)
/*
* Do Aux FW software sync and protect devices tunneled through the EC.
* Aux FW update may request RO reboot to force EC cold reset so also
- * disable display request if needed to prevent a second reboot.
+ * unload the option ROM if needed to prevent a second reboot.
*/
rv = ec_sync_update_aux_fw(ctx);
if (rv) {
- ec_sync_disable_display(ctx, need_wait_screen);
+ ec_sync_unload_oprom(ctx, shared, need_wait_screen);
return rv;
}
- /* Reboot to disable display initialization if needed */
- rv = ec_sync_disable_display(ctx, need_wait_screen);
+ /* Reboot to unload VGA Option ROM if needed */
+ rv = ec_sync_unload_oprom(ctx, shared, need_wait_screen);
if (rv)
return rv;
diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c
index 77dc3366..038622bf 100644
--- a/firmware/lib/vboot_api_kernel.c
+++ b/firmware/lib/vboot_api_kernel.c
@@ -399,32 +399,25 @@ VbError_t VbSelectAndLoadKernel(
retval = VbBootRecovery(ctx);
VbExEcEnteringMode(0, VB_EC_RECOVERY);
} else if (DIAGNOSTIC_UI && vb2_nv_get(ctx, VB2_NV_DIAG_REQUEST)) {
- /* If display is unavailable and was not requested, request it
- and reboot. This is not a normal state. */
- if (!(vb2_get_sd(ctx)->flags & VB2_SD_FLAG_DISPLAY_AVAILABLE) &&
- !vb2_nv_get(ctx, VB2_NV_DISPLAY_REQUEST)) {
- VB2_DEBUG("ERROR: Diagnostic mode needs a display "
- "request; rebooting\n");
- vb2_nv_set(ctx, VB2_NV_DISPLAY_REQUEST, 1);
+ struct vb2_shared_data *sd = vb2_get_sd(ctx);
+ if (sd->vbsd->flags & VBSD_OPROM_MATTERS)
+ vb2_nv_set(ctx, VB2_NV_OPROM_NEEDED, 0);
+ vb2_nv_set(ctx, VB2_NV_DIAG_REQUEST, 0);
+
+ /*
+ * Diagnostic boot. This has a UI but only power button
+ * is used for input so no detachable-specific UI is needed.
+ * This mode is also 1-shot so it's placed before developer
+ * mode.
+ */
+ retval = VbBootDiagnostic(ctx);
+ /*
+ * The diagnostic menu should either boot a rom, or
+ * return either of reboot or shutdown. The following
+ * check is a safety precaution.
+ */
+ if (!retval) {
retval = VBERROR_REBOOT_REQUIRED;
- } else {
- vb2_nv_set(ctx, VB2_NV_DISPLAY_REQUEST, 0);
- vb2_nv_set(ctx, VB2_NV_DIAG_REQUEST, 0);
-
- /*
- * Diagnostic boot. This has a UI but only power button
- * is used for input so no detachable-specific UI is
- * needed. This mode is also 1-shot so it's placed
- * before developer mode.
- */
- retval = VbBootDiagnostic(ctx);
- /*
- * The diagnostic menu should either boot a rom, or
- * return either of reboot or shutdown. The following
- * check is a safety precaution.
- */
- if (!retval)
- retval = VBERROR_REBOOT_REQUIRED;
}
} else if (ctx->flags & VB2_CONTEXT_DEVELOPER_MODE) {
if (kparams->inflags & VB_SALK_INFLAGS_VENDOR_DATA_SETTABLE)
diff --git a/firmware/lib/vboot_ui.c b/firmware/lib/vboot_ui.c
index e06d5f6b..60afadc9 100644
--- a/firmware/lib/vboot_ui.c
+++ b/firmware/lib/vboot_ui.c
@@ -393,8 +393,8 @@ static VbError_t vb2_check_diagnostic_key(struct vb2_context *ctx,
uint32_t key) {
if (DIAGNOSTIC_UI && (key == VB_KEY_CTRL('C') || key == VB_KEY_F(12))) {
VB2_DEBUG("Diagnostic mode requested, rebooting\n");
- if (!(vb2_get_sd(ctx)->flags & VB2_SD_FLAG_DISPLAY_AVAILABLE))
- vb2_nv_set(ctx, VB2_NV_DISPLAY_REQUEST, 1);
+ if (vb2_get_sd(ctx)->vbsd->flags & VBSD_OPROM_MATTERS)
+ vb2_nv_set(ctx, VB2_NV_OPROM_NEEDED, 1);
vb2_nv_set(ctx, VB2_NV_DIAG_REQUEST, 1);
return VBERROR_REBOOT_REQUIRED;
diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c
index 1eb540a3..994d4796 100644
--- a/host/lib/crossystem.c
+++ b/host/lib/crossystem.c
@@ -514,8 +514,8 @@ int VbGetSystemPropertyInt(const char *name)
value = vb2_get_nv_storage(VB2_NV_DEV_BOOT_FASTBOOT_FULL_CAP);
} else if (!strcasecmp(name,"dev_enable_udc")) {
value = vb2_get_nv_storage(VB2_NV_DEV_ENABLE_UDC);
- } else if (!strcasecmp(name,"display_request")) {
- value = vb2_get_nv_storage(VB2_NV_DISPLAY_REQUEST);
+ } else if (!strcasecmp(name,"oprom_needed")) {
+ value = vb2_get_nv_storage(VB2_NV_OPROM_NEEDED);
} else if (!strcasecmp(name,"recovery_subcode")) {
value = vb2_get_nv_storage(VB2_NV_RECOVERY_SUBCODE);
} else if (!strcasecmp(name,"wipeout_request")) {
@@ -662,8 +662,8 @@ int VbSetSystemPropertyInt(const char *name, int value)
} else if (!strcasecmp(name,"fwb_tries") ||
!strcasecmp(name,"fw_try_count")) {
return vb2_set_nv_storage(VB2_NV_TRY_COUNT, value);
- } else if (!strcasecmp(name,"display_request")) {
- return vb2_set_nv_storage(VB2_NV_DISPLAY_REQUEST, value);
+ } else if (!strcasecmp(name,"oprom_needed")) {
+ return vb2_set_nv_storage(VB2_NV_OPROM_NEEDED, value);
} else if (!strcasecmp(name,"wipeout_request")) {
/* Can only clear this flag, set only by firmware. */
return vb2_set_nv_storage(VB2_NV_REQ_WIPEOUT, 0);
diff --git a/tests/ec_sync_tests.c b/tests/ec_sync_tests.c
index fb043460..571eef67 100644
--- a/tests/ec_sync_tests.c
+++ b/tests/ec_sync_tests.c
@@ -74,7 +74,6 @@ static void ResetMocks(void)
sd = vb2_get_sd(&ctx);
sd->vbsd = shared;
- sd->flags |= VB2_SD_FLAG_DISPLAY_AVAILABLE;
memset(&shared_data, 0, sizeof(shared_data));
VbSharedDataInit(shared, sizeof(shared_data));
@@ -303,15 +302,12 @@ static void VbSoftwareSyncTest(void)
ResetMocks();
vb2_nv_set(&ctx, VB2_NV_TRY_RO_SYNC, 1);
mock_ec_ro_hash[0]++;
- vb2_nv_set(&ctx, VB2_NV_DISPLAY_REQUEST, 1);
test_ssync(0, 0, "rw update not needed");
TEST_EQ(ec_rw_protected, 1, " ec rw protected");
TEST_EQ(ec_run_image, 1, " ec run image");
TEST_EQ(ec_rw_updated, 0, " ec rw not updated");
TEST_EQ(ec_ro_protected, 1, " ec ro protected");
TEST_EQ(ec_ro_updated, 1, " ec ro updated");
- TEST_EQ(vb2_nv_get(&ctx, VB2_NV_DISPLAY_REQUEST), 1,
- " DISPLAY_REQUEST left untouched");
ResetMocks();
mock_ec_rw_hash[0]++;
@@ -354,33 +350,6 @@ static void VbSoftwareSyncTest(void)
test_ssync(0, 0, "Slow update");
TEST_EQ(screens_displayed[0], VB_SCREEN_WAIT, " wait screen");
- ResetMocks();
- mock_ec_rw_hash[0]++;
- ctx.flags |= VB2_CONTEXT_EC_SYNC_SLOW;
- sd->flags &= ~VB2_SD_FLAG_DISPLAY_AVAILABLE;
- test_ssync(VBERROR_REBOOT_REQUIRED, 0,
- "Slow update - reboot for display");
-
- ResetMocks();
- mock_ec_rw_hash[0]++;
- ctx.flags |= VB2_CONTEXT_EC_SYNC_SLOW;
- vb2_nv_set(&ctx, VB2_NV_DISPLAY_REQUEST, 1);
- test_ssync(VBERROR_REBOOT_REQUIRED, 0,
- "Slow update with display request");
- TEST_EQ(screens_displayed[0], VB_SCREEN_WAIT, " wait screen");
- TEST_EQ(vb2_nv_get(&ctx, VB2_NV_DISPLAY_REQUEST), 0,
- " DISPLAY_REQUEST disabled");
-
- ResetMocks();
- mock_ec_rw_hash[0]++;
- ctx.flags |= VB2_CONTEXT_EC_SYNC_SLOW;
- vb2_nv_set(&ctx, VB2_NV_DISPLAY_REQUEST, 0);
- test_ssync(VBERROR_SUCCESS, 0,
- "Slow update without display request (no reboot needed)");
- TEST_EQ(screens_displayed[0], VB_SCREEN_WAIT, " wait screen");
- TEST_EQ(vb2_nv_get(&ctx, VB2_NV_DISPLAY_REQUEST), 0,
- " DISPLAY_REQUEST still disabled");
-
/* RW cases, no update */
ResetMocks();
mock_in_rw = 1;
@@ -467,12 +436,6 @@ static void VbSoftwareSyncTest(void)
ResetMocks();
ec_aux_fw_mock_severity = VB_AUX_FW_SLOW_UPDATE;
- sd->flags &= ~VB2_SD_FLAG_DISPLAY_AVAILABLE;
- test_ssync(VBERROR_REBOOT_REQUIRED, 0,
- "Slow auxiliary FW update needed - reboot for display");
-
- ResetMocks();
- ec_aux_fw_mock_severity = VB_AUX_FW_SLOW_UPDATE;
test_ssync(VBERROR_SUCCESS, 0,
"Slow auxiliary FW update needed");
TEST_EQ(ec_aux_fw_update_req, 1, " aux fw update requested");
diff --git a/tests/vb2_api_tests.c b/tests/vb2_api_tests.c
index d45f7451..8c31c2ec 100644
--- a/tests/vb2_api_tests.c
+++ b/tests/vb2_api_tests.c
@@ -258,8 +258,8 @@ static void phase1_tests(void)
0, " display available SD flag");
reset_common_data(FOR_MISC);
- vb2_nv_set(&cc, VB2_NV_DISPLAY_REQUEST, 1);
- TEST_SUCC(vb2api_fw_phase1(&cc), "phase1 with DISPLAY_REQUEST");
+ vb2_nv_set(&cc, VB2_NV_OPROM_NEEDED, 1);
+ TEST_SUCC(vb2api_fw_phase1(&cc), "phase1 with OPROM_NEEDED");
TEST_NEQ(cc.flags & VB2_CONTEXT_DISPLAY_INIT,
0, " display init context flag");
TEST_NEQ(sd->flags & VB2_SD_FLAG_DISPLAY_AVAILABLE,
diff --git a/tests/vb2_nvstorage_tests.c b/tests/vb2_nvstorage_tests.c
index 52c14d4e..2dbc9950 100644
--- a/tests/vb2_nvstorage_tests.c
+++ b/tests/vb2_nvstorage_tests.c
@@ -54,7 +54,7 @@ static struct nv_field nvfields[] = {
{VB2_NV_CLEAR_TPM_OWNER_DONE, 0, 1, 0, "clear tpm owner done"},
{VB2_NV_TPM_REQUESTED_REBOOT, 0, 1, 0, "tpm requested reboot"},
{VB2_NV_REQ_WIPEOUT, 0, 1, 0, "request wipeout"},
- {VB2_NV_DISPLAY_REQUEST, 0, 1, 0, "oprom needed"},
+ {VB2_NV_OPROM_NEEDED, 0, 1, 0, "oprom needed"},
{VB2_NV_BACKUP_NVRAM_REQUEST, 0, 1, 0, "backup nvram request"},
{VB2_NV_FASTBOOT_UNLOCK_IN_FW, 0, 1, 0, "fastboot unlock in fw"},
{VB2_NV_BOOT_ON_AC_DETECT, 0, 1, 0, "boot on ac detect"},
diff --git a/tests/vboot_api_kernel2_tests.c b/tests/vboot_api_kernel2_tests.c
index 2d0a7ab5..cb2471f4 100644
--- a/tests/vboot_api_kernel2_tests.c
+++ b/tests/vboot_api_kernel2_tests.c
@@ -98,7 +98,6 @@ static void ResetMocks(void)
sd = vb2_get_sd(&ctx);
sd->vbsd = shared;
- sd->flags |= VB2_SD_FLAG_DISPLAY_AVAILABLE;
audio_looping_calls_left = 30;
vbtlk_retval = 1000;
@@ -1344,7 +1343,7 @@ static void VbBootRecTest(void)
VBERROR_TPM_SET_BOOT_MODE_STATE,
"Ctrl+D todev failure");
- /* Test Diagnostic Mode via Ctrl-C - display available */
+ /* Test Diagnostic Mode via Ctrl-C when no oprom needed */
ResetMocks();
shared->flags = VBSD_BOOT_REC_SWITCH_ON;
trust_ec = 1;
@@ -1364,15 +1363,14 @@ static void VbBootRecTest(void)
TEST_EQ(vb2_nv_get(&ctx, VB2_NV_DIAG_REQUEST), DIAGNOSTIC_UI,
" todiag is updated for Ctrl-C");
- TEST_EQ(vb2_nv_get(&ctx, VB2_NV_DISPLAY_REQUEST), 0,
- " todiag doesn't set unneeded DISPLAY_REQUEST");
+ TEST_EQ(vb2_nv_get(&ctx, VB2_NV_OPROM_NEEDED), 0,
+ " todiag doesn't update for unneeded opom");
TEST_EQ(screens_displayed[0], VB_SCREEN_RECOVERY_INSERT,
" insert screen");
- /* Test Diagnostic Mode via F12 - display disabled */
+ /* Test Diagnostic Mode via F12 - oprom needed */
ResetMocks();
- shared->flags = VBSD_BOOT_REC_SWITCH_ON;
- sd->flags &= ~VB2_SD_FLAG_DISPLAY_AVAILABLE;
+ shared->flags = VBSD_BOOT_REC_SWITCH_ON | VBSD_OPROM_MATTERS;
trust_ec = 1;
vbtlk_retval = VBERROR_NO_DISK_FOUND - VB_DISK_FLAG_REMOVABLE;
MockGpioAfter(100, GPIO_SHUTDOWN);
@@ -1389,12 +1387,12 @@ static void VbBootRecTest(void)
"F12 todiag - disabled");
TEST_EQ(vb2_nv_get(&ctx, VB2_NV_DIAG_REQUEST), DIAGNOSTIC_UI,
" todiag is updated for F12");
- TEST_EQ(vb2_nv_get(&ctx, VB2_NV_DISPLAY_REQUEST), DIAGNOSTIC_UI,
- " todiag sets DISPLAY_REQUEST if needed");
+ TEST_EQ(vb2_nv_get(&ctx, VB2_NV_OPROM_NEEDED), DIAGNOSTIC_UI,
+ " todiag updates opom, if need");
TEST_EQ(screens_displayed[0], VB_SCREEN_RECOVERY_INSERT,
" insert screen");
- /* Test Diagnostic Mode via Ctrl-C OS broken - display available */
+ /* Test Diagnostic Mode via Ctrl-C OS broken */
ResetMocks();
shared->flags = 0;
MockGpioAfter(100, GPIO_SHUTDOWN);
@@ -1411,8 +1409,8 @@ static void VbBootRecTest(void)
"Ctrl+C todiag os broken - disabled");
TEST_EQ(vb2_nv_get(&ctx, VB2_NV_DIAG_REQUEST), DIAGNOSTIC_UI,
" todiag is updated for Ctrl-C");
- TEST_EQ(vb2_nv_get(&ctx, VB2_NV_DISPLAY_REQUEST), 0,
- " todiag doesn't set unneeded DISPLAY_REQUEST");
+ TEST_EQ(vb2_nv_get(&ctx, VB2_NV_OPROM_NEEDED), 0,
+ " todiag doesn't update for unneeded opom");
TEST_EQ(screens_displayed[0], VB_SCREEN_OS_BROKEN,
" os broken screen");
diff --git a/tests/vboot_api_kernel4_tests.c b/tests/vboot_api_kernel4_tests.c
index fdf51da6..adad4131 100644
--- a/tests/vboot_api_kernel4_tests.c
+++ b/tests/vboot_api_kernel4_tests.c
@@ -28,7 +28,6 @@
static uint8_t workbuf[VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE];
static struct vb2_context ctx;
static struct vb2_context ctx_nvram_backend;
-static struct vb2_shared_data *sd;
static VbCommonParams cparams;
static VbSelectAndLoadKernelParams kparams;
static uint8_t shared_data[VB_SHARED_DATA_MIN_SIZE];
@@ -66,8 +65,6 @@ static void ResetMocks(void)
ctx.workbuf = workbuf;
ctx.workbuf_size = sizeof(workbuf);
vb2_init_context(&ctx);
- sd = vb2_get_sd(&ctx);
- sd->flags |= VB2_SD_FLAG_DISPLAY_AVAILABLE;
/*
* ctx_nvram_backend is only used as an NVRAM backend (see
@@ -274,27 +271,26 @@ static void VbSlkTest(void)
ResetMocks();
mock_switches[1] = VB_SWITCH_FLAG_PHYS_PRESENCE_PRESSED;
vb2_nv_set(&ctx_nvram_backend, VB2_NV_DIAG_REQUEST, 1);
- vb2_nv_set(&ctx_nvram_backend, VB2_NV_DISPLAY_REQUEST, 1);
+ vb2_nv_set(&ctx_nvram_backend, VB2_NV_OPROM_NEEDED, 1);
vbboot_retval = -4;
- test_slk(VBERROR_SIMULATED, 0,
- "Normal boot with diag - display available");
- TEST_EQ(vb2_nv_get(&ctx_nvram_backend, VB2_NV_DIAG_REQUEST),
- 0, " diag not requested");
- TEST_EQ(vb2_nv_get(&ctx_nvram_backend, VB2_NV_DISPLAY_REQUEST),
- 0, " DISPLAY_REQUEST disabled");
+ test_slk(VBERROR_SIMULATED, 0, "Normal boot with diag");
+ TEST_EQ(vb2_nv_get(&ctx_nvram_backend, VB2_NV_DIAG_REQUEST), 0,
+ " diag not requested");
+ TEST_EQ(vb2_nv_get(&ctx_nvram_backend, VB2_NV_OPROM_NEEDED), 1,
+ " oprom still needed");
ResetMocks();
mock_switches[1] = VB_SWITCH_FLAG_PHYS_PRESENCE_PRESSED;
vb2_nv_set(&ctx_nvram_backend, VB2_NV_DIAG_REQUEST, 1);
- vb2_nv_set(&ctx_nvram_backend, VB2_NV_DISPLAY_REQUEST, 0);
- sd->flags &= ~VB2_SD_FLAG_DISPLAY_AVAILABLE;
+ vb2_nv_set(&ctx_nvram_backend, VB2_NV_OPROM_NEEDED, 1);
+ shared->flags |= VBSD_OPROM_MATTERS;
vbboot_retval = -4;
- test_slk(VBERROR_REBOOT_REQUIRED, 0,
- "Normal boot with diag - display unavailable");
- TEST_EQ(vb2_nv_get(&ctx_nvram_backend, VB2_NV_DIAG_REQUEST),
- 1, " diag requested");
- TEST_EQ(vb2_nv_get(&ctx_nvram_backend, VB2_NV_DISPLAY_REQUEST),
- 1, " DISPLAY_REQUEST needed");
+ test_slk(VBERROR_SIMULATED, 0,
+ "Normal boot with diag and oprom");
+ TEST_EQ(vb2_nv_get(&ctx_nvram_backend, VB2_NV_DIAG_REQUEST), 0,
+ " diag not requested");
+ TEST_EQ(vb2_nv_get(&ctx_nvram_backend, VB2_NV_OPROM_NEEDED), 0,
+ " oprom not needed");
}
/* Boot dev */
diff --git a/utility/crossystem.c b/utility/crossystem.c
index 00846a67..3093f2a8 100644
--- a/utility/crossystem.c
+++ b/utility/crossystem.c
@@ -78,7 +78,7 @@ const Param sys_param_list[] = {
{"mainfw_act", IS_STRING, "Active main firmware"},
{"mainfw_type", IS_STRING, "Active main firmware type"},
{"nvram_cleared", CAN_WRITE, "Have NV settings been lost? Write 0 to clear"},
- {"display_request", CAN_WRITE, "Should we initialize the display at boot?"},
+ {"oprom_needed", CAN_WRITE, "Should we load the VGA Option ROM at boot?"},
{"phase_enforcement", 0,
"Board should have full security settings applied"},
{"recovery_reason", 0, "Recovery mode reason for current boot"},