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>
This commit is contained in:
Ben Lok
2015-10-20 20:38:34 +08:00
committed by chrome-bot
parent 80b997dc27
commit b1a3d8eda5
3 changed files with 15 additions and 0 deletions

View File

@@ -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 */

View File

@@ -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.

View File

@@ -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);