summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortim <tim2.lin@ite.corp-partner.google.com>2018-08-30 18:42:50 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-09-03 05:53:26 -0700
commit3bd2ae3c4a5ef5423bdbe62b35fa2384a9026d35 (patch)
tree459d67529c8257ed75e3cbb82a1d0e7fe2643fbe
parent845734de27bc705b263a2090ccd662964b6671cd (diff)
downloadchrome-ec-3bd2ae3c4a5ef5423bdbe62b35fa2384a9026d35.tar.gz
it83xx: espi: write-1 clear bug of VMCTRL1 register
For the chip of IT8320BX, we can not write-1 to clear pending bit individually in the register of VMCTRL1. We have to write 0xff to clear pending bit as a workaround. This bug has been fixed in the later version of chip. BUG=b:68918637 BRANCH=none TEST=Ensure the pending bit of register will be individually cleared in IT8320DX chip. Change-Id: Icf8c6f9e5ed11bd45069742a4a928987f61c587d Signed-off-by: tim <tim2.lin@ite.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/1195310 Commit-Ready: Tim2 Lin <tim2.lin@ite.corp-partner.google.com> Tested-by: Tim2 Lin <tim2.lin@ite.corp-partner.google.com> Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r--chip/it83xx/config_chip.h2
-rw-r--r--chip/it83xx/espi.c12
2 files changed, 7 insertions, 7 deletions
diff --git a/chip/it83xx/config_chip.h b/chip/it83xx/config_chip.h
index d719c3e834..21139cd7a4 100644
--- a/chip/it83xx/config_chip.h
+++ b/chip/it83xx/config_chip.h
@@ -75,6 +75,8 @@
* of the control register (bit1 and bit5 at register IT83XX_USBPD_CCCSR).
*/
#define IT83XX_USBPD_CC_VOLTAGE_DETECTOR_INDEPENDENT
+/* For IT8320BX, we have to write 0xff to clear pending bit.*/
+#define IT83XX_ESPI_VWCTRL1_WRITE_FF_CLEAR
#elif defined(CHIP_VARIANT_IT8320DX)
#define CONFIG_FLASH_SIZE 0x00080000
/* The slave frequency is adjustable (bit[2-0] at register IT83XX_ESPI_GCAC1) */
diff --git a/chip/it83xx/espi.c b/chip/it83xx/espi.c
index a38cab9f3f..c600f02317 100644
--- a/chip/it83xx/espi.c
+++ b/chip/it83xx/espi.c
@@ -386,14 +386,12 @@ void espi_vw_interrupt(void)
int i;
uint8_t vwidx_updated = IT83XX_ESPI_VWCTRL1;
- /*
- * TODO(b:68918637): write-1 clear bug.
- * for now, we have to write 0xff to clear pending bit.
- */
-#if 0
- IT83XX_ESPI_VWCTRL1 = vwidx_updated;
-#else
+#ifdef IT83XX_ESPI_VWCTRL1_WRITE_FF_CLEAR
+ /* For IT8320BX, we have to write 0xff to clear pending bit.*/
IT83XX_ESPI_VWCTRL1 = 0xff;
+#else
+ /* write-1 to clear */
+ IT83XX_ESPI_VWCTRL1 = vwidx_updated;
#endif
task_clear_pending_irq(IT83XX_IRQ_ESPI_VW);