summaryrefslogtreecommitdiff
path: root/firmware/2lib
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/2lib')
-rw-r--r--firmware/2lib/2nvstorage.c7
-rw-r--r--firmware/2lib/include/2nvstorage.h2
-rw-r--r--firmware/2lib/include/2nvstorage_fields.h3
-rw-r--r--firmware/2lib/include/2struct.h3
4 files changed, 14 insertions, 1 deletions
diff --git a/firmware/2lib/2nvstorage.c b/firmware/2lib/2nvstorage.c
index 71a0dbb9..b0810c36 100644
--- a/firmware/2lib/2nvstorage.c
+++ b/firmware/2lib/2nvstorage.c
@@ -152,6 +152,9 @@ uint32_t vb2_nv_get(struct vb2_context *ctx, enum vb2_nv_param param)
return (p[VB2_NV_OFFS_DEV] & VB2_NV_DEV_FLAG_DEFAULT_BOOT)
>> VB2_NV_DEV_DEFAULT_BOOT_SHIFT;
+ case VB2_NV_DEV_ENABLE_UDC:
+ return GETBIT(VB2_NV_OFFS_DEV, VB2_NV_DEV_FLAG_UDC);
+
case VB2_NV_DISABLE_DEV_REQUEST:
return GETBIT(VB2_NV_OFFS_BOOT, VB2_NV_BOOT_DISABLE_DEV);
@@ -326,6 +329,10 @@ void vb2_nv_set(struct vb2_context *ctx,
(uint8_t)(value << VB2_NV_DEV_DEFAULT_BOOT_SHIFT);
break;
+ case VB2_NV_DEV_ENABLE_UDC:
+ SETBIT(VB2_NV_OFFS_DEV, VB2_NV_DEV_FLAG_UDC);
+ break;
+
case VB2_NV_DISABLE_DEV_REQUEST:
SETBIT(VB2_NV_OFFS_BOOT, VB2_NV_BOOT_DISABLE_DEV);
break;
diff --git a/firmware/2lib/include/2nvstorage.h b/firmware/2lib/include/2nvstorage.h
index 1a654691..55b16129 100644
--- a/firmware/2lib/include/2nvstorage.h
+++ b/firmware/2lib/include/2nvstorage.h
@@ -59,6 +59,8 @@ enum vb2_nv_param {
VB2_NV_DEV_BOOT_FASTBOOT_FULL_CAP,
/* Set default boot mode (see vb2_dev_default_boot) */
VB2_NV_DEV_DEFAULT_BOOT,
+ /* Enable USB Device Controller */
+ VB2_NV_DEV_ENABLE_UDC,
/*
* Set by userspace to request that RO firmware disable dev-mode on the
* next boot. This is likely only possible if the dev-switch is
diff --git a/firmware/2lib/include/2nvstorage_fields.h b/firmware/2lib/include/2nvstorage_fields.h
index 0ed3325a..9f9f0e4c 100644
--- a/firmware/2lib/include/2nvstorage_fields.h
+++ b/firmware/2lib/include/2nvstorage_fields.h
@@ -61,13 +61,14 @@ enum vb2_nv_offset {
#define VB2_NV_BOOT2_PREV_RESULT_SHIFT 4 /* Number of bits to shift result */
#define VB2_NV_BOOT2_PREV_TRIED 0x40
-/* Fields in VB2_NV_OFFS_DEV (unused = 0xc0) */
+/* Fields in VB2_NV_OFFS_DEV (unused = 0x80) */
#define VB2_NV_DEV_FLAG_USB 0x01
#define VB2_NV_DEV_FLAG_SIGNED_ONLY 0x02
#define VB2_NV_DEV_FLAG_LEGACY 0x04
#define VB2_NV_DEV_FLAG_FASTBOOT_FULL_CAP 0x08
#define VB2_NV_DEV_FLAG_DEFAULT_BOOT 0x30
#define VB2_NV_DEV_DEFAULT_BOOT_SHIFT 4 /* Number of bits to shift */
+#define VB2_NV_DEV_FLAG_UDC 0x40
/* Fields in VB2_NV_OFFS_TPM (unused = 0xf8) */
#define VB2_NV_TPM_CLEAR_OWNER_REQUEST 0x01
diff --git a/firmware/2lib/include/2struct.h b/firmware/2lib/include/2struct.h
index 3411de77..aec76e67 100644
--- a/firmware/2lib/include/2struct.h
+++ b/firmware/2lib/include/2struct.h
@@ -301,6 +301,9 @@ enum vb2_gbb_flag {
/* Disable FWMP */
VB2_GBB_FLAG_DISABLE_FWMP = (1 << 15),
+
+ /* Enable USB Device Controller */
+ VB2_GBB_FLAG_ENABLE_UDC = (1 << 16),
};
struct vb2_gbb_header {