linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] phy: qcom-qmp-usb: fix ipq8074/ipq6018 USB issues
@ 2024-01-23 16:09 Mantas Pucka
  2024-01-23 16:09 ` [PATCH 1/2] phy: qcom-qmp-usb: fix register offsets for ipq8074/ipq6018 Mantas Pucka
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Mantas Pucka @ 2024-01-23 16:09 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Vinod Koul,
	Kishon Vijay Abraham I
  Cc: Mantas Pucka, linux-arm-msm, linux-phy, linux-kernel

Two issues were found in ipq8074/ipq6018 USB support. Sending as series,
because fixes touch the same code.

Mantas Pucka (2):
  phy: qcom-qmp-usb: fix register offsets for ipq8074/ipq6018
  phy: qcom-qmp-usb: fix serdes init sequence for IPQ6018

 drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 30 ++++++++++++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)

-- 
2.7.4


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

* [PATCH 1/2] phy: qcom-qmp-usb: fix register offsets for ipq8074/ipq6018
  2024-01-23 16:09 [PATCH 0/2] phy: qcom-qmp-usb: fix ipq8074/ipq6018 USB issues Mantas Pucka
@ 2024-01-23 16:09 ` Mantas Pucka
  2024-01-23 16:42   ` Dmitry Baryshkov
  2024-01-23 16:09 ` [PATCH 2/2] phy: qcom-qmp-usb: fix serdes init sequence for IPQ6018 Mantas Pucka
  2024-01-24  5:59 ` [PATCH 0/2] phy: qcom-qmp-usb: fix ipq8074/ipq6018 USB issues Vinod Koul
  2 siblings, 1 reply; 7+ messages in thread
From: Mantas Pucka @ 2024-01-23 16:09 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Vinod Koul,
	Kishon Vijay Abraham I, Dmitry Baryshkov
  Cc: Mantas Pucka, linux-arm-msm, linux-phy, linux-kernel

Commit 2be22aae6b18 ("phy: qcom-qmp-usb: populate offsets configuration")
introduced register offsets to the driver but for ipq8074/ipq6018 they do
not match what was in the old style device tree. Example from old
ipq6018.dtsi:

<0x00078200 0x130>,     /* Tx */
<0x00078400 0x200>,     /* Rx */
<0x00078800 0x1f8>,     /* PCS */
<0x00078600 0x044>;     /* PCS misc */

which would translate to:
{.., .pcs = 0x800, .pcs_misc = 0x600, .tx = 0x200, .rx = 0x400 }

but was translated to:
{.., .pcs = 0x600, .tx = 0x200, .rx = 0x400 }

So split usb_offsets and fix USB initialization for IPQ8074 and IPQ6018.
Tested only on IPQ6018

Fixes: 2be22aae6b18 ("phy: qcom-qmp-usb: populate offsets configuration")
Signed-off-by: Mantas Pucka <mantas@8devices.com>
---
 drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
index 243cc2b9a0fb..05b4c0e67896 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
@@ -1556,6 +1556,14 @@ static const char * const qmp_phy_vreg_l[] = {
 	"vdda-phy", "vdda-pll",
 };
 
+static const struct qmp_usb_offsets qmp_usb_offsets_ipq8074 = {
+	.serdes		= 0,
+	.pcs		= 0x800,
+	.pcs_misc	= 0x600,
+	.tx		= 0x200,
+	.rx		= 0x400,
+};
+
 static const struct qmp_usb_offsets qmp_usb_offsets_ipq9574 = {
 	.serdes		= 0,
 	.pcs		= 0x800,
@@ -1616,7 +1624,7 @@ static const struct qmp_usb_offsets qmp_usb_offsets_v7 = {
 static const struct qmp_phy_cfg ipq8074_usb3phy_cfg = {
 	.lanes			= 1,
 
-	.offsets		= &qmp_usb_offsets_v3,
+	.offsets		= &qmp_usb_offsets_ipq8074,
 
 	.serdes_tbl		= ipq8074_usb3_serdes_tbl,
 	.serdes_tbl_num		= ARRAY_SIZE(ipq8074_usb3_serdes_tbl),
-- 
2.7.4


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

* [PATCH 2/2] phy: qcom-qmp-usb: fix serdes init sequence for IPQ6018
  2024-01-23 16:09 [PATCH 0/2] phy: qcom-qmp-usb: fix ipq8074/ipq6018 USB issues Mantas Pucka
  2024-01-23 16:09 ` [PATCH 1/2] phy: qcom-qmp-usb: fix register offsets for ipq8074/ipq6018 Mantas Pucka
