linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: renesas: r8a779h0: Add thermal nodes
@ 2024-03-06 10:58 Geert Uytterhoeven
  2024-03-06 13:43 ` Niklas Söderlund
  0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2024-03-06 10:58 UTC (permalink / raw)
  To: Magnus Damm
  Cc: linux-renesas-soc, linux-arm-kernel, Duy Nguyen, Geert Uytterhoeven

From: Duy Nguyen <duy.nguyen.rh@renesas.com>

Add device nodes for the Thermal Sensor/Chip Internal Voltage
Monitor/Core Voltage Monitor (THS/CIVM/CVM) and the various thermal
zones on the Renesas R-Car V4M (R8A779H0) SoC.

Add support for 2 TSC nodes of thermal.

Signed-off-by: Duy Nguyen <duy.nguyen.rh@renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Tested on Renesas Gray Hawk Single with an R-Car V4M SoC that has
unfortunately no calibration values fused.
To be queued in renesas-devel for v6.10.

Changes compared to the BSP:
  - Drop bogus interrupts property, as interrupts are routed to the ECM,
  - Change polling-delay from <0> to <1000> as interrupts are not
    supported.
---
 arch/arm64/boot/dts/renesas/r8a779h0.dtsi | 40 +++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a779h0.dtsi b/arch/arm64/boot/dts/renesas/r8a779h0.dtsi
index 11885729181bc903..a01929231e08fa30 100644
--- a/arch/arm64/boot/dts/renesas/r8a779h0.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a779h0.dtsi
@@ -318,6 +318,16 @@ sysc: system-controller@e6180000 {
 			#power-domain-cells = <1>;
 		};
 
+		tsc: thermal@e6198000 {
+			compatible = "renesas,r8a779h0-thermal";
+			reg = <0 0xe6198000 0 0x200>,
+			      <0 0xe61a0000 0 0x200>;
+			clocks = <&cpg CPG_MOD 919>;
+			power-domains = <&sysc R8A779H0_PD_ALWAYS_ON>;
+			resets = <&cpg 919>;
+			#thermal-sensor-cells = <1>;
+		};
+
 		i2c0: i2c@e6500000 {
 			compatible = "renesas,i2c-r8a779h0",
 				     "renesas,rcar-gen4-i2c";
@@ -653,6 +663,36 @@ prr: chipid@fff00044 {
 		};
 	};
 
+	thermal-zones {
+		sensor_thermal_cr52: sensor1-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+			thermal-sensors = <&tsc 0>;
+
+			trips {
+				sensor1_crit: sensor1-crit {
+					temperature = <120000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+
+		sensor_thermal_ca76: sensor2-thermal {
+			polling-delay-passive = <250>;
+			polling-delay = <1000>;
+			thermal-sensors = <&tsc 1>;
+
+			trips {
+				sensor2_crit: sensor2-crit {
+					temperature = <120000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+		};
+	};
+
 	timer {
 		compatible = "arm,armv8-timer";
 		interrupts-extended = <&gic GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] arm64: dts: renesas: r8a779h0: Add thermal nodes
  2024-03-06 10:58 [PATCH] arm64: dts: renesas: r8a779h0: Add thermal nodes Geert Uytterhoeven
@ 2024-03-06 13:43 ` Niklas Söderlund
  0 siblings, 0 replies; 2+ messages in thread
From: Niklas Söderlund @ 2024-03-06 13:43 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Magnus Damm, linux-renesas-soc, linux-arm-kernel, Duy Nguyen

Hi Geert,

Thanks for your work.

On 2024-03-06 11:58:35 +0100, Geert Uytterhoeven wrote:
> From: Duy Nguyen <duy.nguyen.rh@renesas.com>
> 
> Add device nodes for the Thermal Sensor/Chip Internal Voltage
> Monitor/Core Voltage Monitor (THS/CIVM/CVM) and the various thermal
> zones on the Renesas R-Car V4M (R8A779H0) SoC.
> 
> Add support for 2 TSC nodes of thermal.
> 
> Signed-off-by: Duy Nguyen <duy.nguyen.rh@renesas.com>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

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

> ---
> Tested on Renesas Gray Hawk Single with an R-Car V4M SoC that has
> unfortunately no calibration values fused.
> To be queued in renesas-devel for v6.10.
> 
> Changes compared to the BSP:
>   - Drop bogus interrupts property, as interrupts are routed to the ECM,
>   - Change polling-delay from <0> to <1000> as interrupts are not
>     supported.
> ---
>  arch/arm64/boot/dts/renesas/r8a779h0.dtsi | 40 +++++++++++++++++++++++
>  1 file changed, 40 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/renesas/r8a779h0.dtsi b/arch/arm64/boot/dts/renesas/r8a779h0.dtsi
> index 11885729181bc903..a01929231e08fa30 100644
> --- a/arch/arm64/boot/dts/renesas/r8a779h0.dtsi
> +++ b/arch/arm64/boot/dts/renesas/r8a779h0.dtsi
> @@ -318,6 +318,16 @@ sysc: system-controller@e6180000 {
>  			#power-domain-cells = <1>;
>  		};
>  
> +		tsc: thermal@e6198000 {
> +			compatible = "renesas,r8a779h0-thermal";
> +			reg = <0 0xe6198000 0 0x200>,
> +			      <0 0xe61a0000 0 0x200>;
> +			clocks = <&cpg CPG_MOD 919>;
> +			power-domains = <&sysc R8A779H0_PD_ALWAYS_ON>;
> +			resets = <&cpg 919>;
> +			#thermal-sensor-cells = <1>;
> +		};
> +
>  		i2c0: i2c@e6500000 {
>  			compatible = "renesas,i2c-r8a779h0",
>  				     "renesas,rcar-gen4-i2c";
> @@ -653,6 +663,36 @@ prr: chipid@fff00044 {
>  		};
>  	};
>  
> +	thermal-zones {
> +		sensor_thermal_cr52: sensor1-thermal {
> +			polling-delay-passive = <250>;
> +			polling-delay = <1000>;
> +			thermal-sensors = <&tsc 0>;
> +
> +			trips {
> +				sensor1_crit: sensor1-crit {
> +					temperature = <120000>;
> +					hysteresis = <1000>;
> +					type = "critical";
> +				};
> +			};
> +		};
> +
> +		sensor_thermal_ca76: sensor2-thermal {
> +			polling-delay-passive = <250>;
> +			polling-delay = <1000>;
> +			thermal-sensors = <&tsc 1>;
> +
> +			trips {
> +				sensor2_crit: sensor2-crit {
> +					temperature = <120000>;
> +					hysteresis = <1000>;
> +					type = "critical";
> +				};
> +			};
> +		};
> +	};
> +
>  	timer {
>  		compatible = "arm,armv8-timer";
>  		interrupts-extended = <&gic GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
> -- 
> 2.34.1
> 
> 

-- 
Kind Regards,
Niklas Söderlund

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-06 13:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-06 10:58 [PATCH] arm64: dts: renesas: r8a779h0: Add thermal nodes Geert Uytterhoeven
2024-03-06 13:43 ` Niklas Söderlund

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).