summaryrefslogtreecommitdiff
path: root/chip/it83xx
diff options
context:
space:
mode:
authortim <tim2.lin@ite.corp-partner.google.com>2020-10-12 15:35:23 +0800
committerCommit Bot <commit-bot@chromium.org>2020-10-14 10:31:15 +0000
commit0064badd26de871b8bc0b53bc764a0da8c66f6bf (patch)
treef88e0e15c1a6fa3c2870a0f8e5b306cb225fa5fd /chip/it83xx
parent19d0edf872e988188443e70976592212f3e38895 (diff)
downloadchrome-ec-0064badd26de871b8bc0b53bc764a0da8c66f6bf.tar.gz
it83xx/flash: handle AP's command of get status while erasing
This change makes EC handle get status command from AP while erasing. BUG=b:168869304 BRANCH=none TEST=Software sync works on Asurada. Signed-off-by: tim <tim2.lin@ite.corp-partner.google.com> Change-Id: I261ce1a82c89b4f8917e8156aa142e2ea327c368 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2465605 Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
Diffstat (limited to 'chip/it83xx')
-rw-r--r--chip/it83xx/flash.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/chip/it83xx/flash.c b/chip/it83xx/flash.c
index 4c4651f58b..df55ad77f4 100644
--- a/chip/it83xx/flash.c
+++ b/chip/it83xx/flash.c
@@ -502,6 +502,18 @@ int FLASH_DMA_CODE flash_physical_erase(int offset, int size)
*/
if (IS_ENABLED(IT83XX_CHIP_FLASH_IS_KGD) && (size > 0x10000))
watchdog_reload();
+ /*
+ * EC still need to handle AP's EC_CMD_GET_COMMS_STATUS command
+ * during erasing.
+ */
+#ifdef IT83XX_IRQ_SPI_SLAVE
+ if (IS_ENABLED(CONFIG_SPI) &&
+ IS_ENABLED(HAS_TASK_HOSTCMD) &&
+ IS_ENABLED(CONFIG_HOST_COMMAND_STATUS)) {
+ if (IT83XX_SPI_RX_VLISR & IT83XX_SPI_RVLI)
+ task_trigger_irq(IT83XX_IRQ_SPI_SLAVE);
+ }
+#endif
}
dma_reset_immu((v_addr + v_size) >= IMMU_TAG_INDEX_BY_DEFAULT);
/* get the ILM address of a flash offset. */