@ 2024-01-23 16:09 ` Mantas Pucka
  2024-01-23 16:39   ` Dmitry Baryshkov
  2024-01-24  5:59 ` [PATCH 0/2] phy: qcom-qmp-usb: fix ipq8074/ipq6018 USB issues Vinod Koul
  2 siblings, 1 reply; 7+ messages in thread
From: Mantas Pucka @ 2024-01-23 16:09 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Vinod Koul,
	Kishon Vijay Abraham I, Baruch Siach
  Cc: Mantas Pucka, linux-arm-msm, linux-phy, linux-kernel

Commit 23fd679249df ("phy: qcom-qmp: add USB3 PHY support for IPQ6018")
noted that IPQ6018 init is identical to IPQ8074. Yet downstream uses
separate serdes init sequence for IPQ6018. Since already existing IPQ9574
serdes init sequence is identical, just reuse it and fix failing USB3 mode
in IPQ6018.

Fixes: 23fd679249df ("phy: qcom-qmp: add USB3 PHY support for IPQ6018")
Signed-off-by: Mantas Pucka <mantas@8devices.com>
---
 drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
index 05b4c0e67896..6621246e4ddf 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-usb.c
@@ -1621,6 +1621,24 @@ static const struct qmp_usb_offsets qmp_usb_offsets_v7 = {
 	.rx		= 0x1000,
 };
 
+static const struct qmp_phy_cfg ipq6018_usb3phy_cfg = {
+	.lanes			= 1,
+
+	.offsets		= &qmp_usb_offsets_ipq8074,
+
+	.serdes_tbl		= ipq9574_usb3_serdes_tbl,
+	.serdes_tbl_num		= ARRAY_SIZE(ipq9574_usb3_serdes_tbl),
+	.tx_tbl			= msm8996_usb3_tx_tbl,
+	.tx_tbl_num		= ARRAY_SIZE(msm8996_usb3_tx_tbl),
+	.rx_tbl			= ipq8074_usb3_rx_tbl,
+	.rx_tbl_num		= ARRAY_SIZE(ipq8074_usb3_rx_tbl),
+	.pcs_tbl		= ipq8074_usb3_pcs_tbl,
+	.pcs_tbl_num		= ARRAY_SIZE(ipq8074_usb3_pcs_tbl),
+	.vreg_list		= qmp_phy_vreg_l,
+	.num_vregs		= ARRAY_SIZE(qmp_phy_vreg_l),
+	.regs			= qmp_v3_usb3phy_regs_layout,
+};
+
 static const struct qmp_phy_cfg ipq8074_usb3phy_cfg = {
 	.lanes			= 1,
 
@@ -2571,7 +2589,7 @@ static int qmp_usb_probe(struct platform_device *pdev)
 static const struct of_device_id qmp_usb_of_match_table[] = {
 	{
 		.compatible = "qcom,ipq6018-qmp-usb3-phy",
-		.data = &ipq8074_usb3phy_cfg,
+		.data = &ipq6018_usb3phy_cfg,
 	}, {
 		.compatible = "qcom,ipq8074-qmp-usb3-phy",
 		.data = &ipq8074_usb3phy_cfg,
-- 
2.7.4


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

* Re: [PATCH 2/2] phy: qcom-qmp-usb: fix serdes init sequence for IPQ6018
  2024-01-23 16:09 ` [PATCH 2/2] phy: qcom-qmp-usb: fix serdes init sequence for IPQ6018 Mantas Pucka
