summaryrefslogtreecommitdiff
path: root/chip/it83xx/clock.c
diff options
context:
space:
mode:
authorDino Li <Dino.Li@ite.com.tw>2018-10-23 10:05:39 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-10-23 22:50:45 -0700
commit4ddcd2a563f8e62f04877054a00e9dd7656dfd72 (patch)
tree916fbd810a43c0de02b126396fa7d95a0c3f696b /chip/it83xx/clock.c
parent94aa19dc8e27b06ab93eecee7abba8b24af7cc6f (diff)
downloadchrome-ec-4ddcd2a563f8e62f04877054a00e9dd7656dfd72.tar.gz
it83xx/clock: turn off VCC before changing PLL
Symptom: On Ampton board, EC's clock frequency is not correct after changing PLL sequence. We have added a workaround to fix changing PLL failure issue while CS# pin's level is low, but it does not fix the issue on the DX version. We need to turn off VCC power to fix this issue on the DX. BUG=b:70537592 BRANCH=none TEST=EC clock frequency is correct on DX version after changing PLL sequence. Change-Id: Id2f507d6b15da40bab178f2754c7b11d64ff5ddf Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/1293133 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: James Chao <james_chao@asus.corp-partner.google.com> Reviewed-by: James Chao <james_chao@asus.corp-partner.google.com> Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'chip/it83xx/clock.c')
-rw-r--r--chip/it83xx/clock.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/chip/it83xx/clock.c b/chip/it83xx/clock.c
index 6ab644912f..12ec22f894 100644
--- a/chip/it83xx/clock.c
+++ b/chip/it83xx/clock.c
@@ -200,6 +200,16 @@ static void clock_set_pll(enum pll_freq_idx idx)
* change PLL.
*/
IT83XX_GPIO_GPCRM5 = (IT83XX_GPIO_GPCRM5 & ~0xc0) | (1 << 7);
+#ifdef IT83XX_ESPI_INHIBIT_CS_BY_VCC_OFF
+ /*
+ * On DX version, we have to turn off VCC before changing PLL
+ * sequence or sequence will fail if CS# pin is low.
+ *
+ * The VCC power status will be treated as power-on later in
+ * clock_init().
+ */
+ IT83XX_GCTRL_RSTS = (IT83XX_GCTRL_RSTS & ~0xc0);
+#endif
#endif
/* Update PLL settings. */
clock_pll_changed();