From 01732ed87cd42a6d4e8767c4b53cce8f02b6c2e9 Mon Sep 17 00:00:00 2001 From: Shamile Khan Date: Mon, 15 Aug 2016 17:47:25 -0700 Subject: [PATCH] reef: Add internal pull-up for TCPC1 INT# by default. Previously this was only done when the board version is EVT or less and when daughter card is inserted. However board version can not be determined at this stage of power up since the function board_get_version() relies on reading Board ID ADC and ADCs have not yet been initialized. This pull up can be removed in future board versions in which the daughter card will always be in place and an internal pull-up will no longer be needed. BUG=chrome-os-partner:55488 chrome-os-partner:56039 BRANCH=none TEST=verify board has no watchdog reset when daughter baord is not connected. Also verify from EC log timestamps that there is no delay of approximately 1 second between "Inits done"and "KB init state" Change-Id: I68eff923dd795b7b2f23f88028ee14d1e845b401 Signed-off-by: Shamile Khan Reviewed-on: https://chromium-review.googlesource.com/370958 Commit-Ready: Kevin K Wong Tested-by: Kevin K Wong Tested-by: Stefan Reinauer Reviewed-by: David Hendricks Reviewed-by: Kevin K Wong --- board/reef/board.c | 16 ---------------- board/reef/gpio.inc | 9 +++++++-- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/board/reef/board.c b/board/reef/board.c index 53db204442..26980fd2c6 100644 --- a/board/reef/board.c +++ b/board/reef/board.c @@ -242,22 +242,6 @@ void board_tcpc_init(void) if (!system_jumped_to_this_image()) board_reset_pd_mcu(); - /* - * If daughter board is not connected, - * then enable Pull-Up for TCPC1 int# pin. - */ - if (board_get_version() <= BOARD_VERSION_2) { - int rv, vendor_id = 0, product_id = 0; - - rv = tcpc_read16(1, TCPC_REG_VENDOR_ID, &vendor_id); - rv |= tcpc_read16(1, TCPC_REG_PRODUCT_ID, &product_id); - - if (rv || ((vendor_id != PS8751_VENDOR_ID) && - (product_id != PS8751_PRODUCT_ID))) - gpio_set_flags(GPIO_USB_C1_PD_INT_ODL, - GPIO_INT_FALLING | GPIO_PULL_UP); - } - /* Enable TCPC0 interrupt */ gpio_enable_interrupt(GPIO_USB_C0_PD_INT_ODL); diff --git a/board/reef/gpio.inc b/board/reef/gpio.inc index b1421d6e05..ffba5edbae 100644 --- a/board/reef/gpio.inc +++ b/board/reef/gpio.inc @@ -9,12 +9,17 @@ * Note: Those with interrupt handlers must be declared first. */ GPIO_INT(CHARGER_INT_L, PIN(3, 3), GPIO_INT_FALLING, bd99955_vbus_interrupt) /* CHARGER_EC_INT_ODL from BD99955 */ +/* + * TODO: The pull ups for Parade TCPC interrupt line can be removed in versions + * of board following EVT in which daughter card (which has an external pull up) + * will always be inserted. + */ #if IS_PROTO == 1 GPIO_INT(USB_C0_PD_INT_ODL, PIN(3, 7), GPIO_INT_RISING, tcpc_alert_event) /* from Analogix TCPC */ -GPIO_INT(USB_C1_PD_INT_ODL, PIN(D, 2), GPIO_INT_FALLING, tcpc_alert_event) /* from Parade TCPC */ +GPIO_INT(USB_C1_PD_INT_ODL, PIN(D, 2), GPIO_INT_FALLING | GPIO_PULL_UP, tcpc_alert_event) /* from Parade TCPC */ #else GPIO_INT(USB_C0_PD_INT_ODL, PIN(3, 7), GPIO_INT_FALLING, tcpc_alert_event) /* from Analogix TCPC */ -GPIO_INT(USB_C1_PD_INT_ODL, PIN(B, 1), GPIO_INT_FALLING, tcpc_alert_event) /* from Parade TCPC */ +GPIO_INT(USB_C1_PD_INT_ODL, PIN(B, 1), GPIO_INT_FALLING | GPIO_PULL_UP, tcpc_alert_event) /* from Parade TCPC */ #endif GPIO_INT(PCH_SLP_S4_L, PIN(8, 6), GPIO_INT_BOTH, power_signal_interrupt) /* SLP_S4_L */