diff options
-rw-r--r-- | board/llama/gpio.inc | 1 | ||||
-rw-r--r-- | board/oak/board.c | 2 | ||||
-rw-r--r-- | power/mediatek.c | 12 |
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); |