summaryrefslogtreecommitdiff
path: root/src/lib/bootmode.c
diff options
context:
space:
mode:
authorAaron Durbin <adurbin@chromium.org>2015-09-02 09:21:36 -0500
committerAaron Durbin <adurbin@chromium.org>2015-09-04 15:09:00 +0000
commitbc98cc66b2fe787173ec04b84ea11bc3e57fe373 (patch)
tree15e1aa71a74fd52bfbc25f0055c3015cb31ca983 /src/lib/bootmode.c
parent5fc6f90ef7d3a69e87a004b07b99ef337c6d3380 (diff)
bootmode: add display_init_required()
Some of the Chrome OS boards were directly calling vboot called in some form after contorting around #ifdef preprocessor macros. The reasoning is that Chrome OS doesn't always do display initialization during startup. It's runtime dependent. While this is a requirement that doesn't mean vboot functions should be sprinkled around in the mainboard and chipset code. Instead provide one function, display_init_required(), that provides the policy for determining display initialization action. For Chrome OS devices this function honors vboot_skip_display_init() and all other configurations default to initializing display. Change-Id: I403213e22c0e621e148773597a550addfbaf3f7e Signed-off-by: Aaron Durbin <adurbin@chromium.org> Reviewed-on: http://review.coreboot.org/11490 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'src/lib/bootmode.c')
-rw-r--r--src/lib/bootmode.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/bootmode.c b/src/lib/bootmode.c
index c7e4927ca1..f2ff72a19a 100644
--- a/src/lib/bootmode.c
+++ b/src/lib/bootmode.c
@@ -19,9 +19,7 @@
#include <rules.h>
#include <bootmode.h>
-#if CONFIG_CHROMEOS || CONFIG_VBOOT_VERIFY_FIRMWARE
#include <vendorcode/google/chromeos/chromeos.h>
-#endif
#if CONFIG_BOOTMODE_STRAPS
int developer_mode_enabled(void)
@@ -78,3 +76,13 @@ void gfx_set_init_done(int done)
gfx_init_done = done;
}
#endif
+
+int display_init_required(void)
+{
+ /* For Chrome OS always honor vboot_skip_display_init(). */
+ if (IS_ENABLED(CONFIG_CHROMEOS))
+ return !vboot_skip_display_init();
+
+ /* By default always initialize display. */
+ return 1;
+}