All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] arm64: dts: amlogic: a1: introduce thermal setup
@ 2024-03-28 19:26 ` Dmitry Rokosov
  0 siblings, 0 replies; 15+ messages in thread
From: Dmitry Rokosov @ 2024-03-28 19:26 UTC (permalink / raw)
  To: neil.armstrong, jbrunet, mturquette, khilman,
	martin.blumenstingl, glaroque, rafael, daniel.lezcano, rui.zhang,
	lukasz.luba, robh+dt, krzysztof.kozlowski+dt, conor+dt
  Cc: kernel, rockosov, linux-amlogic, linux-pm, linux-kernel,
	devicetree, linux-arm-kernel, Dmitry Rokosov

This patch series introduces thermal sensor declaration to the Meson A1
common dtsi file. It also sets up thermal zones for the AD402 reference
board. It depends on the series with A1 thermal support at [1].

Changes v2 since v1 at [2]:
    - provide Neil RvB for cooling-cells dts patch
    - purge unnecessary 'amlogic,a1-thermal' fallback

Links:
[1] - https://lore.kernel.org/all/20240328191322.17551-1-ddrokosov@salutedevices.com/
[2] - https://lore.kernel.org/all/20240328134459.18446-1-ddrokosov@salutedevices.com/

Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>

Dmitry Rokosov (3):
  arm64: dts: amlogic: a1: add cooling-cells for DVFS feature
  arm64: dts: amlogic: a1: introduce cpu temperature sensor
  arm64: dts: amlogic: ad402: setup thermal-zones

 .../arm64/boot/dts/amlogic/meson-a1-ad402.dts | 45 +++++++++++++++++++
 arch/arm64/boot/dts/amlogic/meson-a1.dtsi     | 13 ++++++
 2 files changed, 58 insertions(+)

-- 
2.43.0


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

* [PATCH v2 0/3] arm64: dts: amlogic: a1: introduce thermal setup
@ 2024-03-28 19:26 ` Dmitry Rokosov
  0 siblings, 0 replies; 15+ messages in thread
From: Dmitry Rokosov @ 2024-03-28 19:26 UTC (permalink / raw)
  To: neil.armstrong, jbrunet, mturquette, khilman,
	martin.blumenstingl, glaroque, rafael, daniel.lezcano, rui.zhang,
	lukasz.luba, robh+dt, krzysztof.kozlowski+dt, conor+dt
  Cc: kernel, rockosov, linux-amlogic, linux-pm, linux-kernel,
	devicetree, linux-arm-kernel, Dmitry Rokosov

This patch series introduces thermal sensor declaration to the Meson A1
common dtsi file. It also sets up thermal zones for the AD402 reference
board. It depends on the series with A1 thermal support at [1].

Changes v2 since v1 at [2]:
    - provide Neil RvB for cooling-cells dts patch
    - purge unnecessary 'amlogic,a1-thermal' fallback

Links:
[1] - https://lore.kernel.org/all/20240328191322.17551-1-ddrokosov@salutedevices.com/
[2] - https://lore.kernel.org/all/20240328134459.18446-1-ddrokosov@salutedevices.com/

Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>

Dmitry Rokosov (3):
  arm64: dts: amlogic: a1: add cooling-cells for DVFS feature
  arm64: dts: amlogic: a1: introduce cpu temperature sensor
  arm64: dts: amlogic: ad402: setup thermal-zones

 .../arm64/boot/dts/amlogic/meson-a1-ad402.dts | 45 +++++++++++++++++++
 arch/arm64/boot/dts/amlogic/meson-a1.dtsi     | 13 ++++++
 2 files changed, 58 insertions(+)

