From 4519c0d8105d32f2ede16aa4b0febddd2cd9ecfe Mon Sep 17 00:00:00 2001 From: Caveh Jalali Date: Wed, 17 May 2023 12:50:40 -0700 Subject: [PATCH] mb/google/rex: Set AUX orientation at SoC to follow cable for anx7452 This configures the SoC to flip the orientation of the AUX pins to follow the orientation of the cable when using the anx7452 retimer. This is necessary when there is no external retimer/mux or the retimer/mux does not implement the flip. The anx7452 retimer does not appear to support this feature, so let the SoC do the flip. BUG=b:267589042,b:281006910 TEST=verified DP-ALT mode works on rex using both cable orientations Change-Id: Ibb9f442d2afd81fb5dde4bca97c15457837f9f4a Signed-off-by: Caveh Jalali Reviewed-on: https://review.coreboot.org/c/coreboot/+/75827 Reviewed-by: Eric Lai Reviewed-by: Subrata Banik Reviewed-by: Kapil Porwal Reviewed-by: Tarun Tuli Tested-by: build bot (Jenkins) Reviewed-by: Nick Vaccaro --- src/mainboard/google/rex/variants/rex0/variant.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/mainboard/google/rex/variants/rex0/variant.c b/src/mainboard/google/rex/variants/rex0/variant.c index b259636d66..032eef97c6 100644 --- a/src/mainboard/google/rex/variants/rex0/variant.c +++ b/src/mainboard/google/rex/variants/rex0/variant.c @@ -6,6 +6,10 @@ #include #include +#define TCP2_AUX_SHIFT 4 +#define TCP_AUX_MASK 0x03 +#define TCP_AUX_FOLLOW_CC1 0x01 + const char *get_wifi_sar_cbfs_filename(void) { return "wifi_sar_0.hex"; @@ -26,4 +30,14 @@ void variant_update_soc_chip_config(struct soc_intel_meteorlake_config *config) { config->cnvi_bt_audio_offload = fw_config_probe(FW_CONFIG(AUDIO, MAX98360_ALC5682I_I2S)); + + if (fw_config_probe(FW_CONFIG(DB_USB, USB4_ANX7452)) || + fw_config_probe(FW_CONFIG(DB_USB, USB4_ANX7452_V2))) { + /* + * Configure TCP2 for + * "SBU orientation not handled by external retimer" + */ + config->tcss_aux_ori &= ~(TCP_AUX_MASK << TCP2_AUX_SHIFT); + config->tcss_aux_ori |= TCP_AUX_FOLLOW_CC1 << TCP2_AUX_SHIFT; + } }