devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Patrice CHOTARD <patrice.chotard@foss.st.com>
To: Raphael Gallais-Pou <rgallaispou@gmail.com>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Zhang Rui <rui.zhang@intel.com>,
	Lukasz Luba <lukasz.luba@arm.com>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: <linux-pm@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-stm32@st-md-mailman.stormreply.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<devicetree@vger.kernel.org>
Subject: Re: [PATCH 3/3] ARM: dts: sti: add thermal-zones support on stih418
Date: Tue, 25 Jun 2024 09:00:24 +0200	[thread overview]
Message-ID: <0d15dd5c-c03e-4a54-a151-c109836f1b4c@foss.st.com> (raw)
In-Reply-To: <20240518-thermal-v1-3-7dfca3ed454b@gmail.com>



On 5/18/24 14:12, Raphael Gallais-Pou wrote:
> Add a 'thermal-zones' node for stih418.
> 
> A thermal-zone needs three components:
>   - thermal sensors, described in an earlier commit[1]
>   - cooling devices, specified for each CPU
>   - a thermal zone, describing the overall behavior.
> 
> The thermal zone needs references to both CPUs and thermal sensors,
> which phandle are also added. The thermal management will then be
> achieved on CPUs using the cpufreq framework.
> 
> [1] https://lore.kernel.org/lkml/20240320-thermal-v3-2-700296694c4a@gmail.com/
> 
> Signed-off-by: Raphael Gallais-Pou <rgallaispou@gmail.com>
> ---
>  arch/arm/boot/dts/st/stih407-family.dtsi |  6 +++--
>  arch/arm/boot/dts/st/stih418.dtsi        | 41 +++++++++++++++++++++++++++++---
>  2 files changed, 42 insertions(+), 5 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/st/stih407-family.dtsi b/arch/arm/boot/dts/st/stih407-family.dtsi
> index 29302e74aa1d..35a55aef7f4b 100644
> --- a/arch/arm/boot/dts/st/stih407-family.dtsi
> +++ b/arch/arm/boot/dts/st/stih407-family.dtsi
> @@ -33,7 +33,7 @@ delta_reserved: rproc@44000000 {
>  	cpus {
>  		#address-cells = <1>;
>  		#size-cells = <0>;
> -		cpu@0 {
> +		cpu0: cpu@0 {
>  			device_type = "cpu";
>  			compatible = "arm,cortex-a9";
>  			reg = <0>;
> @@ -52,8 +52,9 @@ cpu@0 {
>  			clock-latency = <100000>;
>  			cpu0-supply = <&pwm_regulator>;
>  			st,syscfg = <&syscfg_core 0x8e0>;
> +			#cooling-cells = <2>;
>  		};
> -		cpu@1 {
> +		cpu1: cpu@1 {
>  			device_type = "cpu";
>  			compatible = "arm,cortex-a9";
>  			reg = <1>;
> @@ -66,6 +67,7 @@ cpu@1 {
>  					    1200000 0
>  					    800000  0
>  					    500000  0>;
> +			#cooling-cells = <2>;
>  		};
>  	};
>  
> diff --git a/arch/arm/boot/dts/st/stih418.dtsi b/arch/arm/boot/dts/st/stih418.dtsi
> index b35b9b7a7ccc..6622ffa8ecfa 100644
> --- a/arch/arm/boot/dts/st/stih418.dtsi
> +++ b/arch/arm/boot/dts/st/stih418.dtsi
> @@ -6,23 +6,26 @@
>  #include "stih418-clock.dtsi"
>  #include "stih407-family.dtsi"
>  #include "stih410-pinctrl.dtsi"
> +#include <dt-bindings/thermal/thermal.h>
>  / {
>  	cpus {
>  		#address-cells = <1>;
>  		#size-cells = <0>;
> -		cpu@2 {
> +		cpu2: cpu@2 {
>  			device_type = "cpu";
>  			compatible = "arm,cortex-a9";
>  			reg = <2>;
>  			/* u-boot puts hpen in SBC dmem at 0xa4 offset */
>  			cpu-release-addr = <0x94100A4>;
> +			#cooling-cells = <2>;
>  		};
> -		cpu@3 {
> +		cpu3: cpu@3 {
>  			device_type = "cpu";
>  			compatible = "arm,cortex-a9";
>  			reg = <3>;
>  			/* u-boot puts hpen in SBC dmem at 0xa4 offset */
>  			cpu-release-addr = <0x94100A4>;
> +			#cooling-cells = <2>;
>  		};
>  	};
>  
> @@ -44,6 +47,38 @@ usb2_picophy2: phy3 {
>  		reset-names = "global", "port";
>  	};
>  
> +	thermal-zones {
> +		cpu_thermal: cpu-thermal {
> +			polling-delay-passive = <250>;  /* 250ms */
> +			polling-delay = <1000>;         /* 1000ms */
> +
> +			thermal-sensors = <&thermal>;
> +
> +			trips {
> +				cpu_crit: cpu-crit {
> +					temperature = <95000>;  /* 95C */
> +					hysteresis = <2000>;
> +					type = "critical";
> +				};
> +				cpu_alert: cpu-alert {
> +					temperature = <85000>;  /* 85C */
> +					hysteresis = <2000>;
> +					type = "passive";
> +				};
> +			};
> +
> +			cooling-maps {
> +				map {
> +					trip = <&cpu_alert>;
> +					cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> +							 <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> +							 <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> +							 <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
> +				};
> +			};
> +		};
> +	};
> +
>  	soc {
>  		rng11: rng@8a8a000 {
>  			status = "disabled";
> @@ -107,7 +142,7 @@ mmc0: sdhci@9060000 {
>  			assigned-clock-rates = <200000000>;
>  		};
>  
> -		thermal@91a0000 {
> +		thermal: thermal@91a0000 {
>  			compatible = "st,stih407-thermal";
>  			reg = <0x91a0000 0x28>;
>  			clock-names = "thermal";
> 

Hi Raphael

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>

Thanks
Patrice

      reply	other threads:[~2024-06-25  7:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-18 12:12 [PATCH 0/3] Add thermal management support for STi platform Raphael Gallais-Pou
2024-05-18 12:12 ` [PATCH 1/3] thermal: st: switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() Raphael Gallais-Pou
2024-06-25  6:17   ` Patrice CHOTARD
2024-05-18 12:12 ` [PATCH 2/3] thermal: sti: depend on THERMAL_OF subsystem Raphael Gallais-Pou
2024-06-25  6:39   ` Patrice CHOTARD
2024-05-18 12:12 ` [PATCH 3/3] ARM: dts: sti: add thermal-zones support on stih418 Raphael Gallais-Pou
2024-06-25  7:00   ` Patrice CHOTARD [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0d15dd5c-c03e-4a54-a151-c109836f1b4c@foss.st.com \
    --to=patrice.chotard@foss.st.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=conor+dt@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=lukasz.luba@arm.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=rafael@kernel.org \
    --cc=rgallaispou@gmail.com \
    --cc=robh@kernel.org \
    --cc=rui.zhang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).