arm64: dts: renesas: r8a77980: add thermal support
diff mbox series

Message ID 90451643-6beb-e61f-912c-3adff4c943cb@cogentembedded.com
State Superseded
Headers show
Series
  • arm64: dts: renesas: r8a77980: add thermal support
Related show

Commit Message

Sergei Shtylyov Oct. 9, 2018, 7:37 p.m. UTC
Describe THS/CIVM in the R8A77980 device trees.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

---
This patch is against the 'renesas-devel-20181008-v4.19-rc7' tag of Simon
Horman's 'renesas.git' repo.

The thermal driver/bindings patches have been just posted...

 arch/arm64/boot/dts/renesas/r8a77980.dtsi |   38 ++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

Comments

Simon Horman Oct. 10, 2018, 8:36 a.m. UTC | #1
[+ Niklas]

On Tue, Oct 09, 2018 at 10:37:47PM +0300, Sergei Shtylyov wrote:
> Describe THS/CIVM in the R8A77980 device trees.
> 
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> 
> ---
> This patch is against the 'renesas-devel-20181008-v4.19-rc7' tag of Simon
> Horman's 'renesas.git' repo.
> 
> The thermal driver/bindings patches have been just posted...
> 
>  arch/arm64/boot/dts/renesas/r8a77980.dtsi |   38 ++++++++++++++++++++++++++++++

Thanks Sergei, one minor nit from me below.

Niklas, I'd value your review of this patch.

>  1 file changed, 38 insertions(+)
> 
> Index: renesas/arch/arm64/boot/dts/renesas/r8a77980.dtsi
> ===================================================================
> --- renesas.orig/arch/arm64/boot/dts/renesas/r8a77980.dtsi
> +++ renesas/arch/arm64/boot/dts/renesas/r8a77980.dtsi
> @@ -330,6 +330,19 @@
>  			#power-domain-cells = <1>;
>  		};
>  
> +		thermal: thermal@e6198000 {

"tsc:" would be consistent with other R-Car Gen 3 dtsi that
describe this device.

> +			compatible = "renesas,r8a77980-thermal";
> +			reg = <0 0xe6198000 0 0x100>,
> +			      <0 0xe61a0000 0 0x100>;
> +			interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>,
> +				     <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,
> +				     <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
> +			clocks = <&cpg CPG_MOD 522>;
> +			power-domains = <&sysc R8A77980_PD_ALWAYS_ON>;
> +			resets = <&cpg 522>;
> +			#thermal-sensor-cells = <1>;
> +		};
> +
>  		intc_ex: interrupt-controller@e61c0000 {
>  			compatible = "renesas,intc-ex-r8a77980", "renesas,irqc";
>  			#interrupt-cells = <2>;
> @@ -1404,6 +1417,31 @@
>  		};
>  	};
>  
> +	thermal-zones {
> +		cpu-thermal {
> +			polling-delay-passive = <250>;
> +			polling-delay = <1000>;
> +			thermal-sensors = <&thermal 0>;
> +
> +			trips {
> +				cpu-crit {
> +					temperature = <120000>;
> +					hysteresis = <2000>;
> +					type = "critical";
> +				};
> +			};
> +
> +			cooling-maps {
> +			};
> +		};
> +
> +		sensor2-thermal {
> +			polling-delay-passive = <250>;
> +			polling-delay = <1000>;
> +			thermal-sensors = <&thermal 1>;
> +		};
> +	};
> +
>  	timer {
>  		compatible = "arm,armv8-timer";
>  		interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) |
>
Sergei Shtylyov Oct. 10, 2018, 10:47 a.m. UTC | #2
On 10/10/2018 11:36 AM, Simon Horman wrote:

>> Describe THS/CIVM in the R8A77980 device trees.
>>
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>>
>> ---
>> This patch is against the 'renesas-devel-20181008-v4.19-rc7' tag of Simon
>> Horman's 'renesas.git' repo.
>>
>> The thermal driver/bindings patches have been just posted...
>>
>>  arch/arm64/boot/dts/renesas/r8a77980.dtsi |   38 ++++++++++++++++++++++++++++++
> 
> Thanks Sergei, one minor nit from me below.
> 
> Niklas, I'd value your review of this patch.
> 
>>  1 file changed, 38 insertions(+)
>>
>> Index: renesas/arch/arm64/boot/dts/renesas/r8a77980.dtsi
>> ===================================================================
>> --- renesas.orig/arch/arm64/boot/dts/renesas/r8a77980.dtsi
>> +++ renesas/arch/arm64/boot/dts/renesas/r8a77980.dtsi
>> @@ -330,6 +330,19 @@
>>  			#power-domain-cells = <1>;
>>  		};
>>  
>> +		thermal: thermal@e6198000 {
> 
> "tsc:" would be consistent with other R-Car Gen 3 dtsi that
> describe this device.

   There's no consistency even among those: R8A779{5|6}0 use "tsc:", 
R8A77995 uses "thermal:"... :-)

