Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <johan+linaro@kernel.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Tested-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20240823-x1e80100-phy-add-gen4x4-v3-2-b7765631ca01@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Abel Vesa and committed by
Vinod Koul
9dab00ee 0c5f4d23

+42
+42
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
··· 1242 1242 QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_VCO_DC_LEVEL_CTRL, 0x0f), 1243 1243 }; 1244 1244 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 + 1245 1249 static const struct qmp_phy_init_tbl x1e80100_qmp_gen4x2_pcie_ln_shrd_tbl[] = { 1246 1250 QMP_PHY_INIT_CFG(QSERDES_V6_LN_SHRD_RXCLK_DIV2_CTRL, 0x01), 1247 1251 QMP_PHY_INIT_CFG(QSERDES_V6_LN_SHRD_DFE_DAC_ENABLE1, 0x88), ··· 3649 3645 .ln_shrd = x1e80100_qmp_gen4x2_pcie_ln_shrd_tbl, 3650 3646 .ln_shrd_num = ARRAY_SIZE(x1e80100_qmp_gen4x2_pcie_ln_shrd_tbl), 3651 3647 }, 3648 + 3649 + .reset_list = sdm845_pciephy_reset_l, 3650 + .num_resets = ARRAY_SIZE(sdm845_pciephy_reset_l), 3651 + .vreg_list = sm8550_qmp_phy_vreg_l, 3652 + .num_vregs = ARRAY_SIZE(sm8550_qmp_phy_vreg_l), 3653 + .regs = pciephy_v6_regs_layout, 3654 + 3655 + .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, 3656 + .phy_status = PHYSTATUS_4_20, 3657 + .has_nocsr_reset = true, 3658 + }; 3659 + 3660 + static const struct qmp_phy_cfg x1e80100_qmp_gen4x4_pciephy_cfg = { 3661 + .lanes = 4, 3662 + 3663 + .offsets = &qmp_pcie_offsets_v6_20, 3664 + 3665 + .tbls = { 3666 + .serdes = x1e80100_qmp_gen4x2_pcie_serdes_tbl, 3667 + .serdes_num = ARRAY_SIZE(x1e80100_qmp_gen4x2_pcie_serdes_tbl), 3668 + .tx = x1e80100_qmp_gen4x2_pcie_tx_tbl, 3669 + .tx_num = ARRAY_SIZE(x1e80100_qmp_gen4x2_pcie_tx_tbl), 3670 + .rx = x1e80100_qmp_gen4x2_pcie_rx_tbl, 3671 + .rx_num = ARRAY_SIZE(x1e80100_qmp_gen4x2_pcie_rx_tbl), 3672 + .pcs = x1e80100_qmp_gen4x2_pcie_pcs_tbl, 3673 + .pcs_num = ARRAY_SIZE(x1e80100_qmp_gen4x2_pcie_pcs_tbl), 3674 + .pcs_misc = x1e80100_qmp_gen4x2_pcie_pcs_misc_tbl, 3675 + .pcs_misc_num = ARRAY_SIZE(x1e80100_qmp_gen4x2_pcie_pcs_misc_tbl), 3676 + .ln_shrd = x1e80100_qmp_gen4x2_pcie_ln_shrd_tbl, 3677 + .ln_shrd_num = ARRAY_SIZE(x1e80100_qmp_gen4x2_pcie_ln_shrd_tbl), 3678 + }, 3679 + 3680 + .serdes_4ln_tbl = x1e80100_qmp_gen4x4_pcie_serdes_4ln_tbl, 3681 + .serdes_4ln_num = ARRAY_SIZE(x1e80100_qmp_gen4x4_pcie_serdes_4ln_tbl), 3682 + 3652 3683 .reset_list = sdm845_pciephy_reset_l, 3653 3684 .num_resets = ARRAY_SIZE(sdm845_pciephy_reset_l), 3654 3685 .vreg_list = sm8550_qmp_phy_vreg_l, ··· 4454 4415 }, { 4455 4416 .compatible = "qcom,x1e80100-qmp-gen4x2-pcie-phy", 4456 4417 .data = &x1e80100_qmp_gen4x2_pciephy_cfg, 4418 + }, { 4419 + .compatible = "qcom,x1e80100-qmp-gen4x4-pcie-phy", 4420 + .data = &x1e80100_qmp_gen4x4_pciephy_cfg, 4457 4421 }, 4458 4422 { }, 4459 4423 };