summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAseda Aboagye <aaboagye@google.com>2018-10-30 09:45:13 -0700
committerCommit Bot <commit-bot@chromium.org>2019-07-18 09:31:17 +0000
commita6c0f370a7fe26d3d7ac1fdc7b3fe092f9bd2b5f (patch)
tree231829c8420d0dd53bc3f62be74b65dec8f38651
parent75b9e4032d757d1429d43b611b8c72353cc15551 (diff)
downloadchrome-ec-a6c0f370a7fe26d3d7ac1fdc7b3fe092f9bd2b5f.tar.gz
nocturne: Only source 5V when chipset is on.
The power rail for the 5V used for sourcing is not available while the chipset is off. Therefore pd_set_power_supply_ready() should return an error if chipset is off. BUG=b:118646299 BRANCH=firmware-nocturne-10984.B TEST=Flash nocturne; plug in a USB Type-C ethernet adapter, run `dut-control power_state:rec` and verify that VBUS is present at the insert screen. TEST=Repeat the above test 20 times and verify that it always succeeds. Change-Id: Ie675d862dfbbe1e1ce08f6b203008ee784eb8ede Signed-off-by: Aseda Aboagye <aaboagye@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/1307699 Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> (cherry picked from commit b6db88f25366a4519ad45d4b54e91cb40e7ea7fb) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1708266 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--board/nocturne/usb_pd_policy.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/board/nocturne/usb_pd_policy.c b/board/nocturne/usb_pd_policy.c
index 8e2c06bd61..1ee6b8a3b6 100644
--- a/board/nocturne/usb_pd_policy.c
+++ b/board/nocturne/usb_pd_policy.c
@@ -149,6 +149,10 @@ int pd_set_power_supply_ready(int port)
if (rv)
return rv;
+ /* The 5V rail used for sourcing is not powered when the AP is off. */
+ if (chipset_in_state(CHIPSET_STATE_ANY_OFF))
+ return EC_ERROR_NOT_POWERED;
+
/* Provide Vbus. */
rv = ppc_vbus_source_enable(port, 1);
if (rv)