diff options
author | Nicolas Boichat <drinkcat@chromium.org> | 2018-08-29 15:45:59 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-10-30 08:42:56 -0700 |
commit | 5e6f10ed2f78b644371abb38e2e1f9a5124bc288 (patch) | |
tree | e9a9cccb4059835d181a983d62e3b778851d3c02 /board/kukui/gpio.inc | |
parent | f420a49e257769b94a991416d0ebf4a30f5c9668 (diff) | |
download | chrome-ec-5e6f10ed2f78b644371abb38e2e1f9a5124bc288.tar.gz |
kukui/emmc: Share EXTI15 interrupt between SPI and eMMC
We never need to have interrupts enabled on both SPI1_NSS and
EMMC_CMD, so we can actually share the interrupt selection EXTI15
between the 2 pins. This frees up PA14 (and EXTI14) for future
interrupt needs.
To make sure that we can answer host commands as soon as the AP as
booted, we quickly poll for the eMMC bootblock switch to turn away
from EC, and switch interrupt from eMMC to SPI.
Also, we clear exit_events in chip/stm32/gpio.c, so that we do not
report a override warning if we disable then re-enable another
interrupt on the same EXTI.
BRANCH=none
BUG=b:113370127
TEST=Boot kukui rev1, check that EC commands works after boot
Change-Id: Ib1f0a56a9f37e1bda01dc4e6b55734196bb3ff50
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1195345
Reviewed-by: Yilun Lin <yllin@chromium.org>
Diffstat (limited to 'board/kukui/gpio.inc')
-rw-r--r-- | board/kukui/gpio.inc | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/board/kukui/gpio.inc b/board/kukui/gpio.inc index 53a96f95c8..b67489fb60 100644 --- a/board/kukui/gpio.inc +++ b/board/kukui/gpio.inc @@ -33,21 +33,15 @@ GPIO_INT_RW(ACCEL_INT_ODL, PIN(A, 4), GPIO_INT_FALLING | GPIO_SEL_1P8V | GPIO_P bmi160_interrupt) GPIO_INT(CHARGER_INT_ODL, PIN(C, 13), GPIO_INT_FALLING | GPIO_PULL_UP, rt946x_interrupt) -#if BOARD_REV == 0 GPIO_INT_RO(EMMC_CMD, PIN(B, 15), GPIO_INT_FALLING, emmc_cmd_interrupt) +GPIO_INT(SPI1_NSS, PIN(A, 15), GPIO_INT_BOTH, + spi_event) +#if BOARD_REV == 0 GPIO_INT_RW(SYNC_INT, PIN(A, 5), GPIO_INT_RISING | GPIO_PULL_DOWN, sync_interrupt) -/* - * rev0 has an interrupt conflict between SPI1_NSS and EMMC_CMD (PIN(x, 15)), - * let's just ignore interrupts as host command won't work anyway. - */ GPIO(SPI1_NSS, PIN(A, 15), GPIO_INPUT) #elif BOARD_REV >= 1 -GPIO_INT_RO(EMMC_CMD, PIN(A, 14), GPIO_INT_FALLING, - emmc_cmd_interrupt) -GPIO_INT(SPI1_NSS, PIN(A, 15), GPIO_INT_BOTH, - spi_event) 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, |