John Zhao has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/62723 )
Change subject: soc/intel/common: Configure TCSS access through IOE P2SB ......................................................................
soc/intel/common: Configure TCSS access through IOE P2SB
This change abstracts the TCSS access through IOE P2SB on Meteor Lake.
BUG=b:213574324 TEST=Build platforms coreboot images successfully.
Change-Id: I3302aabfb5f540c41da6359f11376b4202c6310b Signed-off-by: John john.zhao@intel.com --- M src/soc/intel/common/block/tcss/tcss.c 1 file changed, 21 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/23/62723/1
diff --git a/src/soc/intel/common/block/tcss/tcss.c b/src/soc/intel/common/block/tcss/tcss.c index 2531ac3..cace74f 100644 --- a/src/soc/intel/common/block/tcss/tcss.c +++ b/src/soc/intel/common/block/tcss/tcss.c @@ -368,11 +368,28 @@ } }
+static void ioe_tcss_configure_aux_bias_pads_sbi( + const struct typec_aux_bias_pads *pads) +{ + for (size_t i = 0; i < MAX_TYPE_C_PORTS; i++) { + if (pads[i].pad_auxn_dc && pads[i].pad_auxp_dc) { + ioe_p2sb_sbi_write(PID_IOM, IOM_AUX_BIAS_CTRL_PULLUP_OFFSET(i), + calc_bias_ctrl_reg_value(pads[i].pad_auxp_dc)); + ioe_p2sb_sbi_write(PID_IOM, IOM_AUX_BIAS_CTRL_PULLDOWN_OFFSET(i), + calc_bias_ctrl_reg_value(pads[i].pad_auxn_dc)); + } + } +} + static void tcss_configure_aux_bias_pads( const struct typec_aux_bias_pads *pads) { if (CONFIG(SOC_INTEL_COMMON_BLOCK_TCSS_REG_ACCESS_REGBAR)) tcss_configure_aux_bias_pads_regbar(pads); + else if (CONFIG(SOC_INTEL_COMMON_BLOCK_TCSS_REG_ACCESS_SBI)) { + if (CONFIG(SOC_INTEL_COMMON_BLOCK_IOE_P2SB)) + ioe_tcss_configure_aux_bias_pads_sbi(pads); + } else printk(BIOS_ERR, "%s: Error: No TCSS configuration method is selected!\n", __func__); @@ -433,6 +450,10 @@ { if (CONFIG(SOC_INTEL_COMMON_BLOCK_TCSS_REG_ACCESS_REGBAR)) { return REGBAR32(PID_IOM, IOM_CSME_IMR_TBT_STATUS) & TBT_VALID_AUTHENTICATION; + } else if (CONFIG(SOC_INTEL_COMMON_BLOCK_TCSS_REG_ACCESS_SBI)) { + if (CONFIG(SOC_INTEL_COMMON_BLOCK_IOE_P2SB)) + return (ioe_p2sb_sbi_read(PID_IOM, IOM_CSME_IMR_TBT_STATUS) & + TBT_VALID_AUTHENTICATION); } else { printk(BIOS_ERR, "%s: Error: No validation for Thunderbolt authentication!\n", __func__);