Skip to content

Commit afd55e6

Browse files
Sivaprakash Murugesanvinodkoul
authored andcommitted
phy: qcom-qmp: Use correct values for ipq8074 PCIe Gen2 PHY init
There were some problem in ipq8074 Gen2 PCIe phy init sequence. 1. Few register values were wrongly updated in the phy init sequence. 2. The register QSERDES_RX_SIGDET_CNTRL is a RX tuning parameter register which is added in serdes table causing the wrong register was getting updated. 3. Clocks and resets were not added in the phy init. Fix these to make Gen2 PCIe port on ipq8074 devices to work. Fixes: eef243d ("phy: qcom-qmp: Add support for IPQ8074") Cc: [email protected] Co-developed-by: Selvam Sathappan Periakaruppan <[email protected]> Signed-off-by: Selvam Sathappan Periakaruppan <[email protected]> Signed-off-by: Sivaprakash Murugesan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 04db230 commit afd55e6

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -604,8 +604,8 @@ static const struct qmp_phy_init_tbl ipq8074_pcie_serdes_tbl[] = {
604604
QMP_PHY_INIT_CFG(QSERDES_COM_BG_TRIM, 0xf),
605605
QMP_PHY_INIT_CFG(QSERDES_COM_LOCK_CMP_EN, 0x1),
606606
QMP_PHY_INIT_CFG(QSERDES_COM_VCO_TUNE_MAP, 0x0),
607-
QMP_PHY_INIT_CFG(QSERDES_COM_VCO_TUNE_TIMER1, 0x1f),
608-
QMP_PHY_INIT_CFG(QSERDES_COM_VCO_TUNE_TIMER2, 0x3f),
607+
QMP_PHY_INIT_CFG(QSERDES_COM_VCO_TUNE_TIMER1, 0xff),
608+
QMP_PHY_INIT_CFG(QSERDES_COM_VCO_TUNE_TIMER2, 0x1f),
609609
QMP_PHY_INIT_CFG(QSERDES_COM_CMN_CONFIG, 0x6),
610610
QMP_PHY_INIT_CFG(QSERDES_COM_PLL_IVCO, 0xf),
611611
QMP_PHY_INIT_CFG(QSERDES_COM_HSCLK_SEL, 0x0),
@@ -631,7 +631,6 @@ static const struct qmp_phy_init_tbl ipq8074_pcie_serdes_tbl[] = {
631631
QMP_PHY_INIT_CFG(QSERDES_COM_INTEGLOOP_GAIN1_MODE0, 0x0),
632632
QMP_PHY_INIT_CFG(QSERDES_COM_INTEGLOOP_GAIN0_MODE0, 0x80),
633633
QMP_PHY_INIT_CFG(QSERDES_COM_BIAS_EN_CTRL_BY_PSM, 0x1),
634-
QMP_PHY_INIT_CFG(QSERDES_COM_VCO_TUNE_CTRL, 0xa),
635634
QMP_PHY_INIT_CFG(QSERDES_COM_SSC_EN_CENTER, 0x1),
636635
QMP_PHY_INIT_CFG(QSERDES_COM_SSC_PER1, 0x31),
637636
QMP_PHY_INIT_CFG(QSERDES_COM_SSC_PER2, 0x1),
@@ -640,14 +639,15 @@ static const struct qmp_phy_init_tbl ipq8074_pcie_serdes_tbl[] = {
640639
QMP_PHY_INIT_CFG(QSERDES_COM_SSC_STEP_SIZE1, 0x2f),
641640
QMP_PHY_INIT_CFG(QSERDES_COM_SSC_STEP_SIZE2, 0x19),
642641
QMP_PHY_INIT_CFG(QSERDES_COM_CLK_EP_DIV, 0x19),
643-
QMP_PHY_INIT_CFG(QSERDES_RX_SIGDET_CNTRL, 0x7),
644642
};
645643

646644
static const struct qmp_phy_init_tbl ipq8074_pcie_tx_tbl[] = {
647645
QMP_PHY_INIT_CFG(QSERDES_TX_HIGHZ_TRANSCEIVEREN_BIAS_DRVR_EN, 0x45),
648646
QMP_PHY_INIT_CFG(QSERDES_TX_LANE_MODE, 0x6),
649647
QMP_PHY_INIT_CFG(QSERDES_TX_RES_CODE_LANE_OFFSET, 0x2),
650648
QMP_PHY_INIT_CFG(QSERDES_TX_RCV_DETECT_LVL_2, 0x12),
649+
QMP_PHY_INIT_CFG(QSERDES_TX_EMP_POST1_LVL, 0x36),
650+
QMP_PHY_INIT_CFG(QSERDES_TX_SLEW_CNTL, 0x0a),
651651
};
652652

653653
static const struct qmp_phy_init_tbl ipq8074_pcie_rx_tbl[] = {
@@ -658,7 +658,6 @@ static const struct qmp_phy_init_tbl ipq8074_pcie_rx_tbl[] = {
658658
QMP_PHY_INIT_CFG(QSERDES_RX_RX_EQU_ADAPTOR_CNTRL4, 0xdb),
659659
QMP_PHY_INIT_CFG(QSERDES_RX_UCDR_SO_SATURATION_AND_ENABLE, 0x4b),
660660
QMP_PHY_INIT_CFG(QSERDES_RX_UCDR_SO_GAIN, 0x4),
661-
QMP_PHY_INIT_CFG(QSERDES_RX_UCDR_SO_GAIN_HALF, 0x4),
662661
};
663662

664663
static const struct qmp_phy_init_tbl ipq8074_pcie_pcs_tbl[] = {
@@ -2046,6 +2045,9 @@ static const struct qmp_phy_cfg msm8996_usb3phy_cfg = {
20462045
.pwrdn_ctrl = SW_PWRDN,
20472046
};
20482047

2048+
static const char * const ipq8074_pciephy_clk_l[] = {
2049+
"aux", "cfg_ahb",
2050+
};
20492051
/* list of resets */
20502052
static const char * const ipq8074_pciephy_reset_l[] = {
20512053
"phy", "common",
@@ -2063,8 +2065,8 @@ static const struct qmp_phy_cfg ipq8074_pciephy_cfg = {
20632065
.rx_tbl_num = ARRAY_SIZE(ipq8074_pcie_rx_tbl),
20642066
.pcs_tbl = ipq8074_pcie_pcs_tbl,
20652067
.pcs_tbl_num = ARRAY_SIZE(ipq8074_pcie_pcs_tbl),
2066-
.clk_list = NULL,
2067-
.num_clks = 0,
2068+
.clk_list = ipq8074_pciephy_clk_l,
2069+
.num_clks = ARRAY_SIZE(ipq8074_pciephy_clk_l),
20682070
.reset_list = ipq8074_pciephy_reset_l,
20692071
.num_resets = ARRAY_SIZE(ipq8074_pciephy_reset_l),
20702072
.vreg_list = NULL,

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@
7777
#define QSERDES_COM_CORECLK_DIV_MODE1 0x1bc
7878

7979
/* Only for QMP V2 PHY - TX registers */
80+
#define QSERDES_TX_EMP_POST1_LVL 0x018
81+
#define QSERDES_TX_SLEW_CNTL 0x040
8082
#define QSERDES_TX_RES_CODE_LANE_OFFSET 0x054
8183
#define QSERDES_TX_DEBUG_BUS_SEL 0x064
8284
#define QSERDES_TX_HIGHZ_TRANSCEIVEREN_BIAS_DRVR_EN 0x068

0 commit comments

Comments
 (0)