-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 0/3] arm64: dts: amlogic: a1: introduce thermal setup
@ 2024-03-28 19:26 ` Dmitry Rokosov
  0 siblings, 0 replies; 15+ messages in thread
From: Dmitry Rokosov @ 2024-03-28 19:26 UTC (permalink / raw)
  To: neil.armstrong, jbrunet, mturquette, khilman,
	martin.blumenstingl, glaroque, rafael, daniel.lezcano, rui.zhang,
	lukasz.luba, robh+dt, krzysztof.kozlowski+dt, conor+dt
  Cc: kernel, rockosov, linux-amlogic, linux-pm, linux-kernel,
	devicetree, linux-arm-kernel, Dmitry Rokosov

This patch series introduces thermal sensor declaration to the Meson A1
common dtsi file. It also sets up thermal zones for the AD402 reference
board. It depends on the series with A1 thermal support at [1].

Changes v2 since v1 at [2]:
    - provide Neil RvB for cooling-cells dts patch
    - purge unnecessary 'amlogic,a1-thermal' fallback

Links:
[1] - https://lore.kernel.org/all/20240328191322.17551-1-ddrokosov@salutedevices.com/
[2] - https://lore.kernel.org/all/20240328134459.18446-1-ddrokosov@salutedevices.com/

Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>

Dmitry Rokosov (3):
  arm64: dts: amlogic: a1: add cooling-cells for DVFS feature
  arm64: dts: amlogic: a1: introduce cpu temperature sensor
  arm64: dts: amlogic: ad402: setup thermal-zones

 .../arm64/boot/dts/amlogic/meson-a1-ad402.dts | 45 +++++++++++++++++++
 arch/arm64/boot/dts/amlogic/meson-a1.dtsi     | 13 ++++++
 2 files changed, 58 insertions(+)

-- 
2.43.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v2 1/3] arm64: dts: amlogic: a1: add cooling-cells for DVFS feature
  2024-03-28 19:26 ` Dmitry Rokosov
  (?)
@ 2024-03-28 19:26   ` Dmitry Rokosov
  -1 siblings, 0 replies; 15+ messages in thread
From: Dmitry Rokosov @ 2024-03-28 19:26 UTC (permalink / raw)
  To: neil.armstrong, jbrunet, mturquette, khilman,
	martin.blumenstingl, glaroque, rafael, daniel.lezcano, rui.zhang,
	lukasz.luba, robh+dt, krzysztof.kozlowski+dt, conor+dt
  Cc: kernel, rockosov, linux-amlogic, linux-pm, linux-kernel,
	devicetree, linux-arm-kernel, Dmitry Rokosov

It's used for CPU with DVFS feature to specify minimum and maximum
cooling state used in the reference.
Without these values DVFS will not work and dtbs_check will raise the
error.

Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 arch/arm64/boot/dts/amlogic/meson-a1.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
index fbee986421f1..f65d4a77ee52 100644
--- a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
@@ -32,6 +32,7 @@ cpu0: cpu@0 {
 			reg = <0x0 0x0>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			#cooling-cells = <2>;
 		};
 
 		cpu1: cpu@1 {
@@ -40,6 +41,7 @@ cpu1: cpu@1 {
 			reg = <0x0 0x1>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			#cooling-cells = <2>;
 		};
 
 		l2: l2-cache0 {
-- 
2.43.0


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

* [PATCH v2 1/3] arm64: dts: amlogic: a1: add cooling-cells for DVFS feature
@ 2024-03-28 19:26   ` Dmitry Rokosov
  0 siblings, 0 replies; 15+ messages in thread
From: Dmitry Rokosov @ 2024-03-28 19:26 UTC (permalink / raw)
  To: neil.armstrong, jbrunet, mturquette, khilman,
	martin.blumenstingl, glaroque, rafael, daniel.lezcano, rui.zhang,
	lukasz.luba, robh+dt, krzysztof.kozlowski+dt, conor+dt
  Cc: kernel, rockosov, linux-amlogic, linux-pm, linux-kernel,
	devicetree, linux-arm-kernel, Dmitry Rokosov

