2019-09-27 18:44:57

by Guillaume LA ROQUE

[permalink] [raw]
Subject: [PATCH v6 4/7] arm64: dts: meson: g12: Add minimal thermal zone

Add minimal thermal zone for two temperature sensor
One is located close to the DDR and the other one is
located close to the PLLs (between the CPU and GPU)

Acked-by: Martin Blumenstingl <[email protected]>
Tested-by: Christian Hewitt <[email protected]>
Tested-by: Kevin Hilman <[email protected]>
Signed-off-by: Guillaume La Roque <[email protected]>
---
.../boot/dts/amlogic/meson-g12-common.dtsi | 46 +++++++++++++++++++
1 file changed, 46 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
index 0660d9ef6a86..f98171949fcb 100644
--- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
@@ -12,6 +12,7 @@
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/reset/amlogic,meson-axg-audio-arb.h>
#include <dt-bindings/reset/amlogic,meson-g12a-reset.h>
+#include <dt-bindings/thermal/thermal.h>

/ {
interrupt-parent = <&gic>;
@@ -94,6 +95,50 @@
#size-cells = <2>;
ranges;

+ thermal-zones {
+ cpu_thermal: cpu-thermal {
+ polling-delay = <1000>;
+ polling-delay-passive = <100>;
+ thermal-sensors = <&cpu_temp>;
+
+ trips {
+ cpu_passive: cpu-passive {
+ temperature = <85000>; /* millicelsius */
+ hysteresis = <2000>; /* millicelsius */
+ type = "passive";
+ };
+
+ cpu_hot: cpu-hot {
+ temperature = <95000>; /* millicelsius */
+ hysteresis = <2000>; /* millicelsius */
+ type = "hot";
+ };
+
+ };
+ };
+
+ ddr_thermal: ddr-thermal {
+ polling-delay = <1000>;
+ polling-delay-passive = <100>;
+ thermal-sensors = <&ddr_temp>;
+
+ trips {
+ ddr_passive: ddr-passive {
+ temperature = <85000>; /* millicelsius */
+ hysteresis = <2000>; /* millicelsius */
+ type = "passive";
+ };
+ };
+
+ cooling-maps {
+ map {
+ trip = <&ddr_passive>;
+ cooling-device = <&mali THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+ };
+ };
+ };
+ };
+
ethmac: ethernet@ff3f0000 {
compatible = "amlogic,meson-axg-dwmac",
"snps,dwmac-3.70a",
@@ -2412,6 +2457,7 @@
assigned-clock-rates = <0>, /* Do Nothing */
<800000000>,
<0>; /* Do Nothing */
+ #cooling-cells = <2>;
};
};

--
2.17.1


2019-09-30 08:20:28

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH v6 4/7] arm64: dts: meson: g12: Add minimal thermal zone

On 27/09/2019 20:43, Guillaume La Roque wrote:
> Add minimal thermal zone for two temperature sensor
> One is located close to the DDR and the other one is
> located close to the PLLs (between the CPU and GPU)
>
> Acked-by: Martin Blumenstingl <[email protected]>
> Tested-by: Christian Hewitt <[email protected]>
> Tested-by: Kevin Hilman <[email protected]>
> Signed-off-by: Guillaume La Roque <[email protected]>
> ---
> .../boot/dts/amlogic/meson-g12-common.dtsi | 46 +++++++++++++++++++
> 1 file changed, 46 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
> index 0660d9ef6a86..f98171949fcb 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
> @@ -12,6 +12,7 @@
> #include <dt-bindings/interrupt-controller/arm-gic.h>
> #include <dt-bindings/reset/amlogic,meson-axg-audio-arb.h>
> #include <dt-bindings/reset/amlogic,meson-g12a-reset.h>
> +#include <dt-bindings/thermal/thermal.h>
>
> / {
> interrupt-parent = <&gic>;
> @@ -94,6 +95,50 @@
> #size-cells = <2>;
> ranges;
>
> + thermal-zones {
> + cpu_thermal: cpu-thermal {
> + polling-delay = <1000>;
> + polling-delay-passive = <100>;
> + thermal-sensors = <&cpu_temp>;
> +
> + trips {
> + cpu_passive: cpu-passive {
> + temperature = <85000>; /* millicelsius */
> + hysteresis = <2000>; /* millicelsius */
> + type = "passive";
> + };
> +
> + cpu_hot: cpu-hot {
> + temperature = <95000>; /* millicelsius */
> + hysteresis = <2000>; /* millicelsius */
> + type = "hot";
> + };
> +
> + };
> + };
> +
> + ddr_thermal: ddr-thermal {
> + polling-delay = <1000>;
> + polling-delay-passive = <100>;
> + thermal-sensors = <&ddr_temp>;
> +
> + trips {
> + ddr_passive: ddr-passive {
> + temperature = <85000>; /* millicelsius */
> + hysteresis = <2000>; /* millicelsius */
> + type = "passive";
> + };
> + };
> +
> + cooling-maps {
> + map {
> + trip = <&ddr_passive>;
> + cooling-device = <&mali THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
> + };
> + };
> + };
> + };
> +
> ethmac: ethernet@ff3f0000 {
> compatible = "amlogic,meson-axg-dwmac",
> "snps,dwmac-3.70a",
> @@ -2412,6 +2457,7 @@
> assigned-clock-rates = <0>, /* Do Nothing */
> <800000000>,
> <0>; /* Do Nothing */
> + #cooling-cells = <2>;
> };
> };
>
>

