summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2017-06-16 16:59:24 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2018-02-02 22:45:11 +0000
commita5f3d7cd7b56d06e37f97e57d382d2c756cdf9e1 (patch)
treeb9ab43c07c118e8113f8346ebb5155e759a0f7f4
parent78edffd806cf20602f70cbe0e0d3a8c3663d1539 (diff)
downloadchrome-ec-a5f3d7cd7b56d06e37f97e57d382d2c756cdf9e1.tar.gz
power: rk3399: Assert SYS_RST in S5.
This commit changes SYS_RST_L to remain asserted on the transition to S5. SYS_RST_L is then deasserted on the transition to S0; there is no longer any pulse for SYS_RST_L between S5 and S0. The existing warm reset behaviour is unchanged. Additionally, this only affects non-kevin gru devices. BUG=b:35647982 BRANCH=gru TEST=Flash bob; Verify that SYS_RST_L is asserted in S5. Verify that it's deasserted in S0. TEST=Flash kevin; Verify that SYS_RST_L is NOT asserted in S5. Change-Id: Ic9c1c9c276178c7d417044a5961c3ecb2bec5635 Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/538983 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org> Tested-by: Vadim Bendebury <vbendeb@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--power/rk3399.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/power/rk3399.c b/power/rk3399.c
index b87183c632..5a37fe0334 100644
--- a/power/rk3399.c
+++ b/power/rk3399.c
@@ -135,7 +135,9 @@ DECLARE_DEFERRED(force_shutdown);
enum power_state power_handle_state(enum power_state state)
{
+#ifdef BOARD_KEVIN
static int sys_reset_asserted;
+#endif
int tries = 0;
switch (state) {
@@ -218,13 +220,14 @@ enum power_state power_handle_state(enum power_state state)
#endif
gpio_set_level(GPIO_PP900_USB_EN, 1);
msleep(2);
-
+#ifdef BOARD_KEVIN
/*
* Assert SYS_RST now, to be released in S3S0, to avoid
* resetting the TPM soon after power-on.
*/
gpio_set_level(GPIO_SYS_RST_L, 0);
sys_reset_asserted = 1;
+#endif
gpio_set_level(GPIO_PP1800_PMU_EN_L, 0);
msleep(2);
@@ -271,13 +274,17 @@ enum power_state power_handle_state(enum power_state state)
msleep(2);
gpio_set_level(GPIO_PP3300_S0_EN_L, 0);
+#ifdef BOARD_KEVIN
/* Release SYS_RST if we came from S5 */
if (sys_reset_asserted) {
+#endif
+ /* Release SYS_RST now. */
msleep(10);
gpio_set_level(GPIO_SYS_RST_L, 1);
-
+#ifdef BOARD_KEVIN
sys_reset_asserted = 0;
}
+#endif
if (power_wait_signals(IN_PGOOD_S0)) {
chipset_force_shutdown();
@@ -364,6 +371,14 @@ enum power_state power_handle_state(enum power_state state)
gpio_set_level(GPIO_PP900_AP_EN, 0);
gpio_set_level(GPIO_PPVAR_LOGIC_EN, 0);
+#ifndef BOARD_KEVIN
+ /*
+ * Keep SYS_RST_L asserted in S5. We'll deassert on the way
+ * up.
+ */
+ gpio_set_level(GPIO_SYS_RST_L, 0);
+#endif
+
/* Start shutting down */
return POWER_S5;