summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Lok <ben.lok@mediatek.com>2015-10-20 20:38:34 +0800
committerchrome-bot <chrome-bot@chromium.org>2015-11-03 09:08:20 -0800
commitb1a3d8eda54e06bf2cf99bc7dd6abfa368a5bdab (patch)
treeb9b1d186ff0dec9f2699b8b5b378e3a7d8429b0e
parent80b997dc276b099714e1c5b6eeea02adbae44081 (diff)
downloadchrome-ec-b1a3d8eda54e06bf2cf99bc7dd6abfa368a5bdab.tar.gz
oak: handle the warm reset key from servo board
Warm reset key from servo board lets the POWER_GOOD signal deasserted temporarily (about 1~2 seconds) since Oak rev4. In order to detect this case, check the AP_RESET_L status, ignore the transient state if reset key is pressing. BUG=chrome-os-partner:46655 BRANCH=none TEST=make buildall -j; Press warm reset key of servo board, AP should reset normally. Change-Id: Ib9f111d2273cde61354e72367fe74d4ee15d2291 Signed-off-by: Ben Lok <ben.lok@mediatek.com> Reviewed-on: https://chromium-review.googlesource.com/307201 Tested-by: Yidi Lin <yidi.lin@mediatek.com> Reviewed-by: Rong Chang <rongchang@chromium.org>
-rw-r--r--board/llama/gpio.inc1
-rw-r--r--board/oak/board.c2
-rw-r--r--power/mediatek.c12
3 files changed, 15 insertions, 0 deletions
diff --git a/board/llama/gpio.inc b/board/llama/gpio.inc
index 4b52f4c8f9..d49812445e 100644
--- a/board/llama/gpio.inc
+++ b/board/llama/gpio.inc
@@ -66,6 +66,7 @@ UNIMPLEMENTED(WP_L)
UNIMPLEMENTED(BOARD_VERSION2)
UNIMPLEMENTED(BOARD_VERSION3)
UNIMPLEMENTED(5V_POWER_GOOD)
+UNIMPLEMENTED(AP_RESET_L)
ALTERNATE(PIN_MASK(A, 0x0600), 1, MODULE_UART, 0) /* USART1: PA9/PA10 */
ALTERNATE(PIN_MASK(B, 0x00c0), 1, MODULE_I2C, 0) /* I2C MASTER:PB6/7 */
diff --git a/board/oak/board.c b/board/oak/board.c
index 1b838ffa7b..7e204a33b5 100644
--- a/board/oak/board.c
+++ b/board/oak/board.c
@@ -357,6 +357,7 @@ void board_typec_dp_set(int port, int level)
mutex_unlock(&dp_hw_lock);
}
+#if BOARD_REV < OAK_REV3
#ifndef CONFIG_AP_WARM_RESET_INTERRUPT
/* Using this hook if system doesn't have enough external line. */
static void check_ap_reset_second(void)
@@ -376,6 +377,7 @@ static void check_ap_reset_second(void)
}
DECLARE_HOOK(HOOK_SECOND, check_ap_reset_second, HOOK_PRIO_DEFAULT);
#endif
+#endif
/**
* Set AP reset.
diff --git a/power/mediatek.c b/power/mediatek.c
index 49b9154edf..87ccec5629 100644
--- a/power/mediatek.c
+++ b/power/mediatek.c
@@ -225,6 +225,18 @@ static int is_power_good_asserted(void)
*/
static int is_power_good_deasserted(void)
{
+ /*
+ * Warm reset key from servo board lets the POWER_GOOD signal
+ * deasserted temporarily (about 1~2 seconds) on rev4.
+ * In order to detect this case, check the AP_RESET_L status,
+ * ignore the transient state if reset key is pressing.
+ */
+ if (system_get_board_version() >= 4) {
+ if (0 == gpio_get_level(GPIO_AP_RESET_L)) {
+ return 0;
+ }
+ }
+
if (!(power_get_signals() & IN_POWER_GOOD))
usleep(POWER_DEBOUNCE_TIME);