diff options
-rw-r--r-- | src/vendorcode/google/chromeos/chromeos.c | 32 | ||||
-rw-r--r-- | src/vendorcode/google/chromeos/chromeos.h | 16 | ||||
-rw-r--r-- | src/vendorcode/google/chromeos/vboot_common.c | 27 | ||||
-rw-r--r-- | src/vendorcode/google/chromeos/vboot_common.h | 8 |
4 files changed, 35 insertions, 48 deletions
diff --git a/src/vendorcode/google/chromeos/chromeos.c b/src/vendorcode/google/chromeos/chromeos.c index c2190b737d..4864b8c7d9 100644 --- a/src/vendorcode/google/chromeos/chromeos.c +++ b/src/vendorcode/google/chromeos/chromeos.c @@ -20,38 +20,6 @@ #include <stddef.h> #include <string.h> #include "chromeos.h" -#include <boot/coreboot_tables.h> -#include <cbfs.h> -#include <cbmem.h> -#include <console/console.h> -#include "vboot_handoff.h" - -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); -} int __attribute__((weak)) clear_recovery_mode_switch(void) { diff --git a/src/vendorcode/google/chromeos/chromeos.h b/src/vendorcode/google/chromeos/chromeos.h index 798ab3eb3a..bdc9435870 100644 --- a/src/vendorcode/google/chromeos/chromeos.h +++ b/src/vendorcode/google/chromeos/chromeos.h @@ -45,29 +45,14 @@ void elog_add_boot_reason(void); /* functions implemented in watchdog.c */ void elog_add_watchdog_reset(void); void reboot_from_watchdog(void); - -int vboot_enable_developer(void); -int vboot_enable_recovery(void); -int vboot_skip_display_init(void); #else static inline void elog_add_boot_reason(void) { return; } static inline void elog_add_watchdog_reset(void) { return; } static inline void reboot_from_watchdog(void) { return; } -static inline int vboot_skip_display_init(void) { return 0; } #endif /* CONFIG_CHROMEOS */ struct romstage_handoff; -#if CONFIG_VBOOT_VERIFY_FIRMWARE -/* Returns 0 on success < 0 on error. */ -int vboot_get_handoff_info(void **addr, uint32_t *size); -#else /* CONFIG_VBOOT_VERIFY_FIRMWARE */ -static inline int vboot_get_handoff_info(void **addr, uint32_t *size) -{ - return -1; -} -#endif /* CONFIG_VBOOT_VERIFY_FIRMWARE */ - #include "gnvs.h" struct device; @@ -84,6 +69,5 @@ static inline void chromeos_reserve_ram_oops(struct device *dev, int idx) {} #endif /* CONFIG_CHROMEOS_RAMOOPS */ void cbmem_add_vpd_calibration_data(void); -void vboot_reboot(void); #endif /* __CHROMEOS_H__ */ 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)) diff --git a/src/vendorcode/google/chromeos/vboot_common.h b/src/vendorcode/google/chromeos/vboot_common.h index 088cd1e3ba..f4d5e11537 100644 --- a/src/vendorcode/google/chromeos/vboot_common.h +++ b/src/vendorcode/google/chromeos/vboot_common.h @@ -39,5 +39,13 @@ struct vboot_components { /* The following functions return 0 on success, < 0 on error. */ int vboot_named_region_device(const char *name, struct region_device *rdev); int vboot_region_device(const struct region *reg, struct region_device *rdev); +int vboot_get_handoff_info(void **addr, uint32_t *size); + +/* The following functions return 1 for true and 0 for false. */ +int vboot_skip_display_init(void); +int vboot_enable_recovery(void); +int vboot_enable_developer(void); + +void vboot_reboot(void); #endif /* VBOOT_COMMON_H */ |