From 9520460224e391bb747149bcc14da0d155088d83 Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Mon, 2 Jul 2018 15:04:29 +0800 Subject: kukui: GPIO fixups, and mirror AP watchdog input to output We can do more complicated things with the watchdog signal in the future. Also fix a bunch of GPIO signals after review. BRANCH=none BUG=b:109900671 TEST=make BOARD=kukui -j Change-Id: I8c9998dbec2c15d2aedd3c5d299e502d42b663fe Signed-off-by: Nicolas Boichat Reviewed-on: https://chromium-review.googlesource.com/1122137 Reviewed-by: Yilun Lin --- board/kukui/board.c | 11 ++++++++--- board/kukui/gpio.inc | 10 +++++----- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/board/kukui/board.c b/board/kukui/board.c index 431cf5b14b..af0bbf0b7b 100644 --- a/board/kukui/board.c +++ b/board/kukui/board.c @@ -62,9 +62,14 @@ static void warm_reset_request_interrupt(enum gpio_signal signal) static void ap_watchdog_interrupt(enum gpio_signal signal) { - CPRINTS("AP watchdog triggered."); - cflush(); - /* TODO(b:109900671): Handle AP watchdog, when necessary. */ + int level = gpio_get_level(GPIO_AP_EC_WATCHDOG_L); + + CPRINTS("AP watchdog level %d", level); + /* + * TODO(b:109900671): Handle AP watchdog, when necessary, for now, just + * mirror input to output. + */ + gpio_set_level(GPIO_PMIC_WATCHDOG_L, level); } #include "gpio_list.h" diff --git a/board/kukui/gpio.inc b/board/kukui/gpio.inc index 20c91d9b60..bbd60607e5 100644 --- a/board/kukui/gpio.inc +++ b/board/kukui/gpio.inc @@ -24,11 +24,11 @@ GPIO_INT(POWER_BUTTON_L, PIN(A, 0), GPIO_INT_BOTH | GPIO_PULL_UP, GPIO_INT(AP_IN_SLEEP_L, PIN(C, 12), GPIO_INT_BOTH | GPIO_PULL_DOWN, power_signal_interrupt) -GPIO_INT(PMIC_EC_RESETB, PIN(B, 7), GPIO_INT_BOTH | GPIO_PULL_UP, +GPIO_INT(PMIC_EC_RESETB, PIN(B, 7), GPIO_INT_BOTH | GPIO_PULL_DOWN, power_signal_interrupt) GPIO_INT(WARM_RESET_REQ, PIN(A, 3), GPIO_INT_RISING | GPIO_PULL_DOWN, warm_reset_request_interrupt) -GPIO_INT(AP_EC_WATCHDOG_L, PIN(C, 2), GPIO_INT_FALLING | GPIO_PULL_UP, +GPIO_INT(AP_EC_WATCHDOG_L, PIN(C, 2), GPIO_INT_FALLING, ap_watchdog_interrupt) GPIO_INT(ACCEL_INT_ODL, PIN(A, 4), GPIO_INT_FALLING | GPIO_SEL_1P8V | GPIO_PULL_UP, @@ -45,8 +45,8 @@ GPIO(PP3300_S3_EN, PIN(A, 8), GPIO_OUT_LOW) /* Reset pins */ GPIO(AP_SYS_RST_L, PIN(C, 11), GPIO_ODR_LOW) -GPIO(PMIC_WATCHDOG_L, PIN(C, 3), GPIO_ODR_HIGH) -GPIO(PMIC_EN_ODL, PIN(C, 10), GPIO_OUT_LOW) +GPIO(PMIC_WATCHDOG_L, PIN(C, 3), GPIO_OUT_LOW) +GPIO(PMIC_EN_ODL, PIN(C, 10), GPIO_ODR_HIGH) GPIO(PMIC_FORCE_RESET, PIN(A, 2), GPIO_OUT_LOW) GPIO(MT6370_RST_L, PIN(F, 0), GPIO_OUT_LOW) @@ -64,7 +64,7 @@ GPIO(BOARD_ID, PIN(C, 0), GPIO_ANALOG) /* Other input pins */ GPIO(WP_L, PIN(C, 8), GPIO_INPUT) /* EC_FLASH_WP_ODL */ -GPIO(CCD_MODE_ODL, PIN(C, 9), GPIO_INPUT | GPIO_PULL_UP) +GPIO(CCD_MODE_ODL, PIN(C, 9), GPIO_INPUT) GPIO(BOOT0, PIN(F, 11), GPIO_INPUT) /* Other output pins */ -- cgit v1.2.1