summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2012-08-28 15:00:51 -0700
committerGerrit <chrome-bot@google.com>2012-08-28 16:39:33 -0700
commit9dc62178c97b94e5c308f1c36fd0858c316959e5 (patch)
treecbf17a7f91bd3f53db1a6b7ef08e3381ef1f6c88 /firmware
parent1d053f6e2341dae1b2c48a422fbb5ce46a3bbefc (diff)
downloadvboot-9dc62178c97b94e5c308f1c36fd0858c316959e5.tar.gz
Add VB_INIT_FLAG_SW_WP_ENABLED to VbInit() input flags.
We need to know not only whether the HW WP pin is asserted, but whether the flash chip has configured its software protection registers to actually protect anything. This flag can be used to indicate that. BUG=chrome-os-partner:13265 BRANCH=link TEST=none This just adds the flag. Nothing actually sets the flag yet, so there's nothing to test. Change-Id: Icba9945fb56eb3a4681486c630cbbdc9232485ef Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/31642 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'firmware')
-rw-r--r--firmware/include/vboot_api.h3
-rw-r--r--firmware/include/vboot_struct.h2
-rw-r--r--firmware/lib/vboot_api_init.c2
3 files changed, 7 insertions, 0 deletions
diff --git a/firmware/include/vboot_api.h b/firmware/include/vboot_api.h
index b5f3fb34..3d9b6921 100644
--- a/firmware/include/vboot_api.h
+++ b/firmware/include/vboot_api.h
@@ -181,6 +181,9 @@ 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
/* Output flags for VbInitParams.out_flags. Used to indicate
* potential boot paths and configuration to the calling firmware
diff --git a/firmware/include/vboot_struct.h b/firmware/include/vboot_struct.h
index f8451a3f..4f48d9fc 100644
--- a/firmware/include/vboot_struct.h
+++ b/firmware/include/vboot_struct.h
@@ -237,6 +237,8 @@ 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
/* Supported flags by header version. It's ok to add new flags while keeping
* struct version 2 as long as flag-NOT-present is the correct value for
diff --git a/firmware/lib/vboot_api_init.c b/firmware/lib/vboot_api_init.c
index 8d1540ba..0a1ee434 100644
--- a/firmware/lib/vboot_api_init.c
+++ b/firmware/lib/vboot_api_init.c
@@ -56,6 +56,8 @@ VbError_t VbInit(VbCommonParams* cparams, VbInitParams* iparams) {
shared->flags |= VBSD_BOOT_REC_SWITCH_ON;
if (iparams->flags & VB_INIT_FLAG_WP_ENABLED)
shared->flags |= VBSD_BOOT_FIRMWARE_WP_ENABLED;
+ if (iparams->flags & VB_INIT_FLAG_SW_WP_ENABLED)
+ shared->flags |= VBSD_BOOT_FIRMWARE_SW_WP_ENABLED;
if (iparams->flags & VB_INIT_FLAG_S3_RESUME)
shared->flags |= VBSD_BOOT_S3_RESUME;
if (iparams->flags & VB_INIT_FLAG_RO_NORMAL_SUPPORT)