Skip to content

Commit 9dab00e

Browse files
abelvesavinodkoul
authored andcommitted
phy: qcom: qmp-pcie: Add Gen4 4-lanes mode for X1E80100
The sixth PCIe controller on X1E80100 can be used in either 4-lanes mode or 2-lanes mode. Add the configuration and compatible for the 4-lane mode. Reviewed-by: Johan Hovold <[email protected]> Signed-off-by: Abel Vesa <[email protected]> Tested-by: Johan Hovold <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 0c5f4d2 commit 9dab00e

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

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

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,6 +1242,10 @@ static const struct qmp_phy_init_tbl x1e80100_qmp_gen4x2_pcie_serdes_tbl[] = {
12421242
QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_VCO_DC_LEVEL_CTRL, 0x0f),
12431243
};
12441244

1245+
static const struct qmp_phy_init_tbl x1e80100_qmp_gen4x4_pcie_serdes_4ln_tbl[] = {
1246+
QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_BIAS_EN_CLK_BUFLR_EN, 0x1c),
1247+
};
1248+
12451249
static const struct qmp_phy_init_tbl x1e80100_qmp_gen4x2_pcie_ln_shrd_tbl[] = {
12461250
QMP_PHY_INIT_CFG(QSERDES_V6_LN_SHRD_RXCLK_DIV2_CTRL, 0x01),
12471251
QMP_PHY_INIT_CFG(QSERDES_V6_LN_SHRD_DFE_DAC_ENABLE1, 0x88),
@@ -3645,6 +3649,41 @@ static const struct qmp_phy_cfg x1e80100_qmp_gen4x2_pciephy_cfg = {
36453649
.ln_shrd = x1e80100_qmp_gen4x2_pcie_ln_shrd_tbl,
36463650
.ln_shrd_num = ARRAY_SIZE(x1e80100_qmp_gen4x2_pcie_ln_shrd_tbl),
36473651
},
3652+
3653+
.reset_list = sdm845_pciephy_reset_l,
3654+
.num_resets = ARRAY_SIZE(sdm845_pciephy_reset_l),
3655+
.vreg_list = sm8550_qmp_phy_vreg_l,
3656+
.num_vregs = ARRAY_SIZE(sm8550_qmp_phy_vreg_l),
3657+
.regs = pciephy_v6_regs_layout,
3658+
3659+
.pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL,
3660+
.phy_status = PHYSTATUS_4_20,
3661+
.has_nocsr_reset = true,
3662+
};
3663+
3664+
static const struct qmp_phy_cfg x1e80100_qmp_gen4x4_pciephy_cfg = {
3665+
.lanes = 4,
3666+
3667+
.offsets = &qmp_pcie_offsets_v6_20,
3668+
3669+
.tbls = {
3670+
.serdes = x1e80100_qmp_gen4x2_pcie_serdes_tbl,
3671+
.serdes_num = ARRAY_SIZE(x1e80100_qmp_gen4x2_pcie_serdes_tbl),
3672+
.tx = x1e80100_qmp_gen4x2_pcie_tx_tbl,
3673+
.tx_num = ARRAY_SIZE(x1e80100_qmp_gen4x2_pcie_tx_tbl),
3674+
.rx = x1e80100_qmp_gen4x2_pcie_rx_tbl,
3675+
.rx_num = ARRAY_SIZE(x1e80100_qmp_gen4x2_pcie_rx_tbl),
3676+
.pcs = x1e80100_qmp_gen4x2_pcie_pcs_tbl,
3677+
.pcs_num = ARRAY_SIZE(x1e80100_qmp_gen4x2_pcie_pcs_tbl),
3678+
.pcs_misc = x1e80100_qmp_gen4x2_pcie_pcs_misc_tbl,
3679+
.pcs_misc_num = ARRAY_SIZE(x1e80100_qmp_gen4x2_pcie_pcs_misc_tbl),
3680+
.ln_shrd = x1e80100_qmp_gen4x2_pcie_ln_shrd_tbl,
3681+
.ln_shrd_num = ARRAY_SIZE(x1e80100_qmp_gen4x2_pcie_ln_shrd_tbl),
3682+
},
3683+
3684+
.serdes_4ln_tbl = x1e80100_qmp_gen4x4_pcie_serdes_4ln_tbl,
3685+
.serdes_4ln_num = ARRAY_SIZE(x1e80100_qmp_gen4x4_pcie_serdes_4ln_tbl),
3686+
36483687
.reset_list = sdm845_pciephy_reset_l,
36493688
.num_resets = ARRAY_SIZE(sdm845_pciephy_reset_l),
36503689
.vreg_list = sm8550_qmp_phy_vreg_l,
@@ -4415,6 +4454,9 @@ static const struct of_device_id qmp_pcie_of_match_table[] = {
44154454
}, {
44164455
.compatible = "qcom,x1e80100-qmp-gen4x2-pcie-phy",
44174456
.data = &x1e80100_qmp_gen4x2_pciephy_cfg,
4457+
}, {
4458+
.compatible = "qcom,x1e80100-qmp-gen4x4-pcie-phy",
4459+
.data = &x1e80100_qmp_gen4x4_pciephy_cfg,
44184460
},
44194461
{ },
44204462
};

0 commit comments

Comments
 (0)