mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: "Emmanuel Gil Peyrot" <linkmauve@linkmauve.fr>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Heiko Stuebner" <heiko@sntech.de>,
	"Sebastian Reichel" <sebastian.reichel@collabora.com>,
	"Cristian Ciocaltea" <cristian.ciocaltea@collabora.com>,
	"Tamás Szűcs" <szucst@iit.uni-miskolc.hu>,
	"Christopher Obbard" <chris.obbard@collabora.com>,
	"Shreeya Patel" <shreeya.patel@collabora.com>,
	"John Clark" <inindev@gmail.com>,
	"Dragan Simic" <dsimic@manjaro.org>,
	"Chris Morgan" <macromorgan@hotmail.com>,
	"Andy Yan" <andy.yan@rock-chips.com>,
	devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
	"Nicolas Frattaroli" <frattaroli.nicolas@gmail.com>,
	"Alexey Charkov" <alchark@gmail.com>
Subject: Re: [PATCH 1/2] arm64: dts: rockchip: Add the rk3588 thermal zones
Date: Mon, 22 Jan 2024 21:52:10 +0100	[thread overview]
Message-ID: <c2963862-9d22-438a-8357-eccf14fead7d@linaro.org> (raw)
In-Reply-To: <20240122203502.3311520-2-linkmauve@linkmauve.fr>


Hi Emmanuel,

please sync up with Alexey Charkov (added in Cc) who is doing a similar 
configuration [1] which was reviewed.

Thanks
   -- Daniel

[1] 
https://lore.kernel.org/all/CABjd4YyL1ZwNOJrWPwZtc7=e4h18a9tQOnuKP6soy=iTHv-WEA@mail.gmail.com/

