Commit Graph

8 Commits

Author SHA1 Message Date
Scott
d862dd0598 pd: Enable detection of VBUS via the TCPM/TCPCI interface
Modified TCPC layer to utilize the Power_Status and Power_Status_Mask
registers. VBUS status is stored in Power_Status and when a change
is detected, it's communicated to the TCPM via the ALERT# line.

BUG=chrome-os-partner:43440
BRANCH=none
TEST=Tested the feature on Glados and Oak connecting to both Ziger
and Samus. Verfied that VBUS status is communicated via the TCPCI and
that PD contracts are established without using the VBUS_WAKE GPIO
lines on Glados and Oak.

Change-Id: Ie5aa32eecc887f3cb00880a285f1e710b7064384
Signed-off-by: Scott Collyer <scollyer@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/289931
Reviewed-by: Rong Chang <rongchang@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Rong Chang <rongchang@chromium.org>
Tested-by: Rong Chang <rongchang@chromium.org>
2015-08-21 08:10:03 +00:00
Alec Berg
64bbfe253c tcpc: add RX message buffer and don't send goodCRC when full
Add RX message buffer to the TCPC (currently two deep). If
the buffer is full and message is received, don't send goodCRC.

BUG=chrome-os-partner:43482
BRANCH=none
TEST=tested on glados. saw that with back to back PD
packets, we send goodCRC to both packets and process them in
order, taking about 7ms per packet. also tested buffer size
of 1 and verified that with back to back PD packets, we don't
send goodCRC to second packet.

Change-Id: I7f44b3c3a186ae61be8ca03017deec6e6b6c6f9f
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/289005
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2015-08-01 21:05:30 +00:00
Alec Berg
e85a3fa0d4 tcpc: move tcpc initialized bit into error status register
Move TCPC initialized bit from alert register into error status
register. This is not part of the TCPCI spec, but the existing
code creates a bug that if TCPM reboots without TCPC also rebooting,
then we will never get the initialized alert from TCPC since
it has already happened, so the TCPM will loop indefinitely
waiting for TCPC to be ready. This fixes the bug by moving the
bit to a status register, which is more appropriate.

BUG=none
BRANCH=none
TEST=load on glados, reboot and make sure TCPM see's that the
TCPC is initialized.

Change-Id: I8e96b59031e01a4faec8f519727df1fa95f498bc
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/288342
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2015-07-24 21:54:18 +00:00
Alec Berg
b339fdf6c1 tcpc: update TCPCI register map
Update TCPCI register map to match version 0.64 of spec.

BUG=none
BRANCH=none
TEST=load on glados, test can make power contract with zinger.

Change-Id: I62e6428b5836aeb018fa7b4f38b6f3b419aed0c6
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/288341
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2015-07-24 21:54:12 +00:00
Alec Berg
a11ffa6c93 tcpc: use initialization complete alert bit to signal readiness
Use the new TCPC initialization complete bit in alert register to
signal TCPC readiness instead of checking for USB VID to be set.

BUG=none
BRANCH=none
TEST=load on glados, make sure we can boot without battery.

Change-Id: I4b25c973ece0de6dd3f419c5901cff1d8d05ed95
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/282593
Reviewed-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2015-06-30 19:02:57 +00:00
Alec Berg
4114b7f1fe tcpc: update tcpci registers to latest spec
Update TCPCI registers to version 0.62 of PD Interface
specification.

BUG=none
BRANCH=none
TEST=test on glados and samus

Change-Id: I57338b385123371e90f3b79b84e652af15be1bf1
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/282067
Reviewed-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2015-06-30 17:18:31 +00:00
Alec Berg
82ec2510a3 pd: refactor tcpm and move alert function to tcpm driver
Refactor the tcpm/tcpc split such that the tcpm driver implements
the alert functionality since it may be unique for different tcpc
chips.

BUG=chrome-os-partner:41842
BRANCH=none
TEST=make -j buildall. run on samus and glados.

Change-Id: I23f2d7f8627d5337b8d001a09bf27622be24fe33
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/281631
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2015-06-30 17:18:25 +00:00
Alec Berg
cbb79c2558 pd: create driver/tcpm/ to hold TCPM drivers
Create driver/tcpm/ folder to hold TCPM drivers. Currently the
two drivers are a stub driver which is used when TCPM and TCPC
are on the same MCU and can make direct calls between the two
and the TCPCI driver which implements the standard TCPCI protocol.

BUG=chrome-os-partner:41842
BRANCH=none
TEST=make -j buildall

Change-Id: Ie4d9b36eb33155254f8b87b83861f98a7a80693a
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/281630
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2015-06-24 23:13:28 +00:00