mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Claudiu Beznea <claudiu.beznea@microchip.com>
To: <nicolas.ferre@microchip.com>, <alexandre.belloni@bootlin.com>,
	<robh+dt@kernel.org>, <krzysztof.kozlowski+dt@linaro.org>,
	<linux@armlinux.org.uk>, <arnd@arndb.de>
Cc: <linux-arm-kernel@lists.infradead.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Claudiu Beznea <claudiu.beznea@microchip.com>
Subject: [PATCH 06/11] ARM: dts: at91: sama7g5: add thermal zones node
Date: Wed, 26 Oct 2022 15:41:09 +0300	[thread overview]
Message-ID: <20221026124114.985876-7-claudiu.beznea@microchip.com> (raw)
In-Reply-To: <20221026124114.985876-1-claudiu.beznea@microchip.com>

Add thermal zones node with its associated trips and cooling-maps.
It uses CPUFreq as cooling device for temperatures in the interval
[90, 100) degrees Celsius and describe the temperature of 100 degrees
Celsius as critical temperature. System will be is shutting down when
reaching critical temperature.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
---
 arch/arm/boot/dts/sama7g5.dtsi | 42 ++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/arch/arm/boot/dts/sama7g5.dtsi b/arch/arm/boot/dts/sama7g5.dtsi
index 52829be04427..fb517f9aff30 100644
--- a/arch/arm/boot/dts/sama7g5.dtsi
+++ b/arch/arm/boot/dts/sama7g5.dtsi
@@ -17,6 +17,7 @@
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/mfd/at91-usart.h>
 #include <dt-bindings/nvmem/microchip,sama7g5-otpc.h>
+#include <dt-bindings/thermal/thermal.h>
 
 / {
 	model = "Microchip SAMA7G5 family SoC";
@@ -36,6 +37,7 @@ cpu0: cpu@0 {
 			clocks = <&pmc PMC_TYPE_CORE PMC_CPUPLL>;
 			clock-names = "cpu";
 			operating-points-v2 = <&cpu_opp_table>;
+			#cooling-cells = <2>; /* min followed by max */
 		};
 	};
 
@@ -74,6 +76,46 @@ opp-1000000002 {
 		};
 	};
 
+	thermal-zones {
+		cpu_thermal: cpu-thermal {
+			polling-delay-passive = <1000>;
+			polling-delay = <5000>;
+			thermal-sensors = <&thermal_sensor>;
+
+			trips {
+				cpu_normal: cpu-alert0 {
+					temperature = <90000>;
+					hysteresis = <0>;
+					type = "passive";
+				};
+
+				cpu_hot: cpu-alert1 {
+					temperature = <95000>;
+					hysteresis = <0>;
+					type = "passive";
+				};
+
+				cpu_critical: cpu-critical {
+					temperature = <100000>;
+					hysteresis = <0>;
+					type = "critical";
+				};
+			};
+
+			cooling-maps {
+				map0 {
+					trip = <&cpu_normal>;
+					cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+				};
+
+				map1 {
+					trip = <&cpu_hot>;
+					cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+				};
+			};
+		};
+	};
+
 	clocks {
 		slow_xtal: slow_xtal {
 			compatible = "fixed-clock";
-- 
2.34.1


  parent reply	other threads:[~2022-10-26 12:39 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26 12:41 [PATCH 00/11] ARM: at91: fixes and enhancement Claudiu Beznea
2022-10-26 12:41 ` [PATCH 01/11] ARM: at91: pm: avoid soft resetting AC DLL Claudiu Beznea
2022-10-26 12:41 ` [PATCH 02/11] ARM: dts: at91: sama7g5: add otpc node Claudiu Beznea
2022-10-26 12:41 ` [PATCH 03/11] ARM: dts: at91: sama7g5: add io-channel-cells to adc node Claudiu Beznea
2022-10-26 12:41 ` [PATCH 04/11] ARM: dts: at91: sama7g5: add cells for temperature calibration Claudiu Beznea
2022-10-26 12:41 ` [PATCH 05/11] ARM: dts: at91: sama7g5: add temperature sensor Claudiu Beznea
2022-10-26 12:41 ` Claudiu Beznea [this message]
2022-10-26 12:41 ` [PATCH 07/11] ARM: configs: at91: sama7: use make savedefconfig Claudiu Beznea
2022-10-26 12:41 ` [PATCH 08/11] ARM: configs: at91: sama7: add config for microchip otpc Claudiu Beznea
2022-10-26 12:41 ` [PATCH 09/11] ARM: configs: at91: sama7: add config for thermal management Claudiu Beznea
2022-10-26 12:41 ` [PATCH 10/11] ARM: dts: at91: sama7g5: use generic name for securam Claudiu Beznea
2022-10-26 12:41 ` [PATCH 11/11] ARM: dts: at91: sam9x60ek: remove status = "okay" for regulators Claudiu Beznea
2022-11-01 15:09 ` [PATCH 00/11] ARM: at91: fixes and enhancement Claudiu.Beznea

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=20221026124114.985876-7-claudiu.beznea@microchip.com \
    --to=claudiu.beznea@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=arnd@arndb.de \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=nicolas.ferre@microchip.com \
    --cc=robh+dt@kernel.org \
    /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

all inboxes | Powered by JetHome®