]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
phy: qcom: Add SM8150 to QMP UFS PHY driver
authorJulius Lehmann <lehmanju@devpi.de>
Wed, 2 Oct 2024 18:52:17 +0000 (20:52 +0200)
committerCaleb Connolly <caleb.connolly@linaro.org>
Wed, 20 Nov 2024 16:57:58 +0000 (17:57 +0100)
Copy PHY tables over from Linux to support SM8150

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
drivers/phy/qcom/phy-qcom-qmp-ufs.c

index eef0093e1869b012b09d3c63588d48e71c135128..5c90d60e7d10fc3653e2dfa3fbaad77bda8a13cf 100644 (file)
@@ -183,6 +183,29 @@ static const struct qmp_ufs_init_tbl sdm845_ufsphy_pcs[] = {
        QMP_PHY_INIT_CFG(QPHY_V3_PCS_UFS_MULTI_LANE_CTRL1, 0x02),
 };
 
+static const struct qmp_ufs_init_tbl sm8150_ufsphy_hs_g4_tx[] = {
+       QMP_PHY_INIT_CFG(QSERDES_V4_TX_LANE_MODE_1, 0x75),
+};
+
+static const struct qmp_ufs_init_tbl sm8150_ufsphy_hs_g4_rx[] = {
+       QMP_PHY_INIT_CFG(QSERDES_V4_RX_UCDR_SO_SATURATION_AND_ENABLE, 0x5a),
+       QMP_PHY_INIT_CFG(QSERDES_V4_RX_UCDR_PI_CTRL2, 0x81),
+       QMP_PHY_INIT_CFG(QSERDES_V4_RX_UCDR_FO_GAIN, 0x0e),
+       QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_TERM_BW, 0x6f),
+       QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_IDAC_MEASURE_TIME, 0x20),
+       QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_IDAC_TSETTLE_LOW, 0x80),
+       QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_IDAC_TSETTLE_HIGH, 0x01),
+       QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_LOW, 0x3f),
+       QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_HIGH, 0xff),
+       QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_HIGH2, 0xff),
+       QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_HIGH3, 0x7f),
+       QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_00_HIGH4, 0x6c),
+       QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_01_LOW, 0x6d),
+       QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_01_HIGH, 0x6d),
+       QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_01_HIGH2, 0xed),
+       QMP_PHY_INIT_CFG(QSERDES_V4_RX_RX_MODE_01_HIGH4, 0x3c),
+};
+
 static const struct qmp_ufs_init_tbl sm8150_ufsphy_serdes[] = {
        QMP_PHY_INIT_CFG(QSERDES_V4_COM_SYSCLK_EN_SEL, 0xd9),
        QMP_PHY_INIT_CFG(QSERDES_V4_COM_HSCLK_SEL, 0x11),
@@ -723,6 +746,44 @@ static const struct qmp_ufs_cfg sdm845_ufsphy_cfg = {
        .no_pcs_sw_reset        = true,
 };
 
+static const struct qmp_ufs_cfg sm8150_ufsphy_cfg = {
+       .lanes                  = 2,
+
+       .offsets                = &qmp_ufs_offsets,
+
+       .tbls = {
+               .serdes         = sm8150_ufsphy_serdes,
+               .serdes_num     = ARRAY_SIZE(sm8150_ufsphy_serdes),
+               .tx             = sm8150_ufsphy_tx,
+               .tx_num         = ARRAY_SIZE(sm8150_ufsphy_tx),
+               .rx             = sm8150_ufsphy_rx,
+               .rx_num         = ARRAY_SIZE(sm8150_ufsphy_rx),
+               .pcs            = sm8150_ufsphy_pcs,
+               .pcs_num        = ARRAY_SIZE(sm8150_ufsphy_pcs),
+       },
+       .tbls_hs_b = {
+               .serdes         = sm8150_ufsphy_hs_b_serdes,
+               .serdes_num     = ARRAY_SIZE(sm8150_ufsphy_hs_b_serdes),
+       },
+       .tbls_hs_g4 = {
+               .tx             = sm8150_ufsphy_hs_g4_tx,
+               .tx_num         = ARRAY_SIZE(sm8150_ufsphy_hs_g4_tx),
+               .rx             = sm8150_ufsphy_hs_g4_rx,
+               .rx_num         = ARRAY_SIZE(sm8150_ufsphy_hs_g4_rx),
+               .pcs            = sm8150_ufsphy_hs_g4_pcs,
+               .pcs_num        = ARRAY_SIZE(sm8150_ufsphy_hs_g4_pcs),
+       },
+       .clk_list               = sdm845_ufs_phy_clk_l,
+       .num_clks               = ARRAY_SIZE(sdm845_ufs_phy_clk_l),
+       .vreg_list              = qmp_ufs_vreg_l,
+       .num_vregs              = ARRAY_SIZE(qmp_ufs_vreg_l),
+       .reset_list             = qmp_ufs_reset_l,
+       .num_resets             = ARRAY_SIZE(qmp_ufs_reset_l),
+       .regs                   = ufsphy_v4_regs_layout,
+
+       .no_pcs_sw_reset        = false,
+};
+
 static const struct qmp_ufs_cfg sm8250_ufsphy_cfg = {
        .lanes                  = 2,
 
@@ -1235,6 +1296,7 @@ static struct phy_ops qmp_ufs_ops = {
 
 static const struct udevice_id qmp_ufs_ids[] = {
        { .compatible = "qcom,sdm845-qmp-ufs-phy", .data = (ulong)&sdm845_ufsphy_cfg },
+       { .compatible = "qcom,sm8150-qmp-ufs-phy", .data = (ulong)&sm8150_ufsphy_cfg },
        { .compatible = "qcom,sm8250-qmp-ufs-phy", .data = (ulong)&sm8250_ufsphy_cfg },
        { .compatible = "qcom,sm8550-qmp-ufs-phy", .data = (ulong)&sm8550_ufsphy_cfg },
        { .compatible = "qcom,sm8650-qmp-ufs-phy", .data = (ulong)&sm8650_ufsphy_cfg },