Honor both fake_dev and virtual dev switch

BUG=chrome-os-partner:9706
TEST=none

No test yet. The entire boot/dev-mode/recovery flow depends on this working.
This is only part of the process, which will eventually be tested through
FAFT.

Change-Id: Iea6eaf59d4f349590cf9b920e4effb6a2641b2dc
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/23657
Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
Bill Richardson
2012-05-24 12:15:30 -07:00
committed by Gerrit
parent 201fe0bb55
commit 6f4cc56359
2 changed files with 13 additions and 13 deletions

View File

@@ -364,8 +364,7 @@ uint32_t SetupTPM(int recovery_mode, int developer_mode,
rsf->struct_version, rsf->flags, rsf->fw_versions));
/* The developer_mode value that's passed in is only set by a hardware
* dev-switch. We should OR it with any enabled virtual switch, since it
* can only be set by doing the keyboard-based dev-mode dance. */
* dev-switch. We should OR it with any enabled virtual switch. */
if (rsf->flags & FLAG_VIRTUAL_DEV_MODE_ON)
developer_mode = 1;
@@ -474,8 +473,8 @@ uint32_t RollbackFirmwareSetup(int recovery_mode, int hw_dev_sw,
RETURN_ON_FAILURE(SetupTPM(recovery_mode, *dev_mode_ptr, &rsf));
*version = rsf.fw_versions;
if (!hw_dev_sw)
*dev_mode_ptr = rsf.flags & FLAG_VIRTUAL_DEV_MODE_ON ? 1 : 0;
if (!hw_dev_sw && (rsf.flags & FLAG_VIRTUAL_DEV_MODE_ON))
*dev_mode_ptr = 1; /* OR with the TPM's value */
VBDEBUG(("TPM: RollbackFirmwareSetup %x\n", (int)rsf.fw_versions));
return TPM_SUCCESS;
}