Skip to content

Commit 1797c66

Browse files
Prudhvi Yarlagaddavinodkoul
authored andcommitted
phy: qcom: qmp-pcie: Add support for Glymur PCIe Gen5x4 PHY
Add support for Gen5 x4 PCIe QMP PHY found on Glymur platform. Signed-off-by: Prudhvi Yarlagadda <quic_pyarlaga@quicinc.com> Signed-off-by: Wenbin Yao <wenbin.yao@oss.qualcomm.com> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Acked-by: Manivannan Sadhasivam <mani@kernel.org> Signed-off-by: Qiang Yu <qiang.yu@oss.qualcomm.com> Link: https://patch.msgid.link/20251103-glymur-pcie-upstream-v6-3-18a5e0a538dc@oss.qualcomm.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent bc2ba6e commit 1797c66

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,12 @@ static const unsigned int pciephy_v7_regs_layout[QPHY_LAYOUT_SIZE] = {
100100
[QPHY_PCS_POWER_DOWN_CONTROL] = QPHY_V7_PCS_POWER_DOWN_CONTROL,
101101
};
102102

103+
static const unsigned int pciephy_v8_50_regs_layout[QPHY_LAYOUT_SIZE] = {
104+
[QPHY_START_CTRL] = QPHY_V8_50_PCS_START_CONTROL,
105+
[QPHY_PCS_STATUS] = QPHY_V8_50_PCS_STATUS1,
106+
[QPHY_PCS_POWER_DOWN_CONTROL] = QPHY_V8_50_PCS_POWER_DOWN_CONTROL,
107+
};
108+
103109
static const struct qmp_phy_init_tbl msm8998_pcie_serdes_tbl[] = {
104110
QMP_PHY_INIT_CFG(QSERDES_V3_COM_BIAS_EN_CLKBUFLR_EN, 0x14),
105111
QMP_PHY_INIT_CFG(QSERDES_V3_COM_CLK_SELECT, 0x30),
@@ -3072,6 +3078,7 @@ struct qmp_pcie_offsets {
30723078
u16 rx2;
30733079
u16 txz;
30743080
u16 rxz;
3081+
u16 txrxz;
30753082
u16 ln_shrd;
30763083
};
30773084

@@ -3356,6 +3363,12 @@ static const struct qmp_pcie_offsets qmp_pcie_offsets_v6_30 = {
33563363
.ln_shrd = 0x8000,
33573364
};
33583365

3366+
static const struct qmp_pcie_offsets qmp_pcie_offsets_v8_50 = {
3367+
.serdes = 0x8000,
3368+
.pcs = 0x9000,
3369+
.txrxz = 0xd000,
3370+
};
3371+
33593372
static const struct qmp_phy_cfg ipq8074_pciephy_cfg = {
33603373
.lanes = 1,
33613374

@@ -4412,6 +4425,22 @@ static const struct qmp_phy_cfg qmp_v6_gen4x4_pciephy_cfg = {
44124425
.phy_status = PHYSTATUS_4_20,
44134426
};
44144427

4428+
static const struct qmp_phy_cfg glymur_qmp_gen5x4_pciephy_cfg = {
4429+
.lanes = 4,
4430+
4431+
.offsets = &qmp_pcie_offsets_v8_50,
4432+
4433+
.reset_list = sdm845_pciephy_reset_l,
4434+
.num_resets = ARRAY_SIZE(sdm845_pciephy_reset_l),
4435+
.vreg_list = qmp_phy_vreg_l,
4436+
.num_vregs = ARRAY_SIZE(qmp_phy_vreg_l),
4437+
4438+
.regs = pciephy_v8_50_regs_layout,
4439+
4440+
.pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL,
4441+
.phy_status = PHYSTATUS_4_20,
4442+
};
4443+
44154444
static void qmp_pcie_init_port_b(struct qmp_pcie *qmp, const struct qmp_phy_cfg_tbls *tbls)
44164445
{
44174446
const struct qmp_phy_cfg *cfg = qmp->cfg;
@@ -5163,6 +5192,9 @@ static int qmp_pcie_probe(struct platform_device *pdev)
51635192

51645193
static const struct of_device_id qmp_pcie_of_match_table[] = {
51655194
{
5195+
.compatible = "qcom,glymur-qmp-gen5x4-pcie-phy",
5196+
.data = &glymur_qmp_gen5x4_pciephy_cfg,
5197+
}, {
51665198
.compatible = "qcom,ipq6018-qmp-pcie-phy",
51675199
.data = &ipq6018_pciephy_cfg,
51685200
}, {

0 commit comments

Comments
 (0)