Update PCIe PHY settings for SA8775P
Subsystems (4)
v2 cover Update PCIe PHY settings for SA8775P
This Series is to update PCIe PHY settings as per latest hardware programming guide and remove max link speed dt property for SA8775P PCIe EP.
---
v1 -> v2:
- Update commit message as per the review comments.
- Remove max-link-speed DT property.
---
Mrinmay Sarkar (2):
phy: qcom: qmp-pcie: Update PHY settings for SA8775P
arm64: dts: qcom: sa8775p: Remove max link speed property for PCIe EP
arch/arm64/boot/dts/qcom/sa8775p.dtsi | 2 - drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 89 ++++++++++++---------- drivers/phy/qualcomm/phy-qcom-qmp-pcs-pcie-v5_20.h | 2 + drivers/phy/qualcomm/phy-qcom-qmp-pcs-v5_20.h | 4 + .../phy/qualcomm/phy-qcom-qmp-qserdes-ln-shrd-v5.h | 11 +++ drivers/phy/qualcomm/phy-qcom-qmp.h | 1 + 6 files changed, 66 insertions(+), 43 deletions(-)
---
base-commit: edef457004774e598fc4c1b7d1d4f0bcd9d0bb30
change-id: 20250513-update_phy-2cd804dd2401
Best regards,
Signature · 1 line
Mrinmay Sarkar <[email protected]>
PATCH v2 1/2 phy: qcom: qmp-pcie: Update PHY settings for SA8775P
From: Mrinmay Sarkar <[email protected]>
Make changes to update the PHY settings to align with the latest PCIe PHY Hardware Programming Guide for both PCIe controllers on the SA8775P platform.
Add the ln_shrd region for SA8775P, incorporating new register writes as specified in the updated Hardware Programming Guide.
Update pcs table for QCS8300, since both QCS8300 and SA8775P are closely related and share same pcs settings.
--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 89 ++++++++++++---------- drivers/phy/qualcomm/phy-qcom-qmp-pcs-pcie-v5_20.h | 2 + drivers/phy/qualcomm/phy-qcom-qmp-pcs-v5_20.h | 4 + .../phy/qualcomm/phy-qcom-qmp-qserdes-ln-shrd-v5.h | 11 +++ drivers/phy/qualcomm/phy-qcom-qmp.h | 1 + 5 files changed, 66 insertions(+), 41 deletions(-)
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +48 -41
@@ -2639,29 +2639,29 @@ static const struct qmp_phy_init_tbl sa8775p_qmp_gen4x2_pcie_rc_serdes_alt_tbl[] };static const struct qmp_phy_init_tbl sa8775p_qmp_gen4x2_pcie_rx_alt_tbl[] = { -QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_UCDR_PI_CONTROLS ,0x16 ), +QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_UCDR_PI_CONTROLS ,0x07 ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_DFE_CTLE_POST_CAL_OFFSET ,0x38 ), -QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE_0_1_B0 ,0x9a ), +QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE_0_1_B0 ,0x9b ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE_0_1_B1 ,0xb0 ), -QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE_0_1_B2 ,0x92 ), +QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE_0_1_B2 ,0xe4 ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE_0_1_B3 ,0xf0 ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE_0_1_B4 ,0x42 ), -QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE_0_1_B5 ,0x99 ), -QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE_0_1_B6 ,0x29 ), -QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE2_B0 ,0x9a ), +QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE_0_1_B5 ,0x00 ), +QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE_0_1_B6 ,0x20 ), +QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE2_B0 ,0x9b ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE2_B1 ,0xfb ), -QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE2_B2 ,0x92 ), +QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE2_B2 ,0xe4 ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE2_B3 ,0xec ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE2_B4 ,0x43 ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE2_B5 ,0xdd ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE2_B6 ,0x0d ), -QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE3_B0 ,0xf3 ), +QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE3_B0 ,0xb3 ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE3_B1 ,0xf8 ), -QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE3_B2 ,0xec ), -QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE3_B3 ,0xd6 ), -QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE3_B4 ,0x83 ), -QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE3_B5 ,0xf5 ), -QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE3_B6 ,0x5e ), +QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE3_B2 ,0xed ), +QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE3_B3 ,0xe5 ), +QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE3_B4 ,0x8d ), +QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE3_B5 ,0xd6 ), +QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE3_B6 ,0x7e ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_PHPRE_CTRL ,0x20 ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_AUX_DATA_THRESH_BIN_RATE_0_1 ,0x3f ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_AUX_DATA_THRESH_BIN_RATE_2_3 ,0x37 ),
@@ -2680,12 +2680,12 @@ static const struct qmp_phy_init_tbl sa8775p_qmp_gen4x2_pcie_rx_alt_tbl[] = {QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_UCDR_FO_GAIN_RATE3 ,0x08 ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_UCDR_SO_GAIN_RATE3 ,0x04 ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_VGA_CAL_CNTRL1 ,0x04 ), -QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_VGA_CAL_MAN_VAL ,0x08 ), -QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_EQU_ADAPTOR_CNTRL4 ,0x0b ), +QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_VGA_CAL_MAN_VAL ,0x03 ), +QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_EQU_ADAPTOR_CNTRL4 ,0x08 ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_EQ_OFFSET_ADAPTOR_CNTRL1 ,0x7c ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_IDAC_SAOFFSET ,0x10 ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_DFE_DAC_ENABLE1 ,0x00 ), -QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_GM_CAL ,0x05 ), +QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_GM_CAL ,0x01 ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_TX_ADAPT_POST_THRESH1 ,0x00 ), QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_TX_ADAPT_POST_THRESH2, 0x1f), };
@@ -2699,6 +2699,8 @@ static const struct qmp_phy_init_tbl sa8775p_qmp_gen4_pcie_tx_tbl[] = { };static const struct qmp_phy_init_tbl sa8775p_qmp_gen4_pcie_pcs_misc_tbl[] = { +QMP_PHY_INIT_CFG (QPHY_PCIE_V5_20_PCS_G3_RXEQEVAL_TIME ,0x27 ), +QMP_PHY_INIT_CFG (QPHY_PCIE_V5_20_PCS_G4_RXEQEVAL_TIME ,0x27 ),QMP_PHY_INIT_CFG (QPHY_V5_20_PCS_PCIE_EQ_CONFIG1 ,0x16 ),QMP_PHY_INIT_CFG (QPHY_V5_20_PCS_PCIE_G4_EQ_CONFIG5 ,0x02 ),QMP_PHY_INIT_CFG (QPHY_V5_20_PCS_PCIE_G4_PRE_GAIN ,0x2e ),
@@ -2711,11 +2713,19 @@ static const struct qmp_phy_init_tbl sa8775p_qmp_gen4_pcie_rc_pcs_misc_tbl[] = { QMP_PHY_INIT_CFG(QPHY_V5_20_PCS_PCIE_OSC_DTCT_ACTIONS, 0x00), }; -static const struct qmp_phy_init_tbl sa8775p_qmp_gen4x2_pcie_pcs_alt_tbl[] = { +static const struct qmp_phy_init_tbl sa8775p_qmp_gen4_pcie_pcs_alt_tbl[] = {QMP_PHY_INIT_CFG (QPHY_V5_20_PCS_EQ_CONFIG4 ,0x16 ),QMP_PHY_INIT_CFG (QPHY_V5_20_PCS_EQ_CONFIG5 ,0x22 ),QMP_PHY_INIT_CFG (QPHY_V5_20_PCS_G3S2_PRE_GAIN ,0x2e ),QMP_PHY_INIT_CFG (QPHY_V5_20_PCS_RX_SIGDET_LVL ,0x66 ), +QMP_PHY_INIT_CFG (QPHY_V5_20_PCS_LOCK_DETECT_CONFIG1 ,0xff ), +QMP_PHY_INIT_CFG (QPHY_V5_20_PCS_LOCK_DETECT_CONFIG2 ,0x89 ), +QMP_PHY_INIT_CFG (QPHY_V5_20_PCS_ALIGN_DETECT_CONFIG1 ,0x00 ), +QMP_PHY_INIT_CFG (QPHY_V5_20_PCS_ALIGN_DETECT_CONFIG2 ,0x50 ), +}; + +static const struct qmp_phy_init_tbl sa8775p_qmp_gen4x2_pcie_ln_shrd_tbl[] = { +QMP_PHY_INIT_CFG (QSERDES_v5_LN_SHRD_UCDR_PI_CTRL2,0x00 ), };static const struct qmp_phy_init_tbl sa8775p_qmp_gen4x4_pcie_rx_alt_tbl[] = {
@@ -2739,27 +2749,27 @@ static const struct qmp_phy_init_tbl sa8775p_qmp_gen4x4_pcie_rx_alt_tbl[] = {QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MARG_COARSE_THRESH5_RATE3 ,0x1f ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MARG_COARSE_THRESH6_RATE3 ,0x1f ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_Q_PI_INTRINSIC_BIAS_RATE32 ,0x09 ), -QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE_0_1_B0 ,0x99 ), +QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE_0_1_B0 ,0x9b ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE_0_1_B1 ,0xb0 ), -QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE_0_1_B2 ,0x92 ), +QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE_0_1_B2 ,0xd2 ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE_0_1_B3 ,0xf0 ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE_0_1_B4 ,0x42 ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE_0_1_B5 ,0x00 ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE_0_1_B6 ,0x20 ), -QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE2_B0 ,0x9a ), +QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE2_B0 ,0x9b ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE2_B1 ,0xb6 ), -QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE2_B2 ,0x92 ), +QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE2_B2 ,0xd2 ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE2_B3 ,0xf0 ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE2_B4 ,0x43 ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE2_B5 ,0xdd ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE2_B6 ,0x0d ), -QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE3_B0 ,0xf3 ), +QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE3_B0 ,0xb3 ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE3_B1 ,0xf6 ), -QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE3_B2 ,0xee ), -QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE3_B3 ,0xd2 ), +QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE3_B2 ,0xe4 ), +QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE3_B3 ,0xe6 ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE3_B4 ,0x83 ), -QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE3_B5 ,0xf9 ), -QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE3_B6 ,0x3d ), +QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE3_B5 ,0xd6 ), +QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_RX_MODE_RATE3_B6 ,0x7e ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_TX_ADAPT_POST_THRESH1 ,0x00 ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_TX_ADAPT_POST_THRESH2 ,0x1f ), QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_UCDR_FO_GAIN_RATE2, 0x0c),
@@ -2767,14 +2777,7 @@ static const struct qmp_phy_init_tbl sa8775p_qmp_gen4x4_pcie_rx_alt_tbl[] = {QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_UCDR_SO_GAIN_RATE3 ,0x04 ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_UCDR_PI_CONTROLS ,0x16 ),QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_VGA_CAL_CNTRL1 ,0x04 ), - QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_VGA_CAL_MAN_VAL, 0x08), -}; - -static const struct qmp_phy_init_tbl sa8775p_qmp_gen4x4_pcie_pcs_alt_tbl[] = { -QMP_PHY_INIT_CFG (QPHY_V5_20_PCS_EQ_CONFIG4 ,0x16 ), -QMP_PHY_INIT_CFG (QPHY_V5_20_PCS_EQ_CONFIG5 ,0x22 ), -QMP_PHY_INIT_CFG (QPHY_V5_20_PCS_G3S2_PRE_GAIN ,0x2e ), -QMP_PHY_INIT_CFG (QPHY_V5_20_PCS_RX_SIGDET_LVL ,0x66 ), + QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_VGA_CAL_MAN_VAL, 0x06), }; static const struct qmp_phy_init_tbl sa8775p_qmp_gen4x4_pcie_serdes_alt_tbl[] = {
@@ -3191,6 +3194,7 @@ static const struct qmp_pcie_offsets qmp_pcie_offsets_v5_20 = { .rx = 0x0200, .tx2 = 0x0800, .rx2 = 0x0a00, + .ln_shrd = 0x0e00, };static const struct qmp_pcie_offsets qmp_pcie_offsets_v5_30 = {
@@ -3398,8 +3402,8 @@ static const struct qmp_phy_cfg qcs8300_qmp_gen4x2_pciephy_cfg = { .tx_num = ARRAY_SIZE(sa8775p_qmp_gen4_pcie_tx_tbl), .rx = qcs8300_qmp_gen4x2_pcie_rx_alt_tbl, .rx_num = ARRAY_SIZE(qcs8300_qmp_gen4x2_pcie_rx_alt_tbl), - .pcs = sa8775p_qmp_gen4x2_pcie_pcs_alt_tbl, - .pcs_num = ARRAY_SIZE(sa8775p_qmp_gen4x2_pcie_pcs_alt_tbl), + .pcs = sa8775p_qmp_gen4_pcie_pcs_alt_tbl, + .pcs_num = ARRAY_SIZE(sa8775p_qmp_gen4_pcie_pcs_alt_tbl), .pcs_misc = sa8775p_qmp_gen4_pcie_pcs_misc_tbl, .pcs_misc_num = ARRAY_SIZE(sa8775p_qmp_gen4_pcie_pcs_misc_tbl), },
@@ -4067,12 +4071,15 @@ static const struct qmp_phy_cfg sa8775p_qmp_gen4x2_pciephy_cfg = { .tx_num = ARRAY_SIZE(sa8775p_qmp_gen4_pcie_tx_tbl), .rx = sa8775p_qmp_gen4x2_pcie_rx_alt_tbl, .rx_num = ARRAY_SIZE(sa8775p_qmp_gen4x2_pcie_rx_alt_tbl), - .pcs = sa8775p_qmp_gen4x2_pcie_pcs_alt_tbl, - .pcs_num = ARRAY_SIZE(sa8775p_qmp_gen4x2_pcie_pcs_alt_tbl), - .pcs_misc = sa8775p_qmp_gen4_pcie_pcs_misc_tbl, + .pcs = sa8775p_qmp_gen4_pcie_pcs_alt_tbl, + .pcs_num = ARRAY_SIZE(sa8775p_qmp_gen4_pcie_pcs_alt_tbl), + .pcs_misc = sa8775p_qmp_gen4_pcie_pcs_misc_tbl, .pcs_misc_num = ARRAY_SIZE(sa8775p_qmp_gen4_pcie_pcs_misc_tbl), .pcs_lane1 = sdx65_qmp_pcie_pcs_lane1_tbl, .pcs_lane1_num = ARRAY_SIZE(sdx65_qmp_pcie_pcs_lane1_tbl), + .ln_shrd = sa8775p_qmp_gen4x2_pcie_ln_shrd_tbl, + .ln_shrd_num = ARRAY_SIZE(sa8775p_qmp_gen4x2_pcie_ln_shrd_tbl), + }, .tbls_rc = &(const struct qmp_phy_cfg_tbls ) {
@@ -4112,8 +4119,8 @@ static const struct qmp_phy_cfg sa8775p_qmp_gen4x4_pciephy_cfg = { .tx_num = ARRAY_SIZE(sa8775p_qmp_gen4_pcie_tx_tbl), .rx = sa8775p_qmp_gen4x4_pcie_rx_alt_tbl, .rx_num = ARRAY_SIZE(sa8775p_qmp_gen4x4_pcie_rx_alt_tbl), - .pcs = sa8775p_qmp_gen4x4_pcie_pcs_alt_tbl, - .pcs_num = ARRAY_SIZE(sa8775p_qmp_gen4x4_pcie_pcs_alt_tbl), + .pcs = sa8775p_qmp_gen4_pcie_pcs_alt_tbl, + .pcs_num = ARRAY_SIZE(sa8775p_qmp_gen4_pcie_pcs_alt_tbl), .pcs_misc = sa8775p_qmp_gen4_pcie_pcs_misc_tbl, .pcs_misc_num = ARRAY_SIZE(sa8775p_qmp_gen4_pcie_pcs_misc_tbl), },
drivers/phy/qualcomm/phy-qcom-qmp-pcs-pcie-v5_20.h +2 -0
@@ -13,6 +13,8 @@#define QPHY_V5_20_PCS_PCIE_OSC_DTCT_ACTIONS 0x090#define QPHY_V5_20_PCS_PCIE_EQ_CONFIG1 0x0a0#define QPHY_V5_20_PCS_PCIE_PRESET_P10_POST 0x0e0 +#define QPHY_PCIE_V5_20_PCS_G3_RXEQEVAL_TIME 0x0f0 +#define QPHY_PCIE_V5_20_PCS_G4_RXEQEVAL_TIME 0x0f4#define QPHY_V5_20_PCS_PCIE_G4_EQ_CONFIG2 0x0fc#define QPHY_V5_20_PCS_PCIE_G4_EQ_CONFIG5 0x108#define QPHY_V5_20_PCS_PCIE_G4_PRE_GAIN 0x15c
drivers/phy/qualcomm/phy-qcom-qmp-pcs-v5_20.h +4 -0
@@ -8,8 +8,12 @@#define QPHY_V5_20_PCS_INSIG_SW_CTRL7 0x060#define QPHY_V5_20_PCS_INSIG_MX_CTRL7 0x07c +#define QPHY_V5_20_PCS_LOCK_DETECT_CONFIG1 0x0c4 +#define QPHY_V5_20_PCS_LOCK_DETECT_CONFIG2 0x0c8#define QPHY_V5_20_PCS_G3S2_PRE_GAIN 0x170#define QPHY_V5_20_PCS_RX_SIGDET_LVL 0x188 +#define QPHY_V5_20_PCS_ALIGN_DETECT_CONFIG1 0x1b8 +#define QPHY_V5_20_PCS_ALIGN_DETECT_CONFIG2 0x1bc#define QPHY_V5_20_PCS_EQ_CONFIG2 0x1d8#define QPHY_V5_20_PCS_EQ_CONFIG4 0x1e0#define QPHY_V5_20_PCS_EQ_CONFIG5 0x1e4
drivers/phy/qualcomm/phy-qcom-qmp-qserdes-ln-shrd-v5.h new file +11 -0
@@ -0,0 +1,11 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright (c) 2025, The Linux Foundation. All rights reserved. +*/ + +#ifndef QCOM_PHY_QMP_QSERDES_LN_SHRD_V5_H_ +#define QCOM_PHY_QMP_QSERDES_LN_SHRD_V5_H_ + +#define QSERDES_v5_LN_SHRD_UCDR_PI_CTRL2 0x04c + +#endif
drivers/phy/qualcomm/phy-qcom-qmp.h +1 -0
@@ -25,6 +25,7 @@#include "phy-qcom-qmp-qserdes-txrx-v6.h" #include "phy-qcom-qmp-qserdes-txrx-v6_20.h" #include "phy-qcom-qmp-qserdes-txrx-v6_n4.h" +#include "phy-qcom-qmp-qserdes-ln-shrd-v5.h" #include "phy-qcom-qmp-qserdes-ln-shrd-v6.h" #include "phy-qcom-qmp-qserdes-com-v7.h"
Signature · 1 line
2.25.1
[email protected]
reviewerRe: [PATCH v2 1/2] phy: qcom: qmp-pcie: Update PHY settings for SA8775P
Hi,
Quoted 12 lines · Mrinmay Sarkar
From: Mrinmay Sarkar <[email protected]>
Make changes to update the PHY settings to align with the latest PCIe PHY Hardware Programming Guide for both PCIe controllers on the SA8775P platform.
Add the
ln_shrdregion for SA8775P, incorporating new register writes as specified in the updated Hardware Programming Guide.Update pcs table for QCS8300, since both QCS8300 and SA8775P are closely related and share same pcs settings.
Quoted 8 lines
Signed-off-by Mrinmay Sarkar <[email protected]>--- drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 89 ++++++++++++---------- drivers/phy/qualcomm/phy-qcom-qmp-pcs-pcie-v5_20.h | 2 + drivers/phy/qualcomm/phy-qcom-qmp-pcs-v5_20.h | 4 + .../phy/qualcomm/phy-qcom-qmp-qserdes-ln-shrd-v5.h | 11 +++ drivers/phy/qualcomm/phy-qcom-qmp.h | 1 + 5 files changed, 66 insertions(+), 41 deletions(-
I think the subject should be "Update PHY settings for QCS8300 & SA8775P".
As my comment on patch 2, what's the relationship ? does those PHY settings fix the "Gen4 stability issues" or are needed for the Gen4 equalization ?
Thanks,
Neil
Re: [PATCH v2 1/2] phy: qcom: qmp-pcie: Update PHY settings for SA8775P
In reply to Mrinmay SarkarQuoted 6 lines · Mrinmay Sarkar
From: Mrinmay Sarkar <[email protected]>
Make changes to update the PHY settings to align with the latest PCIe PHY Hardware Programming Guide for both PCIe controllers on the SA8775P platform.
Quoted 8 lines
Add the
ln_shrdregion for SA8775P, incorporating new register writes as specified in the updated Hardware Programming Guide.Update pcs table for QCS8300, since both QCS8300 and SA8775P are closely related and share same pcs settings.
Signed-off-by Mrinmay Sarkar <[email protected]>---
So I took a closer look and please re-validate the changes, I checked one write randomly and it turned out to be inconsistent
[...]
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c static const struct qmp_phy_init_tbl sa8775p_qmp_gen4x2_pcie_rx_alt_tbl[] = { · line 2683
Quoted 3 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +1
-2-QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_VGA_CAL_MAN_VAL ,0x08 ), - QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_EQU_ADAPTOR_CNTRL4, 0x0b), + QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_VGA_CAL_MAN_VAL, 0x03),
^ this should be 0x0a according to reference v1.19 for RC mode
Konrad
A message that is not in the archive (sent off-list or not yet received): CAMyL0qPmMVt1Wd4fkQsf_pt8ggJhpR=u7GbXtifczK4Xp8yRJA@mail.gmail.com
Re: [PATCH v2 1/2] phy: qcom: qmp-pcie: Update PHY settings for SA8775P
Quoted 25 lines · Mrinmay Sarkar
Quoted 23 lines · Konrad Dybcio
Quoted 6 lines · Mrinmay Sarkar
From: Mrinmay Sarkar <[email protected]>
Make changes to update the PHY settings to align with the latest PCIe PHY Hardware Programming Guide for both PCIe controllers on the SA8775P platform.
Quoted 8 lines
Add the
ln_shrdregion for SA8775P, incorporating new register writes as specified in the updated Hardware Programming Guide.Update pcs table for QCS8300, since both QCS8300 and SA8775P are closely related and share same pcs settings.
Signed-off-by Mrinmay Sarkar <[email protected]>---
So I took a closer look and please re-validate the changes, I checked one write randomly and it turned out to be inconsistent
[...]
Quoted 7 lines
Quoted 6 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c static const struct qmp_phy_init_tbl sa8775p_qmp_gen4x2_pcie_rx_alt_tbl[] = { · line 2683
Quoted 3 lines
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c +1
-2-QMP_PHY_INIT_CFG (QSERDES_V5_20_RX_VGA_CAL_MAN_VAL ,0x08 ), - QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_RX_EQU_ADAPTOR_CNTRL4, 0x0b), + QMP_PHY_INIT_CFG(QSERDES_V5_20_RX_VGA_CAL_MAN_VAL, 0x03),^ this should be
0x0aaccording to reference v1.19 for RC modeAs per v1.19 for SA8775 RC mode I can see the value for this is
0x03only.
Ah right, the docs are structured in a confusing way..
Konrad
PATCH v2 2/2 arm64: dts: qcom: sa8775p: Remove max link speed property for PCIe EP
In reply to Mrinmay SarkarFrom: Mrinmay Sarkar <[email protected]>
The maximum link speed was previously restricted to Gen3 due to the absence of Gen4 equalization support in the driver.
Add change to remove max link speed property, Since Gen4 equalization support has already been added into the driver.
--- arch/arm64/boot/dts/qcom/sa8775p.dtsi | 2 -- 1 file changed, 2 deletions(-)
arch/arm64/boot/dts/qcom/sa8775p.dtsi +0 -2
@@ -6462,7 +6462,6 @@ pcie0_ep: pcie-ep@1c00000 { power-domains = <&gcc PCIE_0_GDSC>; phys = <&pcie0_phy>; phy-names = "pciephy"; - max-link-speed = <3>; /* FIXME: Limiting the Gen speed due to stability issues */ num-lanes = <2>; linux,pci-domain = <0>;
@@ -6620,7 +6619,6 @@ pcie1_ep: pcie-ep@1c10000 { power-domains = <&gcc PCIE_1_GDSC>; phys = <&pcie1_phy>; phy-names = "pciephy"; - max-link-speed = <3>; /* FIXME: Limiting the Gen speed due to stability issues */ num-lanes = <4>; linux,pci-domain = <1>;
Signature · 1 line
2.25.1
[email protected]
reviewerRe: [PATCH v2 2/2] arm64: dts: qcom: sa8775p: Remove max link speed property for PCIe EP
Quoted 7 lines · Mrinmay Sarkar
From: Mrinmay Sarkar <[email protected]>
The maximum link speed was previously restricted to Gen3 due to the absence of Gen4 equalization support in the driver.
Add change to remove max link speed property, Since Gen4 equalization support has already been added into the driver.
Which driver, PHY or Controller ? does this change depends on the patch 1 PHY settings update ?
Quoted 27 lines
Signed-off-by Mrinmay Sarkar <[email protected]>--- arch/arm64/boot/dts/qcom/sa8775p.dtsi | 2 -- 1 file changed, 2 deletions(-)arch/arm64/boot/dts/qcom/sa8775p.dtsi +0
-2@@ -6462,7 +6462,6 @@ pcie0_ep: pcie-ep@1c00000 { power-domains = <&gcc PCIE_0_GDSC>; phys = <&pcie0_phy>; phy-names = "pciephy"; - max-link-speed = <3>; /* FIXME: Limiting the Gen speed due to stability issues */ num-lanes = <2>; linux,pci-domain = <0>;@@ -6620,7 +6619,6 @@ pcie1_ep: pcie-ep@1c10000 { power-domains = <&gcc PCIE_1_GDSC>; phys = <&pcie1_phy>; phy-names = "pciephy"; - max-link-speed = <3>; /* FIXME: Limiting the Gen speed due to stability issues */ num-lanes = <4>; linux,pci-domain = <1>;
Re: [PATCH v2 2/2] arm64: dts: qcom: sa8775p: Remove max link speed property for PCIe EP
Quoted 10 lines · On 5/14/25 6:38 PM, [email protected] wrote:
Quoted 7 lines · Mrinmay Sarkar
From: Mrinmay Sarkar <[email protected]>
The maximum link speed was previously restricted to Gen3 due to the absence of Gen4 equalization support in the driver.
Add change to remove max link speed property, Since Gen4 equalization support has already been added into the driver.
Which driver, PHY or Controller ?
Controller, see
09483959e34d ("PCI: dwc: Add support for configuring lane equalization presets")
and commits around it
does this change depends on the patch 1 PHY settings update ?
That I'm curious about too, but I would guesstimate no
Konrad
Re: [PATCH v2 2/2] arm64: dts: qcom: sa8775p: Remove max link speed property for PCIe EP
Quoted 8 lines · Konrad Dybcio
Quoted 6 lines · On 5/14/25 6:38 PM, [email protected] wrote:
Quoted 5 lines · Mrinmay Sarkar
From: Mrinmay Sarkar <[email protected]>
The maximum link speed was previously restricted to Gen3 due to the absence of Gen4 equalization support in the driver.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Add change to remove max link speed property, Since Gen4 equalization support has already been added into the driver.
Which driver, PHY or Controller ?
Controller, see
09483959e34d("PCI: dwc: Add support for configuring lane equalization presets")
Yes, this patch is helping to solve gen4 stability issue.
Quoted 7 lines
and commits around it
does this change depends on the patch 1 PHY settings update ?
That I'm curious about too, but I would guesstimate no
this change doesn't depends on the patch 1 PHY settings update
Quoted 1 line
Konrad
Mrinmay
Re: [PATCH v2 2/2] arm64: dts: qcom: sa8775p: Remove max link speed property for PCIe EP
Quoted 21 lines · Mrinmay Sarkar
Quoted 8 lines · Konrad Dybcio
Quoted 6 lines · On 5/14/25 6:38 PM, [email protected] wrote:
Quoted 5 lines · Mrinmay Sarkar
From: Mrinmay Sarkar <[email protected]>
The maximum link speed was previously restricted to Gen3 due to the absence of Gen4 equalization support in the driver.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Add change to remove max link speed property, Since Gen4 equalization support has already been added into the driver.
Which driver, PHY or Controller ?
Controller, see
09483959e34d("PCI: dwc: Add support for configuring lane equalization presets")Yes, this patch is helping to solve gen4 stability issue.
Quoted 1 line
Quoted 7 lines
Quoted 6 lines
and commits around it
does this change depends on the patch 1 PHY settings update ?
That I'm curious about too, but I would guesstimate no
this change doesn't depends on the patch 1 PHY settings update
Then what has changed, as previously it was documented to have stability issues.
Signature · 2 lines
With best wishes Dmitry
Re: [PATCH v2 2/2] arm64: dts: qcom: sa8775p: Remove max link speed property for PCIe EP
Quoted 25 lines · Dmitry Baryshkov
Quoted 23 lines · Mrinmay Sarkar
Quoted 8 lines · Konrad Dybcio
Quoted 6 lines · On 5/14/25 6:38 PM, [email protected] wrote:
Quoted 5 lines · Mrinmay Sarkar
From: Mrinmay Sarkar <[email protected]>
The maximum link speed was previously restricted to Gen3 due to the absence of Gen4 equalization support in the driver.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Add change to remove max link speed property, Since Gen4 equalization support has already been added into the driver.
Which driver, PHY or Controller ?
Controller, see
09483959e34d("PCI: dwc: Add support for configuring lane equalization presets")Yes, this patch is helping to solve gen4 stability issue.
Quoted 3 lines
and commits around it
Quoted 9 lines
Quoted 5 lines
Quoted 4 lines
does this change depends on the patch 1 PHY settings update ?
That I'm curious about too, but I would guesstimate no
this change doesn't depends on the patch 1 PHY settings update
Then what has changed, as previously it was documented to have stability issues.
Actually this controller change is solving the stability issue with
gen4: "PCI: qcom: Add equalization settings for 16.0 GT/s"
https://lore.kernel.org/linux-pci/[email protected]/
Thanks,
Mrinmay
Quoted 3 lines
--
With best wishes
Dmitry
Neil Armstrong
reviewerRe: [PATCH v2 2/2] arm64: dts: qcom: sa8775p: Remove max link speed property for PCIe EP
Quoted 31 lines · Mrinmay Sarkar
Quoted 29 lines · Dmitry Baryshkov
Quoted 27 lines · Mrinmay Sarkar
Quoted 8 lines · Konrad Dybcio
Quoted 6 lines · On 5/14/25 6:38 PM, [email protected] wrote:
Quoted 5 lines · Mrinmay Sarkar
From: Mrinmay Sarkar <[email protected]>
The maximum link speed was previously restricted to Gen3 due to the absence of Gen4 equalization support in the driver.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Add change to remove max link speed property, Since Gen4 equalization support has already been added into the driver.
Which driver, PHY or Controller ?
Controller, see
09483959e34d("PCI: dwc: Add support for configuring lane equalization presets")Yes, this patch is helping to solve gen4 stability issue.
Quoted 7 lines
and commits around it
does this change depends on the patch 1 PHY settings update ?
That I'm curious about too, but I would guesstimate no
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
this change doesn't depends on the patch 1 PHY settings update
Then what has changed, as previously it was documented to have stability issues.
Actually this controller change is solving the stability issue with
gen4: "PCI: qcom: Add equalization settings for 16.0 GT/s"
https://lore.kernel.org/linux-pci/[email protected]/
Ok so those patches should be send separately and will reduce maintainers work by trying to figure out if there's a dependency.
Neil
Quoted 6 lines
Thanks,
MrinmayQuoted 3 lines
--
With best wishes
Dmitry