diff options
-rw-r--r-- | firmware/include/load_firmware_fw.h | 4 | ||||
-rw-r--r-- | firmware/lib/vboot_firmware.c | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/firmware/include/load_firmware_fw.h b/firmware/include/load_firmware_fw.h index 8ba67cf7..2332564b 100644 --- a/firmware/include/load_firmware_fw.h +++ b/firmware/include/load_firmware_fw.h @@ -20,6 +20,9 @@ #define LOAD_FIRMWARE_SUCCESS 0 /* Success */ #define LOAD_FIRMWARE_RECOVERY 1 /* Reboot to recovery mode */ +/* Boot flags for LoadFirmware().boot_flags */ +#define BOOT_FLAG_DEVELOPER UINT64_C(0x01) /* Developer switch is on */ + typedef struct LoadFirmwareParams { /* Inputs to LoadFirmware() */ void *firmware_root_key_blob; /* Key used to sign firmware header */ @@ -35,6 +38,7 @@ typedef struct LoadFirmwareParams { * buffer, in bytes. On output, this * will contain the actual key blob * size placed into the buffer. */ + uint64_t boot_flags; /* Boot flags */ /* Outputs from LoadFirmware(); valid only if LoadFirmware() returns * LOAD_FIRMWARE_SUCCESS. */ diff --git a/firmware/lib/vboot_firmware.c b/firmware/lib/vboot_firmware.c index 1b401ba7..11ea6f77 100644 --- a/firmware/lib/vboot_firmware.c +++ b/firmware/lib/vboot_firmware.c @@ -60,8 +60,9 @@ int LoadFirmware(LoadFirmwareParams* params) { } /* Initialize the TPM and read rollback indices. */ - /* TODO: fix SetupTPM parameter for developer mode */ - if (0 != RollbackFirmwareSetup(0, &tpm_key_version, &tpm_fw_version)) { + if (0 != RollbackFirmwareSetup( + (params->boot_flags & BOOT_FLAG_DEVELOPER ? 1 : 0), + &tpm_key_version, &tpm_fw_version)) { VBDEBUG(("Unable to get stored versions.\n")); return LOAD_FIRMWARE_RECOVERY; } |