From f22925531a49127dca6b43b738e4c006fa33ff11 Mon Sep 17 00:00:00 2001 From: Ayushee Date: Fri, 28 Aug 2020 14:21:18 -0700 Subject: 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 Change-Id: I661aa4630b42fbaa136ff3855c4f70e3dee61546 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2382634 Reviewed-by: Keith Short --- baseboard/volteer/baseboard.h | 1 + baseboard/volteer/usb_pd_policy.c | 11 +---------- 2 files changed, 2 insertions(+), 10 deletions(-) (limited to 'baseboard') diff --git a/baseboard/volteer/baseboard.h b/baseboard/volteer/baseboard.h index 772b34e694..132ed7375b 100644 --- a/baseboard/volteer/baseboard.h +++ b/baseboard/volteer/baseboard.h @@ -158,6 +158,7 @@ #define CONFIG_USB_POWER_DELIVERY #define CONFIG_USB_PD_ALT_MODE #define CONFIG_USB_PD_ALT_MODE_DFP +#define CONFIG_USB_PD_ALT_MODE_UFP #define CONFIG_USB_PD_DISCHARGE_PPC #define CONFIG_USB_PD_DUAL_ROLE #define CONFIG_USB_PD_TCPC_RUNTIME_CONFIG diff --git a/baseboard/volteer/usb_pd_policy.c b/baseboard/volteer/usb_pd_policy.c index 2b4cd162aa..670654198f 100644 --- a/baseboard/volteer/usb_pd_policy.c +++ b/baseboard/volteer/usb_pd_policy.c @@ -76,8 +76,6 @@ int board_vbus_source_enabled(int port) /* Responses specifically for the enablement of TBT mode in the role of UFP */ #define OPOS_TBT 1 -static union tbt_dev_mode_enter_cmd - ufp_enter_mode[CONFIG_USB_PD_PORT_MAX_COUNT]; static const union tbt_mode_resp_device vdo_tbt_modes[1] = { { @@ -181,14 +179,7 @@ static int svdm_tbt_compat_response_enter_mode( */ if ((mux_state & USB_PD_MUX_USB_ENABLED) || (mux_state & USB_PD_MUX_SAFE_MODE)) { - - /* - * TODO(b:157163664): set retimer config for UFP - * Save TBT3 SOP VDO from request so retimer can use it - */ - ufp_enter_mode[port] = - (union tbt_dev_mode_enter_cmd)payload[1]; - + pd_ufp_set_enter_mode(port, payload); set_tbt_compat_mode_ready(port); CPRINTS("UFP Enter TBT mode"); return 1; /* ACK */ -- cgit v1.2.1