diff options
author | Yilun Lin <yllin@google.com> | 2018-07-12 17:08:25 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-08-22 08:16:09 -0700 |
commit | 26708ffa05ee1fc88bd754ddb959499acea1c41d (patch) | |
tree | c9cac042aef873a4ce511f2777c6a7cd2fb207b4 /board | |
parent | f724479c5b3a3e394b4e6f7c16ed1054815daa44 (diff) | |
download | chrome-ec-26708ffa05ee1fc88bd754ddb959499acea1c41d.tar.gz |
kukui: Update GPIO for board rev1.
kukui has many GPIO pin changes in rev1. Getting idea from oak,
we use BOARD_REV=n to support building images for different board
revisions. BOARD_REV defaults to 0 for now.
TEST=make BOARD=kukui -j
TEST=make BOARD=kukui -j; modify BOARD_REV=1, make BOARD=kukui -B -j
BUG=b:80159522, b:112616655
BRANCH=None
Change-Id: I49624d541eb9cc50c5d48abaa8699485b64bac28
Signed-off-by: Yilun Lin <yllin@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1135880
Commit-Ready: Yilun Lin <yllin@chromium.org>
Tested-by: Yilun Lin <yllin@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/kukui/board.c | 12 | ||||
-rw-r--r-- | board/kukui/board.h | 7 | ||||
-rw-r--r-- | board/kukui/gpio.inc | 44 |
3 files changed, 53 insertions, 10 deletions
diff --git a/board/kukui/board.c b/board/kukui/board.c index dec00249e1..5509aee78a 100644 --- a/board/kukui/board.c +++ b/board/kukui/board.c @@ -72,6 +72,18 @@ static void ap_watchdog_interrupt(enum gpio_signal signal) gpio_set_level(GPIO_PMIC_WATCHDOG_L, level); } +#if BOARD_REV >= 1 +static void hall_interrupt(enum gpio_signal signal) +{ + /* TODO(b/111378000): Implement hall_interrupt */ +} + +static void gauge_interrupt(enum gpio_signal signal) +{ + /* TODO(b/111378620): Impelement gauge_interrupt */ +} +#endif + #include "gpio_list.h" /******************************************************************************/ diff --git a/board/kukui/board.h b/board/kukui/board.h index 8fa0c5c0d8..51f7b967d6 100644 --- a/board/kukui/board.h +++ b/board/kukui/board.h @@ -8,6 +8,13 @@ #ifndef __CROS_EC_BOARD_H #define __CROS_EC_BOARD_H +/* board revision */ +#define BOARD_REV 0 + +#if BOARD_REV < 0 || BOARD_REV > 1 +#error "Board revision out of range" +#endif + /* Optional modules */ #define CONFIG_ADC #undef CONFIG_ADC_WATCHDOG diff --git a/board/kukui/gpio.inc b/board/kukui/gpio.inc index ec9b6f343b..70c6b25136 100644 --- a/board/kukui/gpio.inc +++ b/board/kukui/gpio.inc @@ -31,23 +31,37 @@ GPIO_INT(WARM_RESET_REQ, PIN(A, 3), GPIO_INT_RISING | GPIO_PULL_DOWN, GPIO_INT(AP_EC_WATCHDOG_L, PIN(C, 2), GPIO_INT_BOTH, ap_watchdog_interrupt) -#ifdef SECTION_IS_RW -GPIO_INT(ACCEL_INT_ODL, PIN(A, 4), GPIO_INT_FALLING | GPIO_SEL_1P8V | GPIO_PULL_UP, +GPIO_INT_RW(ACCEL_INT_ODL, PIN(A, 4), GPIO_INT_FALLING | GPIO_SEL_1P8V | GPIO_PULL_UP, bmi160_interrupt) -GPIO_INT(SYNC_INT, PIN(A, 5), GPIO_INT_RISING | GPIO_PULL_DOWN, - sync_interrupt) -#endif GPIO_INT(CHARGER_INT_ODL, PIN(C, 13), GPIO_INT_FALLING | GPIO_PULL_UP, rt946x_interrupt) -#ifdef SECTION_IS_RO -GPIO_INT(EMMC_CMD, PIN(A, 14), GPIO_INT_FALLING, +GPIO_INT_RO(EMMC_CMD, PIN(A, 14), GPIO_INT_FALLING, emmc_cmd_interrupt) +#if BOARD_REV == 0 +GPIO_INT_RW(SYNC_INT, PIN(A, 5), GPIO_INT_RISING | GPIO_PULL_DOWN, + sync_interrupt) +#elif BOARD_REV >= 1 +GPIO_INT_RW(SYNC_INT, PIN(A, 8), GPIO_INT_RISING | GPIO_PULL_DOWN, + sync_interrupt) +GPIO_INT(HALL_INT_L, PIN(C, 5), GPIO_INT_FALLING, + hall_interrupt) +GPIO_INT(GAUGE_INT_ODL, PIN(C, 9), GPIO_INT_FALLING | GPIO_PULL_UP, + gauge_interrupt) +#endif + +/* Interrupts not implemented yet */ +#if BOARD_REV >= 1 +GPIO(ALS_INT_ODL, PIN(A, 6), GPIO_INPUT) #endif /* Voltage rails control pins */ GPIO(PP3300_S0_EN, PIN(B, 6), GPIO_OUT_LOW) GPIO(PP1800_S3_EN, PIN(C, 7), GPIO_OUT_LOW) +#if BOARD_REV == 0 GPIO(PP3300_S3_EN, PIN(A, 8), GPIO_OUT_LOW) +#elif BOARD_REV >= 1 +GPIO(PP3300_S3_EN, PIN(D, 2), GPIO_OUT_LOW) +#endif /* Reset pins */ GPIO(AP_SYS_RST_L, PIN(C, 11), GPIO_OUT_LOW) @@ -70,20 +84,30 @@ GPIO(BOARD_ID, PIN(C, 0), GPIO_ANALOG) /* Other input pins */ GPIO(WP_L, PIN(C, 8), GPIO_INPUT) /* EC_FLASH_WP_ODL */ -GPIO(CCD_MODE_ODL, PIN(C, 9), GPIO_INPUT) GPIO(BOOT0, PIN(F, 11), GPIO_INPUT) +#if BOARD_REV == 0 +GPIO(CCD_MODE_ODL, PIN(C, 9), GPIO_INPUT) +#elif BOARD_REV >= 1 +GPIO(CCD_MODE_ODL, PIN(A, 1), GPIO_INPUT) +GPIO(BATT_ID, PIN(A, 7), GPIO_INPUT) +#endif /* Other output pins */ GPIO(ENTERING_RW, PIN(C, 6), GPIO_ODR_HIGH) /* EC_ENTERING_RW_ODL */ GPIO(EC_INT_L, PIN(B, 12), GPIO_ODR_HIGH) /* EC_AP_INT_ODL */ GPIO(EC_BOARD_ID_EN_L, PIN(C, 15), GPIO_ODR_HIGH) /* EC_BOARD_ID_EN_ODL */ GPIO(USB_C0_DISCHARGE, PIN(B, 0), GPIO_OUT_LOW) -GPIO(USB_C0_DP_OE_L, PIN(C, 5), GPIO_OUT_HIGH) GPIO(USB_C0_DP_POLARITY, PIN(C, 14), GPIO_OUT_LOW) GPIO(USB_C0_HPD_OD, PIN(F, 1), GPIO_OUT_LOW) -GPIO(OTG_EN, PIN(A, 6), GPIO_OUT_LOW) GPIO(BOOTBLOCK_MUX_OE, PIN(C, 4), GPIO_ODR_HIGH) GPIO(BOOTBLOCK_EN_L, PIN(C, 1), GPIO_ODR_HIGH) +#if BOARD_REV == 0 +GPIO(USB_C0_DP_OE_L, PIN(C, 5), GPIO_OUT_HIGH) +GPIO(OTG_EN, PIN(A, 6), GPIO_OUT_LOW) +#elif BOARD_REV >= 1 +GPIO(USB_C0_DP_OE_L, PIN(A, 5), GPIO_OUT_HIGH) +GPIO(USB_ID, PIN(A, 13), GPIO_ODR_HIGH) +#endif /* USART1: PA9/PA10 */ ALTERNATE(PIN_MASK(A, 0x0600), 1, MODULE_UART, 0) |