diff options
author | Edward Hill <ecgh@chromium.org> | 2020-08-26 16:45:47 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-08-29 02:43:33 +0000 |
commit | aabd4ce93b4dd8cb7a56ccc79442b0d1f1f47fe0 (patch) | |
tree | ad6c9bf586421ac0bf3ea8e2ff5c9a1c1791302d /baseboard/zork | |
parent | d986a057af8246e6062b60f223a5ecbcdd6144de (diff) | |
download | chrome-ec-aabd4ce93b4dd8cb7a56ccc79442b0d1f1f47fe0.tar.gz |
zork: Delay between G3 exit and power button
On G3->S5, wait for GPIO_EC_FCH_RSMRST_L to be deasserted before
asserting GPIO_EC_FCH_PWR_BTN_L.
BUG=b:164921478
BRANCH=zork
TEST=power button timing
Signed-off-by: Edward Hill <ecgh@chromium.org>
Change-Id: Ib16f8ccf795382a26e70fd505e03c59db4eeaa88
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2378558
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Diffstat (limited to 'baseboard/zork')
-rw-r--r-- | baseboard/zork/baseboard.c | 20 | ||||
-rw-r--r-- | baseboard/zork/baseboard.h | 1 |
2 files changed, 21 insertions, 0 deletions
diff --git a/baseboard/zork/baseboard.c b/baseboard/zork/baseboard.c index 0d289120e7..4a482a42cb 100644 --- a/baseboard/zork/baseboard.c +++ b/baseboard/zork/baseboard.c @@ -328,3 +328,23 @@ __override int isl9241_update_learn_mode(int chgnum, int enable) return isl9241_write(chgnum, ISL9241_REG_CONTROL1, reg); } + +/* + * b/164921478: On G3->S5, wait for RSMRST_L to be deasserted before asserting + * PWRBTN_L. + */ +void board_pwrbtn_to_pch(int level) +{ + /* Add delay for G3 exit if asserting PWRBTN_L and S5_PGOOD is low. */ + if (!level && !gpio_get_level(GPIO_S5_PGOOD)) { + /* + * From measurement, wait 80 ms for RSMRST_L to rise after + * S5_PGOOD. + */ + msleep(80); + + if (!gpio_get_level(GPIO_S5_PGOOD)) + ccprints("Error: pwrbtn S5_PGOOD low"); + } + gpio_set_level(GPIO_PCH_PWRBTN_L, level); +} diff --git a/baseboard/zork/baseboard.h b/baseboard/zork/baseboard.h index f5b46483d3..4e166be723 100644 --- a/baseboard/zork/baseboard.h +++ b/baseboard/zork/baseboard.h @@ -83,6 +83,7 @@ #define CONFIG_POWER_SHUTDOWN_PAUSE_IN_S5 #define CONFIG_POWER_BUTTON #define CONFIG_POWER_BUTTON_X86 +#define CONFIG_POWER_BUTTON_TO_PCH_CUSTOM #ifdef VARIANT_ZORK_TREMBYLE #define CONFIG_FANS FAN_CH_COUNT |