[TEGRA194_CPUFREQ,v5,1/4] dt-bindings: arm: Add t194 ccplex compatible and bpmp property
diff mbox series

Message ID 1594649209-29394-2-git-send-email-sumitg@nvidia.com
State New
Headers show
Series
  • Add cpufreq driver for Tegra194
Related show

Commit Message

Sumit Gupta July 13, 2020, 2:06 p.m. UTC
To do frequency scaling on all CPUs within T194 CPU Complex, we need
to query BPMP for data on valid operating points. Document a compatible
string under 'cpus' node to represent the CPU Complex for binding drivers
like cpufreq which don't have their node or CPU Complex node to bind to.
Also, document a property to point to the BPMP device that can be queried
for all CPUs.

Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
---
 Documentation/devicetree/bindings/arm/cpus.yaml | 11 +++++++++++
 1 file changed, 11 insertions(+)

Comments

Rob Herring July 13, 2020, 4:42 p.m. UTC | #1
On Mon, Jul 13, 2020 at 07:36:46PM +0530, Sumit Gupta wrote:
> To do frequency scaling on all CPUs within T194 CPU Complex, we need
> to query BPMP for data on valid operating points. Document a compatible
> string under 'cpus' node to represent the CPU Complex for binding drivers
> like cpufreq which don't have their node or CPU Complex node to bind to.
> Also, document a property to point to the BPMP device that can be queried
> for all CPUs.

The cpus.yaml binding documents what's in 'cpu' nodes, not 'cpus' 
node. AIUI, the latter is what you want. You should do your own schema 
file here.

> 
> Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
> ---
>  Documentation/devicetree/bindings/arm/cpus.yaml | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/arm/cpus.yaml b/Documentation/devicetree/bindings/arm/cpus.yaml
> index a018147..9b328e3 100644
> --- a/Documentation/devicetree/bindings/arm/cpus.yaml
> +++ b/Documentation/devicetree/bindings/arm/cpus.yaml
> @@ -162,6 +162,7 @@ properties:
>        - nvidia,tegra132-denver
>        - nvidia,tegra186-denver
>        - nvidia,tegra194-carmel
> +      - nvidia,tegra194-ccplex

Tegra194 has 2 different CPUs?

>        - qcom,krait
>        - qcom,kryo
>        - qcom,kryo260
> @@ -255,6 +256,15 @@ properties:
>  
>        where voltage is in V, frequency is in MHz.
>  
> +  nvidia,bpmp:
> +    $ref: '/schemas/types.yaml#/definitions/phandle'
> +    description: |
> +      Specifies the bpmp node that needs to be queried to get
> +      operating point data for all CPUs.
> +
> +      Optional for systems that have a "compatible"
> +      property value of "nvidia,tegra194-ccplex".
> +
>    power-domains:
>      $ref: '/schemas/types.yaml#/definitions/phandle-array'
>      description:
> @@ -340,6 +350,7 @@ required:
>  
>  dependencies:
>    rockchip,pmu: [enable-method]
> +  nvidia,bpmp: [compatible]
>  
>  examples:
>    - |
> -- 
> 2.7.4
>
Sumit Gupta July 14, 2020, 11:43 a.m. UTC | #2
> On Mon, Jul 13, 2020 at 07:36:46PM +0530, Sumit Gupta wrote:
>> To do frequency scaling on all CPUs within T194 CPU Complex, we need
>> to query BPMP for data on valid operating points. Document a compatible
>> string under 'cpus' node to represent the CPU Complex for binding drivers
>> like cpufreq which don't have their node or CPU Complex node to bind to.
>> Also, document a property to point to the BPMP device that can be queried
>> for all CPUs.
> 
> The cpus.yaml binding documents what's in 'cpu' nodes, not 'cpus'
> node. AIUI, the latter is what you want. You should do your own schema
> file here.
> 
Do you mean to change existing file name from 'cpus.yaml' to 'cpu.yaml' 
and create new 'cpus.yaml' file?
I think it's better to incorporate the change in existing 'cpus.yaml' 
file to keep both cpu@X and cpus node details together. Please suggest.

