diff --git a/board/kevin/gpio.inc b/board/kevin/gpio.inc index 47e502b96d..62b8d1f6c8 100644 --- a/board/kevin/gpio.inc +++ b/board/kevin/gpio.inc @@ -12,7 +12,8 @@ GPIO_INT(WP_L, PIN(9, 3), GPIO_INT_BOTH, switch_interrupt) -GPIO_INT(SHI_CS_L, PIN(5, 3), GPIO_INT_FALLING, shi_cs_event) +GPIO_INT(SHI_CS_L, PIN(5, 3), GPIO_INT_FALLING | GPIO_PULL_DOWN, + shi_cs_event) GPIO_INT(USB_C0_PD_INT_L, PIN(6, 0), GPIO_INT_FALLING | GPIO_PULL_UP, tcpc_alert_event) GPIO_INT(USB_C1_PD_INT_L, PIN(6, 2), GPIO_INT_FALLING | GPIO_PULL_UP, @@ -124,6 +125,15 @@ GPIO(USB_A_CHARGE_EN, PIN(8, 4), GPIO_OUT_LOW) GPIO(GPIOB6_NC, PIN(B, 6), GPIO_INPUT | GPIO_PULL_UP) #endif +/* + * SPI host interface - enable PDs by default. These will be made functional + * by the SHI driver when the AP powers up, and restored back to GPIO when + * the AP powers down. + */ +GPIO(SHI_SDI, PIN(4, 6), GPIO_INPUT | GPIO_PULL_DOWN) +GPIO(SHI_SDO, PIN(4, 7), GPIO_INPUT | GPIO_PULL_DOWN) +GPIO(SHI_SCLK, PIN(5, 5), GPIO_INPUT | GPIO_PULL_DOWN) + /* SPIP_MOSI/SPIP_SCLK GPIOA3/A1 */ ALTERNATE(PIN_MASK(A, 0x0A), 1, MODULE_SPI, 0) /* SPIP_MISO GPIO95 */ diff --git a/chip/npcx/shi.c b/chip/npcx/shi.c index 76118abaa7..d00b153747 100644 --- a/chip/npcx/shi.c +++ b/chip/npcx/shi.c @@ -779,13 +779,12 @@ static void shi_disable(void) /* Disable SHI_CS_L interrupt */ gpio_disable_interrupt(GPIO_SHI_CS_L); - /* Disable pullup and interrupts on SHI_CS_L */ - gpio_set_flags(GPIO_SHI_CS_L, GPIO_INPUT); + /* Restore SHI_CS_L back to default state */ + gpio_reset(GPIO_SHI_CS_L); /* * Mux SHI related pins * SHI_SDI SHI_SDO SHI_CS# SHI_SCLK are selected to GPIO - * (Default GPIO config = input) */ CLEAR_BIT(NPCX_DEVALT(ALT_GROUP_C), NPCX_DEVALTC_SHI_SL); }