Add support for PCIe PHY in IPQ9574
v4 cover Add support for PCIe PHY in IPQ9574
This series adds support for a single-lane and two-lane PCIe PHYs found on Qualcomm IPQ9574 platform.
[V4]
Picked up the R-b/A-b tags.
Split the phy driver and headers to individual patches.
[V3]
https://lore.kernel.org/linux-arm-msm/[email protected]/ [V2] https://lore.kernel.org/linux-arm-msm/[email protected]/ [V1] https://lore.kernel.org/linux-arm-msm/[email protected]/
devi priya (4):
dt-bindings: phy: qcom,ipq8074-qmp-pcie: Document the IPQ9574 QMP PCIe
PHYs
phy: qcom-qmp: Add missing offsets for Qserdes PLL registers.
phy: qcom-qmp: Add missing register definitions for PCS V5
phy: qcom-qmp-pcie: Add support for IPQ9574 g3x1 and g3x2 PCIEs
.../phy/qcom,ipq8074-qmp-pcie-phy.yaml | 2 + drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 309 ++++++++++++++++++ .../phy/qualcomm/phy-qcom-qmp-pcs-pcie-v5.h | 14 + .../phy/qualcomm/phy-qcom-qmp-qserdes-pll.h | 3 + 4 files changed, 328 insertions(+)
Signature · 1 line
2.34.1
PATCH v4 1/4 dt-bindings: phy: qcom,ipq8074-qmp-pcie: Document the IPQ9574 QMP PCIe PHYs
Document the QMP PCIe PHYs on IPQ9574 platform.
---
Changes in V4:
- Picked up the Acked-by tag
.../devicetree/bindings/phy/qcom,ipq8074-qmp-pcie-phy.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/phy/qcom,ipq8074-qmp-pcie-phy.yaml +2 -0
@@ -19,6 +19,8 @@ properties: - qcom,ipq6018-qmp-pcie-phy - qcom,ipq8074-qmp-gen3-pcie-phy - qcom,ipq8074-qmp-pcie-phy + - qcom,ipq9574-qmp-gen3x1-pcie-phy + - qcom,ipq9574-qmp-gen3x2-pcie-phy reg: items:
Signature · 1 line
2.34.1
PATCH v4 2/4 phy: qcom-qmp: Add missing offsets for Qserdes PLL registers.
In reply to devi priyaAdd missing register offsets for Qserdes PLL.
---
Changes in V4:
- Picked up the R-b tag
drivers/phy/qualcomm/phy-qcom-qmp-qserdes-pll.h | 3 +++ 1 file changed, 3 insertions(+)
drivers/phy/qualcomm/phy-qcom-qmp-qserdes-pll.h +3 -0
@@ -8,6 +8,9 @@/* QMP V2 PHY for PCIE gen3 ports - QSERDES PLL registers */ #define QSERDES_PLL_BG_TIMER 0x00c +#define QSERDES_PLL_SSC_EN_CENTER 0x010 +#define QSERDES_PLL_SSC_ADJ_PER1 0x014 +#define QSERDES_PLL_SSC_ADJ_PER2 0x018#define QSERDES_PLL_SSC_PER1 0x01c#define QSERDES_PLL_SSC_PER2 0x020#define QSERDES_PLL_SSC_STEP_SIZE1_MODE0 0x024
Signature · 1 line
2.34.1
PATCH v4 3/4 phy: qcom-qmp: Add missing register definitions for PCS V5
In reply to devi priyaAdd missing register offsets for PCS V5 registers.
---
Changes in V4:
- Picked up the R-b tag
drivers/phy/qualcomm/phy-qcom-qmp-pcs-pcie-v5.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/phy/qualcomm/phy-qcom-qmp-pcs-pcie-v5.h +14 -0
@@ -11,8 +11,22 @@#define QPHY_V5_PCS_PCIE_POWER_STATE_CONFIG2 0x0c#define QPHY_V5_PCS_PCIE_POWER_STATE_CONFIG4 0x14#define QPHY_V5_PCS_PCIE_ENDPOINT_REFCLK_DRIVE 0x20 +#define QPHY_V5_PCS_PCIE_L1P1_WAKEUP_DLY_TIME_AUXCLK_L 0x44 +#define QPHY_V5_PCS_PCIE_L1P1_WAKEUP_DLY_TIME_AUXCLK_H 0x48 +#define QPHY_V5_PCS_PCIE_L1P2_WAKEUP_DLY_TIME_AUXCLK_L 0x4c +#define QPHY_V5_PCS_PCIE_L1P2_WAKEUP_DLY_TIME_AUXCLK_H 0x50#define QPHY_V5_PCS_PCIE_INT_AUX_CLK_CONFIG1 0x54 +#define QPHY_V5_PCS_PCIE_OSC_DTCT_CONFIG1 0x5c +#define QPHY_V5_PCS_PCIE_OSC_DTCT_CONFIG2 0x60 +#define QPHY_V5_PCS_PCIE_OSC_DTCT_CONFIG4 0x68 +#define QPHY_V5_PCS_PCIE_OSC_DTCT_MODE2_CONFIG2 0x7c +#define QPHY_V5_PCS_PCIE_OSC_DTCT_MODE2_CONFIG4 0x84 +#define QPHY_V5_PCS_PCIE_OSC_DTCT_MODE2_CONFIG5 0x88 +#define QPHY_V5_PCS_PCIE_OSC_DTCT_MODE2_CONFIG6 0x8c#define QPHY_V5_PCS_PCIE_OSC_DTCT_ACTIONS 0x94 +#define QPHY_V5_PCS_PCIE_EQ_CONFIG1 0xa4#define QPHY_V5_PCS_PCIE_EQ_CONFIG2 0xa8 +#define QPHY_V5_PCS_PCIE_PRESET_P10_PRE 0xc0 +#define QPHY_V5_PCS_PCIE_PRESET_P10_POST 0xe4#endif
Signature · 1 line
2.34.1
PATCH v4 4/4 phy: qcom-qmp-pcie: Add support for IPQ9574 g3x1 and g3x2 PCIEs
In reply to devi priyaAdd support for a single-lane and two-lane PCIe PHYs found on Qualcomm IPQ9574 platform.
---
Changes in V4:
- Picked up the R-b tag
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 309 +++++++++++++++++++++++ 1 file changed, 309 insertions(+)
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +309 -0
@@ -489,6 +489,243 @@ static const struct qmp_phy_init_tbl ipq8074_pcie_gen3_pcs_misc_tbl[] = { QMP_PHY_INIT_CFG(QPHY_V4_PCS_PCIE_ENDPOINT_REFCLK_DRIVE, 0xc1), }; +static const struct qmp_phy_init_tbl ipq9574_gen3x1_pcie_serdes_tbl[] = { +QMP_PHY_INIT_CFG (QSERDES_PLL_BIAS_EN_CLKBUFLR_EN ,0x18 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_BIAS_EN_CTRL_BY_PSM ,0x01 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CLK_SELECT ,0x31 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_PLL_IVCO ,0x0f ), +QMP_PHY_INIT_CFG (QSERDES_PLL_BG_TRIM ,0x0f ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CMN_CONFIG ,0x06 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_LOCK_CMP_EN ,0x42 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_RESETSM_CNTRL ,0x20 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SVS_MODE_CLK_SEL ,0x01 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_VCO_TUNE_MAP ,0x04 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SVS_MODE_CLK_SEL ,0x05 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_VCO_TUNE_TIMER1 ,0xff ), +QMP_PHY_INIT_CFG (QSERDES_PLL_VCO_TUNE_TIMER2 ,0x3f ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CORE_CLK_EN ,0x30 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_HSCLK_SEL ,0x21 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_DEC_START_MODE0 ,0x68 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_DIV_FRAC_START3_MODE0 ,0x02 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_DIV_FRAC_START2_MODE0 ,0xaa ), +QMP_PHY_INIT_CFG (QSERDES_PLL_DIV_FRAC_START1_MODE0 ,0xab ), +QMP_PHY_INIT_CFG (QSERDES_PLL_LOCK_CMP2_MODE0 ,0x14 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_LOCK_CMP1_MODE0 ,0xd4 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CP_CTRL_MODE0 ,0x09 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_PLL_RCTRL_MODE0 ,0x16 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_PLL_CCTRL_MODE0 ,0x28 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_INTEGLOOP_GAIN1_MODE0 ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_INTEGLOOP_GAIN0_MODE0 ,0xa0 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_VCO_TUNE2_MODE0 ,0x02 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_VCO_TUNE1_MODE0 ,0x24 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SVS_MODE_CLK_SEL ,0x05 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CORE_CLK_EN ,0x20 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CORECLK_DIV ,0x0a ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CLK_SELECT ,0x32 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SYS_CLK_CTRL ,0x02 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SYSCLK_BUF_ENABLE ,0x07 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SYSCLK_EN_SEL ,0x08 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_BG_TIMER ,0x0a ), +QMP_PHY_INIT_CFG (QSERDES_PLL_HSCLK_SEL ,0x01 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_DEC_START_MODE1 ,0x53 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_DIV_FRAC_START3_MODE1 ,0x05 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_DIV_FRAC_START2_MODE1 ,0x55 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_DIV_FRAC_START1_MODE1 ,0x55 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_LOCK_CMP2_MODE1 ,0x29 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_LOCK_CMP1_MODE1 ,0xaa ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CP_CTRL_MODE1 ,0x09 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_PLL_RCTRL_MODE1 ,0x16 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_PLL_CCTRL_MODE1 ,0x28 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_INTEGLOOP_GAIN1_MODE1 ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_INTEGLOOP_GAIN0_MODE1 ,0xa0 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_VCO_TUNE2_MODE1 ,0x03 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_VCO_TUNE1_MODE1 ,0xb4 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SVS_MODE_CLK_SEL ,0x05 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CORE_CLK_EN ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CORECLK_DIV_MODE1 ,0x08 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SSC_EN_CENTER ,0x01 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SSC_PER1 ,0x7d ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SSC_PER2 ,0x01 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SSC_ADJ_PER1 ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SSC_ADJ_PER2 ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SSC_STEP_SIZE1_MODE0 ,0x0a ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SSC_STEP_SIZE2_MODE0 ,0x05 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SSC_STEP_SIZE1_MODE1 ,0x08 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SSC_STEP_SIZE2_MODE1 ,0x04 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CLK_EP_DIV_MODE0 ,0x19 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CLK_EP_DIV_MODE1 ,0x28 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CLK_ENABLE1 ,0x90 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_HSCLK_SEL ,0x89 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CLK_ENABLE1 ,0x10 ), +}; + +static const struct qmp_phy_init_tbl ipq9574_gen3x2_pcie_serdes_tbl[] = { +QMP_PHY_INIT_CFG (QSERDES_PLL_BIAS_EN_CLKBUFLR_EN ,0x18 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_BIAS_EN_CTRL_BY_PSM ,0x01 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CLK_SELECT ,0x31 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_PLL_IVCO ,0x0f ), +QMP_PHY_INIT_CFG (QSERDES_PLL_BG_TRIM ,0x0f ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CMN_CONFIG ,0x06 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_LOCK_CMP_EN ,0x42 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_RESETSM_CNTRL ,0x20 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SVS_MODE_CLK_SEL ,0x01 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_VCO_TUNE_MAP ,0x04 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SVS_MODE_CLK_SEL ,0x05 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_VCO_TUNE_TIMER1 ,0xff ), +QMP_PHY_INIT_CFG (QSERDES_PLL_VCO_TUNE_TIMER2 ,0x3f ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CORE_CLK_EN ,0x30 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_HSCLK_SEL ,0x21 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_DEC_START_MODE0 ,0x68 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_DIV_FRAC_START3_MODE0 ,0x02 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_DIV_FRAC_START2_MODE0 ,0xaa ), +QMP_PHY_INIT_CFG (QSERDES_PLL_DIV_FRAC_START1_MODE0 ,0xab ), +QMP_PHY_INIT_CFG (QSERDES_PLL_LOCK_CMP2_MODE0 ,0x14 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_LOCK_CMP1_MODE0 ,0xd4 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CP_CTRL_MODE0 ,0x09 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_PLL_RCTRL_MODE0 ,0x16 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_PLL_CCTRL_MODE0 ,0x28 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_INTEGLOOP_GAIN1_MODE0 ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_INTEGLOOP_GAIN0_MODE0 ,0xa0 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_VCO_TUNE2_MODE0 ,0x02 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_VCO_TUNE1_MODE0 ,0x24 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SVS_MODE_CLK_SEL ,0x05 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CORE_CLK_EN ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CORECLK_DIV ,0x0a ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CLK_SELECT ,0x32 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SYS_CLK_CTRL ,0x02 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SYSCLK_BUF_ENABLE ,0x07 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SYSCLK_EN_SEL ,0x08 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_BG_TIMER ,0x0a ), +QMP_PHY_INIT_CFG (QSERDES_PLL_HSCLK_SEL ,0x01 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_DEC_START_MODE1 ,0x53 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_DIV_FRAC_START3_MODE1 ,0x05 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_DIV_FRAC_START2_MODE1 ,0x55 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_DIV_FRAC_START1_MODE1 ,0x55 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_LOCK_CMP2_MODE1 ,0x29 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_LOCK_CMP1_MODE1 ,0xaa ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CP_CTRL_MODE1 ,0x09 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_PLL_RCTRL_MODE1 ,0x16 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_PLL_CCTRL_MODE1 ,0x28 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_INTEGLOOP_GAIN1_MODE1 ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_INTEGLOOP_GAIN0_MODE1 ,0xa0 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_VCO_TUNE2_MODE1 ,0x03 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_VCO_TUNE1_MODE1 ,0xb4 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SVS_MODE_CLK_SEL ,0x05 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CORE_CLK_EN ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CORECLK_DIV_MODE1 ,0x08 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SSC_EN_CENTER ,0x01 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SSC_PER1 ,0x7d ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SSC_PER2 ,0x01 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SSC_ADJ_PER1 ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SSC_ADJ_PER2 ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SSC_STEP_SIZE1_MODE0 ,0x0a ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SSC_STEP_SIZE2_MODE0 ,0x05 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SSC_STEP_SIZE1_MODE1 ,0x08 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_SSC_STEP_SIZE2_MODE1 ,0x04 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CLK_EP_DIV_MODE0 ,0x19 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CLK_EP_DIV_MODE1 ,0x28 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CLK_ENABLE1 ,0x90 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_HSCLK_SEL ,0x89 ), +QMP_PHY_INIT_CFG (QSERDES_PLL_CLK_ENABLE1 ,0x10 ), +}; + +static const struct qmp_phy_init_tbl ipq9574_pcie_rx_tbl[] = { +QMP_PHY_INIT_CFG (QSERDES_V4_RX_SIGDET_CNTRL ,0x03 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_SIGDET_ENABLES ,0x1c ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_SIGDET_DEGLITCH_CNTRL ,0x14 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_EQU_ADAPTOR_CNTRL2 ,0x61 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_EQU_ADAPTOR_CNTRL3 ,0x04 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_EQU_ADAPTOR_CNTRL4 ,0x1e ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_DFE_EN_TIMER ,0x04 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_UCDR_FO_GAIN ,0x0c ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_UCDR_SO_GAIN ,0x02 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_UCDR_SO_SATURATION_AND_ENABLE ,0x7f ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_UCDR_PI_CONTROLS ,0x70 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_EQU_ADAPTOR_CNTRL1 ,0x73 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_EQU_ADAPTOR_CNTRL2 ,0x80 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_MODE_10_LOW ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_MODE_10_HIGH ,0x02 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_MODE_10_HIGH2 ,0xc8 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_MODE_10_HIGH3 ,0x09 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_MODE_10_HIGH4 ,0xb1 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_MODE_01_LOW ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_MODE_01_HIGH ,0x02 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_MODE_01_HIGH2 ,0xc8 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_MODE_01_HIGH3 ,0x09 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_MODE_01_HIGH4 ,0xb1 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_MODE_00_LOW ,0xf0 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_MODE_00_HIGH ,0x02 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_MODE_00_HIGH2 ,0x2f ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_MODE_00_HIGH3 ,0xd3 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_MODE_00_HIGH4 ,0x40 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_IDAC_TSETTLE_HIGH ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_V4_RX_RX_IDAC_TSETTLE_LOW ,0xc0 ), +}; + +static const struct qmp_phy_init_tbl ipq9574_gen3x1_pcie_pcs_tbl[] = { +QMP_PHY_INIT_CFG (QPHY_V4_PCS_P2U3_WAKEUP_DLY_TIME_AUXCLK_H ,0x00 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_P2U3_WAKEUP_DLY_TIME_AUXCLK_L ,0x01 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_RX_DCC_CAL_CONFIG ,0x01 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_RX_SIGDET_LVL ,0xaa ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_REFGEN_REQ_CONFIG1 ,0x0d ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_G12S1_TXDEEMPH_M3P5DB ,0x10 ), +}; + +static const struct qmp_phy_init_tbl ipq9574_gen3x1_pcie_pcs_misc_tbl[] = { +QMP_PHY_INIT_CFG (QPHY_V4_PCS_PCIE_OSC_DTCT_ACTIONS ,0x00 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_PCIE_POWER_STATE_CONFIG2 ,0x0d ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_PCIE_L1P1_WAKEUP_DLY_TIME_AUXCLK_H ,0x00 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_PCIE_L1P1_WAKEUP_DLY_TIME_AUXCLK_L ,0x01 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_PCIE_L1P2_WAKEUP_DLY_TIME_AUXCLK_H ,0x00 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_PCIE_L1P2_WAKEUP_DLY_TIME_AUXCLK_L ,0x01 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_PCIE_EQ_CONFIG1 ,0x14 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_PCIE_EQ_CONFIG1 ,0x10 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_PCIE_EQ_CONFIG2 ,0x0b ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_PCIE_PRESET_P10_PRE ,0x00 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_PCIE_PRESET_P10_POST ,0x58 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_PCIE_POWER_STATE_CONFIG4 ,0x07 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_PCIE_OSC_DTCT_CONFIG2 ,0x52 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_PCIE_INT_AUX_CLK_CONFIG1 ,0x00 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_PCIE_OSC_DTCT_MODE2_CONFIG2 ,0x50 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_PCIE_OSC_DTCT_MODE2_CONFIG4 ,0x1a ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_PCIE_OSC_DTCT_MODE2_CONFIG5 ,0x06 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_PCIE_OSC_DTCT_MODE2_CONFIG6 ,0x03 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_PCIE_ENDPOINT_REFCLK_DRIVE ,0xc1 ), +}; + +static const struct qmp_phy_init_tbl ipq9574_gen3x2_pcie_pcs_tbl[] = { +QMP_PHY_INIT_CFG (QPHY_V4_PCS_REFGEN_REQ_CONFIG1 ,0x0d ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_G12S1_TXDEEMPH_M3P5DB ,0x10 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_P2U3_WAKEUP_DLY_TIME_AUXCLK_H ,0x00 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_P2U3_WAKEUP_DLY_TIME_AUXCLK_L ,0x01 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_RX_DCC_CAL_CONFIG ,0x01 ), +QMP_PHY_INIT_CFG (QPHY_V4_PCS_RX_SIGDET_LVL ,0xaa ), +}; + +static const struct qmp_phy_init_tbl ipq9574_gen3x2_pcie_pcs_misc_tbl[] = { +QMP_PHY_INIT_CFG (QPHY_V5_PCS_PCIE_OSC_DTCT_ACTIONS ,0x00 ), +QMP_PHY_INIT_CFG (QPHY_V5_PCS_PCIE_POWER_STATE_CONFIG2 ,0x1d ), +QMP_PHY_INIT_CFG (QPHY_V5_PCS_PCIE_L1P1_WAKEUP_DLY_TIME_AUXCLK_H ,0x00 ), +QMP_PHY_INIT_CFG (QPHY_V5_PCS_PCIE_L1P1_WAKEUP_DLY_TIME_AUXCLK_L ,0x01 ), +QMP_PHY_INIT_CFG (QPHY_V5_PCS_PCIE_L1P2_WAKEUP_DLY_TIME_AUXCLK_H ,0x00 ), +QMP_PHY_INIT_CFG (QPHY_V5_PCS_PCIE_L1P2_WAKEUP_DLY_TIME_AUXCLK_L ,0x01 ), +QMP_PHY_INIT_CFG (QPHY_V5_PCS_PCIE_EQ_CONFIG1 ,0x14 ), +QMP_PHY_INIT_CFG (QPHY_V5_PCS_PCIE_EQ_CONFIG1 ,0x10 ), +QMP_PHY_INIT_CFG (QPHY_V5_PCS_PCIE_EQ_CONFIG2 ,0x0b ), +QMP_PHY_INIT_CFG (QPHY_V5_PCS_PCIE_PRESET_P10_PRE ,0x00 ), +QMP_PHY_INIT_CFG (QPHY_V5_PCS_PCIE_PRESET_P10_POST ,0x58 ), +QMP_PHY_INIT_CFG (QPHY_V5_PCS_PCIE_POWER_STATE_CONFIG4 ,0x07 ), +QMP_PHY_INIT_CFG (QPHY_V5_PCS_PCIE_OSC_DTCT_CONFIG1 ,0x00 ), +QMP_PHY_INIT_CFG (QPHY_V5_PCS_PCIE_OSC_DTCT_CONFIG2 ,0x52 ), +QMP_PHY_INIT_CFG (QPHY_V5_PCS_PCIE_OSC_DTCT_CONFIG4 ,0x19 ), +QMP_PHY_INIT_CFG (QPHY_V5_PCS_PCIE_INT_AUX_CLK_CONFIG1 ,0x00 ), +QMP_PHY_INIT_CFG (QPHY_V5_PCS_PCIE_OSC_DTCT_MODE2_CONFIG2 ,0x49 ), +QMP_PHY_INIT_CFG (QPHY_V5_PCS_PCIE_OSC_DTCT_MODE2_CONFIG4 ,0x2a ), +QMP_PHY_INIT_CFG (QPHY_V5_PCS_PCIE_OSC_DTCT_MODE2_CONFIG5 ,0x02 ), +QMP_PHY_INIT_CFG (QPHY_V5_PCS_PCIE_OSC_DTCT_MODE2_CONFIG6 ,0x03 ), +QMP_PHY_INIT_CFG (QPHY_V5_PCS_PCIE_ENDPOINT_REFCLK_DRIVE ,0xc1 ), +}; +static const struct qmp_phy_init_tbl sdm845_qmp_pcie_serdes_tbl[] = {QMP_PHY_INIT_CFG (QSERDES_V3_COM_BIAS_EN_CLKBUFLR_EN ,0x14 ),QMP_PHY_INIT_CFG (QSERDES_V3_COM_CLK_SELECT ,0x30 ),
@@ -2535,6 +2772,16 @@ static const struct qmp_pcie_offsets qmp_pcie_offsets_v5 = { .rx2 = 0x1800, }; +static const struct qmp_pcie_offsets qmp_pcie_offsets_ipq9574 = { + .serdes =0 , + .pcs =0x1000 , + .pcs_misc =0x1400 , + .tx =0x0200 , + .rx =0x0400 , + .tx2 =0x0600 , + .rx2 =0x0800 , +}; +static const struct qmp_pcie_offsets qmp_pcie_offsets_v5_20 = { .serdes =0x1000 , .pcs =0x1200 ,
@@ -2647,6 +2894,62 @@ static const struct qmp_phy_cfg ipq6018_pciephy_cfg = { .phy_status = PHYSTATUS, }; +static const struct qmp_phy_cfg ipq9574_gen3x1_pciephy_cfg = { + .lanes =1 , + + .offsets = &qmp_pcie_offsets_v4x1, + + .tbls = { + .serdes = ipq9574_gen3x1_pcie_serdes_tbl, + .serdes_num =ARRAY_SIZE (ipq9574_gen3x1_pcie_serdes_tbl), + .tx = ipq8074_pcie_gen3_tx_tbl, + .tx_num =ARRAY_SIZE (ipq8074_pcie_gen3_tx_tbl), + .rx = ipq9574_pcie_rx_tbl, + .rx_num =ARRAY_SIZE (ipq9574_pcie_rx_tbl), + .pcs = ipq9574_gen3x1_pcie_pcs_tbl, + .pcs_num =ARRAY_SIZE (ipq9574_gen3x1_pcie_pcs_tbl), + .pcs_misc = ipq9574_gen3x1_pcie_pcs_misc_tbl, + .pcs_misc_num =ARRAY_SIZE (ipq9574_gen3x1_pcie_pcs_misc_tbl), + }, + .reset_list = ipq8074_pciephy_reset_l, + .num_resets =ARRAY_SIZE (ipq8074_pciephy_reset_l), + .vreg_list =NULL , + .num_vregs =0 , + .regs = pciephy_v4_regs_layout, + + .pwrdn_ctrl =SW_PWRDN |REFCLK_DRV_DSBL , + .phy_status =PHYSTATUS , + .pipe_clock_rate =250000000 , +}; + +static const struct qmp_phy_cfg ipq9574_gen3x2_pciephy_cfg = { + .lanes =2 , + + .offsets = &qmp_pcie_offsets_ipq9574, + + .tbls = { + .serdes = ipq9574_gen3x2_pcie_serdes_tbl, + .serdes_num =ARRAY_SIZE (ipq9574_gen3x2_pcie_serdes_tbl), + .tx = ipq8074_pcie_gen3_tx_tbl, + .tx_num =ARRAY_SIZE (ipq8074_pcie_gen3_tx_tbl), + .rx = ipq9574_pcie_rx_tbl, + .rx_num =ARRAY_SIZE (ipq9574_pcie_rx_tbl), + .pcs = ipq9574_gen3x2_pcie_pcs_tbl, + .pcs_num =ARRAY_SIZE (ipq9574_gen3x2_pcie_pcs_tbl), + .pcs_misc = ipq9574_gen3x2_pcie_pcs_misc_tbl, + .pcs_misc_num =ARRAY_SIZE (ipq9574_gen3x2_pcie_pcs_misc_tbl), + }, + .reset_list = ipq8074_pciephy_reset_l, + .num_resets =ARRAY_SIZE (ipq8074_pciephy_reset_l), + .vreg_list =NULL , + .num_vregs =0 , + .regs = pciephy_v5_regs_layout, + + .pwrdn_ctrl =SW_PWRDN |REFCLK_DRV_DSBL , + .phy_status =PHYSTATUS , + .pipe_clock_rate =250000000 , +}; +static const struct qmp_phy_cfg sdm845_qmp_pciephy_cfg = { .lanes =1 ,
@@ -4030,6 +4333,12 @@ static const struct of_device_id qmp_pcie_of_match_table[] = { }, { .compatible = "qcom,ipq8074-qmp-pcie-phy", .data = &ipq8074_pciephy_cfg, + }, { + .compatible = "qcom,ipq9574-qmp-gen3x1-pcie-phy", + .data = &ipq9574_gen3x1_pciephy_cfg, + }, { + .compatible = "qcom,ipq9574-qmp-gen3x2-pcie-phy", + .data = &ipq9574_gen3x2_pciephy_cfg, }, { .compatible = "qcom,msm8998-qmp-pcie-phy", .data = &msm8998_pciephy_cfg,
Signature · 1 line
2.34.1
Quoted 7 lines · devi priya
This series adds support for a single-lane and two-lane PCIe PHYs found on Qualcomm IPQ9574 platform.
[V4]
Picked up the R-b/A-b tags.
Split the phy driver and headers to individual patches.
[V3]
Quoted 7 lines
https://lore.kernel.org/linux-arm-msm/[email protected]/ [V2] https://lore.kernel.org/linux-arm-msm/[email protected]/ [V1] https://lore.kernel.org/linux-arm-msm/[email protected]/[...]
Applied, thanks!
[1/4] dt-bindings: phy: qcom,ipq8074-qmp-pcie: Document the IPQ9574 QMP PCIe PHYs
commit: 29f09daab910c797f5468afda91a51e3e29de7ee
[2/4] phy: qcom-qmp: Add missing offsets for Qserdes PLL registers.
commit: f1aaa788b997ba8a7810da0696e89fd3f79ecce3
[3/4] phy: qcom-qmp: Add missing register definitions for PCS V5
commit: 71ae2acf1d7542ecd21c6933cae8fe65d550074b
[4/4] phy: qcom-qmp-pcie: Add support for IPQ9574 g3x1 and g3x2 PCIEs
commit: 2f2f5c13cc5ea87f1dd2debfd06fe5f624e5c0fdBest regards,
Signature · 1 line
Vinod Koul <[email protected]>