aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/vboot/Makefile.inc4
-rw-r--r--src/vboot/bootmode.c9
-rw-r--r--src/vboot/vboot_common.h6
3 files changed, 8 insertions, 11 deletions
diff --git a/src/vboot/Makefile.inc b/src/vboot/Makefile.inc
index fb373c3aad..a09811b52c 100644
--- a/src/vboot/Makefile.inc
+++ b/src/vboot/Makefile.inc
@@ -13,14 +13,14 @@
## GNU General Public License for more details.
##
+ifeq ($(CONFIG_VBOOT),y)
+
bootblock-y += bootmode.c
romstage-y += bootmode.c
ramstage-y += bootmode.c
verstage-y += bootmode.c
postcar-y += bootmode.c
-ifeq ($(CONFIG_VBOOT),y)
-
libverstage-generic-ccopts += -D__PRE_RAM__ -D__VERSTAGE__
verstage-generic-ccopts += -D__PRE_RAM__ -D__VERSTAGE__
diff --git a/src/vboot/bootmode.c b/src/vboot/bootmode.c
index 21922d4ce7..d66911fa91 100644
--- a/src/vboot/bootmode.c
+++ b/src/vboot/bootmode.c
@@ -74,9 +74,6 @@ BOOT_STATE_INIT_ENTRY(BS_DEV_INIT, BS_ON_EXIT,
*/
static int vboot_possibly_executed(void)
{
- if (!IS_ENABLED(CONFIG_VBOOT))
- return 0;
-
if (IS_ENABLED(CONFIG_VBOOT_STARTS_IN_BOOTBLOCK)) {
if (ENV_BOOTBLOCK && IS_ENABLED(CONFIG_SEPARATE_VERSTAGE))
return 0;
@@ -141,9 +138,6 @@ int vboot_check_recovery_request(void)
int vboot_recovery_mode_enabled(void)
{
- if (!IS_ENABLED(CONFIG_VBOOT))
- return 0;
-
return !!vboot_check_recovery_request();
}
@@ -159,9 +153,6 @@ int vboot_recovery_mode_memory_retrain(void)
int vboot_developer_mode_enabled(void)
{
- if (!IS_ENABLED(CONFIG_VBOOT))
- return 0;
-
if (cbmem_possibly_online() && vboot_handoff_check_developer_flag())
return 1;
diff --git a/src/vboot/vboot_common.h b/src/vboot/vboot_common.h
index aa01f28944..8421ecb640 100644
--- a/src/vboot/vboot_common.h
+++ b/src/vboot/vboot_common.h
@@ -104,8 +104,14 @@ void verstage_main(void);
void verstage_mainboard_init(void);
/* Check boot modes */
+#if IS_ENABLED(CONFIG_VBOOT)
int vboot_developer_mode_enabled(void);
int vboot_recovery_mode_enabled(void);
int vboot_recovery_mode_memory_retrain(void);
+#else /* !CONFIG_VBOOT */
+static inline int vboot_developer_mode_enabled(void) { return 0; }
+static inline int vboot_recovery_mode_enabled(void) { return 0; }
+static inline int vboot_recovery_mode_memory_retrain(void) { return 0; }
+#endif
#endif /* __VBOOT_VBOOT_COMMON_H__ */