>>
>> Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
>> ---
>>   Documentation/devicetree/bindings/arm/cpus.yaml | 11 +++++++++++
>>   1 file changed, 11 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/arm/cpus.yaml b/Documentation/devicetree/bindings/arm/cpus.yaml
>> index a018147..9b328e3 100644
>> --- a/Documentation/devicetree/bindings/arm/cpus.yaml
>> +++ b/Documentation/devicetree/bindings/arm/cpus.yaml
>> @@ -162,6 +162,7 @@ properties:
>>         - nvidia,tegra132-denver
>>         - nvidia,tegra186-denver
>>         - nvidia,tegra194-carmel
>> +      - nvidia,tegra194-ccplex
> 
> Tegra194 has 2 different CPUs?
> 
No, T194 SOC has homogeneous architecture with four clusters where each 
cluster has two symmetric cores. 'nvidia,tegra194-carmel' compatible 
string represents each cpu. 'nvidia,tegra194-ccplex' string represents 
the CPU Complex to bind cpufreq driver. The change was done as per 
discussion [1]

>>         - qcom,krait
>>         - qcom,kryo
>>         - qcom,kryo260
>> @@ -255,6 +256,15 @@ properties:
>>
>>         where voltage is in V, frequency is in MHz.
>>
>> +  nvidia,bpmp:
>> +    $ref: '/schemas/types.yaml#/definitions/phandle'
>> +    description: |
>> +      Specifies the bpmp node that needs to be queried to get
>> +      operating point data for all CPUs.
>> +
>> +      Optional for systems that have a "compatible"
>> +      property value of "nvidia,tegra194-ccplex".
>> +
>>     power-domains:
>>       $ref: '/schemas/types.yaml#/definitions/phandle-array'
>>       description:
>> @@ -340,6 +350,7 @@ required:
>>
>>   dependencies:
>>     rockchip,pmu: [enable-method]
>> +  nvidia,bpmp: [compatible]
>>
>>   examples:
>>     - |
>> --
>> 2.7.4
>>

[1] https://marc.info/?l=linux-arm-kernel&m=158999171528418&w=2
Rob Herring July 14, 2020, 1:46 p.m. UTC | #3
On Tue, Jul 14, 2020 at 5:44 AM Sumit Gupta <sumitg@nvidia.com> wrote:
>
>
>
> > On Mon, Jul 13, 2020 at 07:36:46PM +0530, Sumit Gupta wrote:
> >> To do frequency scaling on all CPUs within T194 CPU Complex, we need
> >> to query BPMP for data on valid operating points. Document a compatible
> >> string under 'cpus' node to represent the CPU Complex for binding drivers
> >> like cpufreq which don't have their node or CPU Complex node to bind to.
> >> Also, document a property to point to the BPMP device that can be queried
> >> for all CPUs.
> >
> > The cpus.yaml binding documents what's in 'cpu' nodes, not 'cpus'
> > node. AIUI, the latter is what you want. You should do your own schema
> > file here.
> >
> Do you mean to change existing file name from 'cpus.yaml' to 'cpu.yaml'
> and create new 'cpus.yaml' file?
> I think it's better to incorporate the change in existing 'cpus.yaml'
> file to keep both cpu@X and cpus node details together. Please suggest.

No, I'm suggesting you create nvidia,tegra194-ccplex.yaml.


