summaryrefslogtreecommitdiff
path: root/chip/it83xx/clock.c
diff options
context:
space:
mode:
authorDino Li <Dino.Li@ite.com.tw>2019-12-20 13:18:21 +0800
committerCommit Bot <commit-bot@chromium.org>2019-12-23 03:03:22 +0000
commite3f009f7773cc40f86b01326fe451e797b3f5080 (patch)
treecfea22a2521bf09e56cf4212cf9a2f9249c2d8e5 /chip/it83xx/clock.c
parentb462358fe122b51cdad99740329e6034c35bf4a0 (diff)
downloadchrome-ec-e3f009f7773cc40f86b01326fe451e797b3f5080.tar.gz
chip/it8xxx2: Don't let internal flash go into deep power down mode
We got an issue on IT83202BX that flash won't be able to wake up correctly in EC low power mode when WRST# is asserted. This issue might cause cold reset failure so we made this change to fix it. BUG=none BRANCH=none TEST=hibernate EC and then press servo board's COLD_RST_L to reset EC. EC reboots. Change-Id: Ide3a240e1fe62d712536c69d8f390241e67144f6 Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1973974 Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'chip/it83xx/clock.c')
-rw-r--r--chip/it83xx/clock.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/chip/it83xx/clock.c b/chip/it83xx/clock.c
index 468037f0e9..7c679bffbe 100644
--- a/chip/it83xx/clock.c
+++ b/chip/it83xx/clock.c
@@ -141,6 +141,30 @@ void __ram_code clock_ec_pll_ctrl(enum ec_pll_ctrl mode)
IT83XX_ECPM_PLLCTRL = mode;
/* for deep doze / sleep mode */
IT83XX_ECPM_PLLCTRL = mode;
+
+#ifdef IT83XX_CHIP_FLASH_NO_DEEP_POWER_DOWN
+ /*
+ * WORKAROUND: this workaround is used to fix EC gets stuck in low power
+ * mode when WRST# is asserted.
+ *
+ * By default, flash will go into deep power down mode automatically
+ * when EC is in low power mode. But we got an issue on IT83202BX that
+ * flash won't be able to wake up correctly when WRST# is asserted
+ * under this condition.
+ * This issue might cause cold reset failure so we fix it.
+ *
+ * NOTE: this fix will increase power number about 40uA in low power
+ * mode.
+ */
+ if (mode == EC_PLL_DOZE)
+ IT83XX_SMFI_SMECCS &= ~IT83XX_SMFI_MASK_HOSTWA;
+ else
+ /*
+ * Don't send deep power down mode command to flash when EC in
+ * low power mode.
+ */
+ IT83XX_SMFI_SMECCS |= IT83XX_SMFI_MASK_HOSTWA;
+#endif
/*
* barrier: ensure low power mode setting is taken into control
* register before standby instruction.