From 6020472e12860d58ec3cf2d6336e4eecc2017b63 Mon Sep 17 00:00:00 2001 From: Sam McNally Date: Thu, 27 Feb 2020 21:29:25 +1100 Subject: vboot: Add a reboot option to keep EFS in RO with the AP off. With EFS, the EC will typically switch to RW shortly after boot. cros_ec_softrec_power triggers recovery mode using the hostevent console command after rebooting the EC with ap-off and then simulates a power button press. This requires the EC to remain in RO after rebooting so doesn't currently work with EFS. Add a reboot option "ap-off-in-ro" to request the EC remain in RO with the AP off after rebooting. BUG=b:149657030 TEST=make buildall; firmware_RecoveryCacheBootKeys on puff BRANCH=none Change-Id: I65d291106accebf18bb46d951351def122627e61 Signed-off-by: Sam McNally Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2077699 Reviewed-by: Daisuke Nojiri --- common/vboot/vboot.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'common/vboot/vboot.c') diff --git a/common/vboot/vboot.c b/common/vboot/vboot.c index 38924f4b3e..9819c9c316 100644 --- a/common/vboot/vboot.c +++ b/common/vboot/vboot.c @@ -204,8 +204,11 @@ void vboot_main(void) return; } - if (is_manual_recovery()) { - CPRINTS("Manual recovery"); + if (is_manual_recovery() || + (system_get_reset_flags() & EC_RESET_FLAG_STAY_IN_RO)) { + if (is_manual_recovery()) + CPRINTS("Manual recovery"); + if (battery_is_present() || has_matrix_keyboard()) { show_power_shortage(); return; -- cgit v1.2.1