diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2013-11-28 18:11:49 +0200 |
---|---|---|
committer | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2014-05-01 15:38:41 +0200 |
commit | 5687fc9d2120c01b929f24df07667f87089f9b5f (patch) | |
tree | 937c1599f52ecd341c2fdf7fe8ca6e5d64ea9825 /src/vendorcode/google/chromeos/chromeos.c | |
parent | 580e5642a8d1db1bc85c5d55dc2227f3fda8eb34 (diff) | |
download | coreboot-5687fc9d2120c01b929f24df07667f87089f9b5f.tar.xz |
Declare recovery and developer modes outside ChromeOS
Move the implementation for recovery and developer modes from
vendorcode/google/chromes to lib/.
Change-Id: I33335fb282de2c7bc613dc58d6912c47f3b5c06c
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: http://review.coreboot.org/4308
Tested-by: build bot (Jenkins)
Reviewed-by: Aaron Durbin <adurbin@google.com>
Diffstat (limited to 'src/vendorcode/google/chromeos/chromeos.c')
-rw-r--r-- | src/vendorcode/google/chromeos/chromeos.c | 36 |
1 files changed, 4 insertions, 32 deletions
diff --git a/src/vendorcode/google/chromeos/chromeos.c b/src/vendorcode/google/chromeos/chromeos.c index e917ba1f35..f8dd7dc3d8 100644 --- a/src/vendorcode/google/chromeos/chromeos.c +++ b/src/vendorcode/google/chromeos/chromeos.c @@ -27,7 +27,9 @@ #include <console/console.h> #if CONFIG_VBOOT_VERIFY_FIRMWARE -static int vboot_enable_developer(void) +#include <payload_loader.h> + +int vboot_enable_developer(void) { struct vboot_handoff *vbho; @@ -42,7 +44,7 @@ static int vboot_enable_developer(void) return !!(vbho->init_params.out_flags & VB_INIT_OUT_ENABLE_DEVELOPER); } -static int vboot_enable_recovery(void) +int vboot_enable_recovery(void) { struct vboot_handoff *vbho; @@ -53,36 +55,6 @@ static int vboot_enable_recovery(void) return !!(vbho->init_params.out_flags & VB_INIT_OUT_ENABLE_RECOVERY); } -#else -static inline int vboot_enable_developer(void) { return 0; } -static inline int vboot_enable_recovery(void) { return 0; } -#endif - -int developer_mode_enabled(void) -{ - return get_developer_mode_switch() || vboot_enable_developer(); -} - -int recovery_mode_enabled(void) -{ - /* - * This is called in multiple places and has to detect - * recovery mode triggered from the EC and via shared - * recovery reason set with crossystem. - * - * If shared recovery reason is set: - * - before VbInit then get_recovery_mode_from_vbnv() is true - * - after VbInit then vboot_enable_recovery() is true - * - * Otherwise the mainboard handler for get_recovery_mode_switch() - * will detect recovery mode initiated by the EC. - */ - return get_recovery_mode_switch() || get_recovery_mode_from_vbnv() || - vboot_enable_recovery(); -} - -#if CONFIG_VBOOT_VERIFY_FIRMWARE -#include <payload_loader.h> static void *vboot_get_payload(size_t *len) { |