summaryrefslogtreecommitdiff
path: root/src/vendorcode/google/chromeos/vboot_common.c
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2015-09-03 11:41:14 +0200
committerAaron Durbin <adurbin@chromium.org>2015-09-29 22:35:47 +0000
commit115360fdb36be77e86dfa1208f3c1e3dca649685 (patch)
tree5c04700db4d2f433bdec55443822df19aac51d3a /src/vendorcode/google/chromeos/vboot_common.c
parentc947fee4791a8274ebb9128c43b0052d5cabe1b4 (diff)
downloadcoreboot-115360fdb36be77e86dfa1208f3c1e3dca649685.tar.xz
chromeos: vboot-related functions move to common vboot code
This moves a few vboot-prefixed functions that were defined in chromeos.c to vboot_common.c, since those are only relevant to vboot and depend on the vboot handoff data. This allows more separation between CONFIG_CHROMEOS and what CONFIG_CHROMEOS selects, so that each separate option (such as CONFIG_VBOOT_VERIFY_FIRMWARE) can be enabled separately. Thus, the actual definitions of these functions will only be declared when CONFIG_VBOOT_VERIFY_FIRMWARE is set, so the check before calling vboot_skip_display_init in bootmode was also adapted. Change-Id: I52f8a408645566dac0a2100e819c8ed5d3d88ea5 Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Reviewed-on: http://review.coreboot.org/11497 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src/vendorcode/google/chromeos/vboot_common.c')
-rw-r--r--src/vendorcode/google/chromeos/vboot_common.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/vendorcode/google/chromeos/vboot_common.c b/src/vendorcode/google/chromeos/vboot_common.c
index 2fd29b6bfe..1c216d0d82 100644
--- a/src/vendorcode/google/chromeos/vboot_common.c
+++ b/src/vendorcode/google/chromeos/vboot_common.c
@@ -55,6 +55,33 @@ int vboot_get_handoff_info(void **addr, uint32_t *size)
return 0;
}
+static int vboot_handoff_flag(uint32_t flag)
+{
+ struct vboot_handoff *vbho;
+
+ vbho = cbmem_find(CBMEM_ID_VBOOT_HANDOFF);
+
+ if (vbho == NULL)
+ return 0;
+
+ return !!(vbho->init_params.out_flags & flag);
+}
+
+int vboot_skip_display_init(void)
+{
+ return !vboot_handoff_flag(VB_INIT_OUT_ENABLE_DISPLAY);
+}
+
+int vboot_enable_developer(void)
+{
+ return vboot_handoff_flag(VB_INIT_OUT_ENABLE_DEVELOPER);
+}
+
+int vboot_enable_recovery(void)
+{
+ return vboot_handoff_flag(VB_INIT_OUT_ENABLE_RECOVERY);
+}
+
void vboot_reboot(void)
{
if (IS_ENABLED(CONFIG_CONSOLE_CBMEM_DUMP_TO_UART))