Skip to content

Commit ef2bd6c

Browse files
JIaxygavinodkoul
authored andcommitted
phy: qcom-qmp-ufs: Add SM8475 support
Add the tables and constants for init sequences for UFS QMP phy found in SM8475 SoC. Signed-off-by: Danila Tikhonov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 5787731 commit ef2bd6c

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

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

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -722,6 +722,38 @@ static const struct qmp_phy_init_tbl sm8350_ufsphy_g4_pcs[] = {
722722
QMP_PHY_INIT_CFG(QPHY_V5_PCS_UFS_BIST_FIXED_PAT_CTRL, 0x0a),
723723
};
724724

725+
static const struct qmp_phy_init_tbl sm8475_ufsphy_serdes[] = {
726+
QMP_PHY_INIT_CFG(QSERDES_V6_COM_SYSCLK_EN_SEL, 0xd9),
727+
QMP_PHY_INIT_CFG(QSERDES_V6_COM_CMN_CONFIG_1, 0x16),
728+
QMP_PHY_INIT_CFG(QSERDES_V6_COM_HSCLK_SEL_1, 0x11),
729+
QMP_PHY_INIT_CFG(QSERDES_V6_COM_HSCLK_HS_SWITCH_SEL_1, 0x00),
730+
QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP_EN, 0x01),
731+
QMP_PHY_INIT_CFG(QSERDES_V6_COM_VCO_TUNE_INITVAL2, 0x00),
732+
QMP_PHY_INIT_CFG(QSERDES_V6_COM_DEC_START_MODE0, 0x82),
733+
QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_RCTRL_MODE0, 0x18),
734+
QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_CCTRL_MODE0, 0x18),
735+
QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP1_MODE0, 0xff),
736+
QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP2_MODE0, 0x0c),
737+
};
738+
739+
static const struct qmp_phy_init_tbl sm8475_ufsphy_g4_serdes[] = {
740+
QMP_PHY_INIT_CFG(QSERDES_V6_COM_VCO_TUNE_MAP, 0x04),
741+
QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_IVCO, 0x0f),
742+
QMP_PHY_INIT_CFG(QSERDES_V6_COM_CP_CTRL_MODE0, 0x14),
743+
QMP_PHY_INIT_CFG(QSERDES_V6_COM_DEC_START_MODE1, 0x98),
744+
QMP_PHY_INIT_CFG(QSERDES_V6_COM_CP_CTRL_MODE1, 0x14),
745+
QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_RCTRL_MODE1, 0x18),
746+
QMP_PHY_INIT_CFG(QSERDES_V6_COM_PLL_CCTRL_MODE1, 0x18),
747+
QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP1_MODE1, 0x32),
748+
QMP_PHY_INIT_CFG(QSERDES_V6_COM_LOCK_CMP2_MODE1, 0x0f),
749+
};
750+
751+
static const struct qmp_phy_init_tbl sm8475_ufsphy_g4_pcs[] = {
752+
QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_PLL_CNTL, 0x0b),
753+
QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_TX_HSGEAR_CAPABILITY, 0x04),
754+
QMP_PHY_INIT_CFG(QPHY_V6_PCS_UFS_RX_HSGEAR_CAPABILITY, 0x04),
755+
};
756+
725757
static const struct qmp_phy_init_tbl sm8550_ufsphy_serdes[] = {
726758
QMP_PHY_INIT_CFG(QSERDES_V6_COM_SYSCLK_EN_SEL, 0xd9),
727759
QMP_PHY_INIT_CFG(QSERDES_V6_COM_CMN_CONFIG_1, 0x16),
@@ -1346,6 +1378,42 @@ static const struct qmp_phy_cfg sm8450_ufsphy_cfg = {
13461378
.regs = ufsphy_v5_regs_layout,
13471379
};
13481380

1381+
static const struct qmp_phy_cfg sm8475_ufsphy_cfg = {
1382+
.lanes = 2,
1383+
1384+
.offsets = &qmp_ufs_offsets_v6,
1385+
.max_supported_gear = UFS_HS_G4,
1386+
1387+
.tbls = {
1388+
.serdes = sm8475_ufsphy_serdes,
1389+
.serdes_num = ARRAY_SIZE(sm8475_ufsphy_serdes),
1390+
.tx = sm8550_ufsphy_tx,
1391+
.tx_num = ARRAY_SIZE(sm8550_ufsphy_tx),
1392+
.rx = sm8550_ufsphy_rx,
1393+
.rx_num = ARRAY_SIZE(sm8550_ufsphy_rx),
1394+
.pcs = sm8550_ufsphy_pcs,
1395+
.pcs_num = ARRAY_SIZE(sm8550_ufsphy_pcs),
1396+
},
1397+
.tbls_hs_b = {
1398+
.serdes = sm8550_ufsphy_hs_b_serdes,
1399+
.serdes_num = ARRAY_SIZE(sm8550_ufsphy_hs_b_serdes),
1400+
},
1401+
.tbls_hs_overlay[0] = {
1402+
.serdes = sm8475_ufsphy_g4_serdes,
1403+
.serdes_num = ARRAY_SIZE(sm8475_ufsphy_g4_serdes),
1404+
.tx = sm8550_ufsphy_g4_tx,
1405+
.tx_num = ARRAY_SIZE(sm8550_ufsphy_g4_tx),
1406+
.rx = sm8550_ufsphy_g4_rx,
1407+
.rx_num = ARRAY_SIZE(sm8550_ufsphy_g4_rx),
1408+
.pcs = sm8475_ufsphy_g4_pcs,
1409+
.pcs_num = ARRAY_SIZE(sm8475_ufsphy_g4_pcs),
1410+
.max_gear = UFS_HS_G4,
1411+
},
1412+
.vreg_list = qmp_phy_vreg_l,
1413+
.num_vregs = ARRAY_SIZE(qmp_phy_vreg_l),
1414+
.regs = ufsphy_v6_regs_layout,
1415+
};
1416+
13491417
static const struct qmp_phy_cfg sm8550_ufsphy_cfg = {
13501418
.lanes = 2,
13511419

@@ -1941,6 +2009,9 @@ static const struct of_device_id qmp_ufs_of_match_table[] = {
19412009
}, {
19422010
.compatible = "qcom,sm8450-qmp-ufs-phy",
19432011
.data = &sm8450_ufsphy_cfg,
2012+
}, {
2013+
.compatible = "qcom,sm8475-qmp-ufs-phy",
2014+
.data = &sm8475_ufsphy_cfg,
19442015
}, {
19452016
.compatible = "qcom,sm8550-qmp-ufs-phy",
19462017
.data = &sm8550_ufsphy_cfg,

0 commit comments

Comments
 (0)