summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTudor Brindus <tbrindus@google.com>2018-07-31 16:25:26 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-08-02 21:50:16 -0700
commitc239374ac3e1af342c10f4f3244bc98d76c2413a (patch)
tree8c714790f01af5c176fa9f3b88e62ceb6139444b
parent12cf2ec05c40442b926a711abe264bcd935235c0 (diff)
downloadvboot-c239374ac3e1af342c10f4f3244bc98d76c2413a.tar.gz
vboot_reference: Add recoverysw_is_virtual flag to crossystem
This commit adds a flag recoverysw_is_virtual for determining whether a device's recovery switch status (as given by recoverysw_cur) is from a physical button or a line connected to Servo, without a physical button (e.g. veyron_minnie). BRANCH=none BUG=chromium:845589 TEST=manually tested on cave and veyron_minnie; make runtests Change-Id: If8e54e1df78b25a52dbf359ce641bea75533d705 Reviewed-on: https://chromium-review.googlesource.com/1157537 Commit-Ready: Tudor Brindus <tbrindus@chromium.org> Tested-by: Tudor Brindus <tbrindus@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
-rw-r--r--host/lib/crossystem.c7
-rw-r--r--utility/crossystem.c1
2 files changed, 8 insertions, 0 deletions
diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c
index e8c48d86..0df67629 100644
--- a/host/lib/crossystem.c
+++ b/host/lib/crossystem.c
@@ -51,6 +51,7 @@ 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_RECSW_VIRTUAL, /* Recovery switch is virtual */
VDAT_INT_HW_WPSW_BOOT, /* Hardware WP switch position at boot */
VDAT_INT_FW_VERSION_TPM, /* Current firmware version in TPM */
@@ -427,6 +428,10 @@ int GetVdatInt(VdatIntField field)
value = (sh->flags &
VBSD_BOOT_REC_SWITCH_ON ? 1 : 0);
break;
+ case VDAT_INT_RECSW_VIRTUAL:
+ value = (sh->flags &
+ VBSD_BOOT_REC_SWITCH_VIRTUAL ? 1 : 0);
+ break;
case VDAT_INT_HW_WPSW_BOOT:
value = (sh->flags &
VBSD_BOOT_FIRMWARE_WP_ENABLED ? 1 : 0);
@@ -530,6 +535,8 @@ int VbGetSystemPropertyInt(const char *name)
value = GetVdatInt(VDAT_INT_DEVSW_VIRTUAL);
} else if (!strcasecmp(name, "recoverysw_boot")) {
value = GetVdatInt(VDAT_INT_RECSW_BOOT);
+ } else if (!strcasecmp(name, "recoverysw_is_virtual")) {
+ value = GetVdatInt(VDAT_INT_RECSW_VIRTUAL);
} else if (!strcasecmp(name, "wpsw_boot")) {
value = GetVdatInt(VDAT_INT_HW_WPSW_BOOT);
} else if (!strcasecmp(name,"vdat_flags")) {
diff --git a/utility/crossystem.c b/utility/crossystem.c
index 82ee9d79..13e589ca 100644
--- a/utility/crossystem.c
+++ b/utility/crossystem.c
@@ -88,6 +88,7 @@ const Param sys_param_list[] = {
{"recoverysw_boot", 0, "Recovery switch position at boot"},
{"recoverysw_cur", 0, "Recovery switch current position"},
{"recoverysw_ec_boot", 0, "Recovery switch position at EC boot"},
+ {"recoverysw_is_virtual", 0, "Recovery switch is virtual"},
{"ro_fwid", IS_STRING, "Read-only firmware ID"},
{"tpm_attack", CAN_WRITE, "TPM was interrupted since this flag was cleared"},
{"tpm_fwver", 0, "Firmware version stored in TPM", "0x%08x"},