diff options
Diffstat (limited to 'firmware/lib/vboot_nvstorage.c')
-rw-r--r-- | firmware/lib/vboot_nvstorage.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/firmware/lib/vboot_nvstorage.c b/firmware/lib/vboot_nvstorage.c index ebf796e6..54ac5ec9 100644 --- a/firmware/lib/vboot_nvstorage.c +++ b/firmware/lib/vboot_nvstorage.c @@ -57,6 +57,9 @@ #define BOOT2_PREV_RESULT_SHIFT 4 /* Number of bits to shift result */ #define BOOT2_PREV_TRIED 0x40 +#define FASTBOOT_OFFSET 8 +#define FASTBOOT_UNLOCK_IN_FW 0x01 + #define KERNEL_FIELD_OFFSET 11 #define CRC_OFFSET 15 @@ -202,6 +205,10 @@ int VbNvGet(VbNvContext *context, VbNvParam param, uint32_t *dest) *dest = (raw[HEADER_OFFSET] & HEADER_WIPEOUT) ? 1 : 0; return 0; + case VBNV_FASTBOOT_UNLOCK_IN_FW: + *dest = (raw[FASTBOOT_OFFSET] & FASTBOOT_UNLOCK_IN_FW) ? 1 : 0; + return 0; + default: return 1; } @@ -388,6 +395,13 @@ int VbNvSet(VbNvContext *context, VbNvParam param, uint32_t value) raw[HEADER_OFFSET] &= ~HEADER_WIPEOUT; break; + case VBNV_FASTBOOT_UNLOCK_IN_FW: + if (value) + raw[FASTBOOT_OFFSET] |= FASTBOOT_UNLOCK_IN_FW; + else + raw[FASTBOOT_OFFSET] &= ~FASTBOOT_UNLOCK_IN_FW; + break; + default: return 1; } |