summaryrefslogtreecommitdiff
path: root/include/usb_tc_sm.h
diff options
context:
space:
mode:
authorli feng <li1.feng@intel.com>2020-12-14 19:58:51 -0800
committerCommit Bot <commit-bot@chromium.org>2021-02-05 02:05:44 +0000
commit0e5eda0e47524c6a5ceb8de28b2de23ba4949b14 (patch)
tree4f8e8eabec1ce24bc2c633cea1d9859fd5354449 /include/usb_tc_sm.h
parent829aa191a6e2b5b51e7d1fe9a5cb30c233dc210a (diff)
downloadchrome-ec-0e5eda0e47524c6a5ceb8de28b2de23ba4949b14.tar.gz
retimer: support retimer firmware update
To support AP to update firmware during boot up, one byte EC RAM is allocated for AP <-> EC communication. AP queries PD port/requests EC to perform operations via EC_CMD_ACPI_WRITE; and fetches result from EC via EC_CMD_ACPI_READ. The flow is: 1. AP queries EC PD ports which port supports retimer firmware update. 2. AP queries current MUX. 3. a) If no device attached, AP requests EC to suspend PD task of the port. Then AP requests EC to set MUX to USB mode, Safe mode, TBT mode. After entering TBT mode, the OS can either enumerate the retimers or do firmware update on the enumerated retimers. Once done, AP requests EC to disconnect MUX and resume PD task. 3. b) If device attached, AP moves on as usual. Retimer firmware update is not performed. BUG=b:162528867 BRANCH=none TEST=Tested NDA case on Voxel board, together with coreboot and kernel changes. Coreboot changes are merged. Kernel patches list is: https://chromium-review.googlesource.com/c/chromiumos/ third_party/kernel/+/2670719 After power up, host scans retimers, in sysfs localhost ~ # ls /sys/bus/thunderbolt/devices/ 0-0 0-0:1.1 0-0:3.1 domain0 On PD port 1, manually update retimer firmware. Copy firmware to nvm_non_active1/nvmem, then authenticate it. Host starts flow to update firmware. After it's done, PD port 1 resumes. Hotplug DP dongle/TBT device, devices should function fully. TEST=Tested DA cases on Voxel board, together with coreboot and kernel changes. USB4/TBT devices function as usual. Signed-off-by: li feng <li1.feng@intel.com> Change-Id: Ie976e75f892d5caf48a948598a058a4f42e07eb3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2594492 Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'include/usb_tc_sm.h')
-rw-r--r--include/usb_tc_sm.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/usb_tc_sm.h b/include/usb_tc_sm.h
index d01cc900a0..f29015b015 100644
--- a/include/usb_tc_sm.h
+++ b/include/usb_tc_sm.h
@@ -372,6 +372,24 @@ const char *tc_get_current_state(int port);
*/
uint32_t tc_get_flags(int port);
+/**
+ * USB retimer firmware update set run flag
+ * Setting this flag indicates firmware update operations can be
+ * processed unconditionally.
+ *
+ * @param port USB-C port number
+ */
+void tc_usb_firmware_fw_update_run(int port);
+
+/**
+ * USB retimer firmware update set limited run flag
+ * Setting this flag indicates firmware update operations can be
+ * processed under limitation: PD task has to be suspended.
+ *
+ * @param port USB-C port number
+ */
+void tc_usb_firmware_fw_update_limited_run(int port);
+
#ifdef CONFIG_USB_CTVPD
/**