UPSTREAM: ec/google/chromeec: let platform prepare for reboot when resetting EC

This fixes an issue on systems where the S3 state in the pm1 control
registers are not cleared when vboot determines recovery mode is
required on an S3 resume. The EC code will reboot the system knowing
that the EC was in RW. However, on subsequent entry into romstage the
S3 path will be taken and fails to recover cbmem -- forcing another
reboot. To work around that, signal to the platform a reboot is
happening and let the platform perform the necessary fix ups to the
register state.

BUG=chrome-os-partner:62627

Change-Id: I2c0bdffb80979954021203c798cf9bce56eca7d6
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Original-Commit-Id: 96a4317fa9
Original-Change-Id: Ic144b11b4968c92a1273b8d9eb9dc10f0056bf3d
Original-Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Original-Reviewed-on: https://review.coreboot.org/18295
Original-Tested-by: build bot (Jenkins)
Original-Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/439150
This commit is contained in:
Aaron Durbin 2017-02-06 10:08:45 -06:00 committed by chrome-bot
commit f857ce5e22

View file

@ -230,6 +230,9 @@ void google_chromeec_check_ec_image(int expected_type)
cec_cmd.cmd_dev_index = 0;
printk(BIOS_DEBUG, "Rebooting with EC in RO mode:\n");
post_code(0); /* clear current post code */
/* Let the platform prepare for the EC taking out the system power. */
if (IS_ENABLED(CONFIG_VBOOT))
vboot_platform_prepare_reboot();
google_chromeec_command(&cec_cmd);
udelay(1000);
hard_reset();