mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-26 19:25:02 +00:00
fastboot: Add fastboot related flags to nvstorage
Use unused offset 8 for fastboot related flags. BUG=chrome-os-partner:40196 BRANCH=None TEST=Compiles successfully. Change-Id: I6df0985924ba80cdcb68bb6b7658bf962f01287f Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/273180 Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Furquan Shaikh <furquan@chromium.org> Trybot-Ready: Furquan Shaikh <furquan@chromium.org>
This commit is contained in:
committed by
ChromeOS Commit Bot
parent
ebf886b5fd
commit
c180460feb
@@ -323,6 +323,7 @@ VbError_t VbInit(VbCommonParams *cparams, VbInitParams *iparams)
|
||||
VbNvSet(&vnc, VBNV_DEV_BOOT_LEGACY, 0);
|
||||
VbNvSet(&vnc, VBNV_DEV_BOOT_SIGNED_ONLY, 0);
|
||||
VbNvSet(&vnc, VBNV_DEV_BOOT_FASTBOOT_FULL_CAP, 0);
|
||||
VbNvSet(&vnc, VBNV_FASTBOOT_UNLOCK_IN_FW, 0);
|
||||
/*
|
||||
* Back up any changes now, so these values can't be forgotten
|
||||
* by draining the battery. We really only care about these
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ static const VbNvParam backup_params[] = {
|
||||
VBNV_DEV_BOOT_LEGACY,
|
||||
VBNV_DEV_BOOT_SIGNED_ONLY,
|
||||
VBNV_DEV_BOOT_FASTBOOT_FULL_CAP,
|
||||
VBNV_FASTBOOT_UNLOCK_IN_FW,
|
||||
};
|
||||
|
||||
/* We can't back things up if there isn't enough storage. */
|
||||
|
||||
Reference in New Issue
Block a user