summaryrefslogtreecommitdiff
path: root/host
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 /host
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 'host')
-rw-r--r--host/lib/crossystem.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c
index b5655433..a19384da 100644
--- a/host/lib/crossystem.c
+++ b/host/lib/crossystem.c
@@ -38,7 +38,8 @@ typedef enum VdatIntField {
VDAT_INT_DEVSW_BOOT, /* Dev switch position at boot */
VDAT_INT_DEVSW_VIRTUAL, /* Dev switch is virtual */
VDAT_INT_RECSW_BOOT, /* Recovery switch position at boot */
- VDAT_INT_WPSW_BOOT, /* WP switch position at boot */
+ VDAT_INT_HW_WPSW_BOOT, /* Hardware WP switch position at boot */
+ VDAT_INT_SW_WPSW_BOOT, /* Flash chip's WP setting at boot */
VDAT_INT_FW_VERSION_TPM, /* Current firmware version in TPM */
VDAT_INT_KERNEL_VERSION_TPM, /* Current kernel version in TPM */
@@ -364,9 +365,12 @@ int GetVdatInt(VdatIntField field) {
case VDAT_INT_RECSW_BOOT:
value = (sh->flags & VBSD_BOOT_REC_SWITCH_ON ? 1 : 0);
break;
- case VDAT_INT_WPSW_BOOT:
+ case VDAT_INT_HW_WPSW_BOOT:
value = (sh->flags & VBSD_BOOT_FIRMWARE_WP_ENABLED ? 1 : 0);
break;
+ case VDAT_INT_SW_WPSW_BOOT:
+ value = (sh->flags & VBSD_BOOT_FIRMWARE_SW_WP_ENABLED ? 1 : 0);
+ break;
case VDAT_INT_RECOVERY_REASON:
value = sh->recovery_reason;
break;
@@ -432,7 +436,9 @@ int VbGetSystemPropertyInt(const char* name) {
} else if (!strcasecmp(name, "recoverysw_boot")) {
value = GetVdatInt(VDAT_INT_RECSW_BOOT);
} else if (!strcasecmp(name, "wpsw_boot")) {
- value = GetVdatInt(VDAT_INT_WPSW_BOOT);
+ value = GetVdatInt(VDAT_INT_HW_WPSW_BOOT);
+ } else if (!strcasecmp(name, "sw_wpsw_boot")) {
+ value = GetVdatInt(VDAT_INT_SW_WPSW_BOOT);
} else if (!strcasecmp(name,"vdat_flags")) {
value = GetVdatInt(VDAT_INT_FLAGS);
} else if (!strcasecmp(name,"tpm_fwver")) {