Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

phy: qcom-qmp-ufs: Add HS G4 mode support to SM8150 SoC

UFS PHY in SM8150 SoC is capable of operating at HS G4 mode. Hence, add the
required register settings using the tables_hs_g4 struct instance.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tested-by: Andrew Halaney <ahalaney@redhat.com> # Qdrive3/sa8540p-ride
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20230114071009.88102-8-manivannan.sadhasivam@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Manivannan Sadhasivam and committed by
Vinod Koul
f89dcb24 0cf7620e

+36
+36
drivers/phy/qualcomm/phy-qcom-qmp-ufs.c
··· 379 379 QMP_PHY_INIT_CFG(QSERDES_V4_TX_TRAN_DRVR_EMP_EN, 0x0c), 380 380 }; 381 381 382 + static const struct qmp_phy_init_tbl sm8150_ufsphy_hs_g4_tx[] = { 383 + QMP_PHY_INIT_CFG(QSERDES_V4_TX_LANE_MODE_1, 0x75), 384 + }; 385 + 382 386 static const struct qmp_phy_init_tbl sm8150_ufsphy_rx[] = { 383 387 QMP_PHY_INIT_CFG(QSERDES_V4_RX_SIGDET_LVL, 0x24), 384 388 QMP_PHY_INIT_CFG(QSERDES_V4_RX_SIGDET_CNTRL, 0x0f), ··· 420 416 QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_10_HIGH4, 0xb1), 421 417 }; 422 418 419 + static const struct qmp_phy_init_tbl sm8150_ufsphy_hs_g4_rx[] = { 420 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_UCDR_SO_SATURATION_AND_ENABLE, 0x5a), 421 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_UCDR_PI_CTRL2, 0x81), 422 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_UCDR_FO_GAIN, 0x0e), 423 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_TERM_BW, 0x6f), 424 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_IDAC_MEASURE_TIME, 0x20), 425 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_IDAC_TSETTLE_LOW, 0x80), 426 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_IDAC_TSETTLE_HIGH, 0x01), 427 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_LOW, 0x3f), 428 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_HIGH, 0xff), 429 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_HIGH2, 0xff), 430 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_HIGH3, 0x7f), 431 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_HIGH4, 0x6c), 432 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_01_LOW, 0x6d), 433 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_01_HIGH, 0x6d), 434 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_01_HIGH2, 0xed), 435 + QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_01_HIGH4, 0x3c), 436 + }; 437 + 423 438 static const struct qmp_phy_init_tbl sm8150_ufsphy_pcs[] = { 424 439 QMP_PHY_INIT_CFG(QPHY_V4_PCS_UFS_RX_SIGDET_CTRL2, 0x6d), 425 440 QMP_PHY_INIT_CFG(QPHY_V4_PCS_UFS_TX_LARGE_AMP_DRV_LVL, 0x0a), ··· 447 424 QMP_PHY_INIT_CFG(QPHY_V4_PCS_UFS_DEBUG_BUS_CLKSEL, 0x1f), 448 425 QMP_PHY_INIT_CFG(QPHY_V4_PCS_UFS_RX_MIN_HIBERN8_TIME, 0xff), 449 426 QMP_PHY_INIT_CFG(QPHY_V4_PCS_UFS_MULTI_LANE_CTRL1, 0x02), 427 + }; 428 + 429 + static const struct qmp_phy_init_tbl sm8150_ufsphy_hs_g4_pcs[] = { 430 + QMP_PHY_INIT_CFG(QPHY_V4_PCS_UFS_TX_LARGE_AMP_DRV_LVL, 0x10), 431 + QMP_PHY_INIT_CFG(QPHY_V4_PCS_UFS_BIST_FIXED_PAT_CTRL, 0x0a), 450 432 }; 451 433 452 434 static const struct qmp_phy_init_tbl sm8350_ufsphy_serdes[] = { ··· 796 768 .tbls_hs_b = { 797 769 .serdes = sm8150_ufsphy_hs_b_serdes, 798 770 .serdes_num = ARRAY_SIZE(sm8150_ufsphy_hs_b_serdes), 771 + }, 772 + .tbls_hs_g4 = { 773 + .tx = sm8150_ufsphy_hs_g4_tx, 774 + .tx_num = ARRAY_SIZE(sm8150_ufsphy_hs_g4_tx), 775 + .rx = sm8150_ufsphy_hs_g4_rx, 776 + .rx_num = ARRAY_SIZE(sm8150_ufsphy_hs_g4_rx), 777 + .pcs = sm8150_ufsphy_hs_g4_pcs, 778 + .pcs_num = ARRAY_SIZE(sm8150_ufsphy_hs_g4_pcs), 799 779 }, 800 780 .clk_list = sdm845_ufs_phy_clk_l, 801 781 .num_clks = ARRAY_SIZE(sdm845_ufs_phy_clk_l),