Currently, if a board supports dual role power ports, the EC will
briefly apply Rp resistors on the CC lines upon initializing the PD
tasks. This was put in place such that the partner port is a known
state. In the case of an external PD charger, the presence of the Rp
will cause the charger to stop sourcing VBUS. We only apply the pull up
for reset cases where the EC did not just loose power (e.g. power on
reset or brownout).
This however presents a problem when booting off of AC only. If a user
types 'reboot ap-off', there will be an extra reset because VBUS is
dropped and the "ap-off" flag will be lost.
This commit simply checks to see if there is an explicit contract in
place for a port. If an explicit contract is in place and PD
communications are allowed, we will not apply the Rp resistors. The PD
state machine will then attempt to send a SoftReset to the port partner
in order to reset the PD protocol layer. If an explicit contract is not
in place, or if PD communications are not allowed, the Rp's will be
asserted briefly as before.
BUG=b:72838807,b:35587129,chromium:712746
BRANCH=None
TEST=Flash zoombini; Remove battery and plug in just AC; Enter `reboot
ap-off` and verify that AP remains off in the subsequent boot and there
is no extra reset.
TEST=Make zoombini locked. Have a PD contract in RW, reboot to RO and
verify that VBUS is dropped from a PD charger.
TEST=Repeat test on meowth.
CQ-DEPEND=CL:905922
Change-Id: Ie2e3fe5b6b318e166b2a42dfa3241646369ec571
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/905390
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>