On 22/01/2024 21:34, Emmanuel Gil Peyrot wrote:
> The driver got added back in 45d7b3867a5cabb97fc31f16122cda8540c3a30c,
> but the dts never got updated, so here it is!
> 
> I’ve added it to the rk3588s because that’s where most of the
> definitions are, but I’ve only tested on a rk3588 so maybe there are
> subtle changes.
> 
> The rk3588 TRM also documents slightly different values (in part 1
> section 14.5.3) than the driver, but I’ve left the values alone since I
> have no way to determine which one is (more) correct.
> 
> Only the CPU is properly mapped, as neither the GPU nor the NPU have
> been added to the dts for now, I’ve left some TODOs there.
> 
> All of the thermal zones report almost the same value on my rock-5b
> board, I’m not sure if this is due to a programming error or if this is
> to be expected.  For instance, after running for a while, all of the
> zones report 44384 m℃, despite having used neither the GPU nor the NPU.
> 
> Additionally, the alert and crit temperatures have been arbitrarily
> chosen based on other dts files, not based on any knowledge of the
> thermal behaviours of this specific SoC.
> 
> Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
> ---
>   arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 181 ++++++++++++++++++++++
>   1 file changed, 181 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
> index 36b1b7acfe6a..c7a2078960b7 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3588s.dtsi
> @@ -10,6 +10,7 @@
>   #include <dt-bindings/reset/rockchip,rk3588-cru.h>
>   #include <dt-bindings/phy/phy.h>
>   #include <dt-bindings/ata/ahci.h>
> +#include <dt-bindings/thermal/thermal.h>
>   
>   / {
>   	compatible = "rockchip,rk3588";
> @@ -436,6 +437,186 @@ scmi_shmem: sram@0 {
>   		};
>   	};
>   
> +	thermal_zones: thermal-zones {
> +		soc-thermal {
> +			polling-delay-passive = <250>; /* milliseconds */
> +			polling-delay = <1000>; /* milliseconds */
> +			thermal-sensors = <&tsadc 0>;
> +
> +			trips {
> +				soc_alert: trip-alert {
> +					temperature = <80000>;
> +					hysteresis = <2000>;
> +					type = "passive";
> +				};
> +				soc_crit: trip-crit {
> +					temperature = <100000>;
> +					hysteresis = <2000>;
> +					type = "critical";
> +				};
> +			};
> +			cooling-maps {
> +				map0 {
> +					trip = <&soc_alert>;
> +					cooling-device = <&cpu_b0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> +					                 <&cpu_b1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> +					                 <&cpu_b2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> +					                 <&cpu_b3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> +					                 <&cpu_l0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> +					                 <&cpu_l1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> +					                 <&cpu_l2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> +					                 <&cpu_l3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
> +				};
> +			};
> +		};
> +
> +		cluster1-thermal {
> +			polling-delay-passive = <250>; /* milliseconds */
> +			polling-delay = <1000>; /* milliseconds */
> +			thermal-sensors = <&tsadc 1>;
> +
> +			trips {
> +				cluster1_alert: trip-alert {
> +					temperature = <80000>;
> +					hysteresis = <2000>;
> +					type = "passive";
> +				};
> +				cluster1_crit: trip-crit {
> +					temperature = <100000>;
> +					hysteresis = <2000>;
> +					type = "critical";
> +				};
> +			};
> +			cooling-maps {
> +				map0 {
> +					trip = <&cluster1_alert>;
> +					cooling-device = <&cpu_b0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> +					                 <&cpu_b1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
> +				};
> +			};
> +		};
> +
> +		cluster2-thermal {
> +			polling-delay-passive = <250>; /* milliseconds */
> +			polling-delay = <1000>; /* milliseconds */
> +			thermal-sensors = <&tsadc 2>;
> +
> +			trips {
> +				cluster2_alert: trip-alert {
> +					temperature = <80000>;
> +					hysteresis = <2000>;
> +					type = "passive";
> +				};
> +				cluster2_crit: trip-crit {
> +					temperature = <100000>;
> +					hysteresis = <2000>;
> +					type = "critical";
> +				};
> +			};
> +			cooling-maps {
> +				map0 {
> +					trip = <&cluster2_alert>;
> +					cooling-device = <&cpu_b2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> +					                 <&cpu_b3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
> +				};
> +			};
> +		};
> +
> +		cluster0-thermal {
> +			polling-delay-passive = <250>; /* milliseconds */
> +			polling-delay = <1000>; /* milliseconds */
> +			thermal-sensors = <&tsadc 3>;
> +
> +			trips {
> +				cluster0_alert: trip-alert {
> +					temperature = <80000>;
> +					hysteresis = <2000>;
> +					type = "passive";
> +				};
> +				cluster0_crit: trip-crit {
> +					temperature = <100000>;
> +					hysteresis = <2000>;
> +					type = "critical";
> +				};
> +			};
> +			cooling-maps {
> +				map0 {
> +					trip = <&cluster0_alert>;
> +					cooling-device = <&cpu_l0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> +					                 <&cpu_l1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> +					                 <&cpu_l2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> +					                 <&cpu_l3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
> +				};
> +			};
> +		};
> +
> +		center-thermal {
> +			polling-delay-passive = <250>; /* milliseconds */
> +			polling-delay = <1000>; /* milliseconds */
> +			thermal-sensors = <&tsadc 4>;
> +
> +			trips {
> +				center_alert: trip-alert {
> +					temperature = <80000>;
> +					hysteresis = <2000>;
> +					type = "passive";
> +				};
> +				center_crit: trip-crit {
> +					temperature = <100000>;
> +					hysteresis = <2000>;
> +					type = "critical";
> +				};
> +			};
> +			cooling-maps {
> +				/* TODO: what exactly is "center"? */
> +			};
> +		};
> +
> +		gpu-thermal {
> +			polling-delay-passive = <250>; /* milliseconds */
> +			polling-delay = <1000>; /* milliseconds */
> +			thermal-sensors = <&tsadc 5>;
> +
> +			trips {
> +				gpu_alert: trip-alert {
> +					temperature = <80000>;
> +					hysteresis = <2000>;
> +					type = "passive";
> +				};
> +				gpu_crit: trip-crit {
> +					temperature = <100000>;
> +					hysteresis = <2000>;
> +					type = "critical";
> +				};
> +			};
> +			cooling-maps {
> +				/* TODO: Add the GPU here once it is supported. */
> +			};
> +		};
> +
> +		npu-thermal {
> +			polling-delay-passive = <250>; /* milliseconds */
> +			polling-delay = <1000>; /* milliseconds */
> +			thermal-sensors = <&tsadc 6>;
> +
> +			trips {
> +				npu_alert: trip-alert {
> +					temperature = <80000>;
> +					hysteresis = <2000>;
> +					type = "passive";
> +				};
> +				npu_crit: trip-crit {
> +					temperature = <100000>;
> +					hysteresis = <2000>;
> +					type = "critical";
> +				};
> +			};
> +			cooling-maps {
> +				/* TODO: Add the NPU here once it is supported. */
> +			};
> +		};
> +	};
> +
>   	usb_host0_ehci: usb@fc800000 {
>   		compatible = "rockchip,rk3588-ehci", "generic-ehci";
>   		reg = <0x0 0xfc800000 0x0 0x40000>;

-- 
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


  reply	other threads:[~2024-01-22 20:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-22 20:34 [PATCH 0/2] Add the thermal zones of the rk3588 to its dts Emmanuel Gil Peyrot
2024-01-22 20:34 ` [PATCH 1/2] arm64: dts: rockchip: Add the rk3588 thermal zones Emmanuel Gil Peyrot
2024-01-22 20:52   ` Daniel Lezcano [this message]
2024-01-22 22:09     ` Emmanuel Gil Peyrot
2024-01-23  6:31       ` Alexey Charkov
2024-01-22 20:34 ` [PATCH 2/2] arm64: dts: rockchip: Enable the tsadc on Rock-5B Emmanuel Gil Peyrot

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=c2963862-9d22-438a-8357-eccf14fead7d@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=alchark@gmail.com \
    --cc=andy.yan@rock-chips.com \
    --cc=chris.obbard@collabora.com \
    --cc=conor+dt@kernel.org \
    --cc=cristian.ciocaltea@collabora.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dsimic@manjaro.org \
    --cc=frattaroli.nicolas@gmail.com \
    --cc=heiko@sntech.de \
    --cc=inindev@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linkmauve@linkmauve.fr \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=macromorgan@hotmail.com \
    --cc=robh+dt@kernel.org \
    --cc=sebastian.reichel@collabora.com \
    --cc=shreeya.patel@collabora.com \
    --cc=szucst@iit.uni-miskolc.hu \
    /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®