From c473e5a384576f8a0699a448e8b6fdfd83f9737d Mon Sep 17 00:00:00 2001 From: Caveh Jalali Date: Fri, 11 Jan 2019 22:56:00 -0800 Subject: atlas: only apply internal EC_WP_L pullup when needed we had applied an internal pullup on the EC side to the EC_WP_L signal to work around a problem. we now have a board level fix on newer boards, so we should only apply this workaround on older boards. BUG=b:122568899,b:116670191 BRANCH=stabilize-atlas-11512.6.B TEST=verified older boards still read EC_WP_L as high Change-Id: Ia95b8649eed240a7c97c6b1cc20ed5ccea40e4f2 Signed-off-by: Caveh Jalali Reviewed-on: https://chromium-review.googlesource.com/c/1407244 Commit-Queue: Caveh Jalali Tested-by: Caveh Jalali Reviewed-by: Caveh Jalali --- board/atlas/board.c | 8 ++++++++ board/atlas/board.h | 2 ++ board/atlas/gpio.inc | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/board/atlas/board.c b/board/atlas/board.c index ebd24cc503..9afbe8183f 100644 --- a/board/atlas/board.c +++ b/board/atlas/board.c @@ -455,6 +455,14 @@ void board_hibernate(void) /* Initialize board. */ static void board_init(void) { + if (system_get_board_version() < ATLAS_REV_FIXED_EC_WP) { + int dflags; + + CPRINTS("Applying EC_WP_L workaround"); + dflags = gpio_get_default_flags(GPIO_EC_WP_L); + gpio_set_flags(GPIO_EC_WP_L, dflags | GPIO_PULL_UP); + } + /* Provide AC status to the PCH */ gpio_set_level(GPIO_PCH_ACOK, extpower_is_present()); diff --git a/board/atlas/board.h b/board/atlas/board.h index 66c217b9c2..76a4370db2 100644 --- a/board/atlas/board.h +++ b/board/atlas/board.h @@ -284,4 +284,6 @@ void board_reset_pd_mcu(void); /* ps8751 requires 1ms reset down assertion */ #define PS8XXX_RST_L_RST_H_DELAY_MS 1 +#define ATLAS_REV_FIXED_EC_WP 4 + #endif /* __CROS_EC_BOARD_H */ diff --git a/board/atlas/gpio.inc b/board/atlas/gpio.inc index 25c7b4767b..2846ba22b0 100644 --- a/board/atlas/gpio.inc +++ b/board/atlas/gpio.inc @@ -21,7 +21,7 @@ GPIO_INT(SLP_SUS_L_PCH, PIN(D, 4), GPIO_INT_BOTH, power_signal_interrupt) GPIO_INT(ROP_EC_ACOK, PIN(0, 0), GPIO_INT_BOTH | GPIO_HIB_WAKE_HIGH, extpower_interrupt) /* misc interrupt handler section */ -GPIO_INT(EC_WP_L, PIN(A, 1), GPIO_INT_BOTH | GPIO_PULL_UP, switch_interrupt) +GPIO_INT(EC_WP_L, PIN(A, 1), GPIO_INT_BOTH, switch_interrupt) GPIO_INT(LID_OPEN, PIN(D, 2), GPIO_INT_BOTH | GPIO_HIB_WAKE_HIGH, lid_interrupt) GPIO_INT(ACCELGYRO3_INT_L, PIN(4, 1), GPIO_INT_FALLING, bmi160_interrupt) -- cgit v1.2.1