All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] phy/qualcomm: add hbr3_hbr2 voltage and premphasis swing table
@ 2021-02-18 16:51 Kuogee Hsieh
  2021-02-18 18:46 ` Stephen Boyd
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Kuogee Hsieh @ 2021-02-18 16:51 UTC (permalink / raw)
  To: robdclark, sean, swboyd, vkoul, agross, bjorn.andersson
  Cc: tanmay, abhinavk, aravindh, khsieh, linux-arm-msm, linux-kernel

Add hbr3_hbr2 voltage and premphasis swing table to support
HBR3 link rate.

Changes in V2:
-- replaced upper case with lower case at hbr3_hbr2 table

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..4dcc074 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)
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/2] phy/qualcomm: add hbr3_hbr2 voltage and premphasis swing table
  2021-02-18 16:51 [PATCH v2 1/2] phy/qualcomm: add hbr3_hbr2 voltage and premphasis swing table Kuogee Hsieh
@ 2021-02-18 18:46 ` Stephen Boyd
  2021-02-24 19:39   ` Stephen Boyd
  2021-02-18 18:47 ` Stephen Boyd
  2021-03-15 10:11 ` Vinod Koul
  2 siblings, 1 reply; 6+ messages in thread
From: Stephen Boyd @ 2021-02-18 18:46 UTC (permalink / raw)
  To: Kuogee Hsieh, agross, bjorn.andersson, robdclark, sean, vkoul
  Cc: tanmay, abhinavk, aravindh, khsieh, linux-arm-msm, linux-kernel

Quoting Kuogee Hsieh (2021-02-18 08:51:10)
> Add hbr3_hbr2 voltage and premphasis swing table to support
> HBR3 link rate.
> 
> Changes in V2:
> -- replaced upper case with lower case at hbr3_hbr2 table
> 
> Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
> ---

Reviewed-by: Stephen Boyd <swboyd@chromium.org>

BTW, the DP driver already set rates for HBR2, so does that mean this is
fixing the voltage and preemphasis settings for HBR2? If so we should
backport this to stable trees and mark it as fixing commit 52e013d0bffa
("phy: qcom-qmp: Add support for DP in USB3+DP combo phy").

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/2] phy/qualcomm: add hbr3_hbr2 voltage and premphasis swing table
  2021-02-18 16:51 [PATCH v2 1/2] phy/qualcomm: add hbr3_hbr2 voltage and premphasis swing table Kuogee Hsieh
  2021-02-18 18:46 ` Stephen Boyd
@ 2021-02-18 18:47 ` Stephen Boyd
  2021-03-15 10:11 ` Vinod Koul
  2 siblings, 0 replies; 6+ messages in thread
From: Stephen Boyd @ 2021-02-18 18:47 UTC (permalink / raw)
  To: Kuogee Hsieh, agross, bjorn.andersson, robdclark, sean, vkoul
  Cc: tanmay, abhinavk, aravindh, khsieh, linux-arm-msm, linux-kernel

Quoting Kuogee Hsieh (2021-02-18 08:51:10)
> Add hbr3_hbr2 voltage and premphasis swing table to support
> HBR3 link rate.
> 
> Changes in V2:
> -- replaced upper case with lower case at hbr3_hbr2 table
> 
> Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
> ---