[...]

MBR, Sergei
Niklas Söderlund Oct. 10, 2018, 10:52 a.m. UTC | #3
Hi Sergei,

On 2018-10-10 13:47:36 +0300, Sergei Shtylyov wrote:
> On 10/10/2018 11:36 AM, Simon Horman wrote:
> 
> >> Describe THS/CIVM in the R8A77980 device trees.
> >>
> >> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> >>
> >> ---
> >> This patch is against the 'renesas-devel-20181008-v4.19-rc7' tag of Simon
> >> Horman's 'renesas.git' repo.
> >>
> >> The thermal driver/bindings patches have been just posted...
> >>
> >>  arch/arm64/boot/dts/renesas/r8a77980.dtsi |   38 ++++++++++++++++++++++++++++++
> > 
> > Thanks Sergei, one minor nit from me below.
> > 
> > Niklas, I'd value your review of this patch.
> > 
> >>  1 file changed, 38 insertions(+)
> >>
> >> Index: renesas/arch/arm64/boot/dts/renesas/r8a77980.dtsi
> >> ===================================================================
> >> --- renesas.orig/arch/arm64/boot/dts/renesas/r8a77980.dtsi
> >> +++ renesas/arch/arm64/boot/dts/renesas/r8a77980.dtsi
> >> @@ -330,6 +330,19 @@
> >>  			#power-domain-cells = <1>;
> >>  		};
> >>  
> >> +		thermal: thermal@e6198000 {
> > 
> > "tsc:" would be consistent with other R-Car Gen 3 dtsi that
> > describe this device.
> 
>    There's no consistency even among those: R8A779{5|6}0 use "tsc:", 
> R8A77995 uses "thermal:"... :-)

D3 (R8A77995) uses the Gen2 thermal driver while V3H uses Gen3 thermal 
driver, so there is some consistency and I think we should aim to make 
it as consistent as possible :-)

> 
> [...]
> 
> MBR, Sergei
Niklas Söderlund Oct. 10, 2018, 10:57 a.m. UTC | #4
Hi Sergei,

Thanks for your work.

On 2018-10-09 22:37:47 +0300, Sergei Shtylyov wrote:
> Describe THS/CIVM in the R8A77980 device trees.
> 
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> 
> ---
> This patch is against the 'renesas-devel-20181008-v4.19-rc7' tag of Simon
> Horman's 'renesas.git' repo.
> 
> The thermal driver/bindings patches have been just posted...
> 
>  arch/arm64/boot/dts/renesas/r8a77980.dtsi |   38 ++++++++++++++++++++++++++++++
>  1 file changed, 38 insertions(+)
> 
> Index: renesas/arch/arm64/boot/dts/renesas/r8a77980.dtsi
> ===================================================================
> --- renesas.orig/arch/arm64/boot/dts/renesas/r8a77980.dtsi
> +++ renesas/arch/arm64/boot/dts/renesas/r8a77980.dtsi
> @@ -330,6 +330,19 @@
>  			#power-domain-cells = <1>;
>  		};
>  
> +		thermal: thermal@e6198000 {

As Simon points out other Gen3 thermal nodes use "tsc:" not "thermal:".

> +			compatible = "renesas,r8a77980-thermal";
> +			reg = <0 0xe6198000 0 0x100>,
> +			      <0 0xe61a0000 0 0x100>;
> +			interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>,
> +				     <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,
> +				     <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
> +			clocks = <&cpg CPG_MOD 522>;
> +			power-domains = <&sysc R8A77980_PD_ALWAYS_ON>;
> +			resets = <&cpg 522>;
> +			#thermal-sensor-cells = <1>;

Missing status = "okay" or am I missing something?

> +		};
> +
>  		intc_ex: interrupt-controller@e61c0000 {
>  			compatible = "renesas,intc-ex-r8a77980", "renesas,irqc";
>  			#interrupt-cells = <2>;
> @@ -1404,6 +1417,31 @@
>  		};
>  	};
>  
> +	thermal-zones {
> +		cpu-thermal {
> +			polling-delay-passive = <250>;
> +			polling-delay = <1000>;
> +			thermal-sensors = <&thermal 0>;
> +
> +			trips {
> +				cpu-crit {
> +					temperature = <120000>;
> +					hysteresis = <2000>;
> +					type = "critical";
> +				};
> +			};
> +
> +			cooling-maps {
> +			};
> +		};
> +
> +		sensor2-thermal {
> +			polling-delay-passive = <250>;
> +			polling-delay = <1000>;
> +			thermal-sensors = <&thermal 1>;
> +		};
> +	};

The thermal-zones node uses the Gen2 labels and I think this should be 
updated to be as consistent as possible with other Gen3 users. For extra 
points expand this could be expanded to also include the cooling-maps 
but could also happen in a separate patch if cooling-devices are not yet 
defined :-)

