From nobody Sun Feb 8 00:49:22 2026 Received: from mail.netcube.li (mail.netcube.li [173.249.15.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F442350285; Tue, 13 Jan 2026 19:32:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=173.249.15.149 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768332728; cv=none; b=EgQ1OecVMIv17yPBn7z3GHHI5KzrunIp3TTS83h/vNU5zDg6M3N5LdXsTbj1pCRMlYVEgACyA/xlqc+6YgaPhBw6cA7ZbefZ69B9lW5hy1CVPnCQ8weC+cU8f27UOPtkFQUaV2LthXHovEJIu8lqdybGjAN2Nl0XASB+eEFFXzg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768332728; c=relaxed/simple; bh=LZyrisVvaaeBusTcFeG6C4rFjFkJ0jSLOQj7AU0iUyE=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=jqwW4lMzzXEeUI57uaO5krrCXAaZEUGjZO0pv6iW8dBd0I4YAjl/VLjHXxbuOR0Trbdz5JV1IcGCr3+5tjgGWLSzbXLmDkW0FX/d1mMFgjFtl4d2F/n3LBIKTMdUM/2wVzGsiqqCWBO+AenYM52jDL/4xEdWrhgylYkwoYhp1m0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=netcube.li; spf=pass smtp.mailfrom=netcube.li; dkim=pass (1024-bit key) header.d=netcube.li header.i=@netcube.li header.b=B51SYI0m; arc=none smtp.client-ip=173.249.15.149 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=netcube.li Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=netcube.li Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=netcube.li header.i=@netcube.li header.b="B51SYI0m" dkim-signature: v=1; a=rsa-sha256; d=netcube.li; s=s1; c=relaxed/relaxed; q=dns/txt; h=From:Subject:Date:Message-ID:To:CC:MIME-Version:Content-Transfer-Encoding; bh=P6I7h+bj3CMTWnDZKlX7MR4NLD2YmzpWA7tYI5nxT+A=; b=B51SYI0mLx9lICXLoVzDjZq4lT/LvshEHrhHwH0YivHdD0YzFW5BTTyZVVHpF/sk8X5XoT/VEmTK8A/2SX1bn0EOcoFzT+0Es5hz4+Uq8tzPzo8sbExFnd4UFCzAgzoXyfDC3Qkiom0nKFiyhe1HqkTrQu35wFQHuFvW0wZyKqc= Received: from lukas-hpz440workstation.lan.sk100508.local (cm70-231.liwest.at [212.241.70.231]) by mail.netcube.li with ESMTPA ; Tue, 13 Jan 2026 19:30:24 +0100 From: Lukas Schmid To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti Cc: linux-sunxi@lists.linux.dev, Alex Studer , Lukas Schmid , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH v2] riscv: dts: allwinner: d1: Add CPU thermal sensor and zone Date: Tue, 13 Jan 2026 19:29:48 +0100 Message-ID: <20260113182951.1059690-1-lukas.schmid@netcube.li> X-Mailer: git-send-email 2.47.3 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Alex Studer The sun20i THS (built in CPU thermal sensor) is supported in code, but was never added to the device tree. So, add it to the device tree, along with a thermal zone for the CPU. Signed-off-by: Alex Studer Link: https://lore.kernel.org/r/20250218020629.1476126-1-alex@studer.dev Changes since v1: - Move include before defines in sun20i-d1s.dtsi - Fix register size for thermal-sensor@2009400 - Move thermal-sensor@2009400 in SoC to match register address sorting - Add thermal-zone for sun8i-t113s.dtsi and fix missing cooling-cells Signed-off-by: Lukas Schmid --- arch/arm/boot/dts/allwinner/sun8i-t113s.dtsi | 33 +++++++++++++++++++ arch/riscv/boot/dts/allwinner/sun20i-d1s.dtsi | 31 +++++++++++++++++ .../boot/dts/allwinner/sunxi-d1s-t113.dtsi | 16 +++++++++ 3 files changed, 80 insertions(+) diff --git a/arch/arm/boot/dts/allwinner/sun8i-t113s.dtsi b/arch/arm/boot/d= ts/allwinner/sun8i-t113s.dtsi index c7181308ae6f..424f4a2487e2 100644 --- a/arch/arm/boot/dts/allwinner/sun8i-t113s.dtsi +++ b/arch/arm/boot/dts/allwinner/sun8i-t113s.dtsi @@ -4,6 +4,7 @@ #define SOC_PERIPHERAL_IRQ(nr) GIC_SPI nr =20 #include +#include #include #include =20 @@ -20,6 +21,7 @@ cpu0: cpu@0 { reg =3D <0>; clocks =3D <&ccu CLK_CPUX>; clock-names =3D "cpu"; + #cooling-cells =3D <2>; }; =20 cpu1: cpu@1 { @@ -28,6 +30,7 @@ cpu1: cpu@1 { reg =3D <1>; clocks =3D <&ccu CLK_CPUX>; clock-names =3D "cpu"; + #cooling-cells =3D <2>; }; }; =20 @@ -56,4 +59,34 @@ pmu { ; interrupt-affinity =3D <&cpu0>, <&cpu1>; }; + + thermal-zones { + cpu-thermal { + polling-delay-passive =3D <0>; + polling-delay =3D <0>; + thermal-sensors =3D <&ths>; + + cooling-maps { + map0 { + trip =3D <&cpu_alert>; + cooling-device =3D <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + + trips { + cpu_alert: cpu-alert { + temperature =3D <85000>; + hysteresis =3D <2000>; + type =3D "passive"; + }; + + cpu-crit { + temperature =3D <100000>; + hysteresis =3D <0>; + type =3D "critical"; + }; + }; + }; + }; }; diff --git a/arch/riscv/boot/dts/allwinner/sun20i-d1s.dtsi b/arch/riscv/boo= t/dts/allwinner/sun20i-d1s.dtsi index a7442a508433..3f4ee820ef56 100644 --- a/arch/riscv/boot/dts/allwinner/sun20i-d1s.dtsi +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1s.dtsi @@ -1,6 +1,8 @@ // SPDX-License-Identifier: (GPL-2.0+ OR MIT) // Copyright (C) 2021-2022 Samuel Holland =20 +#include + #define SOC_PERIPHERAL_IRQ(nr) (nr + 16) =20 #include "sunxi-d1s-t113.dtsi" @@ -115,4 +117,33 @@ pmu { <0x00000000 0x0000000e 0xffffffff 0xffffffff 0x00010000>, <0x00000000 0x0000000f 0xffffffff 0xffffffff 0x00020000>; }; + + thermal-zones { + cpu-thermal { + polling-delay-passive =3D <0>; + polling-delay =3D <0>; + thermal-sensors =3D <&ths>; + + cooling-maps { + map0 { + trip =3D <&cpu_alert>; + cooling-device =3D <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + + trips { + cpu_alert: cpu-alert { + temperature =3D <85000>; + hysteresis =3D <2000>; + type =3D "passive"; + }; + + cpu-crit { + temperature =3D <100000>; + hysteresis =3D <0>; + type =3D "critical"; + }; + }; + }; + }; }; diff --git a/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi b/arch/riscv= /boot/dts/allwinner/sunxi-d1s-t113.dtsi index 63e252b44973..ef7ebeab21ea 100644 --- a/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi +++ b/arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi @@ -214,6 +214,18 @@ gpadc: adc@2009000 { #io-channel-cells =3D <1>; }; =20 + ths: thermal-sensor@2009400 { + compatible =3D "allwinner,sun20i-d1-ths"; + reg =3D <0x2009400 0x400>; + interrupts =3D ; + clocks =3D <&ccu CLK_BUS_THS>; + clock-names =3D "bus"; + resets =3D <&ccu RST_BUS_THS>; + nvmem-cells =3D <&ths_calibration>; + nvmem-cell-names =3D "calibration"; + #thermal-sensor-cells =3D <0>; + }; + dmic: dmic@2031000 { compatible =3D "allwinner,sun20i-d1-dmic", "allwinner,sun50i-h6-dmic"; @@ -474,6 +486,10 @@ sid: efuse@3006000 { reg =3D <0x3006000 0x1000>; #address-cells =3D <1>; #size-cells =3D <1>; + + ths_calibration: thermal-sensor-calibration@14 { + reg =3D <0x14 0x8>; + }; }; =20 crypto: crypto@3040000 { --=20 2.47.3