diff options
author | Ruibin Chang <ruibin.chang@ite.com.tw> | 2020-09-23 18:01:04 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-10-01 18:40:12 +0000 |
commit | 0925bb2ba8afc40d7becd571a89c4bb062311680 (patch) | |
tree | ac96a95bc2a941bac44731b13ea04fe1c5184884 | |
parent | ba00ece0ac06e38edb3f1ab8d82ef5829f4ca77f (diff) | |
download | chrome-ec-0925bb2ba8afc40d7becd571a89c4bb062311680.tar.gz |
driver/it83xx, it8xxx2: avoid CCs open when TCPC init
Between we disconnect Rd_DB and set USBPD_START(port),
CCs are open state for few micro seconds, so I move
Rd_DB disconnection behind USBPD_START(port) to avoid
CCs temporarily open state. But this will cause about
1.5us that CCs assert both Rd_5.1k and Rd_DB.
BUG=b:169691804
BRANCH=none
TEST=on board asurada and reef_it8320, connect to adapter then,
1.power on reset: can go to SNK_READY
2."Reboot" reset: can go to SNK_READY
Signed-off-by: Ruibin Chang <ruibin.chang@ite.com.tw>
Change-Id: I15656cf41c5c123efbb7b7c6ee56a5e74b8a21cb
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2425792
Tested-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Commit-Queue: Jett Rink <jettrink@chromium.org>
-rw-r--r-- | driver/tcpm/it83xx.c | 8 | ||||
-rw-r--r-- | driver/tcpm/it8xxx2.c | 10 |
2 files changed, 14 insertions, 4 deletions
diff --git a/driver/tcpm/it83xx.c b/driver/tcpm/it83xx.c index 3327cfdfed..47c8f3a998 100644 --- a/driver/tcpm/it83xx.c +++ b/driver/tcpm/it83xx.c @@ -433,7 +433,6 @@ static void it83xx_init(enum usbpd_port port, int role) */ IT83XX_USBPD_TCDCR(port) = USBPD_REG_PLUG_IN_OUT_DETECT_STAT; #endif - IT83XX_USBPD_CCPSR(port) = 0xff; /* cc connect */ IT83XX_USBPD_CCCSR(port) = 0; /* disable vconn */ @@ -446,6 +445,13 @@ static void it83xx_init(enum usbpd_port port, int role) task_clear_pending_irq(usbpd_ctrl_regs[port].irq); task_enable_irq(usbpd_ctrl_regs[port].irq); USBPD_START(port); + /* + * Disconnect CCs Rd_DB from GND + * NOTE: CCs assert both Rd_5.1k and Rd_DB from USBPD_START() to + * disconnect Rd_DB about 1.5us. + */ + IT83XX_USBPD_CCPSR(port) |= (USBPD_REG_MASK_DISCONNECT_5_1K_CC2_DB | + USBPD_REG_MASK_DISCONNECT_5_1K_CC1_DB); } static void it83xx_select_polarity(enum usbpd_port port, diff --git a/driver/tcpm/it8xxx2.c b/driver/tcpm/it8xxx2.c index 50339393f6..1cfa184a11 100644 --- a/driver/tcpm/it8xxx2.c +++ b/driver/tcpm/it8xxx2.c @@ -750,9 +750,6 @@ static void it83xx_init(enum usbpd_port port, int role) it83xx_set_power_role(port, role); /* Disable vconn: connect cc analog module, disable cc 5v tolerant */ it83xx_enable_vconn(port, 0); - /* Disconnect CC with 5.1K DB resister to GND */ - IT83XX_USBPD_CCPSR(port) |= (USBPD_REG_MASK_DISCONNECT_5_1K_CC2_DB | - USBPD_REG_MASK_DISCONNECT_5_1K_CC1_DB); /* Enable tx done and hard reset detect interrupt */ IT83XX_USBPD_IMR(port) &= ~(USBPD_REG_MASK_MSG_TX_DONE | USBPD_REG_MASK_HARD_RESET_DETECT); @@ -774,6 +771,13 @@ static void it83xx_init(enum usbpd_port port, int role) task_clear_pending_irq(usbpd_ctrl_regs[port].irq); task_enable_irq(usbpd_ctrl_regs[port].irq); USBPD_START(port); + /* + * Disconnect CCs Rd_DB from GND + * NOTE: CCs assert both Rd_5.1k and Rd_DB from USBPD_START() to + * disconnect Rd_DB about 1.5us. + */ + IT83XX_USBPD_CCPSR(port) |= (USBPD_REG_MASK_DISCONNECT_5_1K_CC2_DB | + USBPD_REG_MASK_DISCONNECT_5_1K_CC1_DB); } static int it83xx_tcpm_init(int port) |