diff --git a/board/hx20/lfw/gpio.inc b/board/hx20/lfw/gpio.inc index cabf346f97..a62b0c685c 100644 --- a/board/hx20/lfw/gpio.inc +++ b/board/hx20/lfw/gpio.inc @@ -15,6 +15,8 @@ */ GPIO(QMSPI_CS0, PIN(055), GPIO_ODR_HIGH) +/* We need to take control of this away from VCI */ +GPIO(EC_ON, PIN(0250), GPIO_OUT_HIGH) /* keep +3VL_EC to power on */ /* Alternate functions GPIO definition */ diff --git a/board/hx30/lfw/gpio.inc b/board/hx30/lfw/gpio.inc index f4142d3c29..fc7440cb23 100644 --- a/board/hx30/lfw/gpio.inc +++ b/board/hx30/lfw/gpio.inc @@ -15,6 +15,8 @@ */ GPIO(QMSPI_CS0, PIN(055), GPIO_ODR_HIGH) +/* We need to take control of this away from VCI */ +GPIO(EC_ON, PIN(0250), GPIO_OUT_HIGH) /* keep +3VL_EC to power on */ /* Alternate functions GPIO definition */ diff --git a/chip/mchp/lfw/ec_lfw.c b/chip/mchp/lfw/ec_lfw.c index 8b2e429fb3..334338daa3 100644 --- a/chip/mchp/lfw/ec_lfw.c +++ b/chip/mchp/lfw/ec_lfw.c @@ -422,6 +422,16 @@ void lfw_main(void) uart_init(); system_init(); + /* + * We need to switch control of VCI_OUT (aliased as EC_ON) away from + * VCI_INx to keep the machine powered even after the user releases the + * power button. This ensures that we can stay on long enough to read + * from SPI flash. + */ + gpio_reset(GPIO_EC_ON); + MCHP_VCI_REGISTER |= MCHP_VCI_REGISTER_FW_CNTRL; + MCHP_VCI_REGISTER |= MCHP_VCI_REGISTER_FW_EXT; + spi_enable(CONFIG_SPI_FLASH_PORT, 1); uart_puts("littlefw ");