summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2012-05-25 12:55:58 -0700
committerGerrit <chrome-bot@google.com>2012-05-25 16:05:22 -0700
commit35d073362603c2c3f63974d04b4af9548297e208 (patch)
tree667899d7c21bb9f5d5b7dd5a01091952550635d4 /firmware
parent6f4cc5635916b071fe8c689805b65f8feff8c205 (diff)
downloadvboot-35d073362603c2c3f63974d04b4af9548297e208.tar.gz
Add DISABLE_DEV_REQUEST flag to nvram.factory-2394.Bfactory-2368.B
This just creates the bit. It doesn't actually do anything yet. BUG=chrome-os-partner:9980 TEST=manual crossystem disable_dev_request=1 crossystem crossystem disable_dev_request=0 crossystem Change-Id: I0e92a6b5ef5074ee5eae2d6d469c1c9826faecb3 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/23752 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'firmware')
-rw-r--r--firmware/include/vboot_nvstorage.h3
-rw-r--r--firmware/lib/vboot_nvstorage.c12
2 files changed, 15 insertions, 0 deletions
diff --git a/firmware/include/vboot_nvstorage.h b/firmware/include/vboot_nvstorage.h
index 0f6e1fce..79141761 100644
--- a/firmware/include/vboot_nvstorage.h
+++ b/firmware/include/vboot_nvstorage.h
@@ -56,6 +56,9 @@ typedef enum VbNvParam {
VBNV_DEV_BOOT_USB,
/* Only boot Google-signed images in developer mode. 0=no, 1=yes. */
VBNV_DEV_BOOT_SIGNED_ONLY,
+ /* 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 virtual. */
+ VBNV_DISABLE_DEV_REQUEST,
} VbNvParam;
diff --git a/firmware/lib/vboot_nvstorage.c b/firmware/lib/vboot_nvstorage.c
index 7361817b..de4fa3b0 100644
--- a/firmware/lib/vboot_nvstorage.c
+++ b/firmware/lib/vboot_nvstorage.c
@@ -22,6 +22,7 @@
#define BOOT_OFFSET 1
#define BOOT_DEBUG_RESET_MODE 0x80
+#define BOOT_DISABLE_DEV_REQUEST 0x40
#define BOOT_TRY_B_COUNT_MASK 0x0F
#define RECOVERY_OFFSET 2
@@ -128,6 +129,10 @@ int VbNvGet(VbNvContext* context, VbNvParam param, uint32_t* dest) {
*dest = (raw[DEV_FLAGS_OFFSET] & DEV_BOOT_SIGNED_ONLY_MASK ? 1 : 0);
return 0;
+ case VBNV_DISABLE_DEV_REQUEST:
+ *dest = (raw[BOOT_OFFSET] & BOOT_DISABLE_DEV_REQUEST ? 1 : 0);
+ return 0;
+
default:
return 1;
}
@@ -220,6 +225,13 @@ int VbNvSet(VbNvContext* context, VbNvParam param, uint32_t value) {
raw[DEV_FLAGS_OFFSET] &= ~DEV_BOOT_SIGNED_ONLY_MASK;
break;
+ case VBNV_DISABLE_DEV_REQUEST:
+ if (value)
+ raw[BOOT_OFFSET] |= BOOT_DISABLE_DEV_REQUEST;
+ else
+ raw[BOOT_OFFSET] &= ~BOOT_DISABLE_DEV_REQUEST;
+ break;
+
default:
return 1;
}