diff options
author | Ben Lok <ben.lok@mediatek.com> | 2015-07-31 16:25:47 +0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-08-04 19:22:01 +0000 |
commit | ccc085dd9a22ce123c16fcf24a816732a3df116f (patch) | |
tree | e770594b02e532c92e620fb9b7376e9ea8a65589 | |
parent | 12495e2b40eb4c5abb2202effd47ec131b43dc89 (diff) | |
download | chrome-ec-ccc085dd9a22ce123c16fcf24a816732a3df116f.tar.gz |
oak: updates GPIO setting for rev3
Modify the GPIO seeting according to the Oak rev3 schematic.
BRANCH=none
BUG=none
TEST=manual
1. define CONFIG_BOARD_OAK_REV_2 in board.h
make -j BOARD=oak
2. define CONFIG_BOARD_OAK_REV_3 in board.h
make -j BOARD=oak
both cases should be built successfully.
Change-Id: I0336624a5a2d356a4c2eb9ffb812ebffb4f5f7c3
Signed-off-by: Ben Lok <ben.lok@mediatek.com>
Reviewed-on: https://chromium-review.googlesource.com/289475
Reviewed-by: Rong Chang <rongchang@chromium.org>
-rw-r--r-- | board/oak/board.c | 21 | ||||
-rw-r--r-- | board/oak/gpio.inc | 71 |
2 files changed, 56 insertions, 36 deletions
diff --git a/board/oak/board.c b/board/oak/board.c index e63ceb2136..8893ed17fc 100644 --- a/board/oak/board.c +++ b/board/oak/board.c @@ -47,19 +47,6 @@ /* Dispaly port hardware can connect to port 0, 1 or neither. */ #define PD_PORT_NONE -1 -static void ap_reset_deferred(void) -{ - /* Warm reset AP */ - chipset_reset(0); -} -DECLARE_DEFERRED(ap_reset_deferred); - -void ap_reset_interrupt(enum gpio_signal signal) -{ - if (gpio_get_level(GPIO_AP_RESET_L) == 0) - hook_call_deferred(ap_reset_deferred, 0); -} - void vbus_wake_interrupt(enum gpio_signal signal) { CPRINTF("VBUS %d\n", !gpio_get_level(signal)); @@ -216,9 +203,6 @@ static void board_init(void) gpio_enable_interrupt(GPIO_PD_MCU_INT); /* Enable VBUS interrupt */ gpio_enable_interrupt(GPIO_VBUS_WAKE_L); -#ifdef CONFIG_AP_WARM_RESET_INTERRUPT - gpio_enable_interrupt(GPIO_AP_RESET_L); -#endif charge_none.voltage = USB_CHARGER_VOLTAGE_MV; charge_none.current = 0; @@ -352,8 +336,9 @@ void board_typec_dp_on(int port) if (dp_hw_port != !port) { /* Get control of DP hardware */ dp_hw_port = port; +#ifdef CONFIG_BOARD_OAK_REV_2 gpio_set_level(GPIO_DP_SWITCH_CTL, port); - +#endif if (!gpio_get_level(GPIO_USB_DP_HPD)) { gpio_set_level(GPIO_USB_DP_HPD, 1); } else { @@ -396,7 +381,9 @@ void board_typec_dp_set(int port, int level) if (dp_hw_port == PD_PORT_NONE) { dp_hw_port = port; +#ifdef CONFIG_BOARD_OAK_REV_2 gpio_set_level(GPIO_DP_SWITCH_CTL, port); +#endif } if (dp_hw_port == port) diff --git a/board/oak/gpio.inc b/board/oak/gpio.inc index 46fc0ec80f..c45e51e785 100644 --- a/board/oak/gpio.inc +++ b/board/oak/gpio.inc @@ -10,11 +10,10 @@ GPIO_INT(AC_PRESENT, PIN(C, 6), GPIO_INT_BOTH, extpower GPIO_INT(POWER_BUTTON_L, PIN(B, 5), GPIO_INT_BOTH | GPIO_PULL_UP, power_button_interrupt) GPIO_INT(SOC_POWER_GOOD, PIN(A, 3), GPIO_INT_BOTH | GPIO_PULL_DOWN, power_signal_interrupt) GPIO_INT(LID_OPEN, PIN(C, 13), GPIO_INT_BOTH, lid_interrupt) /* LID switch detection */ -GPIO_INT(SUSPEND_L, PIN(C, 7), GPIO_INT_BOTH, power_signal_interrupt) /* AP suspend/resume state */ +GPIO_INT(SUSPEND_L, PIN(C, 7), GPIO_INT_BOTH | GPIO_PULL_DOWN, power_signal_interrupt) /* AP suspend/resume state */ GPIO_INT(VBUS_WAKE_L, PIN(E, 1), GPIO_INT_BOTH, vbus_wake_interrupt) /* VBUS wake: PE 1 */ GPIO_INT(PD_MCU_INT, PIN(E, 0), GPIO_INT_FALLING, pd_mcu_interrupt) /* Signal from PD MCU, external pull-up */ GPIO_INT(SPI1_NSS, PIN(A, 4), GPIO_INT_BOTH | GPIO_PULL_UP, spi_event) /* SPI Chip Select */ -GPIO_INT(AP_RESET_L, PIN(C, 3), GPIO_INT_BOTH | GPIO_PULL_UP, ap_reset_interrupt) /* AP reset signal from servo board */ /* Keyboard inputs */ GPIO_INT(KB_IN00, PIN(C, 8), GPIO_KB_INPUT, keyboard_raw_gpio_interrupt) @@ -33,17 +32,24 @@ GPIO(WP_L, PIN(B, 4), GPIO_INPUT) /* Write protect input */ GPIO(BAT_PRESENT_L, PIN(E, 3), GPIO_INPUT|GPIO_PULL_UP) /* Board version */ -GPIO(BOARD_VERSION1, PIN(E, 10), GPIO_INPUT|GPIO_PULL_UP) /* Board ID 0 */ -GPIO(BOARD_VERSION2, PIN(E, 9), GPIO_INPUT|GPIO_PULL_UP) /* Board ID 1 */ -GPIO(BOARD_VERSION3, PIN(E, 12), GPIO_INPUT|GPIO_PULL_UP) /* Board ID 2 */ -GPIO(BOARD_VERSION4, PIN(E, 11), GPIO_INPUT|GPIO_PULL_UP) /* Board ID 3 */ +GPIO(BOARD_VERSION1, PIN(E, 10), GPIO_INPUT|GPIO_PULL_DOWN) /* Board ID 0 */ +GPIO(BOARD_VERSION2, PIN(E, 9), GPIO_INPUT|GPIO_PULL_DOWN) /* Board ID 1 */ +GPIO(BOARD_VERSION3, PIN(E, 12), GPIO_INPUT|GPIO_PULL_DOWN) /* Board ID 2 */ +GPIO(BOARD_VERSION4, PIN(E, 11), GPIO_INPUT|GPIO_PULL_DOWN) /* Board ID 3 */ /* Outputs */ GPIO(BAT_LED0, PIN(B, 11), GPIO_OUT_LOW) /* LED_GREEN */ -GPIO(BAT_LED1, PIN(A, 11), GPIO_OUT_LOW) /* LED_ORANGE */ +GPIO(BAT_LED1, PIN(A, 11), GPIO_OUT_LOW) /* LED_ORANGE or LED_RED(>rev3)*/ +GPIO(PWR_LED0, PIN(F, 10), GPIO_OUT_LOW) /* LED_GREEN */ +GPIO(PWR_LED1, PIN(F, 9), GPIO_OUT_LOW) /* LED_ORANGE */ GPIO(EC_BL_OVERRIDE, PIN(F, 1), GPIO_OUT_LOW) GPIO(EC_INT, PIN(B, 9), GPIO_OUT_HIGH) GPIO(ENTERING_RW, PIN(F, 0), GPIO_OUT_LOW) + + +#ifdef CONFIG_BOARD_OAK_REV_1 +GPIO(AP_RESET_L, PIN(C, 3), GPIO_INPUT|GPIO_PULL_UP) /* AP reset signal from servo board */ +GPIO(USB_C_BC12_SEL, PIN(A, 14), GPIO_OUT_LOW) GPIO(KB_OUT00, PIN(B, 0), GPIO_KB_OUTPUT) GPIO(KB_OUT01, PIN(B, 8), GPIO_KB_OUTPUT) GPIO(KB_OUT02, PIN(B, 12), GPIO_OUT_LOW) /* KSO2 is inverted */ @@ -56,11 +62,42 @@ GPIO(KB_OUT08, PIN(C, 2), GPIO_KB_OUTPUT) GPIO(KB_OUT09, PIN(B, 1), GPIO_KB_OUTPUT) GPIO(KB_OUT10, PIN(C, 5), GPIO_KB_OUTPUT) GPIO(KB_OUT11, PIN(C, 4), GPIO_KB_OUTPUT) -#ifdef CONFIG_BOARD_OAK_REV_1 GPIO(KB_OUT12, PIN(A, 13), GPIO_KB_OUTPUT) -#else -GPIO(KB_OUT12, PIN(D, 5), GPIO_KB_OUTPUT) -#endif /* CONFIG_BOARD_OAK_REV_1 */ +#elif defined(CONFIG_BOARD_OAK_REV_2) +GPIO(AP_RESET_L, PIN(C, 3), GPIO_INPUT|GPIO_PULL_UP) /* AP reset signal from servo board */ +GPIO(USB_C_BC12_SEL, PIN(D, 7), GPIO_OUT_LOW) +GPIO(KB_OUT00, PIN(B, 0), GPIO_KB_OUTPUT) +GPIO(KB_OUT01, PIN(B, 8), GPIO_KB_OUTPUT) +GPIO(KB_OUT02, PIN(B, 12), GPIO_OUT_LOW) /* KSO2 is inverted */ +GPIO(KB_OUT03, PIN(B, 2), GPIO_KB_OUTPUT) +GPIO(KB_OUT04, PIN(A, 8), GPIO_KB_OUTPUT) +GPIO(KB_OUT05, PIN(D, 4), GPIO_KB_OUTPUT) +GPIO(KB_OUT06, PIN(D, 0), GPIO_KB_OUTPUT) +GPIO(KB_OUT07, PIN(D, 1), GPIO_KB_OUTPUT) +GPIO(KB_OUT08, PIN(C, 2), GPIO_KB_OUTPUT) +GPIO(KB_OUT09, PIN(B, 1), GPIO_KB_OUTPUT) +GPIO(KB_OUT10, PIN(C, 5), GPIO_KB_OUTPUT) +GPIO(KB_OUT11, PIN(C, 4), GPIO_KB_OUTPUT) +GPIO(KB_OUT12, PIN(D, 5), GPIO_KB_OUTPUT) +GPIO(DP_MUX_EN_L, PIN(E, 6), GPIO_OUT_LOW) +GPIO(DP_SWITCH_CTL, PIN(E, 5), GPIO_OUT_LOW) +#else /* BOARD_OAK_REV_3 or later */ +GPIO(AP_RESET_L, PIN(C, 3), GPIO_ODR_HIGH) /* Connect to the PMU_SYSRSTB */ +GPIO(USB_C_BC12_SEL, PIN(D, 7), GPIO_OUT_LOW) +GPIO(KB_OUT00, PIN(B, 0), GPIO_KB_OUTPUT) +GPIO(KB_OUT01, PIN(B, 8), GPIO_KB_OUTPUT) +GPIO(KB_OUT02, PIN(B, 12), GPIO_OUT_LOW) /* KSO2 is inverted */ +GPIO(KB_OUT03, PIN(D, 0), GPIO_KB_OUTPUT) +GPIO(KB_OUT04, PIN(A, 8), GPIO_KB_OUTPUT) +GPIO(KB_OUT05, PIN(D, 4), GPIO_KB_OUTPUT) +GPIO(KB_OUT06, PIN(B, 2), GPIO_KB_OUTPUT) +GPIO(KB_OUT07, PIN(D, 1), GPIO_KB_OUTPUT) +GPIO(KB_OUT08, PIN(D, 5), GPIO_KB_OUTPUT) +GPIO(KB_OUT09, PIN(B, 1), GPIO_KB_OUTPUT) +GPIO(KB_OUT10, PIN(C, 5), GPIO_KB_OUTPUT) +GPIO(KB_OUT11, PIN(C, 4), GPIO_KB_OUTPUT) +GPIO(KB_OUT12, PIN(C, 2), GPIO_KB_OUTPUT) +#endif GPIO(SYSTEM_POWER_H, PIN(B, 10), GPIO_OUT_LOW) GPIO(PMIC_PWRON_H, PIN(A, 12), GPIO_OUT_LOW) @@ -73,14 +110,10 @@ GPIO(USB_C1_5V_OUT, PIN(D, 10), GPIO_OUT_LOW) /* USBC port 1 5V */ GPIO(USB_C1_CHARGE_L, PIN(D, 11), GPIO_OUT_LOW) /* USBC port 1 charge */ GPIO(USB_PD_VBUS_WAKE, PIN(B, 15), GPIO_OUT_LOW) /* PD VBUS wake */ GPIO(USB_DP_HPD, PIN(F, 3), GPIO_OUT_LOW) -GPIO(DP_MUX_EN_L, PIN(E, 6), GPIO_OUT_LOW) -GPIO(DP_SWITCH_CTL, PIN(E, 5), GPIO_OUT_LOW) - -#ifdef CONFIG_BOARD_OAK_REV_1 -GPIO(USB_C_BC12_SEL, PIN(A, 14), GPIO_OUT_LOW) -#else -GPIO(USB_C_BC12_SEL, PIN(D, 7), GPIO_OUT_LOW) -#endif /* CONFIG_BOARD_OAK_REV_1 */ +GPIO(USB_C0_DEVMODE_L, PIN(E, 4), GPIO_OUT_HIGH) /* set HSD2 (host mode) path as default */ +GPIO(USB_C1_DEVMODE, PIN(E, 2), GPIO_OUT_LOW) /* set HSD1 (host mode) path as default */ +GPIO(TYPEC0_MUX_EN_L, PIN(E, 13), GPIO_OUT_LOW) +GPIO(TYPEC1_MUX_EN_L, PIN(E, 14), GPIO_OUT_LOW) /* Analog pins */ GPIO(VDC_BOOSTIN_SENSE, PIN(C, 1), GPIO_ANALOG) /* ADC_IN11 */ |