@ 2024-01-23 16:39   ` Dmitry Baryshkov
  0 siblings, 0 replies; 7+ messages in thread
From: Dmitry Baryshkov @ 2024-01-23 16:39 UTC (permalink / raw)
  To: Mantas Pucka
  Cc: Bjorn Andersson, Konrad Dybcio, Vinod Koul,
	Kishon Vijay Abraham I, Baruch Siach, linux-arm-msm, linux-phy,
	linux-kernel

On Tue, 23 Jan 2024 at 18:10, Mantas Pucka <mantas@8devices.com> wrote:
>
> Commit 23fd679249df ("phy: qcom-qmp: add USB3 PHY support for IPQ6018")
> noted that IPQ6018 init is identical to IPQ8074. Yet downstream uses
> separate serdes init sequence for IPQ6018. Since already existing IPQ9574
> serdes init sequence is identical, just reuse it and fix failing USB3 mode
> in IPQ6018.
>
> Fixes: 23fd679249df ("phy: qcom-qmp: add USB3 PHY support for IPQ6018")
> Signed-off-by: Mantas Pucka <mantas@8devices.com>
> ---
>  drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 20 +++++++++++++++++++-
>  1 file changed, 19 insertions(+), 1 deletion(-)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>


-- 
With best wishes
Dmitry

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

* Re: [PATCH 1/2] phy: qcom-qmp-usb: fix register offsets for ipq8074/ipq6018
  2024-01-23 16:09 ` [PATCH 1/2] phy: qcom-qmp-usb: fix register offsets for ipq8074/ipq6018 Mantas Pucka
@ 2024-01-23 16:42   ` Dmitry Baryshkov
  2024-01-23 16:52     ` Mantas
  0 siblings, 1 reply; 7+ messages in thread
From: Dmitry Baryshkov @ 2024-01-23 16:42 UTC (permalink / raw)
  To: Mantas Pucka
  Cc: Bjorn Andersson, Konrad Dybcio, Vinod Koul,
	Kishon Vijay Abraham I, linux-arm-msm, linux-phy, linux-kernel

On Tue, 23 Jan 2024 at 18:09, Mantas Pucka <mantas@8devices.com> wrote:
>
> Commit 2be22aae6b18 ("phy: qcom-qmp-usb: populate offsets configuration")
> introduced register offsets to the driver but for ipq8074/ipq6018 they do
> not match what was in the old style device tree. Example from old
> ipq6018.dtsi:
>
> <0x00078200 0x130>,     /* Tx */
> <0x00078400 0x200>,     /* Rx */
> <0x00078800 0x1f8>,     /* PCS */
> <0x00078600 0x044>;     /* PCS misc */
>
> which would translate to:
> {.., .pcs = 0x800, .pcs_misc = 0x600, .tx = 0x200, .rx = 0x400 }
>
> but was translated to:
> {.., .pcs = 0x600, .tx = 0x200, .rx = 0x400 }

Even worse, it was translated to { ... .pcs = 0xc00, .pcs_misc = 0xa00 ... }

With this fixed:

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

>
> So split usb_offsets and fix USB initialization for IPQ8074 and IPQ6018.
> Tested only on IPQ6018
>
> Fixes: 2be22aae6b18 ("phy: qcom-qmp-usb: populate offsets configuration")
> Signed-off-by: Mantas Pucka <mantas@8devices.com>
> ---
>  drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)


-- 
With best wishes
Dmitry

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

* Re: [PATCH 1/2] phy: qcom-qmp-usb: fix register offsets for ipq8074/ipq6018
  2024-01-23 16:42   ` Dmitry Baryshkov
@ 2024-01-23 16:52     ` Mantas
  0 siblings, 0 replies; 7+ messages in thread
From: Mantas @ 2024-01-23 16:52 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Bjorn Andersson, Konrad Dybcio, Vinod Koul,
	Kishon Vijay Abraham I, linux-arm-msm, linux-phy, linux-kernel

