From 1d6560fc60d66d36c0a7cf5c51a25f7b185499a7 Mon Sep 17 00:00:00 2001 From: Sheng-Liang Song Date: Wed, 30 Apr 2014 15:46:45 -0700 Subject: chromeos: Unconditionally clear the EC recovery request MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the empty weak function clear_recovery_mode_switch(). Problem: If GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC is set, the following will happen: 1. Boot device in recovery mode with Esc + F3 + Pwr. 2. Turn device off with Pwr button. 3. Turn device on with Pwr button. Device still boots to recovery screen with recovery_reason:0x02 recovery button pressed. If GBB_FLAG_DISABLE_EC_SOFTWARE_SYNC isn't set, turning the device off and on again with the Pwr button does a normal boot. Solution: Unconditionally clear the recovery flag. BUG=chromium:279607 BRANCH=TOT TEST=Compile OK. Original-Change-Id: Ie1e3251a6db12e75e385220e9d3791078393b1bf Original-Signed-off-by: Sheng-Liang Song Original-Reviewed-on: https://chromium-review.googlesource.com/197780 Original-Reviewed-by: Aaron Durbin Original-Reviewed-by: Randall Spangler Original-Commit-Queue: Sheng-liang Song Original-Tested-by: Sheng-liang Song (cherry picked from commit 18908bb64cef34ca41812814817ef887961bed34) Signed-off-by: Marc Jones Change-Id: I71ca9f3ea8d816c865375ec66a0603ca211f23ae Reviewed-on: http://review.coreboot.org/7895 Reviewed-by: Kyösti Mälkki Tested-by: build bot (Jenkins) --- src/vendorcode/google/chromeos/vboot_handoff.c | 6 ++++++ src/vendorcode/google/chromeos/vboot_loader.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src/vendorcode/google/chromeos') diff --git a/src/vendorcode/google/chromeos/vboot_handoff.c b/src/vendorcode/google/chromeos/vboot_handoff.c index 1a66f56828..7ef2c7ee5a 100644 --- a/src/vendorcode/google/chromeos/vboot_handoff.c +++ b/src/vendorcode/google/chromeos/vboot_handoff.c @@ -54,6 +54,12 @@ int vboot_enable_recovery(void) return !!(vbho->init_params.out_flags & VB_INIT_OUT_ENABLE_RECOVERY); } +int __attribute__((weak)) clear_recovery_mode_switch(void) +{ + // Can be implemented by a mainboard + return 0; +} + int vboot_skip_display_init(void) { struct vboot_handoff *vbho; diff --git a/src/vendorcode/google/chromeos/vboot_loader.c b/src/vendorcode/google/chromeos/vboot_loader.c index 240b6b6fc5..80e2aea1bb 100644 --- a/src/vendorcode/google/chromeos/vboot_loader.c +++ b/src/vendorcode/google/chromeos/vboot_loader.c @@ -245,8 +245,10 @@ static void vboot_invoke_wrapper(struct vboot_handoff *vboot_handoff) iflags = &vboot_handoff->init_params.flags; if (get_developer_mode_switch()) *iflags |= VB_INIT_FLAG_DEV_SWITCH_ON; - if (get_recovery_mode_switch()) + if (get_recovery_mode_switch()) { + clear_recovery_mode_switch(); *iflags |= VB_INIT_FLAG_REC_BUTTON_PRESSED; + } if (get_write_protect_state()) *iflags |= VB_INIT_FLAG_WP_ENABLED; if (vboot_get_sw_write_protect()) -- cgit v1.2.3