Reviewed-by: Neil Armstrong <[email protected]>

2019-09-30 09:46:16

by Amit Kucheria

[permalink] [raw]
Subject: Re: [PATCH v6 4/7] arm64: dts: meson: g12: Add minimal thermal zone

On Sat, Sep 28, 2019 at 12:14 AM Guillaume La Roque
<[email protected]> wrote:
>
> Add minimal thermal zone for two temperature sensor
> One is located close to the DDR and the other one is
> located close to the PLLs (between the CPU and GPU)
>
> Acked-by: Martin Blumenstingl <[email protected]>
> Tested-by: Christian Hewitt <[email protected]>
> Tested-by: Kevin Hilman <[email protected]>
> Signed-off-by: Guillaume La Roque <[email protected]>
> ---
> .../boot/dts/amlogic/meson-g12-common.dtsi | 46 +++++++++++++++++++
> 1 file changed, 46 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
> index 0660d9ef6a86..f98171949fcb 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
> @@ -12,6 +12,7 @@
> #include <dt-bindings/interrupt-controller/arm-gic.h>
> #include <dt-bindings/reset/amlogic,meson-axg-audio-arb.h>
> #include <dt-bindings/reset/amlogic,meson-g12a-reset.h>
> +#include <dt-bindings/thermal/thermal.h>
>
> / {
> interrupt-parent = <&gic>;
> @@ -94,6 +95,50 @@
> #size-cells = <2>;
> ranges;
>
> + thermal-zones {
> + cpu_thermal: cpu-thermal {
> + polling-delay = <1000>;
> + polling-delay-passive = <100>;
> + thermal-sensors = <&cpu_temp>;
> +
> + trips {
> + cpu_passive: cpu-passive {
> + temperature = <85000>; /* millicelsius */
> + hysteresis = <2000>; /* millicelsius */
> + type = "passive";
> + };
> +
> + cpu_hot: cpu-hot {
> + temperature = <95000>; /* millicelsius */
> + hysteresis = <2000>; /* millicelsius */
> + type = "hot";

critical instead of hot? What is the SoC's critical shutdown temperature?

Typically, you would use 'hot' at the beginning of at up trend e.g. at
75000, 'passive' to start throttling and 'critical' for shutdown
temperature.

> + };
> +
> + };
> + };
> +
> + ddr_thermal: ddr-thermal {
> + polling-delay = <1000>;
> + polling-delay-passive = <100>;
> + thermal-sensors = <&ddr_temp>;
> +
> + trips {
> + ddr_passive: ddr-passive {
> + temperature = <85000>; /* millicelsius */
> + hysteresis = <2000>; /* millicelsius */
> + type = "passive";
> + };
> + };
> +
> + cooling-maps {
> + map {
> + trip = <&ddr_passive>;
> + cooling-device = <&mali THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
> + };
> + };
> + };
> + };
> +
> ethmac: ethernet@ff3f0000 {
> compatible = "amlogic,meson-axg-dwmac",
> "snps,dwmac-3.70a",
> @@ -2412,6 +2457,7 @@
> assigned-clock-rates = <0>, /* Do Nothing */
> <800000000>,
> <0>; /* Do Nothing */
> + #cooling-cells = <2>;
> };
> };
>
> --
> 2.17.1
>