mbox series

[v3,0/5] phy: qcom-qmp-usb: split away legacy USB+DP code

Message ID 20230531023415.1209301-1-dmitry.baryshkov@linaro.org
Headers show
Series phy: qcom-qmp-usb: split away legacy USB+DP code | expand

Message

Dmitry Baryshkov May 31, 2023, 2:34 a.m. UTC
While working on the QMP binding cleanup, I noticed that USB QMP driver
supports both simple USB PHYs (which should be updated) and USB-only
part of USB+DP PHYs (which are largely legacy and don't need to be
updated). To ease further cleanup perform a quick cleanup of the last
remaining USB+DP PHY (on sm8150 platform) and split the legacy codepath
from the USB QMP PHY driver.

Changes since v2:
- Fixed phy subnode names (noted by Caleb)

Changes since v1:
- Rebased on top of phy/next

Dmitry Baryshkov (5):
  dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: add sm8150 USB+DP PHY
  phy: qcom-qmp-combo: add support for the USB+DP PHY on SM8150 platform
  arm64: dts: qcom: sm8150: turn first USB PHY into USB+DP PHY
  dt-bindings: phy: qcom,msm8996-qmp-usb3-phy: drop legacy bindings
  phy: qcom-qmp-usb: split off the legacy USB+dp_com support

 .../phy/qcom,msm8996-qmp-usb3-phy.yaml        |   80 -
 .../phy/qcom,sc7180-qmp-usb3-dp-phy.yaml      |    2 +
 arch/arm64/boot/dts/qcom/sm8150.dtsi          |   19 +-
 drivers/phy/qualcomm/Kconfig                  |   10 +
 drivers/phy/qualcomm/Makefile                 |    1 +
 drivers/phy/qualcomm/phy-qcom-qmp-combo.c     |    4 +
 .../phy/qualcomm/phy-qcom-qmp-usb-legacy.c    | 1407 +++++++++++++++++
 drivers/phy/qualcomm/phy-qcom-qmp-usb.c       |  556 -------
 8 files changed, 1438 insertions(+), 641 deletions(-)
 create mode 100644 drivers/phy/qualcomm/phy-qcom-qmp-usb-legacy.c

Comments

Konrad Dybcio May 31, 2023, 11:35 a.m. UTC | #1
On 31.05.2023 04:34, Dmitry Baryshkov wrote:
> SM8150 and SC8180X are close relatives. Reuse sc8180x data to support
> USB+DP combo PHY on SM8150 platform.
> 
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
I'm not sure this is right. Downstream reuses SA8195 USB seq.

