From 7bb45097af1e8b5f2bcf8e7a8bc6557c6505693b Mon Sep 17 00:00:00 2001 From: Randall Spangler Date: Fri, 2 Mar 2018 15:34:39 -0800 Subject: 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 Reviewed-on: https://chromium-review.googlesource.com/947256 Reviewed-by: Julius Werner --- firmware/2lib/include/2api.h | 6 ------ firmware/include/vboot_api.h | 5 ----- firmware/include/vboot_struct.h | 7 +++++-- firmware/lib/ec_sync.c | 1 - firmware/lib/vboot_api_kernel.c | 2 -- tests/ec_sync_tests.c | 12 ------------ 6 files changed, 5 insertions(+), 28 deletions(-) diff --git a/firmware/2lib/include/2api.h b/firmware/2lib/include/2api.h index 97b5cca6..1e6fada4 100644 --- a/firmware/2lib/include/2api.h +++ b/firmware/2lib/include/2api.h @@ -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), }; /* diff --git a/firmware/include/vboot_api.h b/firmware/include/vboot_api.h index 9f2901a3..51351738 100644 --- a/firmware/include/vboot_api.h +++ b/firmware/include/vboot_api.h @@ -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. diff --git a/firmware/include/vboot_struct.h b/firmware/include/vboot_struct.h index 3f0d888c..6036dc8f 100644 --- a/firmware/include/vboot_struct.h +++ b/firmware/include/vboot_struct.h @@ -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 */ diff --git a/firmware/lib/ec_sync.c b/firmware/lib/ec_sync.c index afa6f1e7..c19e5d20 100644 --- a/firmware/lib/ec_sync.c +++ b/firmware/lib/ec_sync.c @@ -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; } diff --git a/firmware/lib/vboot_api_kernel.c b/firmware/lib/vboot_api_kernel.c index d4475fbb..f5509892 100644 --- a/firmware/lib/vboot_api_kernel.c +++ b/firmware/lib/vboot_api_kernel.c @@ -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; diff --git a/tests/ec_sync_tests.c b/tests/ec_sync_tests.c index 9becb7c3..eceae78f 100644 --- a/tests/ec_sync_tests.c +++ b/tests/ec_sync_tests.c @@ -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]++; -- cgit v1.2.1