diff mbox series

arm64: dts: renesas: r8a77961: Add thermal nodes

Message ID 20200306110025.24747-1-geert+renesas@glider.be (mailing list archive)
State New, archived
Delegated to: Daniel Lezcano
Headers show
Series arm64: dts: renesas: r8a77961: Add thermal nodes | expand

Commit Message

Geert Uytterhoeven March 6, 2020, 11 a.m. UTC
Add a device node for the Thermal Sensor/Chip Internal Voltage Monitor
in the R-Car M3-W+ (R8A77961) SoC, and describe the thermal zones.

According to the R-Car Gen3 Hardware Manual Errata for Revision 2.00 of
Jan 31, 2020, the thermal parameters for R-Car M3-W+ are the same as for
R-Car M3-W.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
It's a bit cold in Magnus' lab:

/ # grep . /sys/devices/virtual/thermal/thermal_zone?/temp
/sys/devices/virtual/thermal/thermal_zone0/temp:17000
/sys/devices/virtual/thermal/thermal_zone1/temp:19000
/sys/devices/virtual/thermal/thermal_zone2/temp:18000
---
 arch/arm64/boot/dts/renesas/r8a77961.dtsi | 80 +++++++++++++++++++++++
 1 file changed, 80 insertions(+)

Comments

Niklas Söderlund March 8, 2020, 4:35 p.m. UTC | #1
Hi Geert,

Thanks for your work.

On 2020-03-06 12:00:25 +0100, Geert Uytterhoeven wrote:
> Add a device node for the Thermal Sensor/Chip Internal Voltage Monitor
> in the R-Car M3-W+ (R8A77961) SoC, and describe the thermal zones.
> 
> According to the R-Car Gen3 Hardware Manual Errata for Revision 2.00 of
> Jan 31, 2020, the thermal parameters for R-Car M3-W+ are the same as for
> R-Car M3-W.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> It's a bit cold in Magnus' lab:
> 
> / # grep . /sys/devices/virtual/thermal/thermal_zone?/temp
> /sys/devices/virtual/thermal/thermal_zone0/temp:17000
> /sys/devices/virtual/thermal/thermal_zone1/temp:19000
> /sys/devices/virtual/thermal/thermal_zone2/temp:18000
> ---
>  arch/arm64/boot/dts/renesas/r8a77961.dtsi | 80 +++++++++++++++++++++++
>  1 file changed, 80 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/renesas/r8a77961.dtsi b/arch/arm64/boot/dts/renesas/r8a77961.dtsi
> index b6915319a61c8bf0..2f016458f57d3a33 100644
> --- a/arch/arm64/boot/dts/renesas/r8a77961.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r8a77961.dtsi
> @@ -474,6 +474,20 @@
>  			#power-domain-cells = <1>;
>  		};
>  
> +		tsc: thermal@e6198000 {
> +			compatible = "renesas,r8a77961-thermal";
> +			reg = <0 0xe6198000 0 0x100>,
> +			      <0 0xe61a0000 0 0x100>,
> +			      <0 0xe61a8000 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 R8A77961_PD_ALWAYS_ON>;
> +			resets = <&cpg 522>;
> +			#thermal-sensor-cells = <1>;
> +		};
> +
>  		intc_ex: interrupt-controller@e61c0000 {
>  			#interrupt-cells = <2>;
>  			interrupt-controller;
> @@ -785,6 +799,7 @@
>  			status = "disabled";
>  		};
>  
> +

This don't looks like it's needed :-) With this fixed,

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

>  		pwm1: pwm@e6e31000 {
>  			reg = <0 0xe6e31000 0 8>;
>  			#pwm-cells = <2>;
> @@ -1073,6 +1088,71 @@
>  		};
>  	};
>  
> +	thermal-zones {
> +		sensor_thermal1: sensor-thermal1 {
> +			polling-delay-passive = <250>;
> +			polling-delay = <1000>;
> +			thermal-sensors = <&tsc 0>;
> +			sustainable-power = <3874>;
> +
> +			trips {
> +				sensor1_crit: sensor1-crit {
> +					temperature = <120000>;
> +					hysteresis = <1000>;
> +					type = "critical";
> +				};
> +			};
> +		};
> +
> +		sensor_thermal2: sensor-thermal2 {
> +			polling-delay-passive = <250>;
> +			polling-delay = <1000>;
> +			thermal-sensors = <&tsc 1>;
> +			sustainable-power = <3874>;
> +
> +			trips {
> +				sensor2_crit: sensor2-crit {
> +					temperature = <120000>;
> +					hysteresis = <1000>;
> +					type = "critical";
> +				};
> +			};
> +		};
> +
> +		sensor_thermal3: sensor-thermal3 {
> +			polling-delay-passive = <250>;
> +			polling-delay = <1000>;
> +			thermal-sensors = <&tsc 2>;
> +			sustainable-power = <3874>;
> +
> +			cooling-maps {
> +				map0 {
> +					trip = <&target>;
> +					cooling-device = <&a57_0 2 4>;
> +					contribution = <1024>;
> +				};
> +				map1 {
> +					trip = <&target>;
> +					cooling-device = <&a53_0 0 2>;
> +					contribution = <1024>;
> +				};
> +			};
> +			trips {
> +				target: trip-point1 {
> +					temperature = <100000>;
> +					hysteresis = <1000>;
> +					type = "passive";
> +				};
> +
> +				sensor3_crit: sensor3-crit {
> +					temperature = <120000>;
> +					hysteresis = <1000>;
> +					type = "critical";
> +				};
> +			};
> +		};
> +	};
> +
>  	timer {
>  		compatible = "arm,armv8-timer";
>  		interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(6) | IRQ_TYPE_LEVEL_LOW)>,
> -- 
> 2.17.1
>
Geert Uytterhoeven March 9, 2020, 9:21 a.m. UTC | #2
Hi Niklas,

