summaryrefslogtreecommitdiff
path: root/power
diff options
context:
space:
mode:
authorEric Yilun Lin <yllin@chromium.org>2020-07-27 14:42:41 +0800
committerCommit Bot <commit-bot@chromium.org>2020-07-29 06:44:16 +0000
commitd434d51ab0c0aedc4b27fa66b2969c847fa43575 (patch)
treef34551090790d1c4998eb3450fc9a12d295a3ef4 /power
parenta2c570baef5ebd735931a4cb0161400b76a4310e (diff)
downloadchrome-ec-d434d51ab0c0aedc4b27fa66b2969c847fa43575.tar.gz
power/mt8183: reset EC if EC has jumped and AP reboots
Resets EC if EC has jumped before and we want to boot AP. In the normal flow, EC should stay at RW and reset itself and AP should request EC for bootblock when start booting. On some testing scenario, we might want to boot AP after RO->RW->RO transition, and in such case, AP won't be able to boot due to AP_SYS_RST_ODL been pulled down by the SLG, and SLG latches output until the next EC_RST_ODL. So in such test cases, we should reset the EC. BUG=b:161584167 TEST=boot AP; sysjump RO; apshutdown; powerbtn 1200; ensure AP boots BRANCH=kukui Change-Id: Ia4066f1764b83acf6835f344393dcad8c125d0e3 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2319494 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'power')
-rw-r--r--power/mt8183.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/power/mt8183.c b/power/mt8183.c
index 47b7a8b3e1..56aeaadb7a 100644
--- a/power/mt8183.c
+++ b/power/mt8183.c
@@ -391,8 +391,8 @@ enum power_state power_handle_state(enum power_state state)
gpio_set_level(GPIO_PMIC_EN_ODL, 1);
}
- /* If EC is in RW, or has already booted once, reboot to RO. */
- if (system_get_image_copy() != EC_IMAGE_RO || booted) {
+ /* If EC jumped, or has already booted once, reboot to RO. */
+ if (system_jumped_to_this_image() || booted) {
/*
* TODO(b:109850749): How quickly does the EC come back
* up? Would IN_PGOOD_PMIC be ready by the time we are