Skip to content

Commit ebf198f

Browse files
ziyuezhang-123vinodkoul
authored andcommitted
phy: qcom-qmp-pcie: add dual lane PHY support for QCS8300
The PCIe Gen4x2 PHY for qcs8300 has a lot of difference with sa8775p. So the qcs8300_qmp_gen4x2_pcie_rx_alt_tbl for qcs8300 is added. Reviewed-by: Dmitry Baryshkov <[email protected]> Signed-off-by: Ziyue Zhang <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent e46e59b commit ebf198f

File tree

1 file changed

+89
-0
lines changed

1 file changed

+89
-0
lines changed

drivers/phy/qualcomm/phy-qcom-qmp-pcie.c

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,58 @@ static const struct qmp_phy_init_tbl qcs615_pcie_pcs_tbl[] = {
805805
QMP_PHY_INIT_CFG(QPHY_V2_PCS_TXDEEMPH_M3P5DB_V0, 0xe),
806806
};
807807

808+
static const struct qmp_phy_init_tbl qcs8300_qmp_gen4x2_pcie_rx_alt_tbl[] = {
809+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_UCDR_PI_CONTROLS, 0x16),
810+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_DFE_CTLE_POST_CAL_OFFSET, 0x38),
811+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MODE_RATE_0_1_B0, 0x9b),
812+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MODE_RATE_0_1_B1, 0xb0),
813+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MODE_RATE_0_1_B2, 0xd2),
814+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MODE_RATE_0_1_B3, 0xf0),
815+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MODE_RATE_0_1_B4, 0x42),
816+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MODE_RATE_0_1_B5, 0x00),
817+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MODE_RATE_0_1_B6, 0x20),
818+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MODE_RATE2_B0, 0x9b),
819+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MODE_RATE2_B1, 0xfb),
820+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MODE_RATE2_B2, 0xd2),
821+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MODE_RATE2_B3, 0xec),
822+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MODE_RATE2_B4, 0x43),
823+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MODE_RATE2_B5, 0xdd),
824+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MODE_RATE2_B6, 0x0d),
825+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MODE_RATE3_B0, 0xf3),
826+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MODE_RATE3_B1, 0xf8),
827+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MODE_RATE3_B2, 0xec),
828+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MODE_RATE3_B3, 0xd6),
829+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MODE_RATE3_B4, 0x83),
830+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MODE_RATE3_B5, 0xf5),
831+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MODE_RATE3_B6, 0x5e),
832+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_PHPRE_CTRL, 0x20),
833+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_AUX_DATA_THRESH_BIN_RATE_0_1, 0x3f),
834+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_AUX_DATA_THRESH_BIN_RATE_2_3, 0x37),
835+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_DFE_3, 0x00),
836+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MARG_COARSE_THRESH1_RATE3, 0x1f),
837+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MARG_COARSE_THRESH2_RATE3, 0x1f),
838+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MARG_COARSE_THRESH3_RATE3, 0x1f),
839+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MARG_COARSE_THRESH4_RATE3, 0x1f),
840+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MARG_COARSE_THRESH5_RATE3, 0x1f),
841+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MARG_COARSE_THRESH6_RATE3, 0x1f),
842+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MARG_COARSE_THRESH1_RATE210, 0x1f),
843+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MARG_COARSE_THRESH2_RATE210, 0x1f),
844+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_MARG_COARSE_THRESH3_RATE210, 0x1f),
845+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_Q_PI_INTRINSIC_BIAS_RATE32, 0x09),
846+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_UCDR_FO_GAIN_RATE2, 0x0c),
847+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_UCDR_FO_GAIN_RATE3, 0x08),
848+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_UCDR_SO_GAIN_RATE3, 0x04),
849+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_VGA_CAL_CNTRL1, 0x04),
850+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_VGA_CAL_MAN_VAL, 0x08),
851+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_EQU_ADAPTOR_CNTRL4, 0x0b),
852+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_EQ_OFFSET_ADAPTOR_CNTRL1, 0x7c),
853+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_IDAC_SAOFFSET, 0x10),
854+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_DFE_DAC_ENABLE1, 0x00),
855+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_GM_CAL, 0x05),
856+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_TX_ADAPT_POST_THRESH1, 0x00),
857+
QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_TX_ADAPT_POST_THRESH2, 0x1f),
858+
};
859+
808860
static const struct qmp_phy_init_tbl sdm845_qmp_pcie_serdes_tbl[] = {
809861
QMP_PHY_INIT_CFG(QSERDES_V3_COM_BIAS_EN_CLKBUFLR_EN, 0x14),
810862
QMP_PHY_INIT_CFG(QSERDES_V3_COM_CLK_SELECT, 0x30),
@@ -3336,6 +3388,40 @@ static const struct qmp_phy_cfg qcs615_pciephy_cfg = {
33363388
.phy_status = PHYSTATUS,
33373389
};
33383390

3391+
static const struct qmp_phy_cfg qcs8300_qmp_gen4x2_pciephy_cfg = {
3392+
.lanes = 2,
3393+
.offsets = &qmp_pcie_offsets_v5_20,
3394+
3395+
.tbls = {
3396+
.serdes = sa8775p_qmp_gen4x2_pcie_serdes_alt_tbl,
3397+
.serdes_num = ARRAY_SIZE(sa8775p_qmp_gen4x2_pcie_serdes_alt_tbl),
3398+
.tx = sa8775p_qmp_gen4_pcie_tx_tbl,
3399+
.tx_num = ARRAY_SIZE(sa8775p_qmp_gen4_pcie_tx_tbl),
3400+
.rx = qcs8300_qmp_gen4x2_pcie_rx_alt_tbl,
3401+
.rx_num = ARRAY_SIZE(qcs8300_qmp_gen4x2_pcie_rx_alt_tbl),
3402+
.pcs = sa8775p_qmp_gen4x2_pcie_pcs_alt_tbl,
3403+
.pcs_num = ARRAY_SIZE(sa8775p_qmp_gen4x2_pcie_pcs_alt_tbl),
3404+
.pcs_misc = sa8775p_qmp_gen4_pcie_pcs_misc_tbl,
3405+
.pcs_misc_num = ARRAY_SIZE(sa8775p_qmp_gen4_pcie_pcs_misc_tbl),
3406+
},
3407+
3408+
.tbls_rc = &(const struct qmp_phy_cfg_tbls) {
3409+
.serdes = sa8775p_qmp_gen4x2_pcie_rc_serdes_alt_tbl,
3410+
.serdes_num = ARRAY_SIZE(sa8775p_qmp_gen4x2_pcie_rc_serdes_alt_tbl),
3411+
.pcs_misc = sa8775p_qmp_gen4_pcie_rc_pcs_misc_tbl,
3412+
.pcs_misc_num = ARRAY_SIZE(sa8775p_qmp_gen4_pcie_rc_pcs_misc_tbl),
3413+
},
3414+
3415+
.reset_list = sdm845_pciephy_reset_l,
3416+
.num_resets = ARRAY_SIZE(sdm845_pciephy_reset_l),
3417+
.vreg_list = qmp_phy_vreg_l,
3418+
.num_vregs = ARRAY_SIZE(qmp_phy_vreg_l),
3419+
.regs = pciephy_v5_regs_layout,
3420+
3421+
.pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL,
3422+
.phy_status = PHYSTATUS_4_20,
3423+
};
3424+
33393425
static const struct qmp_phy_cfg sdm845_qmp_pciephy_cfg = {
33403426
.lanes = 1,
33413427

@@ -4891,6 +4977,9 @@ static const struct of_device_id qmp_pcie_of_match_table[] = {
48914977
}, {
48924978
.compatible = "qcom,qcs615-qmp-gen3x1-pcie-phy",
48934979
.data = &qcs615_pciephy_cfg,
4980+
}, {
4981+
.compatible = "qcom,qcs8300-qmp-gen4x2-pcie-phy",
4982+
.data = &qcs8300_qmp_gen4x2_pciephy_cfg,
48944983
}, {
48954984
.compatible = "qcom,sa8775p-qmp-gen4x2-pcie-phy",
48964985
.data = &sa8775p_qmp_gen4x2_pciephy_cfg,

0 commit comments

Comments
 (0)