diff options
author | Jett Rink <jettrink@chromium.org> | 2018-05-21 14:56:33 -0600 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-05-29 13:37:35 -0700 |
commit | 65cd9c106c8ac1e3425acec534e71744c3b472e5 (patch) | |
tree | aa97a9ee4388d50a0766f29adba7e9daecec572d /board | |
parent | ecd0d1b5767c829f4c73a79a9eb6abae343284fb (diff) | |
download | chrome-ec-65cd9c106c8ac1e3425acec534e71744c3b472e5.tar.gz |
yorp: drive PPC EN_SNK from TCPC gpio
Since the PS8751 is now driving the EN_SNK GPIO on the PPC, we cannot
reset without a battery otherwise we will brown out the board.
BRANCH=none
BUG=b:78896495,b:78021059
TEST=verified with reworked board.
Change-Id: Ibadf46de922c49f5fdd08c43991e71f852ff7600
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1067711
Diffstat (limited to 'board')
-rw-r--r-- | board/yorp/board.c | 17 | ||||
-rw-r--r-- | board/yorp/gpio.inc | 6 |
2 files changed, 21 insertions, 2 deletions
diff --git a/board/yorp/board.c b/board/yorp/board.c index d07a8c0194..1a282c8b4c 100644 --- a/board/yorp/board.c +++ b/board/yorp/board.c @@ -11,6 +11,7 @@ #include "charge_manager.h" #include "charge_state.h" #include "common.h" +#include "cros_board_info.h" #include "driver/accel_kionix.h" #include "driver/accelgyro_lsm6dsm.h" #include "driver/bc12/bq24392.h" @@ -308,3 +309,19 @@ void lid_angle_peripheral_enable(int enable) keyboard_scan_enable(enable, KB_SCAN_DISABLE_LID_ANGLE); } #endif + +static void update_drivers_from_board_id(void) +{ + uint32_t board_id = 0; + + /* Errors will count as board_id 0 */ + cbi_get_board_version(&board_id); + + if (board_id == 0) { + /* EC drives C1 PPC for proto 1. b/78896495 */ + ppc_chips[1].flags = PPC_CFG_FLAGS_GPIO_CONTROL; + ppc_chips[1].snk_gpio = GPIO_USB_C1_CHARGE_ON; + ppc_chips[1].src_gpio = GPIO_EN_USB_C1_5V_OUT; + } +} +DECLARE_HOOK(HOOK_INIT, update_drivers_from_board_id, HOOK_PRIO_INIT_I2C + 1); diff --git a/board/yorp/gpio.inc b/board/yorp/gpio.inc index 4a00805cad..cc4a387bd9 100644 --- a/board/yorp/gpio.inc +++ b/board/yorp/gpio.inc @@ -108,8 +108,6 @@ GPIO(USB_C0_BC12_CHG_DET_L, PIN(9, 5), GPIO_INPUT) /* C0 BC1.2 Detect */ GPIO(USB_C0_HPD_1V8_ODL, PIN(C, 5), GPIO_INPUT | /* C0 DP Hotplug Detect */ GPIO_SEL_1P8V) GPIO(USB_C1_PD_RST_ODL, PIN(7, 0), GPIO_ODR_HIGH) /* C1 PD Reset */ -GPIO(EN_USB_C1_5V_OUT, PIN(0, 3), GPIO_OUT_LOW) /* C1 Source 5V */ -GPIO(USB_C1_CHARGE_ON, PIN(4, 0), GPIO_OUT_LOW) /* C1 Accept input voltage*/ GPIO(USB_C1_BC12_VBUS_ON, PIN(B, 1), GPIO_OUT_LOW) /* C1 BC1.2 Power */ GPIO(USB_C1_BC12_CHG_DET_L, PIN(E, 4), GPIO_INPUT) /* C1 BC1.2 Detect */ GPIO(USB_C1_HPD_1V8_ODL, PIN(C, 6), GPIO_INPUT | /* C1 DP Hotplug Detect */ @@ -122,6 +120,10 @@ GPIO(BAT_LED_BLUE_L, PIN(C, 4), GPIO_OUT_HIGH) /* LED_2_L */ /* Keyboard Backlight */ GPIO(KB_BL_PWR_EN, PIN(6, 2), GPIO_OUT_LOW) +/* Only used for PROTO 1 */ +GPIO(EN_USB_C1_5V_OUT, PIN(0, 3), GPIO_OUT_LOW) /* C1 Source 5V */ +GPIO(USB_C1_CHARGE_ON, PIN(4, 0), GPIO_OUT_LOW) /* C1 Accept input voltage*/ + /* Keyboard pins */ ALTERNATE(PIN_MASK(3, 0x03), 0, MODULE_KEYBOARD_SCAN, GPIO_INPUT) /* KSI_00-01 */ ALTERNATE(PIN_MASK(2, 0xFC), 0, MODULE_KEYBOARD_SCAN, GPIO_INPUT) /* KSI_02-07 */ |