diff mbox series

[v4,10/16] dt-bindings: phy: tegra-xusb: Add nvidia,pmc prop

Message ID 20201016130726.1378666-11-jckuo@nvidia.com
State Changes Requested
Headers show
Series Tegra XHCI controller ELPG support | expand

Checks

Context Check Description
robh/checkpatch success

Commit Message

JC Kuo Oct. 16, 2020, 1:07 p.m. UTC
This commit describes the "nvidia,pmc" property for Tegra210 tegra-xusb
PHY driver. It is a phandle and specifier referring to the Tegra210
pmc@7000e400 node.

Signed-off-by: JC Kuo <jckuo@nvidia.com>
---
v4:
   new change to document "nvidia,pmc" prop

 .../devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt      | 1 +
 1 file changed, 1 insertion(+)

Comments

Rob Herring Oct. 19, 2020, 9:40 p.m. UTC | #1
On Fri, Oct 16, 2020 at 09:07:20PM +0800, JC Kuo wrote:
> This commit describes the "nvidia,pmc" property for Tegra210 tegra-xusb
> PHY driver. It is a phandle and specifier referring to the Tegra210
> pmc@7000e400 node.
> 
> Signed-off-by: JC Kuo <jckuo@nvidia.com>
> ---
> v4:
>    new change to document "nvidia,pmc" prop
> 
>  .../devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt      | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt b/Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt
> index 38c5fa21f435..ea559baeb546 100644
> --- a/Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt
> +++ b/Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt
> @@ -54,6 +54,7 @@ For Tegra210:
>  - avdd-pll-uerefe-supply: PLLE reference PLL power supply. Must supply 1.05 V.
>  - dvdd-pex-pll-supply: PCIe/USB3 PLL power supply. Must supply 1.05 V.
>  - hvdd-pex-pll-e-supply: High-voltage PLLE power supply. Must supply 1.8 V.
> +- nvidia,pmc: phandle and specifier referring to the Tegra210 pmc@7000e400 node.

'Tegra210 pmc@7000e400' is kind of specific. Going to update this for 
every address and chip?

If there's only one PMC, you can just find the compatible PMC node. Then 
you don't need a DT update.

Rob
JC Kuo Oct. 28, 2020, 9:18 a.m. UTC | #2
On 10/20/20 5:40 AM, Rob Herring wrote:
> On Fri, Oct 16, 2020 at 09:07:20PM +0800, JC Kuo wrote:
>> This commit describes the "nvidia,pmc" property for Tegra210 tegra-xusb
>> PHY driver. It is a phandle and specifier referring to the Tegra210
>> pmc@7000e400 node.
>>
>> Signed-off-by: JC Kuo <jckuo@nvidia.com>
>> ---
>> v4:
>>    new change to document "nvidia,pmc" prop
>>
>>  .../devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt      | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt b/Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt
>> index 38c5fa21f435..ea559baeb546 100644
>> --- a/Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt
>> +++ b/Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt
>> @@ -54,6 +54,7 @@ For Tegra210:
>>  - avdd-pll-uerefe-supply: PLLE reference PLL power supply. Must supply 1.05 V.
>>  - dvdd-pex-pll-supply: PCIe/USB3 PLL power supply. Must supply 1.05 V.
>>  - hvdd-pex-pll-e-supply: High-voltage PLLE power supply. Must supply 1.8 V.
>> +- nvidia,pmc: phandle and specifier referring to the Tegra210 pmc@7000e400 node.
> 
> 'Tegra210 pmc@7000e400' is kind of specific. Going to update this for 
> every address and chip?
> 
> If there's only one PMC, you can just find the compatible PMC node. Then 
> you don't need a DT update.
> 
> Rob
> 
Hi Rob,
Thanks for your review and suggestion. Yes, there is only one PMC node. You mean
I can retrieve the PMC node with the following code and if do do DT update is
not required, right?

	np = of_find_compatible_node(NULL, NULL, "nvidia,tegra210-pmc");

JC
Thierry Reding Nov. 13, 2020, 4:20 p.m. UTC | #3
On Mon, Oct 19, 2020 at 04:40:46PM -0500, Rob Herring wrote:
> On Fri, Oct 16, 2020 at 09:07:20PM +0800, JC Kuo wrote:
> > This commit describes the "nvidia,pmc" property for Tegra210 tegra-xusb
> > PHY driver. It is a phandle and specifier referring to the Tegra210
> > pmc@7000e400 node.
> > 
> > Signed-off-by: JC Kuo <jckuo@nvidia.com>
> > ---
> > v4:
> >    new change to document "nvidia,pmc" prop
> > 
> >  .../devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt      | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt b/Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt
> > index 38c5fa21f435..ea559baeb546 100644
> > --- a/Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt
> > +++ b/Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt
> > @@ -54,6 +54,7 @@ For Tegra210:
> >  - avdd-pll-uerefe-supply: PLLE reference PLL power supply. Must supply 1.05 V.
> >  - dvdd-pex-pll-supply: PCIe/USB3 PLL power supply. Must supply 1.05 V.
> >  - hvdd-pex-pll-e-supply: High-voltage PLLE power supply. Must supply 1.8 V.
> > +- nvidia,pmc: phandle and specifier referring to the Tegra210 pmc@7000e400 node.
> 
> 'Tegra210 pmc@7000e400' is kind of specific. Going to update this for 
> every address and chip?
> 
> If there's only one PMC, you can just find the compatible PMC node. Then 
> you don't need a DT update.

