firmware: Remove deprecated SW_WP_ENABLED flag

This was deprecated months ago in crossystem, and isn't set by
depthcharge or coreboot.  Remove the flag from vboot as well, keeping
only a reminder in vboot_struct.h so we don't reuse the VbSharedData
bit.

BUG=chromium:742685
BRANCH=none
TEST=make runtests

Change-Id: Ifa928e8ec4d999c524c6f4168695859261f384c9
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/947256
Reviewed-by: Julius Werner <jwerner@chromium.org>
This commit is contained in:
Randall Spangler
2018-03-02 15:34:39 -08:00
committed by chrome-bot
parent 68ca410670
commit 7bb45097af
6 changed files with 5 additions and 28 deletions

View File

@@ -158,12 +158,6 @@ enum vb2_context_flags {
* software sync.
*/
VB2_CONTEXT_EC_EFS = (1 << 17),
/*
* Software write protect for the RO firmware was enabled at boot.
* Caller may set this flag when initializing the context.
*/
VB2_CONTEXT_SW_WP_ENABLED = (1 << 18),
};
/*

View File

@@ -234,11 +234,6 @@ typedef struct VbCommonParams {
#define VB_INIT_FLAG_EC_SOFTWARE_SYNC 0x00000200
/* EC on this platform is slow to update. */
#define VB_INIT_FLAG_EC_SLOW_UPDATE 0x00000400
/*
* Software write protect was enabled at boot time. This is separate from the
* HW write protect. Both must be set for flash write protection to work.
*/
#define VB_INIT_FLAG_SW_WP_ENABLED 0x00000800
/*
* This platform does not have a physical recovery switch which, when present,
* can (and should) be used for additional physical presence checks.

View File

@@ -229,8 +229,11 @@ typedef struct VbKernelPreambleHeader {
#define VBSD_EC_SOFTWARE_SYNC 0x00000800
/* VbInit() was told that the EC firmware is slow to update */
#define VBSD_EC_SLOW_UPDATE 0x00001000
/* Firmware software write protect was enabled at boot time */
#define VBSD_BOOT_FIRMWARE_SW_WP_ENABLED 0x00002000
/*
* Deprecated; was firmware software write protect was enabled at boot time.
* Crossystem support removed https://chromium-review.googlesource.com/575389.
*/
#define VBSD_DEPRECATED_BOOT_FIRMWARE_SW_WP_ENABLED 0x00002000
/* VbInit() was told that the recovery button is a virtual one */
#define VBSD_BOOT_REC_SWITCH_VIRTUAL 0x00004000
/* Firmware used vboot2 for firmware selection */

View File

@@ -375,7 +375,6 @@ VbError_t ec_sync_phase1(struct vb2_context *ctx)
* separately.
*/
if (vb2_nv_get(ctx, VB2_NV_TRY_RO_SYNC) &&
!(ctx->flags & VB2_CONTEXT_SW_WP_ENABLED) &&
check_ec_hash(ctx, 0, VB_SELECT_FIRMWARE_READONLY)) {
return VBERROR_EC_REBOOT_TO_RO_REQUIRED;
}

View File

@@ -259,8 +259,6 @@ static VbError_t vb2_kernel_setup(VbCommonParams *cparams,
ctx.flags |= VB2_CONTEXT_EC_SYNC_SLOW;
if (shared->flags & VBSD_EC_EFS)
ctx.flags |= VB2_CONTEXT_EC_EFS;
if (shared->flags & VBSD_BOOT_FIRMWARE_SW_WP_ENABLED)
ctx.flags |= VB2_CONTEXT_SW_WP_ENABLED;
ctx.workbuf_size = VB2_KERNEL_WORKBUF_RECOMMENDED_SIZE +
VB2_WORKBUF_ALIGN;

View File

@@ -294,18 +294,6 @@ static void VbSoftwareSyncTest(void)
TEST_EQ(ec_ro_protected, 1, " ec ro protected");
TEST_EQ(ec_ro_updated, 1, " ec ro updated");
ResetMocks();
ctx.flags |= VB2_CONTEXT_SW_WP_ENABLED;
vb2_nv_set(&ctx, VB2_NV_TRY_RO_SYNC, 1);
mock_ec_rw_hash[0]++;
mock_ec_ro_hash[0]++;
test_ssync(0, 0, "WP enabled");
TEST_EQ(ec_rw_protected, 1, " ec rw protected");
TEST_EQ(ec_run_image, 1, " ec run image");
TEST_EQ(ec_rw_updated, 1, " ec rw updated");
TEST_EQ(ec_ro_protected, 1, " ec ro protected");
TEST_EQ(ec_ro_updated, 0, " ec ro updated");
ResetMocks();
vb2_nv_set(&ctx, VB2_NV_TRY_RO_SYNC, 1);
mock_ec_ro_hash[0]++;