chromeos: Unconditionally clear the EC recovery request

Added the empty function clear_recovery_mode_switch (weak)

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.

Change-Id: Ie1e3251a6db12e75e385220e9d3791078393b1bf
Signed-off-by: Sheng-Liang Song <ssl@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/197780
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Sheng-liang Song <ssl@google.com>
Tested-by: Sheng-liang Song <ssl@google.com>
This commit is contained in:
Sheng-Liang Song 2014-04-30 15:46:45 -07:00 committed by chrome-internal-fetch
commit 18908bb64c
5 changed files with 35 additions and 18 deletions

View file

@ -83,6 +83,12 @@ int recovery_mode_enabled(void)
vboot_enable_recovery();
}
int __attribute__((weak)) clear_recovery_mode_switch(void)
{
// Can be implemented by a mainboard
return 0;
}
int vboot_skip_display_init(void)
{
#if CONFIG_VBOOT_VERIFY_FIRMWARE

View file

@ -26,6 +26,7 @@
/* functions implemented per mainboard: */
int get_developer_mode_switch(void);
int get_recovery_mode_switch(void);
int clear_recovery_mode_switch(void);
int get_write_protect_state(void);
#ifdef __PRE_RAM__
void __attribute__((weak)) save_chromeos_gpios(void);

View file

@ -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())