2021-08-30 17:57:14

by Sandeep Maheswaram

[permalink] [raw]
Subject: [PATCH 0/3] USB DWC3 QCOM Multi power domain support

Add multi pd support to set performance state for cx domain
to maintain minimum corner voltage for USB clocks.

Add corresponding dt bindings, driver changes and dt changes.

Sandeep Maheswaram (3):
dt-bindings: usb: qcom,dwc3: Add multi-pd bindings for dwc3 qcom
usb: dwc3: qcom: Add multi-pd support
arm64: dts: qcom: sc7280: Add cx power domain support

.../devicetree/bindings/usb/qcom,dwc3.yaml | 13 +++++-
arch/arm64/boot/dts/qcom/sc7280.dtsi | 5 ++-
drivers/usb/dwc3/dwc3-qcom.c | 49 ++++++++++++++++++++++
3 files changed, 65 insertions(+), 2 deletions(-)

--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation


2021-08-30 17:57:20

by Sandeep Maheswaram

[permalink] [raw]
Subject: [PATCH 1/3] dt-bindings: usb: qcom,dwc3: Add multi-pd bindings for dwc3 qcom

Add multi pd bindings to set performance state for cx domain
to maintain minimum corner voltage for USB clocks.

Signed-off-by: Sandeep Maheswaram <[email protected]>
---
Documentation/devicetree/bindings/usb/qcom,dwc3.yaml | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
index e70afc4..838d9c4 100644
--- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
+++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
@@ -41,7 +41,18 @@ properties:

power-domains:
description: specifies a phandle to PM domain provider node
- maxItems: 1
+ minItems: 1
+ items:
+ - description: optional,cx power domain
+ - description: USB gdsc power domain
+
+ power-domain-names:
+ items:
+ - const: cx
+ - const: usb_gdsc
+
+ required-opps:
+ description: specifies the performance state to cx power domain

clocks:
description:
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

2021-08-30 18:00:51

by Sandeep Maheswaram

[permalink] [raw]
Subject: [PATCH 3/3] arm64: dts: qcom: sc7280: Add cx power domain support

Add multi pd support to set performance state for cx domain
to maintain minimum corner voltage for USB clocks.

Signed-off-by: Sandeep Maheswaram <[email protected]>
---
arch/arm64/boot/dts/qcom/sc7280.dtsi | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi
index 53a21d0..7ccccb7 100644
--- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
@@ -1374,7 +1374,10 @@
interrupt-names = "hs_phy_irq", "dp_hs_phy_irq",
"dm_hs_phy_irq", "ss_phy_irq";

- power-domains = <&gcc GCC_USB30_PRIM_GDSC>;
+ power-domains = <&rpmhpd SC7280_CX>, <&gcc GCC_USB30_PRIM_GDSC>;
+ power-domain-names = "cx", "usb_gdsc";
+
+ required-opps = <&rpmhpd_opp_nom>;

resets = <&gcc GCC_USB30_PRIM_BCR>;

--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

2021-08-30 20:13:06

by Doug Anderson

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: usb: qcom,dwc3: Add multi-pd bindings for dwc3 qcom

Hi,

On Mon, Aug 30, 2021 at 10:55 AM Sandeep Maheswaram <[email protected]> wrote:
>
> Add multi pd bindings to set performance state for cx domain
> to maintain minimum corner voltage for USB clocks.
>
> Signed-off-by: Sandeep Maheswaram <[email protected]>
> ---
> Documentation/devicetree/bindings/usb/qcom,dwc3.yaml | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
> index e70afc4..838d9c4 100644
> --- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
> +++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
> @@ -41,7 +41,18 @@ properties:
>
> power-domains:
> description: specifies a phandle to PM domain provider node
> - maxItems: 1
> + minItems: 1
> + items:
> + - description: optional,cx power domain
> + - description: USB gdsc power domain

You need to re-order the above. The optional one needs to be second, not first.


> + power-domain-names:
> + items:
> + - const: cx
> + - const: usb_gdsc