On 2024-01-23 18:42, Dmitry Baryshkov wrote:
> On Tue, 23 Jan 2024 at 18:09, Mantas Pucka <mantas@8devices.com> wrote:
>> Commit 2be22aae6b18 ("phy: qcom-qmp-usb: populate offsets configuration")
>> introduced register offsets to the driver but for ipq8074/ipq6018 they do
>> not match what was in the old style device tree. Example from old
>> ipq6018.dtsi:
>>
>> <0x00078200 0x130>,     /* Tx */
>> <0x00078400 0x200>,     /* Rx */
>> <0x00078800 0x1f8>,     /* PCS */
>> <0x00078600 0x044>;     /* PCS misc */
>>
>> which would translate to:
>> {.., .pcs = 0x800, .pcs_misc = 0x600, .tx = 0x200, .rx = 0x400 }
>>
>> but was translated to:
>> {.., .pcs = 0x600, .tx = 0x200, .rx = 0x400 }
> Even worse, it was translated to { ... .pcs = 0xc00, .pcs_misc = 0xa00 ... }
I was referring to qmp_usb_offsets_v3 here as ipq8074/ipq6018 did use
them, not qmp_usb_offsets_v3_qcm2290.
>
> With this fixed:
>
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>
>> So split usb_offsets and fix USB initialization for IPQ8074 and IPQ6018.
>> Tested only on IPQ6018
>>
>> Fixes: 2be22aae6b18 ("phy: qcom-qmp-usb: populate offsets configuration")
>> Signed-off-by: Mantas Pucka <mantas@8devices.com>
>> ---
>>   drivers/phy/qualcomm/phy-qcom-qmp-usb.c | 10 +++++++++-
>>   1 file changed, 9 insertions(+), 1 deletion(-)
>

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

* Re: [PATCH 0/2] phy: qcom-qmp-usb: fix ipq8074/ipq6018 USB issues
  2024-01-23 16:09 [PATCH 0/2] phy: qcom-qmp-usb: fix ipq8074/ipq6018 USB issues Mantas Pucka
  2024-01-23 16:09 ` [PATCH 1/2] phy: qcom-qmp-usb: fix register offsets for ipq8074/ipq6018 Mantas Pucka
  2024-01-23 16:09 ` [PATCH 2/2] phy: qcom-qmp-usb: fix serdes init sequence for IPQ6018 Mantas Pucka
@ 2024-01-24  5:59 ` Vinod Koul
  2 siblings, 0 replies; 7+ messages in thread
From: Vinod Koul @ 2024-01-24  5:59 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Kishon Vijay Abraham I,
	Mantas Pucka
  Cc: linux-arm-msm, linux-phy, linux-kernel


On Tue, 23 Jan 2024 18:09:18 +0200, Mantas Pucka wrote:
> Two issues were found in ipq8074/ipq6018 USB support. Sending as series,
> because fixes touch the same code.
> 
> Mantas Pucka (2):
>   phy: qcom-qmp-usb: fix register offsets for ipq8074/ipq6018
>   phy: qcom-qmp-usb: fix serdes init sequence for IPQ6018
> 
> [...]

Applied, thanks!

[1/2] phy: qcom-qmp-usb: fix register offsets for ipq8074/ipq6018
      commit: f74c35b630d40d414ca6b53f7b1b468dd4abf478
[2/2] phy: qcom-qmp-usb: fix serdes init sequence for IPQ6018
      commit: 62a5df451ab911421da96655fcc4d1e269ff6e2f

Best regards,
-- 
~Vinod



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

end of thread, other threads:[~2024-01-24  5:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-23 16:09 [PATCH 0/2] phy: qcom-qmp-usb: fix ipq8074/ipq6018 USB issues Mantas Pucka
2024-01-23 16:09 ` [PATCH 1/2] phy: qcom-qmp-usb: fix register offsets for ipq8074/ipq6018 Mantas Pucka
2024-01-23 16:42   ` Dmitry Baryshkov
2024-01-23 16:52     ` Mantas
2024-01-23 16:09 ` [PATCH 2/2] phy: qcom-qmp-usb: fix serdes init sequence for IPQ6018 Mantas Pucka
2024-01-23 16:39   ` Dmitry Baryshkov
2024-01-24  5:59 ` [PATCH 0/2] phy: qcom-qmp-usb: fix ipq8074/ipq6018 USB issues Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).