cr50: Allow boards to disable powering off EC on cr50 update

This patch allows boards to disable turning off EC on cr50 update.
If CR50 resets the whole system, an EC reset is not required.

BUG=b:112604277
BRANCH=none
TEST=gsctool -a -u /media/removable/cr50.bin && reboot
Verify EC reboots. AP prints 'Waiting for CR50 reset to pick up update'
then reboots.

Change-Id: I60a7aa50a549e7a5a1a114245fbf7b9646d813bb
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://review.coreboot.org/28110
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Daisuke Nojiri 2018-08-15 14:36:37 -07:00 committed by Patrick Georgi
parent 632b2321eb
commit bc2a2a0a26
2 changed files with 8 additions and 1 deletions

View File

@ -25,4 +25,10 @@ config POWER_OFF_ON_CR50_UPDATE
help help
Power off machine while waiting for CR50 update to take effect. Power off machine while waiting for CR50 update to take effect.
config DISABLE_POWER_OFF_EC_ON_CR50_UPDATE
bool
default n
help
Disable powering off EC while waiting for CR50 update to take effect.
endif endif

View File

@ -60,7 +60,8 @@ static void enable_update(void *unused)
printk(BIOS_INFO, "Waiting for CR50 reset to pick up update.\n"); printk(BIOS_INFO, "Waiting for CR50 reset to pick up update.\n");
if (IS_ENABLED(CONFIG_POWER_OFF_ON_CR50_UPDATE)) { if (IS_ENABLED(CONFIG_POWER_OFF_ON_CR50_UPDATE)) {
if (IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC)) { if (IS_ENABLED(CONFIG_EC_GOOGLE_CHROMEEC) &&
!IS_ENABLED(CONFIG_DISABLE_POWER_OFF_EC_ON_CR50_UPDATE)) {
printk(BIOS_INFO, "Hibernating EC. Clearing AP_OFF.\n"); printk(BIOS_INFO, "Hibernating EC. Clearing AP_OFF.\n");
google_chromeec_reboot(0, google_chromeec_reboot(0,
EC_REBOOT_HIBERNATE_CLEAR_AP_OFF, EC_REBOOT_HIBERNATE_CLEAR_AP_OFF,