Why do you need the names at all? The ordering of power-domains is
well defined and there are no holes in it and there are no legacy
reasons for having the names (like there are for clocks), so you
should drop. This is much like reg-names and I always point people to
this message from Rob Herring about reg-names:

https://lore.kernel.org/r/CAL_Jsq+MMunmVWqeW9v2RyzsMKP+=kMzeTHNMG4JDHM7Fy0HBg@mail.gmail.com/

You'll have to change your driver to use dev_pm_domain_attach_by_id()
but that should be fine.

-Doug

2021-09-06 09:18:24

by Sandeep Maheswaram

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: usb: qcom,dwc3: Add multi-pd bindings for dwc3 qcom


On 8/31/2021 1:37 AM, Doug Anderson wrote:
> Hi,
>
> On Mon, Aug 30, 2021 at 10:55 AM Sandeep Maheswaram <[email protected]> wrote:
>> Add multi pd bindings to set performance state for cx domain
>> to maintain minimum corner voltage for USB clocks.
>>
>> Signed-off-by: Sandeep Maheswaram <[email protected]>
>> ---
>> Documentation/devicetree/bindings/usb/qcom,dwc3.yaml | 13 ++++++++++++-
>> 1 file changed, 12 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
>> index e70afc4..838d9c4 100644
>> --- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
>> +++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
>> @@ -41,7 +41,18 @@ properties:
>>
>> power-domains:
>> description: specifies a phandle to PM domain provider node
>> - maxItems: 1
>> + minItems: 1
>> + items:
>> + - description: optional,cx power domain
>> + - description: USB gdsc power domain
> You need to re-order the above. The optional one needs to be second, not first.
>
I wanted to use required-opps for cx domain only. so I have put it first
in order.
>> + power-domain-names:
>> + items:
>> + - const: cx
>> + - const: usb_gdsc
> Why do you need the names at all? The ordering of power-domains is
> well defined and there are no holes in it and there are no legacy
> reasons for having the names (like there are for clocks), so you
> should drop. This is much like reg-names and I always point people to
> this message from Rob Herring about reg-names:
>
> https://lore.kernel.org/r/CAL_Jsq+MMunmVWqeW9v2RyzsMKP+=kMzeTHNMG4JDHM7Fy0HBg@mail.gmail.com/
>
> You'll have to change your driver to use dev_pm_domain_attach_by_id()
> but that should be fine.
>
> -Doug

Ok..I will try using  dev_pm_domain_attach_by_id()


2021-09-07 12:22:41

by Rajendra Nayak

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: usb: qcom,dwc3: Add multi-pd bindings for dwc3 qcom


On 9/6/2021 2:45 PM, Sandeep Maheswaram wrote:
>
> On 8/31/2021 1:37 AM, Doug Anderson wrote:
>> Hi,
>>
>> On Mon, Aug 30, 2021 at 10:55 AM Sandeep Maheswaram <[email protected]> wrote:
>>> Add multi pd bindings to set performance state for cx domain
>>> to maintain minimum corner voltage for USB clocks.
>>>
>>> Signed-off-by: Sandeep Maheswaram <[email protected]>
>>> ---
>>>   Documentation/devicetree/bindings/usb/qcom,dwc3.yaml | 13 ++++++++++++-
>>>   1 file changed, 12 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
>>> index e70afc4..838d9c4 100644
>>> --- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
>>> +++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
>>> @@ -41,7 +41,18 @@ properties:
>>>
>>>     power-domains:
>>>       description: specifies a phandle to PM domain provider node
>>> -    maxItems: 1
>>> +    minItems: 1
>>> +    items:
>>> +      - description: optional,cx power domain
>>> +      - description: USB gdsc power domain
>> You need to re-order the above. The optional one needs to be second, not first.
>>
> I wanted to use required-opps for cx domain only. so I have put it first in order.

You can always put a <> for the power-domains for which there are no required-opps

+ power-domain-names = "usb_gdsc", "cx";
+
+ required-opps = <>, <&rpmhpd_opp_nom>;

