diff options
author | Ayushee <ayushee.shah@intel.com> | 2020-08-28 14:21:18 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-01-07 19:16:10 +0000 |
commit | f22925531a49127dca6b43b738e4c006fa33ff11 (patch) | |
tree | e35639ac48e59aad7ddde3e6c62d5f22d71d8e80 /common | |
parent | 840d7258423fced9538af206c2f13f8cd5600b59 (diff) | |
download | chrome-ec-f22925531a49127dca6b43b738e4c006fa33ff11.tar.gz |
BB retimer: Set UFP mode of BB retimer
This CL enables getting the enter mode information received from DFP
and sets the following BB retimer bits accordingly.
Bit 2: RE_TIMER_DRIVER
Bit 18: CABLE_TYPE
Bit 19: VPRO_DOCK_DETECTED
Bit 20: TBT_ACTIVE_LINK_TRAINING
Bit 22: ACTIVE/PASSIVE
Bits 27-25: TBT Cable speed
Bits 29-28: TBT_GEN_SUPPORT
BUG=b:157163664
BRANCH=None
TEST=Tested with volteer as UFP, able to set the retimer bits
Signed-off-by: Ayushee <ayushee.shah@intel.com>
Change-Id: I661aa4630b42fbaa136ff3855c4f70e3dee61546
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2382634
Reviewed-by: Keith Short <keithshort@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/build.mk | 1 | ||||
-rw-r--r-- | common/usb_pd_alt_mode_ufp.c | 22 |
2 files changed, 23 insertions, 0 deletions
diff --git a/common/build.mk b/common/build.mk index 9b20fc1369..1acc35347b 100644 --- a/common/build.mk +++ b/common/build.mk @@ -162,6 +162,7 @@ common-$(CONFIG_USB_PD_HOST_CMD)+=usb_pd_host_cmd.o common-$(CONFIG_USB_PD_CONSOLE_CMD)+=usb_pd_console_cmd.o endif common-$(CONFIG_USB_PD_ALT_MODE_DFP)+=usb_pd_alt_mode_dfp.o +common-$(CONFIG_USB_PD_ALT_MODE_UFP)+=usb_pd_alt_mode_ufp.o common-$(CONFIG_USB_PD_LOGGING)+=event_log.o pd_log.o common-$(CONFIG_USB_PD_TCPC)+=usb_pd_tcpc.o common-$(CONFIG_USB_UPDATE)+=usb_update.o update_fw.o diff --git a/common/usb_pd_alt_mode_ufp.c b/common/usb_pd_alt_mode_ufp.c new file mode 100644 index 0000000000..3db60166d2 --- /dev/null +++ b/common/usb_pd_alt_mode_ufp.c @@ -0,0 +1,22 @@ +/* Copyright 2021 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + * + * Alternate Mode Upstream Facing Port (UFP) USB-PD module. + */ +#include "usb_pd.h" +#include "usb_tbt_alt_mode.h" + +static uint32_t ufp_enter_mode[CONFIG_USB_PD_PORT_MAX_COUNT]; + +/* Save port partner's enter mode message */ +void pd_ufp_set_enter_mode(int port, uint32_t *payload) +{ + ufp_enter_mode[port] = payload[1]; +} + +/* Return port partner's enter mode message */ +uint32_t pd_ufp_get_enter_mode(int port) +{ + return ufp_enter_mode[port]; +} |