summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorli feng <li1.feng@intel.com>2021-07-26 17:42:30 -0700
committerCommit Bot <commit-bot@chromium.org>2021-08-04 17:33:04 +0000
commit9752d7152b8dd0d1f7d59dbcefe8764c56b3409d (patch)
tree10f6715d15c59027955ba38e12bbfc5d894fa848 /common
parentb36278f3f7ca6fb75d624f4a31971c5e4fb1ef25 (diff)
downloadchrome-ec-9752d7152b8dd0d1f7d59dbcefe8764c56b3409d.tar.gz
retimer: move operations to specific TC state
Retimer firmware update operations as below should be handled when PD task is suspended. Move those operations from tc_run() to TC state TC_DISABLED tc_disabled_run(). USB_RETIMER_FW_UPDATE_SET_USB USB_RETIMER_FW_UPDATE_SET_SAFE USB_RETIMER_FW_UPDATE_SET_TBT USB_RETIMER_FW_UPDATE_DISCONNECT BUG=b:193685562 BRANCH=none TEST=Voxel DVT, retimer firmware update Chromium solution, CPFE 13892 OS/Coreboot, PD port 1 NDA, successfully scan retimers. TEST=Voxel DVT, retimer firmware update upstream solution, coreboot includes patches supporting upstream kernel solution, PD port 1 no device attached, successfully scan retimers. Signed-off-by: li feng <li1.feng@intel.com> Change-Id: I4dd0fcfafed362be90182fc8f1ef656495cdc8e3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3055670 Tested-by: Kevin DeRossett <kevin.l.derossett@intel.corp-partner.google.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/usbc/usb_tc_drp_acc_trysrc_sm.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/common/usbc/usb_tc_drp_acc_trysrc_sm.c b/common/usbc/usb_tc_drp_acc_trysrc_sm.c
index 3599415e8e..c56bcd2b81 100644
--- a/common/usbc/usb_tc_drp_acc_trysrc_sm.c
+++ b/common/usbc/usb_tc_drp_acc_trysrc_sm.c
@@ -2101,6 +2101,14 @@ static void tc_disabled_run(const int port)
set_state_tc(port, drp_state[port] == PD_DRP_FORCE_SOURCE ?
TC_UNATTACHED_SRC : TC_UNATTACHED_SNK);
} else {
+ if (IS_ENABLED(CONFIG_USBC_RETIMER_FW_UPDATE)) {
+ if (TC_CHK_FLAG(port,
+ TC_FLAGS_USB_RETIMER_FW_UPDATE_LTD_RUN)) {
+ TC_CLR_FLAG(port,
+ TC_FLAGS_USB_RETIMER_FW_UPDATE_LTD_RUN);
+ usb_retimer_fw_update_process_op_cb(port);
+ }
+ }
tc_pause_event_loop(port);
}
}
@@ -3859,14 +3867,6 @@ void tc_run(const int port)
}
if (IS_ENABLED(CONFIG_USBC_RETIMER_FW_UPDATE)) {
- if (TC_CHK_FLAG(port, TC_FLAGS_SUSPENDED) &&
- TC_CHK_FLAG(port,
- TC_FLAGS_USB_RETIMER_FW_UPDATE_LTD_RUN)) {
- TC_CLR_FLAG(port,
- TC_FLAGS_USB_RETIMER_FW_UPDATE_LTD_RUN);
- usb_retimer_fw_update_process_op_cb(port);
- }
-
if (TC_CHK_FLAG(port, TC_FLAGS_USB_RETIMER_FW_UPDATE_RUN)) {
TC_CLR_FLAG(port, TC_FLAGS_USB_RETIMER_FW_UPDATE_RUN);
usb_retimer_fw_update_process_op_cb(port);