Tested-by: Stephen Boyd <swboyd@chromium.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/2] phy/qualcomm: add hbr3_hbr2 voltage and premphasis swing table
  2021-02-18 18:46 ` Stephen Boyd
@ 2021-02-24 19:39   ` Stephen Boyd
  2021-02-24 22:42     ` khsieh
  0 siblings, 1 reply; 6+ messages in thread
From: Stephen Boyd @ 2021-02-24 19:39 UTC (permalink / raw)
  To: Kuogee Hsieh, agross, bjorn.andersson, robdclark, sean, vkoul
  Cc: tanmay, abhinavk, aravindh, khsieh, linux-arm-msm, linux-kernel

Quoting Stephen Boyd (2021-02-18 10:46:17)
> Quoting Kuogee Hsieh (2021-02-18 08:51:10)
> > Add hbr3_hbr2 voltage and premphasis swing table to support
> > HBR3 link rate.
> > 
> > Changes in V2:
> > -- replaced upper case with lower case at hbr3_hbr2 table
> > 
> > Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
> > ---
> 
> Reviewed-by: Stephen Boyd <swboyd@chromium.org>
> 
> BTW, the DP driver already set rates for HBR2, so does that mean this is
> fixing the voltage and preemphasis settings for HBR2? If so we should
> backport this to stable trees and mark it as fixing commit 52e013d0bffa
> ("phy: qcom-qmp: Add support for DP in USB3+DP combo phy").

Yes? No?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/2] phy/qualcomm: add hbr3_hbr2 voltage and premphasis swing table
  2021-02-24 19:39   ` Stephen Boyd
@ 2021-02-24 22:42     ` khsieh
  0 siblings, 0 replies; 6+ messages in thread
From: khsieh @ 2021-02-24 22:42 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: agross, bjorn.andersson, robdclark, sean, vkoul, tanmay,
	abhinavk, aravindh, linux-arm-msm, linux-kernel

On 2021-02-24 11:39, Stephen Boyd wrote:
> Quoting Stephen Boyd (2021-02-18 10:46:17)
>> Quoting Kuogee Hsieh (2021-02-18 08:51:10)
>> > Add hbr3_hbr2 voltage and premphasis swing table to support
>> > HBR3 link rate.
>> >
>> > Changes in V2:
>> > -- replaced upper case with lower case at hbr3_hbr2 table
>> >
>> > Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
>> > ---
>> 
>> Reviewed-by: Stephen Boyd <swboyd@chromium.org>
>> 
>> BTW, the DP driver already set rates for HBR2, so does that mean this 
>> is
>> fixing the voltage and preemphasis settings for HBR2? If so we should
>> backport this to stable trees and mark it as fixing commit 
>> 52e013d0bffa
>> ("phy: qcom-qmp: Add support for DP in USB3+DP combo phy").
> 
> Yes? No?
yes

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 1/2] phy/qualcomm: add hbr3_hbr2 voltage and premphasis swing table
  2021-02-18 16:51 [PATCH v2 1/2] phy/qualcomm: add hbr3_hbr2 voltage and premphasis swing table Kuogee Hsieh
  2021-02-18 18:46 ` Stephen Boyd
  2021-02-18 18:47 ` Stephen Boyd
@ 2021-03-15 10:11 ` Vinod Koul
  2 siblings, 0 replies; 6+ messages in thread
From: Vinod Koul @ 2021-03-15 10:11 UTC (permalink / raw)
  To: Kuogee Hsieh
  Cc: robdclark, sean, swboyd, agross, bjorn.andersson, tanmay,
	abhinavk, aravindh, linux-arm-msm, linux-kernel

On 18-02-21, 08:51, Kuogee Hsieh wrote:
> Add hbr3_hbr2 voltage and premphasis swing table to support
> HBR3 link rate.

Please use phy: qcom-qmp: "...." for the patch title

> 
> Changes in V2:
> -- replaced upper case with lower case at hbr3_hbr2 table
> 
> 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..4dcc074 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 }

This should use tabs and not spaces, please fix this and resend the
patch after running checkpatch --strict and adding Steve's acks

> +};
> +
> +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)
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project

-- 
~Vinod

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-03-15 10:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-18 16:51 [PATCH v2 1/2] phy/qualcomm: add hbr3_hbr2 voltage and premphasis swing table Kuogee Hsieh
2021-02-18 18:46 ` Stephen Boyd
2021-02-24 19:39   ` Stephen Boyd
2021-02-24 22:42     ` khsieh
2021-02-18 18:47 ` Stephen Boyd
2021-03-15 10:11 ` Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.