[coreboot-gerrit] Change in coreboot[master]: vbnv: Add function to read UDC enable flag

Furquan Shaikh (Code Review) gerrit at coreboot.org
Thu Apr 26 04:12:16 CEST 2018


Hello Duncan Laurie,

I'd like you to do a code review. Please visit

    https://review.coreboot.org/25846

to review the following change.


Change subject: vbnv: Add function to read UDC enable flag
......................................................................

vbnv: Add function to read UDC enable flag

BUG=b:78577893
BRANCH=poppy

Change-Id: Ifd1e9b0781ffee242d695b72287632bc944a50c7
Signed-off-by: Duncan Laurie <dlaurie at google.com>
Signed-off-by: Furquan Shaikh <furquan at google.com>
---
M src/security/vboot/vbnv.c
M src/security/vboot/vbnv.h
M src/security/vboot/vbnv_layout.h
3 files changed, 12 insertions(+), 0 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/46/25846/1

diff --git a/src/security/vboot/vbnv.c b/src/security/vboot/vbnv.c
index 0fecacd..96507c0 100644
--- a/src/security/vboot/vbnv.c
+++ b/src/security/vboot/vbnv.c
@@ -147,6 +147,13 @@
 	return (vbnv_data(BOOT_OFFSET) & BOOT_OPROM_NEEDED) ? 1 : 0;
 }
 
+/* Read the UDC enable flag from VBNV. */
+int vbnv_udc_enable_flag(void)
+{
+	vbnv_setup();
+	return (vbnv_data(DEV_FLAGS_OFFSET) & DEV_ENABLE_UDC) ? 1 : 0;
+}
+
 void vbnv_init(uint8_t *vbnv_copy)
 {
 	if (IS_ENABLED(CONFIG_VBOOT_VBNV_CMOS))
diff --git a/src/security/vboot/vbnv.h b/src/security/vboot/vbnv.h
index 0288d0d..00d6443 100644
--- a/src/security/vboot/vbnv.h
+++ b/src/security/vboot/vbnv.h
@@ -26,6 +26,10 @@
 int get_recovery_mode_from_vbnv(void);
 void set_recovery_mode_into_vbnv(int recovery_reason);
 int vboot_wants_oprom(void);
+
+/* Read the UDC enable flag from VBNV. */
+int vbnv_udc_enable_flag(void);
+
 /* Initialize and read vbnv. This is used in the main vboot logic path. */
 void vbnv_init(uint8_t *vbnv_copy);
 /* Reset vbnv snapshot to a known state. */
diff --git a/src/security/vboot/vbnv_layout.h b/src/security/vboot/vbnv_layout.h
index 1dc01c9..a9326e4 100644
--- a/src/security/vboot/vbnv_layout.h
+++ b/src/security/vboot/vbnv_layout.h
@@ -40,6 +40,7 @@
 #define DEV_FLAGS_OFFSET             4
 #define DEV_BOOT_USB_MASK               0x01
 #define DEV_BOOT_SIGNED_ONLY_MASK       0x02
+#define DEV_ENABLE_UDC                  0x40
 
 #define MISC_FLAGS_OFFSET            8
 #define MISC_FLAGS_BATTERY_CUTOFF_MASK  0x08

-- 
To view, visit https://review.coreboot.org/25846
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifd1e9b0781ffee242d695b72287632bc944a50c7
Gerrit-Change-Number: 25846
Gerrit-PatchSet: 1
Gerrit-Owner: Furquan Shaikh <furquan at google.com>
Gerrit-Reviewer: Duncan Laurie <dlaurie at chromium.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180426/74036e62/attachment.html>


More information about the coreboot-gerrit mailing list