>>> +  power-domain-names:
>>> +     items:
>>> +      - const: cx
>>> +      - const: usb_gdsc
>> Why do you need the names at all? The ordering of power-domains is
>> well defined and there are no holes in it and there are no legacy
>> reasons for having the names (like there are for clocks), so you
>> should drop. This is much like reg-names and I always point people to
>> this message from Rob Herring about reg-names:
>>
>> https://lore.kernel.org/r/CAL_Jsq+MMunmVWqeW9v2RyzsMKP+=kMzeTHNMG4JDHM7Fy0HBg@mail.gmail.com/
>>
>> You'll have to change your driver to use dev_pm_domain_attach_by_id()
>> but that should be fine.
>>
>> -Doug
>
> Ok..I will try using  dev_pm_domain_attach_by_id()
>
>

--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

2021-09-07 13:51:35

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: usb: qcom,dwc3: Add multi-pd bindings for dwc3 qcom

On Mon 30 Aug 10:54 PDT 2021, Sandeep Maheswaram wrote:

> Add multi pd bindings to set performance state for cx domain
> to maintain minimum corner voltage for USB clocks.
>
> Signed-off-by: Sandeep Maheswaram <[email protected]>
> ---
> Documentation/devicetree/bindings/usb/qcom,dwc3.yaml | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
> index e70afc4..838d9c4 100644
> --- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
> +++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
> @@ -41,7 +41,18 @@ properties:
>
> power-domains:
> description: specifies a phandle to PM domain provider node
> - maxItems: 1
> + minItems: 1
> + items:
> + - description: optional,cx power domain
> + - description: USB gdsc power domain
> +
> + power-domain-names:
> + items:
> + - const: cx
> + - const: usb_gdsc

But "usb_gdsc" is a subdomain of "cx", why can't we describe this fact
in gcc?

Regards,
Bjorn

> +
> + required-opps:
> + description: specifies the performance state to cx power domain
>
> clocks:
> description:
> --
> QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> of Code Aurora Forum, hosted by The Linux Foundation
>

2021-09-30 16:07:54

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH 1/3] dt-bindings: usb: qcom,dwc3: Add multi-pd bindings for dwc3 qcom

On Thu 30 Sep 02:41 PDT 2021, Sandeep Maheswaram wrote:

>
> On 9/7/2021 7:20 PM, Bjorn Andersson wrote:
> > On Mon 30 Aug 10:54 PDT 2021, Sandeep Maheswaram wrote:
> >
> > > Add multi pd bindings to set performance state for cx domain
> > > to maintain minimum corner voltage for USB clocks.
> > >
> > > Signed-off-by: Sandeep Maheswaram <[email protected]>
> > > ---
> > > Documentation/devicetree/bindings/usb/qcom,dwc3.yaml | 13 ++++++++++++-
> > > 1 file changed, 12 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
> > > index e70afc4..838d9c4 100644
> > > --- a/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
> > > +++ b/Documentation/devicetree/bindings/usb/qcom,dwc3.yaml
> > > @@ -41,7 +41,18 @@ properties:
> > > power-domains:
> > > description: specifies a phandle to PM domain provider node
> > > - maxItems: 1
> > > + minItems: 1
> > > + items:
> > > + - description: optional,cx power domain
> > > + - description: USB gdsc power domain
> > > +
> > > + power-domain-names:
> > > + items:
> > > + - const: cx
> > > + - const: usb_gdsc
> > But "usb_gdsc" is a subdomain of "cx", why can't we describe this fact
> > in gcc?
> >
> > Regards,
> > Bjorn
> Thanks for your review.
> Any idea on how can this be described in gcc ? Can you point any reference
> for this .
>

There's a series from Dmitry that defines such a relationship between
MDSS_GDSC and the MMCX domain on SM8250. This seems like a continuation
of that support, given that we have multiple parent domains (cx, mx
etc).

You can find that discussion here:

https://lore.kernel.org/all/[email protected]/

Regards,
Bjorn

> Regards
> Sandeep
> > > +
> > > + required-opps:
> > > + description: specifies the performance state to cx power domain
> > > clocks:
> > > description:
> > > --
> > > QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
> > > of Code Aurora Forum, hosted by The Linux Foundation
> > >