summaryrefslogtreecommitdiff
path: root/baseboard
diff options
context:
space:
mode:
authorDiana Z <dzigterman@chromium.org>2018-11-29 14:41:26 -0700
committerchrome-bot <chrome-bot@chromium.org>2018-12-03 12:43:33 -0800
commit90db0f71af1f906a50b90391537410b149cfca3f (patch)
tree061b318bdda3efc30e86b0ece69a2574e8ff907e /baseboard
parent20499e311a9873071014b05817dacc289990ff28 (diff)
downloadchrome-ec-90db0f71af1f906a50b90391537410b149cfca3f.tar.gz
Octopus: allow data role swapping in RO
Since we keep our data role in the BBRAM flags now, it should be safe to allow the EC to perform a data roll swap in RO. This change primarily affects unlocked systems which allow PD communication in RO, and especially affects developers who have software sync disabled and use powered usb dongles for display. BRANCH=octopus BUG=b:116764439 TEST=disabled software sync on a bobba360 and confirmed a powered hub could reliably display, enabled software sync and put the EC into hibernate, waking it with a powered hub, confirming data role swap in RO had no adverse affects or hard resets Change-Id: If56e408afa17c8c9eeeb033d977c25710390fe32 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1355371 Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'baseboard')
-rw-r--r--baseboard/octopus/usb_pd_policy.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/baseboard/octopus/usb_pd_policy.c b/baseboard/octopus/usb_pd_policy.c
index 4c30f5967b..572b9fcdc5 100644
--- a/baseboard/octopus/usb_pd_policy.c
+++ b/baseboard/octopus/usb_pd_policy.c
@@ -46,23 +46,15 @@ int pd_board_checks(void)
int pd_check_data_swap(int port, int data_role)
{
- /*
- * Allow data swap if we are a UFP, otherwise don't allow.
- *
- * When we are still in the Read-Only firmware, avoid swapping roles
- * so we don't jump in RW as a SNK/DFP and potentially confuse the
- * power supply by sending a soft-reset with wrong data role.
- */
- return (data_role == PD_ROLE_UFP) &&
- (system_get_image_copy() != SYSTEM_IMAGE_RO) ? 1 : 0;
+ /* Allow data swap if we are a UFP, otherwise don't allow. */
+ return (data_role == PD_ROLE_UFP);
}
void pd_check_dr_role(int port, int dr_role, int flags)
{
/* If UFP, try to switch to DFP */
if ((flags & PD_FLAGS_PARTNER_DR_DATA) &&
- dr_role == PD_ROLE_UFP &&
- system_get_image_copy() != SYSTEM_IMAGE_RO)
+ dr_role == PD_ROLE_UFP)
pd_request_data_swap(port);
}