I did advise against doing the lookup by compatible string because I
think it has a couple of downsides. On one hand it's going to create an
additional maintenance burden on the XUSB pad controller driver because
the PMC is usually not compatible between SoC versions, so for every new
SoC generation we'll have to add the PMC compatible string to the XUSB
pad controller driver.

On the other hand, this is new functionality and we can easily gate that
on the existence of this phandle, so it doesn't impact DT backwards
compatibility. That also has the advantage of explicitly listing the
dependency between the PMC and the XUSB pad controller in DT, so if we
ever do get around to come up with an even better mechanism to resolve
these dependencies than deferred probe, we do have the data already
available.

Thierry
JC Kuo Nov. 19, 2020, 5:28 a.m. UTC | #4
On 11/14/20 12:20 AM, Thierry Reding wrote:
> On Mon, Oct 19, 2020 at 04:40:46PM -0500, Rob Herring wrote:
>> On Fri, Oct 16, 2020 at 09:07:20PM +0800, JC Kuo wrote:
>>> This commit describes the "nvidia,pmc" property for Tegra210 tegra-xusb
>>> PHY driver. It is a phandle and specifier referring to the Tegra210
>>> pmc@7000e400 node.
>>>
>>> Signed-off-by: JC Kuo <jckuo@nvidia.com>
>>> ---
>>> v4:
>>>    new change to document "nvidia,pmc" prop
>>>
>>>  .../devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt      | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt b/Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt
>>> index 38c5fa21f435..ea559baeb546 100644
>>> --- a/Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt
>>> +++ b/Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt
>>> @@ -54,6 +54,7 @@ For Tegra210:
>>>  - avdd-pll-uerefe-supply: PLLE reference PLL power supply. Must supply 1.05 V.
>>>  - dvdd-pex-pll-supply: PCIe/USB3 PLL power supply. Must supply 1.05 V.
>>>  - hvdd-pex-pll-e-supply: High-voltage PLLE power supply. Must supply 1.8 V.
>>> +- nvidia,pmc: phandle and specifier referring to the Tegra210 pmc@7000e400 node.
>>
>> 'Tegra210 pmc@7000e400' is kind of specific. Going to update this for 
>> every address and chip?
>>
>> If there's only one PMC, you can just find the compatible PMC node. Then 
>> you don't need a DT update.
> 
> I did advise against doing the lookup by compatible string because I
> think it has a couple of downsides. On one hand it's going to create an
> additional maintenance burden on the XUSB pad controller driver because
> the PMC is usually not compatible between SoC versions, so for every new
> SoC generation we'll have to add the PMC compatible string to the XUSB
> pad controller driver.
> 
> On the other hand, this is new functionality and we can easily gate that
> on the existence of this phandle, so it doesn't impact DT backwards
> compatibility. That also has the advantage of explicitly listing the
> dependency between the PMC and the XUSB pad controller in DT, so if we
> ever do get around to come up with an even better mechanism to resolve
> these dependencies than deferred probe, we do have the data already
> available.
> 
> Thierry
> 
Hi Thierry,
Thanks for the ideas. I will stay with the adding "nvidia,pmc" phandle property
implementation. As for the DT document change, I will modify it with below.

nvidia,pmc: phandle and specifier referring to the Tegra210 PMC node.

Thanks,
JC
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt b/Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt
index 38c5fa21f435..ea559baeb546 100644
--- a/Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt
+++ b/Documentation/devicetree/bindings/phy/nvidia,tegra124-xusb-padctl.txt
@@ -54,6 +54,7 @@  For Tegra210:
 - avdd-pll-uerefe-supply: PLLE reference PLL power supply. Must supply 1.05 V.
 - dvdd-pex-pll-supply: PCIe/USB3 PLL power supply. Must supply 1.05 V.
 - hvdd-pex-pll-e-supply: High-voltage PLLE power supply. Must supply 1.8 V.
+- nvidia,pmc: phandle and specifier referring to the Tegra210 pmc@7000e400 node.
 
 For Tegra186:
 - avdd-pll-erefeut-supply: UPHY brick and reference clock as well as UTMI PHY