diff options
author | Ruibin Chang <Ruibin.Chang@ite.com.tw> | 2018-07-26 11:39:14 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-07-31 07:15:43 -0700 |
commit | fc2281cc2d3dce0476505f56e76a24059d74009f (patch) | |
tree | 5c974ddaaa25e04ed395f70672f040a4887ce89d /driver | |
parent | f9dd3fb7a8c0985c2798dbf4163951dd427ec063 (diff) | |
download | chrome-ec-fc2281cc2d3dce0476505f56e76a24059d74009f.tar.gz |
tcpm:it83xx:correct it8320 message ID
A particular dongle plug-in pd port after second times
didn't connect, or sometimes it could connect pd port but still has
no GoodCRC error situation. We found that HW automatically generated
message ID doesn't reset in start up state. And because this dongle
doesn't store the received MsgID, the GoodCRC MsgID of dongle
respond does not match we sending.
After soft reset state, the SRC_Capability MsgID which HW generate
automatically is 1 not 0. And the GoodCRC MsgID of dongle respond
doesn't match we sending, so we send hard reset after soft reset retry.
Finally we disable HW auto generate header, and FW manually set
register to solve both issue.
BUG=b:111945600
BRANCH=none
TEST=Dongle hot-pluggin on Bx and Dx, message ID will reset
in start up state when connect and execute soft reset.
Change-Id: I6592d2397b486249ca38821bb86a2569aa9117b0
Signed-off-by: Ruibin Chang <Ruibin.Chang@ite.com.tw>
Reviewed-on: https://chromium-review.googlesource.com/1152341
Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'driver')
-rw-r--r-- | driver/tcpm/it83xx.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/driver/tcpm/it83xx.c b/driver/tcpm/it83xx.c index 2a46c18cbf..258ab78c87 100644 --- a/driver/tcpm/it83xx.c +++ b/driver/tcpm/it83xx.c @@ -128,16 +128,17 @@ static int it83xx_rx_data(enum usbpd_port port, int *head, uint32_t *buf) static enum tcpc_transmit_complete it83xx_tx_data( enum usbpd_port port, enum tcpm_transmit_type type, - uint8_t msg_type, - uint8_t length, + uint16_t header, const uint32_t *buf) { int r; uint32_t evt; + uint8_t length = PD_HEADER_CNT(header); + + /* set message header */ + IT83XX_USBPD_TMHLR(port) = (uint8_t)header; + IT83XX_USBPD_TMHHR(port) = (header >> 8); - /* set message type */ - IT83XX_USBPD_MTSR0(port) = - (IT83XX_USBPD_MTSR0(port) & ~0x1f) | (msg_type & 0xf); /* * SOP type bit[6~4]: * on bx version and before: @@ -286,8 +287,8 @@ static void it83xx_init(enum usbpd_port port, int role) { /* bit7: Reload CC parameter setting. */ IT83XX_USBPD_CCPSR0(port) |= (1 << 7); - /* reset */ - IT83XX_USBPD_GCR(port) = 0; + /* reset and disable HW auto generate message header */ + IT83XX_USBPD_GCR(port) = (1 << 5); USBPD_SW_RESET(port); /* set SOP: receive SOP message only. * bit[7]: SOP" support enable. @@ -498,8 +499,7 @@ static int it83xx_tcpm_transmit(int port, case TCPC_TX_SOP_DEBUG_PRIME_PRIME: status = it83xx_tx_data(port, type, - PD_HEADER_TYPE(header), - PD_HEADER_CNT(header), + header, data); break; case TCPC_TX_BIST_MODE_2: |