It's used for CPU with DVFS feature to specify minimum and maximum
cooling state used in the reference.
Without these values DVFS will not work and dtbs_check will raise the
error.

Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 arch/arm64/boot/dts/amlogic/meson-a1.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
index fbee986421f1..f65d4a77ee52 100644
--- a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
@@ -32,6 +32,7 @@ cpu0: cpu@0 {
 			reg = <0x0 0x0>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			#cooling-cells = <2>;
 		};
 
 		cpu1: cpu@1 {
@@ -40,6 +41,7 @@ cpu1: cpu@1 {
 			reg = <0x0 0x1>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			#cooling-cells = <2>;
 		};
 
 		l2: l2-cache0 {
-- 
2.43.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v2 1/3] arm64: dts: amlogic: a1: add cooling-cells for DVFS feature
@ 2024-03-28 19:26   ` Dmitry Rokosov
  0 siblings, 0 replies; 15+ messages in thread
From: Dmitry Rokosov @ 2024-03-28 19:26 UTC (permalink / raw)
  To: neil.armstrong, jbrunet, mturquette, khilman,
	martin.blumenstingl, glaroque, rafael, daniel.lezcano, rui.zhang,
	lukasz.luba, robh+dt, krzysztof.kozlowski+dt, conor+dt
  Cc: kernel, rockosov, linux-amlogic, linux-pm, linux-kernel,
	devicetree, linux-arm-kernel, Dmitry Rokosov

It's used for CPU with DVFS feature to specify minimum and maximum
cooling state used in the reference.
Without these values DVFS will not work and dtbs_check will raise the
error.

Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
---
 arch/arm64/boot/dts/amlogic/meson-a1.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
index fbee986421f1..f65d4a77ee52 100644
--- a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
@@ -32,6 +32,7 @@ cpu0: cpu@0 {
 			reg = <0x0 0x0>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			#cooling-cells = <2>;
 		};
 
 		cpu1: cpu@1 {
@@ -40,6 +41,7 @@ cpu1: cpu@1 {
 			reg = <0x0 0x1>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			#cooling-cells = <2>;
 		};
 
 		l2: l2-cache0 {
-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 2/3] arm64: dts: amlogic: a1: introduce cpu temperature sensor
  2024-03-28 19:26 ` Dmitry Rokosov
  (?)
@ 2024-03-28 19:26   ` Dmitry Rokosov
  -1 siblings, 0 replies; 15+ messages in thread
From: Dmitry Rokosov @ 2024-03-28 19:26 UTC (permalink / raw)
  To: neil.armstrong, jbrunet, mturquette, khilman,
	martin.blumenstingl, glaroque, rafael, daniel.lezcano, rui.zhang,
	lukasz.luba, robh+dt, krzysztof.kozlowski+dt, conor+dt
  Cc: kernel, rockosov, linux-amlogic, linux-pm, linux-kernel,
	devicetree, linux-arm-kernel, Dmitry Rokosov

The A1 SoC family has only one thermal sensor for CPU temperature
measurement. It is required to set the TS clock rate to 500kHz to make
it workable.

Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
---
 arch/arm64/boot/dts/amlogic/meson-a1.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
index f65d4a77ee52..de77eb53d1dc 100644
--- a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
@@ -854,6 +854,17 @@ usb2_phy1: phy@4000 {
 				power-domains = <&pwrc PWRC_USB_ID>;
 			};
 
+			cpu_temp: temperature-sensor@4c00 {
+				compatible = "amlogic,a1-cpu-thermal";
+				reg = <0x0 0x4c00 0x0 0x50>;
+				interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clkc_periphs CLKID_TS>;
+				assigned-clocks = <&clkc_periphs CLKID_TS>;
+				assigned-clock-rates = <500000>;
+				#thermal-sensor-cells = <0>;
+				amlogic,ao-secure = <&sec_AO>;
+			};
+
 			hwrng: rng@5118 {
 				compatible = "amlogic,meson-rng";
 				reg = <0x0 0x5118 0x0 0x4>;
-- 
2.43.0


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

* [PATCH v2 2/3] arm64: dts: amlogic: a1: introduce cpu temperature sensor
@ 2024-03-28 19:26   ` Dmitry Rokosov
  0 siblings, 0 replies; 15+ messages in thread
From: Dmitry Rokosov @ 2024-03-28 19:26 UTC (permalink / raw)
  To: neil.armstrong, jbrunet, mturquette, khilman,
	martin.blumenstingl, glaroque, rafael, daniel.lezcano, rui.zhang,
	lukasz.luba, robh+dt, krzysztof.kozlowski+dt, conor+dt
  Cc: kernel, rockosov, linux-amlogic, linux-pm, linux-kernel,
	devicetree, linux-arm-kernel, Dmitry Rokosov

The A1 SoC family has only one thermal sensor for CPU temperature
measurement. It is required to set the TS clock rate to 500kHz to make
it workable.

Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
---
 arch/arm64/boot/dts/amlogic/meson-a1.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
index f65d4a77ee52..de77eb53d1dc 100644
--- a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
@@ -854,6 +854,17 @@ usb2_phy1: phy@4000 {
 				power-domains = <&pwrc PWRC_USB_ID>;
 			};
 
+			cpu_temp: temperature-sensor@4c00 {
+				compatible = "amlogic,a1-cpu-thermal";
+				reg = <0x0 0x4c00 0x0 0x50>;
+				interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clkc_periphs CLKID_TS>;
+				assigned-clocks = <&clkc_periphs CLKID_TS>;
+				assigned-clock-rates = <500000>;
+				#thermal-sensor-cells = <0>;
+				amlogic,ao-secure = <&sec_AO>;
+			};
+
 			hwrng: rng@5118 {
 				compatible = "amlogic,meson-rng";
 				reg = <0x0 0x5118 0x0 0x4>;
-- 
2.43.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v2 2/3] arm64: dts: amlogic: a1: introduce cpu temperature sensor
@ 2024-03-28 19:26   ` Dmitry Rokosov
  0 siblings, 0 replies; 15+ messages in thread
From: Dmitry Rokosov @ 2024-03-28 19:26 UTC (permalink / raw)
  To: neil.armstrong, jbrunet, mturquette, khilman,
	martin.blumenstingl, glaroque, rafael, daniel.lezcano, rui.zhang,
	lukasz.luba, robh+dt, krzysztof.kozlowski+dt, conor+dt
  Cc: kernel, rockosov, linux-amlogic, linux-pm, linux-kernel,
	devicetree, linux-arm-kernel, Dmitry Rokosov

The A1 SoC family has only one thermal sensor for CPU temperature
measurement. It is required to set the TS clock rate to 500kHz to make
it workable.

Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
---
 arch/arm64/boot/dts/amlogic/meson-a1.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
index f65d4a77ee52..de77eb53d1dc 100644
--- a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi
@@ -854,6 +854,17 @@ usb2_phy1: phy@4000 {
 				power-domains = <&pwrc PWRC_USB_ID>;
 			};
 
+			cpu_temp: temperature-sensor@4c00 {
+				compatible = "amlogic,a1-cpu-thermal";
+				reg = <0x0 0x4c00 0x0 0x50>;
+				interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>;
+				clocks = <&clkc_periphs CLKID_TS>;
+				assigned-clocks = <&clkc_periphs CLKID_TS>;
+				assigned-clock-rates = <500000>;
+				#thermal-sensor-cells = <0>;
+				amlogic,ao-secure = <&sec_AO>;
+			};
+
 			hwrng: rng@5118 {
 				compatible = "amlogic,meson-rng";
 				reg = <0x0 0x5118 0x0 0x4>;
-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 3/3] arm64: dts: amlogic: ad402: setup thermal-zones
  2024-03-28 19:26 ` Dmitry Rokosov
  (?)
@ 2024-03-28 19:26   ` Dmitry Rokosov
  -1 siblings, 0 replies; 15+ messages in thread
From: Dmitry Rokosov @ 2024-03-28 19:26 UTC (permalink / raw)
  To: neil.armstrong, jbrunet, mturquette, khilman,
	martin.blumenstingl, glaroque, rafael, daniel.lezcano, rui.zhang,
	lukasz.luba, robh+dt, krzysztof.kozlowski+dt, conor+dt
  Cc: kernel, rockosov, linux-amlogic, linux-pm, linux-kernel,
	devicetree, linux-arm-kernel, Dmitry Rokosov

There is one thermal zone with 3 trip points: soc_passive, soc_hot, and
soc_critical, as well as two cooling maps.

Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
---
 .../arm64/boot/dts/amlogic/meson-a1-ad402.dts | 45 +++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-a1-ad402.dts b/arch/arm64/boot/dts/amlogic/meson-a1-ad402.dts
index 6c02301840ff..2d22e8b45c6d 100644
--- a/arch/arm64/boot/dts/amlogic/meson-a1-ad402.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-a1-ad402.dts
@@ -7,6 +7,7 @@
 /dts-v1/;
 
 #include "meson-a1.dtsi"
+#include <dt-bindings/thermal/thermal.h>
 
 #include <dt-bindings/gpio/gpio.h>
 
@@ -177,6 +178,50 @@ codec {
 			};
 		};
 	};
+
+	thermal-zones {
+		soc_thermal: soc_thermal {
+			polling-delay = <1000>;
+			polling-delay-passive = <100>;
+			sustainable-power = <130>;
+
+			thermal-sensors = <&cpu_temp>;
+
+			trips {
+				soc_passive: soc-passive {
+					temperature = <70000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				soc_hot: soc-hot {
+					temperature = <85000>;
+					hysteresis = <5000>;
+					type = "hot";
+				};
+
+				soc_critical: soc-critical {
+					temperature = <110000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+
+			soc_cooling_maps: cooling-maps {
+				map0 {
+					trip = <&soc_passive>;
+					cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+							 <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+				};
+
+				map1 {
+					trip = <&soc_hot>;
+					cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+							 <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+				};
+			};
+		};
+	};
 };
 
 /* Bluetooth HCI H4 */
-- 
2.43.0


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

* [PATCH v2 3/3] arm64: dts: amlogic: ad402: setup thermal-zones
@ 2024-03-28 19:26   ` Dmitry Rokosov
  0 siblings, 0 replies; 15+ messages in thread
From: Dmitry Rokosov @ 2024-03-28 19:26 UTC (permalink / raw)
  To: neil.armstrong, jbrunet, mturquette, khilman,
	martin.blumenstingl, glaroque, rafael, daniel.lezcano, rui.zhang,
	lukasz.luba, robh+dt, krzysztof.kozlowski+dt, conor+dt
  Cc: kernel, rockosov, linux-amlogic, linux-pm, linux-kernel,
	devicetree, linux-arm-kernel, Dmitry Rokosov

There is one thermal zone with 3 trip points: soc_passive, soc_hot, and
soc_critical, as well as two cooling maps.

Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
---
 .../arm64/boot/dts/amlogic/meson-a1-ad402.dts | 45 +++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-a1-ad402.dts b/arch/arm64/boot/dts/amlogic/meson-a1-ad402.dts
index 6c02301840ff..2d22e8b45c6d 100644
--- a/arch/arm64/boot/dts/amlogic/meson-a1-ad402.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-a1-ad402.dts
@@ -7,6 +7,7 @@
 /dts-v1/;
 
 #include "meson-a1.dtsi"
+#include <dt-bindings/thermal/thermal.h>
 
 #include <dt-bindings/gpio/gpio.h>
 
@@ -177,6 +178,50 @@ codec {
 			};
 		};
 	};
