summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2021-07-01 05:29:16 +0800
committerCommit Bot <commit-bot@chromium.org>2021-07-19 09:21:08 +0000
commit2d3af1227d6c74733f4e16da424ffaabdfcd23d4 (patch)
treec316b7cc46ddf876db9267872b84487d03637006 /firmware
parente33704be83614838400368ce5853becab9b88f4f (diff)
downloadvboot-2d3af1227d6c74733f4e16da424ffaabdfcd23d4.tar.gz
vboot: add MINIOS_PRIORITY flag to nvstorage
Flag decides whether MINIOS-A or MINIOS-B is booted. BUG=b:186682292 TEST=make clean && make runtests TEST=Deploy and run `crossystem minios_priority` commands BRANCH=none Signed-off-by: Joel Kitching <kitching@google.com> Change-Id: I11460bf1522cde8e98e680b0f00a417e2b4ef9a1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2998513 Tested-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
Diffstat (limited to 'firmware')
-rw-r--r--firmware/2lib/2nvstorage.c7
-rw-r--r--firmware/2lib/include/2nvstorage.h2
-rw-r--r--firmware/2lib/include/2nvstorage_fields.h5
3 files changed, 12 insertions, 2 deletions
diff --git a/firmware/2lib/2nvstorage.c b/firmware/2lib/2nvstorage.c
index 1cd5ba25..0f28404b 100644
--- a/firmware/2lib/2nvstorage.c
+++ b/firmware/2lib/2nvstorage.c
@@ -209,6 +209,9 @@ uint32_t vb2_nv_get(struct vb2_context *ctx, enum vb2_nv_param param)
return GETBIT(VB2_NV_OFFS_MISC,
VB2_NV_MISC_POST_EC_SYNC_DELAY);
+ case VB2_NV_MINIOS_PRIORITY:
+ return GETBIT(VB2_NV_OFFS_MISC, VB2_NV_MISC_MINIOS_PRIORITY);
+
case VB2_NV_DEPRECATED_DEV_BOOT_FASTBOOT_FULL_CAP:
case VB2_NV_DEPRECATED_FASTBOOT_UNLOCK_IN_FW:
case VB2_NV_DEPRECATED_ENABLE_ALT_OS_REQUEST:
@@ -416,6 +419,10 @@ void vb2_nv_set(struct vb2_context *ctx,
SETBIT(VB2_NV_OFFS_MISC, VB2_NV_MISC_POST_EC_SYNC_DELAY);
break;
+ case VB2_NV_MINIOS_PRIORITY:
+ SETBIT(VB2_NV_OFFS_MISC, VB2_NV_MISC_MINIOS_PRIORITY);
+ break;
+
case VB2_NV_DEPRECATED_DEV_BOOT_FASTBOOT_FULL_CAP:
case VB2_NV_DEPRECATED_FASTBOOT_UNLOCK_IN_FW:
case VB2_NV_DEPRECATED_ENABLE_ALT_OS_REQUEST:
diff --git a/firmware/2lib/include/2nvstorage.h b/firmware/2lib/include/2nvstorage.h
index 2f40b233..fe758230 100644
--- a/firmware/2lib/include/2nvstorage.h
+++ b/firmware/2lib/include/2nvstorage.h
@@ -125,6 +125,8 @@ enum vb2_nv_param {
VB2_NV_POST_EC_SYNC_DELAY,
/* Request booting of diagnostic rom. 0=no, 1=yes. */
VB2_NV_DIAG_REQUEST,
+ /* Priority of miniOS partition to load: 0=MINIOS-A, 1=MINIOS-B. */
+ VB2_NV_MINIOS_PRIORITY,
};
/* Firmware result codes for VB2_NV_FW_RESULT and VB2_NV_FW_PREV_RESULT */
diff --git a/firmware/2lib/include/2nvstorage_fields.h b/firmware/2lib/include/2nvstorage_fields.h
index 9575e87e..449b8fd3 100644
--- a/firmware/2lib/include/2nvstorage_fields.h
+++ b/firmware/2lib/include/2nvstorage_fields.h
@@ -79,7 +79,7 @@ enum vb2_nv_offset {
#define VB2_NV_BOOT_DISABLE_DEV 0x40
#define VB2_NV_BOOT_DEBUG_RESET 0x80
-/* Fields in VB2_NV_OFFS_BOOT2 (unused = 0x00) */
+/* Fields in VB2_NV_OFFS_BOOT2 */
#define VB2_NV_BOOT2_RESULT_MASK 0x03
#define VB2_NV_BOOT2_TRIED 0x04
#define VB2_NV_BOOT2_TRY_NEXT 0x08
@@ -102,11 +102,12 @@ enum vb2_nv_offset {
#define VB2_NV_TPM_CLEAR_OWNER_DONE 0x02
#define VB2_NV_TPM_REBOOTED 0x04
-/* Fields in VB2_NV_OFFS_MISC (unused = 0x80) */
+/* Fields in VB2_NV_OFFS_MISC (unused = 0xa0) */
#define VB2_NV_MISC_DEPRECATED_UNLOCK_FASTBOOT 0x01
#define VB2_NV_MISC_BOOT_ON_AC_DETECT 0x02
#define VB2_NV_MISC_TRY_RO_SYNC 0x04
#define VB2_NV_MISC_BATTERY_CUTOFF 0x08
+#define VB2_NV_MISC_MINIOS_PRIORITY 0x10
#define VB2_NV_MISC_POST_EC_SYNC_DELAY 0x40
#endif /* VBOOT_REFERENCE_2NVSTORAGE_FIELDS_H_ */