diff mbox series

[1/2] phy/qualcomm: add hbr3_hbr2 voltage and premphasis swing table

Message ID 1613604031-27798-1-git-send-email-khsieh@codeaurora.org (mailing list archive)
State Not Applicable, archived
Headers show
Series [1/2] phy/qualcomm: add hbr3_hbr2 voltage and premphasis swing table | expand

Commit Message

Kuogee Hsieh Feb. 17, 2021, 11:20 p.m. UTC
Add hbr3_hbr2 voltage and premphasis swing table to support
HBR3 link rate.

Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
---
 drivers/phy/qualcomm/phy-qcom-qmp.c | 23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

Comments

Stephen Boyd Feb. 17, 2021, 11:43 p.m. UTC | #1
Quoting Kuogee Hsieh (2021-02-17 15:20:31)
> Add hbr3_hbr2 voltage and premphasis swing table to support
> HBR3 link rate.
> 
> Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
> ---
>  drivers/phy/qualcomm/phy-qcom-qmp.c | 23 +++++++++++++++++++++--
>  1 file changed, 21 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c
> index 0939a9e..c920143 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp.c
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp.c
> @@ -2965,6 +2965,20 @@ static void qcom_qmp_phy_dp_aux_init(struct qmp_phy *qphy)
>                qphy->pcs + QSERDES_V3_DP_PHY_AUX_INTERRUPT_MASK);
>  }
>  
> +static const u8 qmp_dp_v3_pre_emphasis_hbr3_hbr2[4][4] = {
> +        { 0x00, 0x0C, 0x15, 0x1A },
> +        { 0x02, 0x0E, 0x16, 0xFF },
> +        { 0x02, 0x11, 0xFF, 0xFF },
> +        { 0x04, 0xFF, 0xFF, 0xFF }

Lowercase hex please.

> +};
> +
> +static const u8 qmp_dp_v3_voltage_swing_hbr3_hbr2[4][4] = {
> +        { 0x02, 0x12, 0x16, 0x1A },
> +        { 0x09, 0x19, 0x1F, 0xFF },
> +        { 0x10, 0x1F, 0xFF, 0xFF },
> +        { 0x1F, 0xFF, 0xFF, 0xFF }
> +};

Lowercase hex please.

> +
>  static const u8 qmp_dp_v3_pre_emphasis_hbr_rbr[4][4] = {
>         { 0x00, 0x0c, 0x14, 0x19 },
>         { 0x00, 0x0b, 0x12, 0xff },
> @@ -3000,8 +3014,13 @@ static void qcom_qmp_phy_configure_dp_tx(struct qmp_phy *qphy)
>                 drvr_en = 0x10;
>         }
>  
> -       voltage_swing_cfg = qmp_dp_v3_voltage_swing_hbr_rbr[v_level][p_level];
> -       pre_emphasis_cfg = qmp_dp_v3_pre_emphasis_hbr_rbr[v_level][p_level];
> +       if (dp_opts->link_rate <= 2700) {
> +               voltage_swing_cfg = qmp_dp_v3_voltage_swing_hbr_rbr[v_level][p_level];
> +               pre_emphasis_cfg = qmp_dp_v3_pre_emphasis_hbr_rbr[v_level][p_level];
> +       } else {
> +               voltage_swing_cfg = qmp_dp_v3_voltage_swing_hbr3_hbr2[v_level][p_level];
> +               pre_emphasis_cfg = qmp_dp_v3_pre_emphasis_hbr3_hbr2[v_level][p_level];
> +       }
>
diff mbox series

Patch

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c
index 0939a9e..c920143 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp.c
@@ -2965,6 +2965,20 @@  static void qcom_qmp_phy_dp_aux_init(struct qmp_phy *qphy)
 	       qphy->pcs + QSERDES_V3_DP_PHY_AUX_INTERRUPT_MASK);
 }
 
+static const u8 qmp_dp_v3_pre_emphasis_hbr3_hbr2[4][4] = {
+        { 0x00, 0x0C, 0x15, 0x1A },
+        { 0x02, 0x0E, 0x16, 0xFF },
+        { 0x02, 0x11, 0xFF, 0xFF },
+        { 0x04, 0xFF, 0xFF, 0xFF }
+};
+
+static const u8 qmp_dp_v3_voltage_swing_hbr3_hbr2[4][4] = {
+        { 0x02, 0x12, 0x16, 0x1A },
+        { 0x09, 0x19, 0x1F, 0xFF },
+        { 0x10, 0x1F, 0xFF, 0xFF },
+        { 0x1F, 0xFF, 0xFF, 0xFF }
+};
+
 static const u8 qmp_dp_v3_pre_emphasis_hbr_rbr[4][4] = {
 	{ 0x00, 0x0c, 0x14, 0x19 },
 	{ 0x00, 0x0b, 0x12, 0xff },
@@ -3000,8 +3014,13 @@  static void qcom_qmp_phy_configure_dp_tx(struct qmp_phy *qphy)
 		drvr_en = 0x10;
 	}
 
-	voltage_swing_cfg = qmp_dp_v3_voltage_swing_hbr_rbr[v_level][p_level];
-	pre_emphasis_cfg = qmp_dp_v3_pre_emphasis_hbr_rbr[v_level][p_level];
+	if (dp_opts->link_rate <= 2700) {
+		voltage_swing_cfg = qmp_dp_v3_voltage_swing_hbr_rbr[v_level][p_level];
+		pre_emphasis_cfg = qmp_dp_v3_pre_emphasis_hbr_rbr[v_level][p_level];
+	} else {
+		voltage_swing_cfg = qmp_dp_v3_voltage_swing_hbr3_hbr2[v_level][p_level];
+		pre_emphasis_cfg = qmp_dp_v3_pre_emphasis_hbr3_hbr2[v_level][p_level];
+	}
 
 	/* TODO: Move check to config check */
 	if (voltage_swing_cfg == 0xFF && pre_emphasis_cfg == 0xFF)