Linux Power Management development
 help / color / mirror / Atom feed
From: Yixun Lan <dlan@kernel.org>
To: Shuwei Wu <shuwei.wu@mailbox.org>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	Daniel Lezcano <daniel.lezcano@kernel.org>,
	Zhang Rui <rui.zhang@intel.com>,
	Lukasz Luba <lukasz.luba@arm.com>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Paul Walmsley <pjw@kernel.org>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	Albert Ou <aou@eecs.berkeley.edu>,
	Alexandre Ghiti <alex@ghiti.fr>,
	linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-riscv@lists.infradead.org, spacemit@lists.linux.dev,
	linux-kernel@vger.kernel.org, Vincent Legoll <legoll@online.fr>,
	Gong Shuai <gsh517025@gmail.com>
Subject: Re: [PATCH v5 3/3] riscv: dts: spacemit: Add thermal sensor for K1 SoC
Date: Tue, 19 May 2026 00:26:02 +0000	[thread overview]
Message-ID: <20260519002602-GKE3679294@kernel.org> (raw)
In-Reply-To: <20260427-k1-thermal-v5-3-df39187480ed@mailbox.org>

Hi Shuwei,

On 15:15 Mon 27 Apr     , Shuwei Wu wrote:
> Include the Thermal Sensor node in the SpacemiT K1 dtsi
> with definitions for registers, clocks, and interrupts.
> Additionally, configure thermal zones for the soc, package, gpu, and
> clusters to enable temperature monitoring via the thermal framework.
> 
> Tested-by: Vincent Legoll <legoll@online.fr> # OrangePi-RV2
> Tested-by: Gong Shuai <gsh517025@gmail.com>
> Signed-off-by: Shuwei Wu <shuwei.wu@mailbox.org>
> 
> ---
> Changes in v2:
> - Update compatible to "spacemit,k1-tsensor"
> ---
>  arch/riscv/boot/dts/spacemit/k1.dtsi | 101 +++++++++++++++++++++++++++++++++++
>  1 file changed, 101 insertions(+)
> 
> diff --git a/arch/riscv/boot/dts/spacemit/k1.dtsi b/arch/riscv/boot/dts/spacemit/k1.dtsi
> index 529ec68e9c23..e9952204224e 100644
> --- a/arch/riscv/boot/dts/spacemit/k1.dtsi
> +++ b/arch/riscv/boot/dts/spacemit/k1.dtsi
> @@ -339,6 +339,96 @@ osc_32k: clock-32k {
>  		};
>  	};
>  
> +	thermal-zones {
> +		soc-thermal {
> +			polling-delay-passive = <0>;
> +			polling-delay = <0>;
> +			thermal-sensors = <&thermal 0>;
> +
> +			trips {
> +				soc-crit {
> +					temperature = <115000>;
> +					hysteresis = <0>;
> +					type = "critical";
> +				};
> +			};
> +		};
> +
> +		package-thermal {
> +			polling-delay-passive = <0>;
> +			polling-delay = <0>;
> +			thermal-sensors = <&thermal 1>;
> +
> +			trips {
> +				package-crit {
> +					temperature = <115000>;
> +					hysteresis = <0>;
> +					type = "critical";
> +				};
> +			};
> +		};
> +
> +		gpu-thermal {
> +			polling-delay-passive = <100>;
> +			polling-delay = <0>;
> +			thermal-sensors = <&thermal 2>;
> +
> +			trips {
> +				gpu-alert {
> +					temperature = <85000>;
> +					hysteresis = <2000>;
> +					type = "passive";
> +				};
> +
> +				gpu-crit {
> +					temperature = <115000>;
> +					hysteresis = <0>;
> +					type = "critical";
> +				};
> +			};
> +		};
> +
> +		cluster0-thermal {
> +			polling-delay-passive = <100>;
> +			polling-delay = <0>;
> +			thermal-sensors = <&thermal 3>;
> +
> +			trips {
> +				cluster0-alert {
> +					temperature = <85000>;
> +					hysteresis = <2000>;
> +					type = "passive";
> +				};
> +
> +				cluster0-crit {
> +					temperature = <115000>;
> +					hysteresis = <0>;
> +					type = "critical";
> +				};
> +			};
> +		};
> +
> +		cluster1-thermal {
> +			polling-delay-passive = <100>;
> +			polling-delay = <0>;
> +			thermal-sensors = <&thermal 4>;
> +
> +			trips {
> +				cluster1-alert {
> +					temperature = <85000>;
> +					hysteresis = <2000>;
> +					type = "passive";
> +				};
> +
> +				cluster1-crit {
> +					temperature = <115000>;
> +					hysteresis = <0>;
> +					type = "critical";
> +				};
> +			};
> +		};
> +	};
> +
>  	soc {
>  		compatible = "simple-bus";
>  		interrupt-parent = <&plic>;
> @@ -494,6 +584,17 @@ syscon_apbc: system-controller@d4015000 {
>  			#reset-cells = <1>;
>  		};
>  
> +		thermal: thermal@d4018000 {
> +			compatible = "spacemit,k1-tsensor";
> +			reg = <0x0 0xd4018000 0x0 0x100>;
> +			clocks = <&syscon_apbc CLK_TSEN>,
> +				 <&syscon_apbc CLK_TSEN_BUS>;
> +			clock-names = "core", "bus";
> +			interrupts = <61>;
> +			resets = <&syscon_apbc RESET_TSEN>;
> +			#thermal-sensor-cells = <1>;
> +		};
Ok, so if I understand correctly the thermal is a SoC feature, so with
above it will be enabled by default for all boards, but for the convention
we usually disable it in dtsi file, and enable it at board dts level

Please convince me doing above is better? as I'm not sure if there is
cases that user want it disabled (but could possible)..

-- 
Yixun Lan (dlan)

  reply	other threads:[~2026-05-19  0:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-27  7:15 [PATCH v5 0/3] thermal: spacemit: Add support for SpacemiT K1 SoC thermal sensor Shuwei Wu
2026-04-27  7:15 ` [PATCH v5 1/3] dt-bindings: thermal: Add SpacemiT K1 " Shuwei Wu
2026-04-27  7:15 ` [PATCH v5 2/3] thermal: spacemit: k1: Add thermal sensor support Shuwei Wu
2026-04-27  7:15 ` [PATCH v5 3/3] riscv: dts: spacemit: Add thermal sensor for K1 SoC Shuwei Wu
2026-05-19  0:26   ` Yixun Lan [this message]
2026-05-19  2:41     ` Shuwei Wu
2026-05-19  5:38       ` Yixun Lan
2026-05-18 18:45 ` [PATCH v5 0/3] thermal: spacemit: Add support for SpacemiT K1 SoC thermal sensor Daniel Lezcano

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=20260519002602-GKE3679294@kernel.org \
    --to=dlan@kernel.org \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor+dt@kernel.org \
    --cc=daniel.lezcano@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gsh517025@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=legoll@online.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=lukasz.luba@arm.com \
    --cc=p.zabel@pengutronix.de \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=rafael@kernel.org \
    --cc=robh@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=shuwei.wu@mailbox.org \
    --cc=spacemit@lists.linux.dev \
    /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