On Sun, Mar 8, 2020 at 5:35 PM Niklas Söderlund
<niklas.soderlund@ragnatech.se> wrote:
> On 2020-03-06 12:00:25 +0100, Geert Uytterhoeven wrote:
> > Add a device node for the Thermal Sensor/Chip Internal Voltage Monitor
> > in the R-Car M3-W+ (R8A77961) SoC, and describe the thermal zones.
> >
> > According to the R-Car Gen3 Hardware Manual Errata for Revision 2.00 of
> > Jan 31, 2020, the thermal parameters for R-Car M3-W+ are the same as for
> > R-Car M3-W.
> >
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

> > --- a/arch/arm64/boot/dts/renesas/r8a77961.dtsi
> > +++ b/arch/arm64/boot/dts/renesas/r8a77961.dtsi

> > @@ -785,6 +799,7 @@
> >                       status = "disabled";
> >               };
> >
> > +
>
> This don't looks like it's needed :-) With this fixed,
>
> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Thanks, queued in renesas-devel for v5.7, with the above fixed.

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
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/renesas/r8a77961.dtsi b/arch/arm64/boot/dts/renesas/r8a77961.dtsi
index b6915319a61c8bf0..2f016458f57d3a33 100644
--- a/arch/arm64/boot/dts/renesas/r8a77961.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77961.dtsi
@@ -474,6 +474,20 @@ 
 			#power-domain-cells = <1>;
 		};
 
+		tsc: thermal@e6198000 {
+			compatible = "renesas,r8a77961-thermal";
+			reg = <0 0xe6198000 0 0x100>,
+			      <0 0xe61a0000 0 0x100>,
+			      <0 0xe61a8000 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 R8A77961_PD_ALWAYS_ON>;
+			resets = <&cpg 522>;
+			#thermal-sensor-cells = <1>;
+		};
+
 		intc_ex: interrupt-controller@e61c0000 {
 			#interrupt-cells = <2>;
 			interrupt-controller;
@@ -785,6 +799,7 @@ 
 			status = "disabled";
 		};
 
+
 		pwm1: pwm@e6e31000 {
 			reg = <0 0xe6e31000 0 8>;
 			#pwm-cells = <2>;
@@ -1073,6 +1088,71 @@ 
 		};
 	};
 
+	thermal-zones {
+		sensor_thermal1: sensor-thermal1 {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+			thermal-sensors = <&tsc 0>;
+			sustainable-power = <3874>;
+
+			trips {
+				sensor1_crit: sensor1-crit {
+					temperature = <120000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		sensor_thermal2: sensor-thermal2 {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+			thermal-sensors = <&tsc 1>;
+			sustainable-power = <3874>;
+
+			trips {
+				sensor2_crit: sensor2-crit {
+					temperature = <120000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		sensor_thermal3: sensor-thermal3 {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+			thermal-sensors = <&tsc 2>;
+			sustainable-power = <3874>;
+
+			cooling-maps {
+				map0 {
+					trip = <&target>;
+					cooling-device = <&a57_0 2 4>;
+					contribution = <1024>;
+				};
+				map1 {
+					trip = <&target>;
+					cooling-device = <&a53_0 0 2>;
+					contribution = <1024>;
+				};
+			};
+			trips {
+				target: trip-point1 {
+					temperature = <100000>;
+					hysteresis = <1000>;
+					type = "passive";
+				};
+
+				sensor3_crit: sensor3-crit {
+					temperature = <120000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+	};
+
 	timer {
 		compatible = "arm,armv8-timer";
 		interrupts-extended = <&gic GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(6) | IRQ_TYPE_LEVEL_LOW)>,