public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Shuwei Wu" <shuwei.wu@mailbox.org>
To: "Anand Moon" <linux.amoon@gmail.com>, "Shuwei Wu" <shuweiwoo@163.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
	"Daniel Lezcano" <daniel.lezcano@linaro.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>,
	"Yixun Lan" <dlan@gentoo.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>
Subject: Re: [PATCH v3 3/3] riscv: dts: spacemit: Add thermal sensor for K1 SoC
Date: Wed, 22 Apr 2026 18:37:20 +0800	[thread overview]
Message-ID: <DHZM9D696P6G.NVPMN20XXM3H@mailbox.org> (raw)
In-Reply-To: <CANAwSgTOmbb+Vzhck1riVaFM89zYLdMe3dn6DRHrc7p+rkR2DQ@mail.gmail.com>

Hi Anand,

Thank you for the careful review.

On Wed Apr 22, 2026 at 1:56 PM CST, Anand Moon wrote:
> Hi Shuwei,
>
> On Mon, 19 Jan 2026 at 08:13, Shuwei Wu <shuweiwoo@163.com> 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.
>>
>> Signed-off-by: Shuwei Wu <shuweiwoo@163.com>
>> ---
>> 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 7818ca4979b6..0fe7396ea6e4 100644
>> --- a/arch/riscv/boot/dts/spacemit/k1.dtsi
>> +++ b/arch/riscv/boot/dts/spacemit/k1.dtsi
>> @@ -338,6 +338,96 @@ osc_32k: clock-32k {
>>                 };
>>         };
>>
> I feel the thermal zones appear to be configured at significantly
> higher temperatures
> compared to the thresholds typically used in commercial-grade and
> industrial-grade device
> test environments 1.2 Test Environment
>
> [1] https://www.spacemit.com/community/document/info?lang=en&nodepath=hardware/key_stone/k1/k1_hw/avl_veri_sop.md

The official definition of this temperature range is as follows:
"The CPU delivers stable and reliable computing power from -40°C to 85°C,
complying with the demanding requirements of industrial applications."

[1] https://www.spacemit.com/community/document/info?lang=en&nodepath=hardware/key_stone
/k1/k1_docs/root_overview.md

Therefore, this does not mean that the chip cannot continue to work above
this temperature.

The datasheet also defines another temperature, the Junction Temperature,
which represents the chip's temperature limit. Exceeding this temperature
may permanently damage the chip.

[2] https://www.spacemit.com/community/document/info?lang=en&nodepath=hardware/key_stone
/k1/k1_docs/k1_usermanual/4.Electrical_Characteristics.md

>
> Thermal zones should be defined as part of the SBC board design,
> with the option to integrate PWM-controlled fan support in the future.

These thermal zones describe fixed hardware properties of the K1 SoC itself,
and are common for all K1-based boards.

And this is also done in Allwinner D1, StarFive JH7110 and some other chips.

>
> Thanks
> -Anand
>> +       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>;
>> @@ -434,6 +524,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>;
>> +               };
>> +
>>                 i2c6: i2c@d4018800 {
>>                         compatible = "spacemit,k1-i2c";
>>                         reg = <0x0 0xd4018800 0x0 0x38>;
>>
>> --
>> 2.52.0
>>
>>
>> _______________________________________________
>> linux-riscv mailing list
>> linux-riscv@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-riscv

-- 
Best regards,
Shuwei Wu

  reply	other threads:[~2026-04-22 10:37 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-19  2:41 [PATCH v3 0/3] thermal: spacemit: Add support for SpacemiT K1 SoC thermal sensor Shuwei Wu
2026-01-19  2:41 ` [PATCH v3 1/3] dt-bindings: thermal: Add SpacemiT K1 " Shuwei Wu
2026-01-19  2:41 ` [PATCH v3 2/3] thermal: spacemit: k1: Add thermal sensor support Shuwei Wu
2026-03-05 15:35   ` Yao Zi
2026-03-05 17:05   ` Yanko Kaneti
2026-03-30  9:42   ` Troy Mitchell
2026-04-06 18:45   ` Anand Moon
2026-01-19  2:41 ` [PATCH v3 3/3] riscv: dts: spacemit: Add thermal sensor for K1 SoC Shuwei Wu
2026-04-22  5:56   ` Anand Moon
2026-04-22 10:37     ` Shuwei Wu [this message]
2026-04-23  3:46       ` Anand Moon
2026-03-05  6:34 ` [PATCH v3 0/3] thermal: spacemit: Add support for SpacemiT K1 SoC thermal sensor Shuwei Wu
2026-03-29 10:45 ` Gong Shuai
2026-04-03 12:57 ` Vincent Legoll
2026-04-03 16:28   ` Gong Shuai

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=DHZM9D696P6G.NVPMN20XXM3H@mailbox.org \
    --to=shuwei.wu@mailbox.org \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor+dt@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dlan@gentoo.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux.amoon@gmail.com \
    --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=shuweiwoo@163.com \
    --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