> +
>  	timer {
>  		compatible = "arm,armv8-timer";
>  		interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) |
Sergei Shtylyov Oct. 10, 2018, 11:20 a.m. UTC | #5
On 10/10/2018 01:57 PM, Niklas Söderlund wrote:

>> Describe THS/CIVM in the R8A77980 device trees.
>>
>> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
>>
>> ---
>> This patch is against the 'renesas-devel-20181008-v4.19-rc7' tag of Simon
>> Horman's 'renesas.git' repo.
>>
>> The thermal driver/bindings patches have been just posted...
>>
>>  arch/arm64/boot/dts/renesas/r8a77980.dtsi |   38 ++++++++++++++++++++++++++++++
>>  1 file changed, 38 insertions(+)
>>
>> Index: renesas/arch/arm64/boot/dts/renesas/r8a77980.dtsi
>> ===================================================================
>> --- renesas.orig/arch/arm64/boot/dts/renesas/r8a77980.dtsi
>> +++ renesas/arch/arm64/boot/dts/renesas/r8a77980.dtsi
>> @@ -330,6 +330,19 @@
>>  			#power-domain-cells = <1>;
>>  		};
>>  
>> +		thermal: thermal@e6198000 {
> 
> As Simon points out other Gen3 thermal nodes use "tsc:" not "thermal:".

   Ah, indeed. However the manual calls this device THS/CIVM regardless of
the version.

>> +			compatible = "renesas,r8a77980-thermal";
>> +			reg = <0 0xe6198000 0 0x100>,
>> +			      <0 0xe61a0000 0 0x100>;
>> +			interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>,
>> +				     <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,
>> +				     <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
>> +			clocks = <&cpg CPG_MOD 522>;
>> +			power-domains = <&sysc R8A77980_PD_ALWAYS_ON>;
>> +			resets = <&cpg 522>;
>> +			#thermal-sensor-cells = <1>;
> 
> Missing status = "okay" or am I missing something?

   Yes, 'status = "okay"' can be omitted with the same effect.

>> +		};
>> +
>>  		intc_ex: interrupt-controller@e61c0000 {
>>  			compatible = "renesas,intc-ex-r8a77980", "renesas,irqc";
>>  			#interrupt-cells = <2>;
>> @@ -1404,6 +1417,31 @@
>>  		};
>>  	};
>>  
>> +	thermal-zones {
>> +		cpu-thermal {
>> +			polling-delay-passive = <250>;
>> +			polling-delay = <1000>;
>> +			thermal-sensors = <&thermal 0>;
>> +
>> +			trips {
>> +				cpu-crit {
>> +					temperature = <120000>;
>> +					hysteresis = <2000>;
>> +					type = "critical";
>> +				};
>> +			};
>> +
>> +			cooling-maps {
>> +			};
>> +		};
>> +
>> +		sensor2-thermal {
>> +			polling-delay-passive = <250>;
>> +			polling-delay = <1000>;
>> +			thermal-sensors = <&thermal 1>;
>> +		};
>> +	};
> 
> The thermal-zones node uses the Gen2 labels

   I don't see it using any labels at all...

> and I think this should be 
> updated to be as consistent as possible with other Gen3 users. For extra

   OK, I forgot to look at the thermal zones on R8A779{5|6}0...

> points expand this could be expanded to also include the cooling-maps 
> but could also happen in a separate patch if cooling-devices are not yet 
> defined :-)

   I'll look into that...

[...]

MBR, Sergei

Patch
diff mbox series

Index: renesas/arch/arm64/boot/dts/renesas/r8a77980.dtsi
===================================================================
--- renesas.orig/arch/arm64/boot/dts/renesas/r8a77980.dtsi
+++ renesas/arch/arm64/boot/dts/renesas/r8a77980.dtsi
@@ -330,6 +330,19 @@ 
 			#power-domain-cells = <1>;
 		};
 
+		thermal: thermal@e6198000 {
+			compatible = "renesas,r8a77980-thermal";
+			reg = <0 0xe6198000 0 0x100>,
+			      <0 0xe61a0000 0 0x100>;
+			interrupts = <GIC_SPI 67 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 69 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 522>;
+			power-domains = <&sysc R8A77980_PD_ALWAYS_ON>;
+			resets = <&cpg 522>;
+			#thermal-sensor-cells = <1>;
+		};
+
 		intc_ex: interrupt-controller@e61c0000 {
 			compatible = "renesas,intc-ex-r8a77980", "renesas,irqc";
 			#interrupt-cells = <2>;
@@ -1404,6 +1417,31 @@ 
 		};
 	};
 
+	thermal-zones {
+		cpu-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+			thermal-sensors = <&thermal 0>;
+
+			trips {
+				cpu-crit {
+					temperature = <120000>;
+					hysteresis = <2000>;
+					type = "critical";
+				};
+			};
+
+			cooling-maps {
+			};
+		};
+
+		sensor2-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+			thermal-sensors = <&thermal 1>;
+		};
+	};
+
 	timer {
 		compatible = "arm,armv8-timer";
 		interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) |