Konrad
>  drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> index 33cc99d9c77d..2bff1bbb8610 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> @@ -3614,6 +3614,10 @@ static const struct of_device_id qmp_combo_of_match_table[] = {
>  		.compatible = "qcom,sm6350-qmp-usb3-dp-phy",
>  		.data = &sm6350_usb3dpphy_cfg,
>  	},
> +	{
> +		.compatible = "qcom,sm8150-qmp-usb3-dp-phy",
> +		.data = &sc8180x_usb3dpphy_cfg,
> +	},
>  	{
>  		.compatible = "qcom,sm8250-qmp-usb3-dp-phy",
>  		.data = &sm8250_usb3dpphy_cfg,
Dmitry Baryshkov May 31, 2023, 12:13 p.m. UTC | #2
On Wed, 31 May 2023 at 14:35, Konrad Dybcio <konrad.dybcio@linaro.org> wrote:
> On 31.05.2023 04:34, Dmitry Baryshkov wrote:
> > SM8150 and SC8180X are close relatives. Reuse sc8180x data to support
> > USB+DP combo PHY on SM8150 platform.
> >
> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> > ---
> I'm not sure this is right. Downstream reuses SA8195 USB seq.

The upstream driver uses sm8150 data for sc8180x. So even if sc8180x
data is not correct for sc8180x, it is definitely the one that we
should use for sm8150:

static const struct qmp_phy_cfg sc8180x_usb3dpphy_cfg = {
        .serdes_tbl             = sm8150_usb3_serdes_tbl,
        .serdes_tbl_num         = ARRAY_SIZE(sm8150_usb3_serdes_tbl),
        .tx_tbl                 = sm8150_usb3_tx_tbl,
        .tx_tbl_num             = ARRAY_SIZE(sm8150_usb3_tx_tbl),
        .rx_tbl                 = sm8150_usb3_rx_tbl,
        .rx_tbl_num             = ARRAY_SIZE(sm8150_usb3_rx_tbl),
        .pcs_tbl                = sm8150_usb3_pcs_tbl,
        .pcs_tbl_num            = ARRAY_SIZE(sm8150_usb3_pcs_tbl),
        .pcs_usb_tbl            = sm8150_usb3_pcs_usb_tbl,
        .pcs_usb_tbl_num        = ARRAY_SIZE(sm8150_usb3_pcs_usb_tbl),

        .dp_serdes_tbl          = qmp_v4_dp_serdes_tbl,
        .dp_serdes_tbl_num      = ARRAY_SIZE(qmp_v4_dp_serdes_tbl),
        .dp_tx_tbl              = qmp_v4_dp_tx_tbl,
        .dp_tx_tbl_num          = ARRAY_SIZE(qmp_v4_dp_tx_tbl),



>
> Konrad
> >  drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> > index 33cc99d9c77d..2bff1bbb8610 100644
> > --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> > +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
> > @@ -3614,6 +3614,10 @@ static const struct of_device_id qmp_combo_of_match_table[] = {
> >               .compatible = "qcom,sm6350-qmp-usb3-dp-phy",
> >               .data = &sm6350_usb3dpphy_cfg,
> >       },
> > +     {
> > +             .compatible = "qcom,sm8150-qmp-usb3-dp-phy",
> > +             .data = &sc8180x_usb3dpphy_cfg,
> > +     },
> >       {
> >               .compatible = "qcom,sm8250-qmp-usb3-dp-phy",
> >               .data = &sm8250_usb3dpphy_cfg,
Konrad Dybcio May 31, 2023, 12:16 p.m. UTC | #3
On 31.05.2023 14:13, Dmitry Baryshkov wrote:
> On Wed, 31 May 2023 at 14:35, Konrad Dybcio <konrad.dybcio@linaro.org> wrote:
>> On 31.05.2023 04:34, Dmitry Baryshkov wrote:
>>> SM8150 and SC8180X are close relatives. Reuse sc8180x data to support
>>> USB+DP combo PHY on SM8150 platform.
>>>
>>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>> ---
>> I'm not sure this is right. Downstream reuses SA8195 USB seq.
> 
> The upstream driver uses sm8150 data for sc8180x. So even if sc8180x
> data is not correct for sc8180x, it is definitely the one that we
> should use for sm8150:
Right sorry, this patch adds support for 81*5*0. I wanted to point out
that 8180 has a different set of init commands and one of them is probably
incorrect.

Konrad
> 
> static const struct qmp_phy_cfg sc8180x_usb3dpphy_cfg = {
>         .serdes_tbl             = sm8150_usb3_serdes_tbl,
>         .serdes_tbl_num         = ARRAY_SIZE(sm8150_usb3_serdes_tbl),
>         .tx_tbl                 = sm8150_usb3_tx_tbl,
>         .tx_tbl_num             = ARRAY_SIZE(sm8150_usb3_tx_tbl),
>         .rx_tbl                 = sm8150_usb3_rx_tbl,
>         .rx_tbl_num             = ARRAY_SIZE(sm8150_usb3_rx_tbl),
>         .pcs_tbl                = sm8150_usb3_pcs_tbl,
>         .pcs_tbl_num            = ARRAY_SIZE(sm8150_usb3_pcs_tbl),
>         .pcs_usb_tbl            = sm8150_usb3_pcs_usb_tbl,
>         .pcs_usb_tbl_num        = ARRAY_SIZE(sm8150_usb3_pcs_usb_tbl),
> 
>         .dp_serdes_tbl          = qmp_v4_dp_serdes_tbl,
>         .dp_serdes_tbl_num      = ARRAY_SIZE(qmp_v4_dp_serdes_tbl),
>         .dp_tx_tbl              = qmp_v4_dp_tx_tbl,
>         .dp_tx_tbl_num          = ARRAY_SIZE(qmp_v4_dp_tx_tbl),
> 
> 
> 
>>
>> Konrad
>>>  drivers/phy/qualcomm/phy-qcom-qmp-combo.c | 4 ++++
>>>  1 file changed, 4 insertions(+)
>>>
>>> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
>>> index 33cc99d9c77d..2bff1bbb8610 100644
>>> --- a/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
>>> +++ b/drivers/phy/qualcomm/phy-qcom-qmp-combo.c
>>> @@ -3614,6 +3614,10 @@ static const struct of_device_id qmp_combo_of_match_table[] = {
>>>               .compatible = "qcom,sm6350-qmp-usb3-dp-phy",
>>>               .data = &sm6350_usb3dpphy_cfg,
>>>       },
>>> +     {
>>> +             .compatible = "qcom,sm8150-qmp-usb3-dp-phy",
>>> +             .data = &sc8180x_usb3dpphy_cfg,
>>> +     },
>>>       {
>>>               .compatible = "qcom,sm8250-qmp-usb3-dp-phy",
>>>               .data = &sm8250_usb3dpphy_cfg,
> 
> 
>
Vinod Koul July 11, 2023, 7:44 a.m. UTC | #4
On Wed, 31 May 2023 05:34:10 +0300, Dmitry Baryshkov wrote:
> While working on the QMP binding cleanup, I noticed that USB QMP driver
> supports both simple USB PHYs (which should be updated) and USB-only
> part of USB+DP PHYs (which are largely legacy and don't need to be
> updated). To ease further cleanup perform a quick cleanup of the last
> remaining USB+DP PHY (on sm8150 platform) and split the legacy codepath
> from the USB QMP PHY driver.
> 
> [...]

Applied, thanks!

[1/5] dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: add sm8150 USB+DP PHY
      commit: b484e246a21433daaabd8678347c96f8339bf818
[2/5] phy: qcom-qmp-combo: add support for the USB+DP PHY on SM8150 platform
      commit: 4daee20877df04b96bc36752acdc41dfc581b34c
[3/5] arm64: dts: qcom: sm8150: turn first USB PHY into USB+DP PHY
      (no commit info)
[4/5] dt-bindings: phy: qcom,msm8996-qmp-usb3-phy: drop legacy bindings
      commit: c30d437e92d20741a6db7ece024e15a0f5af6bcc
[5/5] phy: qcom-qmp-usb: split off the legacy USB+dp_com support
      commit: 770025644d971229c86fb97796268b8363c2c70a

Best regards,
Vinod Koul July 11, 2023, 7:47 a.m. UTC | #5
On 11-07-23, 13:14, Vinod Koul wrote:
> 
> On Wed, 31 May 2023 05:34:10 +0300, Dmitry Baryshkov wrote:
> > While working on the QMP binding cleanup, I noticed that USB QMP driver
> > supports both simple USB PHYs (which should be updated) and USB-only
> > part of USB+DP PHYs (which are largely legacy and don't need to be
> > updated). To ease further cleanup perform a quick cleanup of the last
> > remaining USB+DP PHY (on sm8150 platform) and split the legacy codepath
> > from the USB QMP PHY driver.
> > 
> > [...]
> 
> Applied, thanks!
> 
> [1/5] dt-bindings: phy: qcom,sc7180-qmp-usb3-dp-phy: add sm8150 USB+DP PHY
>       commit: b484e246a21433daaabd8678347c96f8339bf818
> [2/5] phy: qcom-qmp-combo: add support for the USB+DP PHY on SM8150 platform
>       commit: 4daee20877df04b96bc36752acdc41dfc581b34c
> [3/5] arm64: dts: qcom: sm8150: turn first USB PHY into USB+DP PHY
>       (no commit info)

b4 messed up 3 is not picked up, rest are

> [4/5] dt-bindings: phy: qcom,msm8996-qmp-usb3-phy: drop legacy bindings
>       commit: c30d437e92d20741a6db7ece024e15a0f5af6bcc
> [5/5] phy: qcom-qmp-usb: split off the legacy USB+dp_com support
>       commit: 770025644d971229c86fb97796268b8363c2c70a
> 
> Best regards,
> -- 
> ~Vinod
> 
> 
> 
> -- 
> linux-phy mailing list
> linux-phy@lists.infradead.org
> https://lists.infradead.org/mailman/listinfo/linux-phy