Skip to content

Commit 8e11a94

Browse files
Mrinmay Sarkarvinodkoul
authored andcommitted
phy: qcom-qmp-pcie: add endpoint support for sa8775p
Add support for dual lane end point mode PHY found on sa8755p platform. Signed-off-by: Mrinmay Sarkar <[email protected]> Reviewed-by: Dmitry Baryshkov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent f5d5a0b commit 8e11a94

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

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

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2147,6 +2147,34 @@ static const struct qmp_phy_init_tbl sa8775p_qmp_gen4x4_pcie_rc_serdes_alt_tbl[]
21472147
QMP_PHY_INIT_CFG(QSERDES_V5_COM_CLK_SELECT, 0x34),
21482148
};
21492149

2150+
static const struct qmp_phy_init_tbl sa8775p_qmp_gen4x2_pcie_ep_serdes_alt_tbl[] = {
2151+
QMP_PHY_INIT_CFG(QSERDES_V5_COM_BG_TIMER, 0x02),
2152+
QMP_PHY_INIT_CFG(QSERDES_V5_COM_SYS_CLK_CTRL, 0x07),
2153+
QMP_PHY_INIT_CFG(QSERDES_V5_COM_CP_CTRL_MODE0, 0x27),
2154+
QMP_PHY_INIT_CFG(QSERDES_V5_COM_CP_CTRL_MODE1, 0x0a),
2155+
QMP_PHY_INIT_CFG(QSERDES_V5_COM_PLL_RCTRL_MODE0, 0x17),
2156+
QMP_PHY_INIT_CFG(QSERDES_V5_COM_PLL_RCTRL_MODE1, 0x19),
2157+
QMP_PHY_INIT_CFG(QSERDES_V5_COM_PLL_CCTRL_MODE0, 0x00),
2158+
QMP_PHY_INIT_CFG(QSERDES_V5_COM_PLL_CCTRL_MODE1, 0x03),
2159+
QMP_PHY_INIT_CFG(QSERDES_V5_COM_SYSCLK_EN_SEL, 0x00),
2160+
QMP_PHY_INIT_CFG(QSERDES_V5_COM_INTEGLOOP_GAIN0_MODE0, 0xfb),
2161+
QMP_PHY_INIT_CFG(QSERDES_V5_COM_INTEGLOOP_GAIN1_MODE0, 0x01),
2162+
QMP_PHY_INIT_CFG(QSERDES_V5_COM_INTEGLOOP_GAIN0_MODE1, 0xfb),
2163+
QMP_PHY_INIT_CFG(QSERDES_V5_COM_INTEGLOOP_GAIN1_MODE1, 0x01),
2164+
QMP_PHY_INIT_CFG(QSERDES_V5_COM_CMN_MODE, 0x14),
2165+
QMP_PHY_INIT_CFG(QSERDES_V5_COM_LOCK_CMP1_MODE0, 0xff),
2166+
QMP_PHY_INIT_CFG(QSERDES_V5_COM_LOCK_CMP2_MODE0, 0x04),
2167+
QMP_PHY_INIT_CFG(QSERDES_V5_COM_LOCK_CMP1_MODE1, 0xff),
2168+
QMP_PHY_INIT_CFG(QSERDES_V5_COM_LOCK_CMP2_MODE1, 0x09),
2169+
QMP_PHY_INIT_CFG(QSERDES_V5_COM_DEC_START_MODE0, 0x19),
2170+
QMP_PHY_INIT_CFG(QSERDES_V5_COM_DEC_START_MODE1, 0x28),
2171+
};
2172+
2173+
static const struct qmp_phy_init_tbl sa8775p_qmp_gen4x2_pcie_ep_pcs_alt_tbl[] = {
2174+
QMP_PHY_INIT_CFG(QPHY_V5_20_PCS_INSIG_MX_CTRL7, 0x00),
2175+
QMP_PHY_INIT_CFG(QPHY_V5_20_PCS_INSIG_SW_CTRL7, 0x00),
2176+
};
2177+
21502178
struct qmp_pcie_offsets {
21512179
u16 serdes;
21522180
u16 pcs;
@@ -3043,6 +3071,15 @@ static const struct qmp_phy_cfg sa8775p_qmp_gen4x2_pciephy_cfg = {
30433071
.pcs_misc_num = ARRAY_SIZE(sa8775p_qmp_gen4_pcie_rc_pcs_misc_tbl),
30443072
},
30453073

3074+
.tbls_ep = &(const struct qmp_phy_cfg_tbls) {
3075+
.serdes = sa8775p_qmp_gen4x2_pcie_ep_serdes_alt_tbl,
3076+
.serdes_num = ARRAY_SIZE(sa8775p_qmp_gen4x2_pcie_ep_serdes_alt_tbl),
3077+
.pcs_misc = sm8450_qmp_gen4x2_pcie_ep_pcs_misc_tbl,
3078+
.pcs_misc_num = ARRAY_SIZE(sm8450_qmp_gen4x2_pcie_ep_pcs_misc_tbl),
3079+
.pcs = sa8775p_qmp_gen4x2_pcie_ep_pcs_alt_tbl,
3080+
.pcs_num = ARRAY_SIZE(sa8775p_qmp_gen4x2_pcie_ep_pcs_alt_tbl),
3081+
},
3082+
30463083
.reset_list = sdm845_pciephy_reset_l,
30473084
.num_resets = ARRAY_SIZE(sdm845_pciephy_reset_l),
30483085
.vreg_list = qmp_phy_vreg_l,

drivers/phy/qualcomm/phy-qcom-qmp-pcs-v5_20.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#ifndef QCOM_PHY_QMP_PCS_V5_20_H_
77
#define QCOM_PHY_QMP_PCS_V5_20_H_
88

9+
#define QPHY_V5_20_PCS_INSIG_SW_CTRL7 0x060
10+
#define QPHY_V5_20_PCS_INSIG_MX_CTRL7 0x07c
911
#define QPHY_V5_20_PCS_G3S2_PRE_GAIN 0x170
1012
#define QPHY_V5_20_PCS_RX_SIGDET_LVL 0x188
1113
#define QPHY_V5_20_PCS_EQ_CONFIG2 0x1d8

0 commit comments

Comments
 (0)