diff options
author | Dino Li <Dino.Li@ite.com.tw> | 2021-06-08 22:38:23 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-06-10 06:12:19 +0000 |
commit | fa451fa44d7f36c0073c795c9969d8e7f03fd1f3 (patch) | |
tree | f1013f2c3510b1eb3aee25c56cde7b07182c0717 /chip/it83xx | |
parent | d8e89fc1cc4513a46931724e828efaa8029311fa (diff) | |
download | chrome-ec-fa451fa44d7f36c0073c795c9969d8e7f03fd1f3.tar.gz |
it8xxx2/spi: re-init spi module after disable emmc boot mode
This CL reset and re-initialize SPI module after AP jumped to BL.
So EC will have a good state to start receiving AP's commands.
BRANCH=icarus
BUG=b:184702635
TEST=on cozmo, confirm that EC doesn't miss the first command from
AP after booting.
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
Change-Id: Ib7cf0e9cb70a67950d53d3abc7df42969c9b4dc2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2947422
Tested-by: Eric Yilun Lin <yllin@google.com>
Reviewed-by: Eric Yilun Lin <yllin@google.com>
Diffstat (limited to 'chip/it83xx')
-rw-r--r-- | chip/it83xx/spi.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/chip/it83xx/spi.c b/chip/it83xx/spi.c index d92d98fdf2..a21ba8c10d 100644 --- a/chip/it83xx/spi.c +++ b/chip/it83xx/spi.c @@ -363,6 +363,23 @@ static void spi_reset(void) } DECLARE_HOOK(HOOK_SYSJUMP, spi_reset, HOOK_PRIO_DEFAULT); +#if defined(SECTION_IS_RO) && defined(CONFIG_BOOTBLOCK) +/* AP has booted */ +void emmc_ap_jump_to_bl(enum gpio_signal signal) +{ + /* Transmission completed. Set SPI pin mux to AP communication mode */ + IT83XX_GCTRL_PIN_MUX0 &= ~BIT(7); + /* Reset and re-initialize SPI module to communication mode */ + spi_reset(); + spi_init(); + /* Disable interrupt of detection of AP's BOOTBLOCK_EN_L */ + gpio_disable_interrupt(GPIO_BOOTBLOCK_EN_L); + enable_sleep(SLEEP_MASK_EMMC); + + CPRINTS("eMMC emulation disabled. AP Jumped to BL"); +} +#endif + /* Get protocol information */ enum ec_status spi_get_protocol_info(struct host_cmd_handler_args *args) { |