summaryrefslogtreecommitdiff
path: root/host
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@google.com>2018-04-12 10:20:16 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-04-17 15:47:13 -0700
commit534194ead77895dd131ed59b968b21a2ae36f133 (patch)
tree28506beacf01d948e008b903b21e2b27e41a9e92 /host
parentf2a16b86fa1830e425fa66923b8ed3e2099b955d (diff)
downloadvboot-534194ead77895dd131ed59b968b21a2ae36f133.tar.gz
Add new NV and GBB flag to control UDC
This change adds a new NV and GBB flag for controlling USB device mode behavior, adding an additional step to enable UDC on systems that support it. Users of this feature will need to first enable developer mode and then enable UDC separately by running "crossystem dev_enable_udc=1". Alternatively those without write protect enabled can set a GBB flag to have UDC enabled by default while in developer mode. This is based on the security reviewed proposal at https://docs.google.com/document/d/1b6avd9xvhvljN_NKtctWrClj4mSYZ_uPmp7MmAnPwqs BUG=b:74339386 BRANCH=poppy TEST=manual testing on Eve device Change-Id: I6f440320f28b033639b53246d3034bc8acc37a33 Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/1010769 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Diffstat (limited to 'host')
-rw-r--r--host/lib/crossystem.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/host/lib/crossystem.c b/host/lib/crossystem.c
index f379d228..e8c48d86 100644
--- a/host/lib/crossystem.c
+++ b/host/lib/crossystem.c
@@ -508,6 +508,8 @@ int VbGetSystemPropertyInt(const char *name)
value = vb2_get_nv_storage(VB2_NV_DEV_BOOT_SIGNED_ONLY);
} else if (!strcasecmp(name,"dev_boot_fastboot_full_cap")) {
value = vb2_get_nv_storage(VB2_NV_DEV_BOOT_FASTBOOT_FULL_CAP);
+ } else if (!strcasecmp(name,"dev_enable_udc")) {
+ value = vb2_get_nv_storage(VB2_NV_DEV_ENABLE_UDC);
} else if (!strcasecmp(name,"oprom_needed")) {
value = vb2_get_nv_storage(VB2_NV_OPROM_NEEDED);
} else if (!strcasecmp(name,"recovery_subcode")) {
@@ -708,6 +710,9 @@ int VbSetSystemPropertyInt(const char *name, int value)
} else if (!strcasecmp(name, "fastboot_unlock_in_fw")) {
return vb2_set_nv_storage_with_backup(
VB2_NV_FASTBOOT_UNLOCK_IN_FW, value);
+ } else if (!strcasecmp(name, "dev_enable_udc")) {
+ return vb2_set_nv_storage_with_backup(
+ VB2_NV_DEV_ENABLE_UDC, value);
} else if (!strcasecmp(name, "boot_on_ac_detect")) {
return vb2_set_nv_storage_with_backup(
VB2_NV_BOOT_ON_AC_DETECT, value);