> >> Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
> >> ---
> >>   Documentation/devicetree/bindings/arm/cpus.yaml | 11 +++++++++++
> >>   1 file changed, 11 insertions(+)
> >>
> >> diff --git a/Documentation/devicetree/bindings/arm/cpus.yaml b/Documentation/devicetree/bindings/arm/cpus.yaml
> >> index a018147..9b328e3 100644
> >> --- a/Documentation/devicetree/bindings/arm/cpus.yaml
> >> +++ b/Documentation/devicetree/bindings/arm/cpus.yaml
> >> @@ -162,6 +162,7 @@ properties:
> >>         - nvidia,tegra132-denver
> >>         - nvidia,tegra186-denver
> >>         - nvidia,tegra194-carmel
> >> +      - nvidia,tegra194-ccplex
> >
> > Tegra194 has 2 different CPUs?
> >
> No, T194 SOC has homogeneous architecture with four clusters where each
> cluster has two symmetric cores. 'nvidia,tegra194-carmel' compatible
> string represents each cpu. 'nvidia,tegra194-ccplex' string represents
> the CPU Complex to bind cpufreq driver. The change was done as per
> discussion [1]

You are adding the compatible string to the cpu@N node compatible.

>
> >>         - qcom,krait
> >>         - qcom,kryo
> >>         - qcom,kryo260
> >> @@ -255,6 +256,15 @@ properties:
> >>
> >>         where voltage is in V, frequency is in MHz.
> >>
> >> +  nvidia,bpmp:
> >> +    $ref: '/schemas/types.yaml#/definitions/phandle'
> >> +    description: |
> >> +      Specifies the bpmp node that needs to be queried to get
> >> +      operating point data for all CPUs.
> >> +
> >> +      Optional for systems that have a "compatible"
> >> +      property value of "nvidia,tegra194-ccplex".
> >> +
> >>     power-domains:
> >>       $ref: '/schemas/types.yaml#/definitions/phandle-array'
> >>       description:
> >> @@ -340,6 +350,7 @@ required:
> >>
> >>   dependencies:
> >>     rockchip,pmu: [enable-method]
> >> +  nvidia,bpmp: [compatible]
> >>
> >>   examples:
> >>     - |
> >> --
> >> 2.7.4
> >>
>
> [1] https://marc.info/?l=linux-arm-kernel&m=158999171528418&w=2
Sumit Gupta July 14, 2020, 4:14 p.m. UTC | #4
>>>
>>> The cpus.yaml binding documents what's in 'cpu' nodes, not 'cpus'
>>> node. AIUI, the latter is what you want. You should do your own schema
>>> file here.
>>>
>> Do you mean to change existing file name from 'cpus.yaml' to 'cpu.yaml'
>> and create new 'cpus.yaml' file?
>> I think it's better to incorporate the change in existing 'cpus.yaml'
>> file to keep both cpu@X and cpus node details together. Please suggest.
> 
> No, I'm suggesting you create nvidia,tegra194-ccplex.yaml.
> 
Have posted new version of only this patch with new schema file.
Please review.

Thanks,
Sumit

Patch
diff mbox series

diff --git a/Documentation/devicetree/bindings/arm/cpus.yaml b/Documentation/devicetree/bindings/arm/cpus.yaml
index a018147..9b328e3 100644
--- a/Documentation/devicetree/bindings/arm/cpus.yaml
+++ b/Documentation/devicetree/bindings/arm/cpus.yaml
@@ -162,6 +162,7 @@  properties:
       - nvidia,tegra132-denver
       - nvidia,tegra186-denver
       - nvidia,tegra194-carmel
+      - nvidia,tegra194-ccplex
       - qcom,krait
       - qcom,kryo
       - qcom,kryo260
@@ -255,6 +256,15 @@  properties:
 
       where voltage is in V, frequency is in MHz.
 
+  nvidia,bpmp:
+    $ref: '/schemas/types.yaml#/definitions/phandle'
+    description: |
+      Specifies the bpmp node that needs to be queried to get
+      operating point data for all CPUs.
+
+      Optional for systems that have a "compatible"
+      property value of "nvidia,tegra194-ccplex".
+
   power-domains:
     $ref: '/schemas/types.yaml#/definitions/phandle-array'
     description:
@@ -340,6 +350,7 @@  required:
 
 dependencies:
   rockchip,pmu: [enable-method]
+  nvidia,bpmp: [compatible]
 
 examples:
   - |