diff options
author | Jett Rink <jettrink@chromium.org> | 2018-03-07 07:48:00 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-03-09 17:38:46 -0800 |
commit | 20e9a125e51a132bffd4ec0020de7da44889379d (patch) | |
tree | 83d4c6f2c8e5f1a8133863581403cd728bbd530a | |
parent | 79aacf3d8eb2ff265fb31e12abc222e9da1aa07a (diff) | |
download | chrome-ec-20e9a125e51a132bffd4ec0020de7da44889379d.tar.gz |
yorp: add usb gpio definitions
BRANCH=none
BUG=b:74127309
TEST=none
Change-Id: I598da6cd2f5e1cd262d0994c2e265a74cbc8fcc1
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/952960
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
-rw-r--r-- | board/yorp/board.c | 12 | ||||
-rw-r--r-- | board/yorp/gpio.inc | 56 |
2 files changed, 66 insertions, 2 deletions
diff --git a/board/yorp/board.c b/board/yorp/board.c index ad811e0fae..6ea1816b84 100644 --- a/board/yorp/board.c +++ b/board/yorp/board.c @@ -16,7 +16,17 @@ #include "system.h" #include "util.h" -/* Must come after other header files. */ +static void tcpc_alert_event(enum gpio_signal signal) +{ + /* TODO(b/74127309): Flesh out USB code */ +} + +static void ppc_interrupt(enum gpio_signal signal) +{ + /* TODO(b/74127309): Flesh out USB code*/ +} + +/* Must come after other header files and GPIO interrupts*/ #include "gpio_list.h" const enum gpio_signal hibernate_wake_pins[] = { diff --git a/board/yorp/gpio.inc b/board/yorp/gpio.inc index 07c51c97e4..46401e9ff5 100644 --- a/board/yorp/gpio.inc +++ b/board/yorp/gpio.inc @@ -7,11 +7,20 @@ /* Declare symbolic names for all the GPIOs that we care about. * Note: Those with interrupt handlers must be declared first. */ + +/* Wake Source interrupts */ GPIO_INT(LID_OPEN, PIN(D, 2), GPIO_INT_BOTH | GPIO_HIB_WAKE_HIGH, lid_interrupt) GPIO_INT(WP_L, PIN(A, 1), GPIO_INT_BOTH, switch_interrupt) /* EC_WP_ODL */ GPIO_INT(POWER_BUTTON_L, PIN(0, 1), GPIO_INT_BOTH, power_button_interrupt) /* EC_PWR_BTN_ODL */ +/* USB-C interrupts */ +GPIO_INT(USB_C0_PD_INT_ODL, PIN(6, 1), GPIO_INT_FALLING, tcpc_alert_event) +GPIO_INT(USB_C1_PD_INT_ODL, PIN(F, 5), GPIO_INT_FALLING, tcpc_alert_event) +GPIO_INT(USB_PD_C0_INT_L, PIN(E, 0), GPIO_INT_FALLING, ppc_interrupt) +GPIO_INT(USB_PD_C1_INT_L, PIN(F, 1), GPIO_INT_FALLING, ppc_interrupt) + +/* Power State interrupts */ #ifdef CONFIG_POWER_S0IX GPIO_INT(PCH_SLP_S0_L, PIN(A, 4), GPIO_INT_BOTH, power_signal_interrupt) /* SLP_S0_L */ #endif @@ -50,4 +59,49 @@ GPIO(PCH_SYS_PWROK, PIN(B, 7), GPIO_OUT_LOW) /* EC_PCH_PWROK. All S0 rails now * normally driven by the PMIC. The EC can also drive this signal in the event * that the ambient or charger temperature sensors exceeds their thresholds. */ -GPIO(CPU_PROCHOT, PIN(3, 7), GPIO_INPUT | GPIO_SEL_1P8V) /* PCH_PROCHOT_ODL */
\ No newline at end of file +GPIO(CPU_PROCHOT, PIN(3, 7), GPIO_INPUT | GPIO_SEL_1P8V) /* PCH_PROCHOT_ODL */ + +/* I2C pins - Alternate function below configures I2C module on these pins */ +GPIO(I2C0_SCL, PIN(B, 5), GPIO_INPUT) /* EC_I2C_BATTERY_3V3_SCL */ +GPIO(I2C0_SDA, PIN(B, 4), GPIO_INPUT) /* EC_I2C_BATTERY_3V3_SDA */ +GPIO(I2C1_SCL, PIN(9, 0), GPIO_INPUT) /* EC_I2C_USB_C0_PD_SCL */ +GPIO(I2C1_SDA, PIN(8, 7), GPIO_INPUT) /* EC_I2C_USB_C0_PD_SDA */ +GPIO(I2C2_SCL, PIN(9, 2), GPIO_INPUT) /* EC_I2C_USB_C1_PD_SCL */ +GPIO(I2C2_SDA, PIN(9, 1), GPIO_INPUT) /* EC_I2C_USB_C1_PD_SDA */ +GPIO(I2C3_SCL, PIN(D, 1), GPIO_INPUT) /* EC_I2C_EEPROM_SCL */ +GPIO(I2C3_SDA, PIN(D, 0), GPIO_INPUT) /* EC_I2C_EEPROM_SDA */ +GPIO(I2C4_SCL, PIN(F, 3), GPIO_INPUT) /* EC_I2C_CHARGER_3V3_SCL */ +GPIO(I2C4_SDA, PIN(F, 2), GPIO_INPUT) /* EC_I2C_CHARGER_3V3_SDA */ +GPIO(I2C7_SCL, PIN(B, 3), GPIO_INPUT | + GPIO_SEL_1P8V) /* EC_I2C_SENSOR_U_SCL */ +GPIO(I2C7_SDA, PIN(B, 2), GPIO_INPUT | + GPIO_SEL_1P8V) /* EC_I2C_SENSOR_U_SDA */ + +/* USB pins */ +GPIO(EN_USB_A_5V, PIN(6, 7), GPIO_OUT_LOW) /* Enable A0/A1 5V Charging */ +GPIO(USB_A_CHARGE_EN_L, PIN(A, 2), GPIO_OUT_HIGH) /* Enable A0/A1 1.5A Charging */ +/* TODO(b/74254366): Break out A1 signals once they are there in HW */ +/* USB_C0_PD_RST_L isn't connected to PIN(6,2) since ANX TCPC doesn't have reset */ +GPIO(USB_C0_BC12_VBUS_ON, PIN(6, 3), GPIO_OUT_LOW) /* C0 BC1.2 Power */ +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_ODR_HIGH | /* 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_ODR_HIGH | /* C1 DP Hotplug Detect */ + GPIO_SEL_1P8V) +/* Alternate functions GPIO definitions */ +/* Cr50 requires no pull-ups on UART pins. */ +ALTERNATE(PIN_MASK(6, 0x30), 0, MODULE_UART, 0) /* UART from EC to Servo */ +ALTERNATE(PIN_MASK(B, 0x30), 1, MODULE_I2C, 0) /* I2C0 */ +ALTERNATE(PIN_MASK(9, 0x07), 1, MODULE_I2C, 0) /* I2C1 SCL / I2C2 */ +ALTERNATE(PIN_MASK(8, 0x80), 1, MODULE_I2C, 0) /* I2C1 SDA */ +ALTERNATE(PIN_MASK(D, 0x03), 1, MODULE_I2C, 0) /* I2C3 */ +ALTERNATE(PIN_MASK(F, 0x0C), 1, MODULE_I2C, 0) /* I2C4 */ +ALTERNATE(PIN_MASK(B, 0x0C), 1, MODULE_I2C, 0) /* I2C7 */ +ALTERNATE(PIN_MASK(4, 0x02), 1, MODULE_ADC, 0) /* ADC4: ADC_USB_C0_VBUS */ +ALTERNATE(PIN_MASK(F, 0x01), 1, MODULE_ADC, 0) /* ADC9: ADC_USB_C1_VBUS */ +ALTERNATE(PIN_MASK(C, 0x18), 1, MODULE_PWM, 0) /* LED 1 & 2 */ |