[v2] arm64: dts: renesas: r8a77980: add thermal support
diff mbox series

Message ID 90934111-8cc5-482d-8a78-5ccc1113e42d@cogentembedded.com
State Accepted
Commit 69c5e602d0bd717da04c18c08017d195ec10da8d
Delegated to: Simon Horman
Headers show
Series
  • [v2] arm64: dts: renesas: r8a77980: add thermal support
Related show

Commit Message

Sergei Shtylyov Oct. 10, 2018, 7:18 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.

Changes in version 2:
- renamed the thermal device node label;
- renamed the thermal zone nodes;
- added the passive trip point in the 1st thermal zone and the passive and
  critical trip points in the 2nd thermal zone;
- changed the "hysteresis" prop in the critical trip point;
- removed the empty "cooling-maps" node from the 1st thermal zone.

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

Comments

Niklas Söderlund Oct. 10, 2018, 10:11 p.m. UTC | #1
Hi Sergei,

Thanks for keep working on this patch.

On 2018-10-10 22:18:11 +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.
> 
> Changes in version 2:
> - renamed the thermal device node label;
> - renamed the thermal zone nodes;
> - added the passive trip point in the 1st thermal zone and the passive and
>   critical trip points in the 2nd thermal zone;
> - changed the "hysteresis" prop in the critical trip point;
> - removed the empty "cooling-maps" node from the 1st thermal zone.
> 
>  arch/arm64/boot/dts/renesas/r8a77980.dtsi |   53 ++++++++++++++++++++++++++++++
>  1 file changed, 53 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>;
>  		};
>  
> +		tsc: 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>;

The status property is missing but as you told me in v1 it should not 
matter. I will leave it for Simon to decide if he wants it to keep it 
consistent with other SoC or if we should remove it from the other dtsi 
files. In any case with or without the status property.

Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> +		};
> +
>  		intc_ex: interrupt-controller@e61c0000 {
>  			compatible = "renesas,intc-ex-r8a77980", "renesas,irqc";
>  			#interrupt-cells = <2>;
> @@ -1404,6 +1417,46 @@
>  		};
>  	};
>  
> +	thermal-zones {
> +		thermal-sensor-1 {
> +			polling-delay-passive = <250>;
> +			polling-delay = <1000>;
> +			thermal-sensors = <&tsc 0>;
> +
> +			trips {
> +				sensor1-passive {
> +					temperature = <95000>;
> +					hysteresis = <1000>;
> +					type = "passive";
> +				};
> +				sensor1-critical {
> +					temperature = <120000>;
> +					hysteresis = <1000>;
> +					type = "critical";
> +				};
> +			};
> +		};
> +
> +		thermal-sensor-2 {
> +			polling-delay-passive = <250>;
> +			polling-delay = <1000>;
> +			thermal-sensors = <&tsc 1>;
> +
> +			trips {
> +				sensor2-passive {
> +					temperature = <95000>;
> +					hysteresis = <1000>;
> +					type = "passive";
> +				};
> +				sensor2-critical {
> +					temperature = <120000>;
> +					hysteresis = <1000>;
> +					type = "critical";
> +				};
> +			};
> +		};
> +	};
> +
>  	timer {
>  		compatible = "arm,armv8-timer";
>  		interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) |
Geert Uytterhoeven Oct. 11, 2018, 7:02 a.m. UTC | #2
Hi Niklas,

On Thu, Oct 11, 2018 at 12:11 AM Niklas Söderlund
<niklas.soderlund@ragnatech.se> wrote:
> On 2018-10-10 22:18:11 +0300, Sergei Shtylyov wrote:
> > Describe THS/CIVM in the R8A77980 device trees.
> >
> > Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

> > --- 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>;
> >               };
> >
> > +             tsc: 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>;
>
> The status property is missing but as you told me in v1 it should not
> matter. I will leave it for Simon to decide if he wants it to keep it
> consistent with other SoC or if we should remove it from the other dtsi
> files. In any case with or without the status property.

Forgot to review commit c79661eb5060e2bf ("arm64: dts: renesas: Remove
unneeded status from thermal nodes")? ;-)

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Niklas Söderlund Oct. 11, 2018, 7:30 a.m. UTC | #3
Hi Geert,

On 2018-10-11 09:02:22 +0200, Geert Uytterhoeven wrote:
> Hi Niklas,
> 
> On Thu, Oct 11, 2018 at 12:11 AM Niklas Söderlund
> <niklas.soderlund@ragnatech.se> wrote:
> > On 2018-10-10 22:18:11 +0300, Sergei Shtylyov wrote:
> > > Describe THS/CIVM in the R8A77980 device trees.
> > >
> > > Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> 
> > > --- 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>;
> > >               };
> > >
> > > +             tsc: 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>;
> >
> > The status property is missing but as you told me in v1 it should not
> > matter. I will leave it for Simon to decide if he wants it to keep it
> > consistent with other SoC or if we should remove it from the other dtsi
> > files. In any case with or without the status property.
> 
> Forgot to review commit c79661eb5060e2bf ("arm64: dts: renesas: Remove
> unneeded status from thermal nodes")? ;-)

Not only that also reviewing using the context from v4.19-rc1 which of 
course is not correct for dtsi patches, thanks for enlightening me :-)
Simon Horman Oct. 12, 2018, 11:23 a.m. UTC | #4
On Thu, Oct 11, 2018 at 09:30:02AM +0200, Niklas Söderlund wrote:
> Hi Geert,
> 
> On 2018-10-11 09:02:22 +0200, Geert Uytterhoeven wrote:
> > Hi Niklas,
> > 
> > On Thu, Oct 11, 2018 at 12:11 AM Niklas Söderlund
> > <niklas.soderlund@ragnatech.se> wrote:
> > > On 2018-10-10 22:18:11 +0300, Sergei Shtylyov wrote:
> > > > Describe THS/CIVM in the R8A77980 device trees.
> > > >
> > > > Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
> > 
> > > > --- 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>;
> > > >               };
> > > >
> > > > +             tsc: 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>;
> > >
> > > The status property is missing but as you told me in v1 it should not
> > > matter. I will leave it for Simon to decide if he wants it to keep it
> > > consistent with other SoC or if we should remove it from the other dtsi
> > > files. In any case with or without the status property.
> > 
> > Forgot to review commit c79661eb5060e2bf ("arm64: dts: renesas: Remove
> > unneeded status from thermal nodes")? ;-)
> 
> Not only that also reviewing using the context from v4.19-rc1 which of 
> course is not correct for dtsi patches, thanks for enlightening me :-)

Thanks everyone, applied or v4.21.

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>;
 		};
 
+		tsc: 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,46 @@ 
 		};
 	};
 
+	thermal-zones {
+		thermal-sensor-1 {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+			thermal-sensors = <&tsc 0>;
+
+			trips {
+				sensor1-passive {
+					temperature = <95000>;
+					hysteresis = <1000>;
+					type = "passive";
+				};
+				sensor1-critical {
+					temperature = <120000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		thermal-sensor-2 {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+			thermal-sensors = <&tsc 1>;
+
+			trips {
+				sensor2-passive {
+					temperature = <95000>;
+					hysteresis = <1000>;
+					type = "passive";
+				};
+				sensor2-critical {
+					temperature = <120000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+	};
+
 	timer {
 		compatible = "arm,armv8-timer";
 		interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(4) |