+
+	thermal-zones {
+		soc_thermal: soc_thermal {
+			polling-delay = <1000>;
+			polling-delay-passive = <100>;
+			sustainable-power = <130>;
+
+			thermal-sensors = <&cpu_temp>;
+
+			trips {
+				soc_passive: soc-passive {
+					temperature = <70000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				soc_hot: soc-hot {
+					temperature = <85000>;
+					hysteresis = <5000>;
+					type = "hot";
+				};
+
+				soc_critical: soc-critical {
+					temperature = <110000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+
+			soc_cooling_maps: cooling-maps {
+				map0 {
+					trip = <&soc_passive>;
+					cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+							 <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+				};
+
+				map1 {
+					trip = <&soc_hot>;
+					cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+							 <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+				};
+			};
+		};
+	};
 };
 
 /* Bluetooth HCI H4 */
-- 
2.43.0


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

* [PATCH v2 3/3] arm64: dts: amlogic: ad402: setup thermal-zones
@ 2024-03-28 19:26   ` Dmitry Rokosov
  0 siblings, 0 replies; 15+ messages in thread
From: Dmitry Rokosov @ 2024-03-28 19:26 UTC (permalink / raw)
  To: neil.armstrong, jbrunet, mturquette, khilman,
	martin.blumenstingl, glaroque, rafael, daniel.lezcano, rui.zhang,
	lukasz.luba, robh+dt, krzysztof.kozlowski+dt, conor+dt
  Cc: kernel, rockosov, linux-amlogic, linux-pm, linux-kernel,
	devicetree, linux-arm-kernel, Dmitry Rokosov

There is one thermal zone with 3 trip points: soc_passive, soc_hot, and
soc_critical, as well as two cooling maps.

Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
---
 .../arm64/boot/dts/amlogic/meson-a1-ad402.dts | 45 +++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-a1-ad402.dts b/arch/arm64/boot/dts/amlogic/meson-a1-ad402.dts
index 6c02301840ff..2d22e8b45c6d 100644
--- a/arch/arm64/boot/dts/amlogic/meson-a1-ad402.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-a1-ad402.dts
@@ -7,6 +7,7 @@
 /dts-v1/;
 
 #include "meson-a1.dtsi"
+#include <dt-bindings/thermal/thermal.h>
 
 #include <dt-bindings/gpio/gpio.h>
 
@@ -177,6 +178,50 @@ codec {
 			};
 		};
 	};
+
+	thermal-zones {
+		soc_thermal: soc_thermal {
+			polling-delay = <1000>;
+			polling-delay-passive = <100>;
+			sustainable-power = <130>;
+
+			thermal-sensors = <&cpu_temp>;
+
+			trips {
+				soc_passive: soc-passive {
+					temperature = <70000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				soc_hot: soc-hot {
+					temperature = <85000>;
+					hysteresis = <5000>;
+					type = "hot";
+				};
+
+				soc_critical: soc-critical {
+					temperature = <110000>;
+					hysteresis = <1000>;
+					type = "critical";
+				};
+			};
+
+			soc_cooling_maps: cooling-maps {
+				map0 {
+					trip = <&soc_passive>;
+					cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+							 <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+				};
+
+				map1 {
+					trip = <&soc_hot>;
+					cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+							 <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+				};
+			};
+		};
+	};
 };
 
 /* Bluetooth HCI H4 */
-- 
2.43.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 0/3] arm64: dts: amlogic: a1: introduce thermal setup
  2024-03-28 19:26 ` Dmitry Rokosov
  (?)
@ 2024-05-03 18:42   ` Dmitry Rokosov
  -1 siblings, 0 replies; 15+ messages in thread
From: Dmitry Rokosov @ 2024-05-03 18:42 UTC (permalink / raw)
  To: neil.armstrong
  Cc: jbrunet, mturquette, khilman, martin.blumenstingl, glaroque,
	rafael, daniel.lezcano, rui.zhang, lukasz.luba, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, kernel, rockosov,
	linux-amlogic, linux-pm, linux-kernel, devicetree,
	linux-arm-kernel

Hello Neil,

A1 Thermal Sensor was applied to linux-pm for v6.10-rc1:

https://lore.kernel.org/all/89a02410-87c8-47c6-aa50-04dad5b4e585@linaro.org/

Could you please advise if it's enough to proceed with this series? Or
do I need to do something more?

On Thu, Mar 28, 2024 at 10:26:34PM +0300, Dmitry Rokosov wrote:
> This patch series introduces thermal sensor declaration to the Meson A1
> common dtsi file. It also sets up thermal zones for the AD402 reference
> board. It depends on the series with A1 thermal support at [1].
> 
> Changes v2 since v1 at [2]:
>     - provide Neil RvB for cooling-cells dts patch
>     - purge unnecessary 'amlogic,a1-thermal' fallback
> 
> Links:
> [1] - https://lore.kernel.org/all/20240328191322.17551-1-ddrokosov@salutedevices.com/
> [2] - https://lore.kernel.org/all/20240328134459.18446-1-ddrokosov@salutedevices.com/
> 
> Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
> 
> Dmitry Rokosov (3):
>   arm64: dts: amlogic: a1: add cooling-cells for DVFS feature
>   arm64: dts: amlogic: a1: introduce cpu temperature sensor
>   arm64: dts: amlogic: ad402: setup thermal-zones
> 
>  .../arm64/boot/dts/amlogic/meson-a1-ad402.dts | 45 +++++++++++++++++++
>  arch/arm64/boot/dts/amlogic/meson-a1.dtsi     | 13 ++++++
>  2 files changed, 58 insertions(+)

-- 
Thank you,
Dmitry

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

* Re: [PATCH v2 0/3] arm64: dts: amlogic: a1: introduce thermal setup
@ 2024-05-03 18:42   ` Dmitry Rokosov
  0 siblings, 0 replies; 15+ messages in thread
From: Dmitry Rokosov @ 2024-05-03 18:42 UTC (permalink / raw)
  To: neil.armstrong
  Cc: jbrunet, mturquette, khilman, martin.blumenstingl, glaroque,
	rafael, daniel.lezcano, rui.zhang, lukasz.luba, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, kernel, rockosov,
	linux-amlogic, linux-pm, linux-kernel, devicetree,
	linux-arm-kernel

Hello Neil,

A1 Thermal Sensor was applied to linux-pm for v6.10-rc1:

https://lore.kernel.org/all/89a02410-87c8-47c6-aa50-04dad5b4e585@linaro.org/

Could you please advise if it's enough to proceed with this series? Or
do I need to do something more?

On Thu, Mar 28, 2024 at 10:26:34PM +0300, Dmitry Rokosov wrote:
> This patch series introduces thermal sensor declaration to the Meson A1
> common dtsi file. It also sets up thermal zones for the AD402 reference
> board. It depends on the series with A1 thermal support at [1].
> 
> Changes v2 since v1 at [2]:
>     - provide Neil RvB for cooling-cells dts patch
>     - purge unnecessary 'amlogic,a1-thermal' fallback
> 
> Links:
> [1] - https://lore.kernel.org/all/20240328191322.17551-1-ddrokosov@salutedevices.com/
> [2] - https://lore.kernel.org/all/20240328134459.18446-1-ddrokosov@salutedevices.com/
> 
> Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
> 
> Dmitry Rokosov (3):
>   arm64: dts: amlogic: a1: add cooling-cells for DVFS feature
>   arm64: dts: amlogic: a1: introduce cpu temperature sensor
>   arm64: dts: amlogic: ad402: setup thermal-zones
> 
>  .../arm64/boot/dts/amlogic/meson-a1-ad402.dts | 45 +++++++++++++++++++
>  arch/arm64/boot/dts/amlogic/meson-a1.dtsi     | 13 ++++++
>  2 files changed, 58 insertions(+)

-- 
Thank you,
Dmitry

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 0/3] arm64: dts: amlogic: a1: introduce thermal setup
@ 2024-05-03 18:42   ` Dmitry Rokosov
  0 siblings, 0 replies; 15+ messages in thread
From: Dmitry Rokosov @ 2024-05-03 18:42 UTC (permalink / raw)
  To: neil.armstrong
  Cc: jbrunet, mturquette, khilman, martin.blumenstingl, glaroque,
	rafael, daniel.lezcano, rui.zhang, lukasz.luba, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, kernel, rockosov,
	linux-amlogic, linux-pm, linux-kernel, devicetree,
	linux-arm-kernel

Hello Neil,

A1 Thermal Sensor was applied to linux-pm for v6.10-rc1:

https://lore.kernel.org/all/89a02410-87c8-47c6-aa50-04dad5b4e585@linaro.org/

Could you please advise if it's enough to proceed with this series? Or
do I need to do something more?

On Thu, Mar 28, 2024 at 10:26:34PM +0300, Dmitry Rokosov wrote:
> This patch series introduces thermal sensor declaration to the Meson A1
> common dtsi file. It also sets up thermal zones for the AD402 reference
> board. It depends on the series with A1 thermal support at [1].
> 
> Changes v2 since v1 at [2]:
>     - provide Neil RvB for cooling-cells dts patch
>     - purge unnecessary 'amlogic,a1-thermal' fallback
> 
> Links:
> [1] - https://lore.kernel.org/all/20240328191322.17551-1-ddrokosov@salutedevices.com/
> [2] - https://lore.kernel.org/all/20240328134459.18446-1-ddrokosov@salutedevices.com/
> 
> Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
> 
> Dmitry Rokosov (3):
>   arm64: dts: amlogic: a1: add cooling-cells for DVFS feature
>   arm64: dts: amlogic: a1: introduce cpu temperature sensor
>   arm64: dts: amlogic: ad402: setup thermal-zones
> 
>  .../arm64/boot/dts/amlogic/meson-a1-ad402.dts | 45 +++++++++++++++++++
>  arch/arm64/boot/dts/amlogic/meson-a1.dtsi     | 13 ++++++
>  2 files changed, 58 insertions(+)

-- 
Thank you,
Dmitry

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

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

end of thread, other threads:[~2024-05-03 18:42 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-28 19:26 [PATCH v2 0/3] arm64: dts: amlogic: a1: introduce thermal setup Dmitry Rokosov
2024-03-28 19:26 ` Dmitry Rokosov
2024-03-28 19:26 ` Dmitry Rokosov
2024-03-28 19:26 ` [PATCH v2 1/3] arm64: dts: amlogic: a1: add cooling-cells for DVFS feature Dmitry Rokosov
2024-03-28 19:26   ` Dmitry Rokosov
2024-03-28 19:26   ` Dmitry Rokosov
2024-03-28 19:26 ` [PATCH v2 2/3] arm64: dts: amlogic: a1: introduce cpu temperature sensor Dmitry Rokosov
2024-03-28 19:26   ` Dmitry Rokosov
2024-03-28 19:26   ` Dmitry Rokosov
2024-03-28 19:26 ` [PATCH v2 3/3] arm64: dts: amlogic: ad402: setup thermal-zones Dmitry Rokosov
2024-03-28 19:26   ` Dmitry Rokosov
2024-03-28 19:26   ` Dmitry Rokosov
2024-05-03 18:42 ` [PATCH v2 0/3] arm64: dts: amlogic: a1: introduce thermal setup Dmitry Rokosov
2024-05-03 18:42   ` Dmitry Rokosov
2024-05-03 18:42   ` Dmitry Rokosov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.