summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Lin <tim2.lin@ite.corp-partner.google.com>2021-08-04 16:32:32 +0800
committerCommit Bot <commit-bot@chromium.org>2021-08-05 04:37:46 +0000
commit6df113fcdce5125e356dc1ef31fee99a0a935ccf (patch)
tree5d48804bec593b5582de6d26809c6129933abea4
parentf6cd71cca9679a36dd21e41ffc77fcfd5f84f464 (diff)
downloadchrome-ec-6df113fcdce5125e356dc1ef31fee99a0a935ccf.tar.gz
zephyr/drivers: flash: enable SHI interrupt to handle AP's command
EC still need to handle AP's EC_CMD_GET_COMMS_STATUS command during flash erasing. BUG=b:195342437 BRANCH=none TEST=zmake testall Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com> Change-Id: Ie6ad4d409673a73efb7b8f2ec8353187f76fa996 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3070940 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
-rw-r--r--zephyr/drivers/cros_flash/cros_flash_it8xxx2.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/zephyr/drivers/cros_flash/cros_flash_it8xxx2.c b/zephyr/drivers/cros_flash/cros_flash_it8xxx2.c
index 9c3d8f9db1..3cacca13cc 100644
--- a/zephyr/drivers/cros_flash/cros_flash_it8xxx2.c
+++ b/zephyr/drivers/cros_flash/cros_flash_it8xxx2.c
@@ -198,6 +198,14 @@ static int cros_flash_it8xxx2_erase(const struct device *dev, int offset,
if (IS_ENABLED(CONFIG_ITE_IT8XXX2_INTC)) {
ite_intc_save_and_disable_interrupts();
}
+ /*
+ * EC still need to handle AP's EC_CMD_GET_COMMS_STATUS command
+ * during erasing.
+ */
+ if (IS_ENABLED(HAS_TASK_HOSTCMD) &&
+ IS_ENABLED(CONFIG_HOST_COMMAND_STATUS)) {
+ irq_enable(DT_IRQN(DT_NODELABEL(shi)));
+ }
/* Always use sector erase command */
for (; size > 0; size -= CONFIG_FLASH_ERASE_SIZE) {
ret = flash_erase(flash_controller, offset,