summaryrefslogtreecommitdiff
path: root/firmware/lib/rollback_index.c
diff options
context:
space:
mode:
authorChe-Liang Chiou <clchiou@chromium.org>2012-06-29 13:23:07 +0800
committerGerrit <chrome-bot@google.com>2012-06-29 00:19:08 -0700
commit552ae43be041331147c5d2aa3897db7a1011637d (patch)
tree028c0a2e62d378ddaaf7230e3345fa92c38f2fd4 /firmware/lib/rollback_index.c
parent61603e2d6128d6fadd2fd8b1f16d60c5df8c00bd (diff)
downloadvboot-552ae43be041331147c5d2aa3897db7a1011637d.tar.gz
Expose getter of virtual dev switch value
Firmware needs to be able to read virtual dev switch to set up device tree blob which is passed to kernel and eventually read by crossystem. Signed-off-by: Che-Liang Chiou <clchiou@chromium.org> BUG=chrome-os-partner:10947 TEST=With this change, U-Boot can read virtual dev switch. Change-Id: Ifac2ec3d39b8e9c1100031fdef085c28bb8b37c7 Reviewed-on: https://gerrit.chromium.org/gerrit/26394 Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Ready: Che-Liang Chiou <clchiou@chromium.org> Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Diffstat (limited to 'firmware/lib/rollback_index.c')
-rw-r--r--firmware/lib/rollback_index.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/firmware/lib/rollback_index.c b/firmware/lib/rollback_index.c
index 668312e6..4666c3e0 100644
--- a/firmware/lib/rollback_index.c
+++ b/firmware/lib/rollback_index.c
@@ -131,6 +131,20 @@ uint32_t WriteSpaceFirmware(RollbackSpaceFirmware* rsf) {
return TPM_E_CORRUPTED_STATE;
}
+VbError_t VbGetVirtualDevMode(int *val) {
+ RollbackSpaceFirmware rsf;
+
+ VBDEBUG(("TPM: Entering %s()\n", __func__));
+ if (TPM_SUCCESS != ReadSpaceFirmware(&rsf))
+ return VBERROR_TPM_FIRMWARE_SETUP;
+
+ VBDEBUG(("TPM: flags are 0x%02x\n", rsf.flags));
+ *val = (rsf.flags & FLAG_VIRTUAL_DEV_MODE_ON) ? 1 : 0;
+
+ VBDEBUG(("TPM: Leaving %s()\n", __func__));
+ return VBERROR_SUCCESS;
+}
+
uint32_t SetVirtualDevMode(int val) {
RollbackSpaceFirmware rsf;