chromeos: Unconditionally clear the EC recovery request
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 <ssl@chromium.org> Original-Reviewed-on: https://chromium-review.googlesource.com/197780 Original-Reviewed-by: Aaron Durbin <adurbin@chromium.org> Original-Reviewed-by: Randall Spangler <rspangler@chromium.org> Original-Commit-Queue: Sheng-liang Song <ssl@google.com> Original-Tested-by: Sheng-liang Song <ssl@google.com> (cherry picked from commit 18908bb64cef34ca41812814817ef887961bed34) Signed-off-by: Marc Jones <marc.jones@se-eng.com> Change-Id: I71ca9f3ea8d816c865375ec66a0603ca211f23ae Reviewed-on: http://review.coreboot.org/7895 Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Tested-by: build bot (Jenkins)
This commit is contained in:
committed by
Marc Jones
parent
afde961adf
commit
1d6560fc60
@ -93,11 +93,35 @@ static u32 google_chromeec_get_mask(u8 type)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int google_chromeec_set_mask(u8 type, u32 mask)
|
||||
{
|
||||
struct ec_params_host_event_mask req;
|
||||
struct ec_response_host_event_mask rsp;
|
||||
struct chromeec_command cmd;
|
||||
|
||||
req.mask = mask;
|
||||
cmd.cmd_code = type;
|
||||
cmd.cmd_version = 0;
|
||||
cmd.cmd_data_in = &req;
|
||||
cmd.cmd_size_in = sizeof(req);
|
||||
cmd.cmd_data_out = &rsp;
|
||||
cmd.cmd_size_out = sizeof(rsp);
|
||||
|
||||
return google_chromeec_command(&cmd);
|
||||
}
|
||||
|
||||
u32 google_chromeec_get_events_b(void)
|
||||
{
|
||||
return google_chromeec_get_mask(EC_CMD_HOST_EVENT_GET_B);
|
||||
}
|
||||
|
||||
int google_chromeec_clear_events_b(u32 mask)
|
||||
{
|
||||
printk(BIOS_DEBUG, "Chrome EC: clear events_b mask to 0x%08x\n", mask);
|
||||
return google_chromeec_set_mask(
|
||||
EC_CMD_HOST_EVENT_CLEAR_B, mask);
|
||||
}
|
||||
|
||||
#ifndef __SMM__
|
||||
void google_chromeec_check_ec_image(int expected_type)
|
||||
{
|
||||
@ -278,23 +302,6 @@ int google_chromeec_i2c_xfer(uint8_t chip, uint8_t addr, int alen,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int google_chromeec_set_mask(u8 type, u32 mask)
|
||||
{
|
||||
struct ec_params_host_event_mask req;
|
||||
struct ec_response_host_event_mask rsp;
|
||||
struct chromeec_command cmd;
|
||||
|
||||
req.mask = mask;
|
||||
cmd.cmd_code = type;
|
||||
cmd.cmd_version = 0;
|
||||
cmd.cmd_data_in = &req;
|
||||
cmd.cmd_size_in = sizeof(req);
|
||||
cmd.cmd_data_out = &rsp;
|
||||
cmd.cmd_size_out = sizeof(rsp);
|
||||
|
||||
return google_chromeec_command(&cmd);
|
||||
}
|
||||
|
||||
int google_chromeec_set_sci_mask(u32 mask)
|
||||
{
|
||||
printk(BIOS_DEBUG, "Chrome EC: Set SCI mask to 0x%08x\n", mask);
|
||||
|
@ -43,6 +43,7 @@ void google_chromeec_check_ec_image(int expected_type);
|
||||
uint8_t google_chromeec_calc_checksum(const uint8_t *data, int size);
|
||||
u16 google_chromeec_get_board_version(void);
|
||||
u32 google_chromeec_get_events_b(void);
|
||||
int google_chromeec_clear_events_b(u32 mask);
|
||||
int google_chromeec_kbbacklight(int percent);
|
||||
void google_chromeec_post(u8 postcode);
|
||||
void google_chromeec_log_events(u32 mask);
|
||||
|
Reference in New Issue
Block a user