From nobody Thu Dec 18 01:39:44 2025 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 706B3A59; Tue, 16 Dec 2025 02:02:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.2 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765850575; cv=none; b=fTRCJekpERkZc3+i8NcmMltw3yqFJLomXKXGF0zJEXQgHTlJNpV9vtFYqcqV+ew4IzLjq7VAMb6bMrnYeYDwX61ha7KQszLd7/xEqJHbbok63Q6j706OmiEe5J+y/7a9qBLDlkooU+EBMWuYW0dZ7B7obolEO8Tdp+UzlYLgTDg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765850575; c=relaxed/simple; bh=y011YJ1uJ0ICDCPPxjeBTXP9an/sM0tsW9o564MeUTs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PiXfikcDNP2CzpkaAvpfmZK6IJS75TcmWzbdbe7DG5LQ6rj7oPQao5WTPfe0JVpUs9VJaxdFCShiNMGd5lmbqiG2j4cNzSittj+MJ1vSLHWlf1DuJbBtlxPrkqCP5MyyEtPLpyj/vmVCjgt+nl5b1SpYPKoJ8vJTsnfnWC+gGmE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=NK+0J1Jw; arc=none smtp.client-ip=117.135.210.2 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="NK+0J1Jw" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Date:Subject:MIME-Version:Content-Type: Message-Id:To; bh=Rs+rfWtyrtk97kpSu5fndp0xU+3WjRNBLxGPmOQrzzo=; b=NK+0J1Jw9/Rk8ursPJv1cCyc4VTt4GInpamkdvrups32oZGe6hzF4/CUgTd6Zk WD/s53T5AKAvtiui2dpW18JiyW9D+e2vdCAetlY+bjEZO6g4+yitJB8mC0+TU4Ux XsmG8JRgP0Vx997mhz752xT/fw5544098vxZOtrezD3cw= Received: from [192.168.10.1] (unknown []) by gzga-smtp-mtada-g0-1 (Coremail) with SMTP id _____wDXUu97vUBpOmJ5Ag--.29S5; Tue, 16 Dec 2025 10:01:39 +0800 (CST) From: Shuwei Wu Date: Tue, 16 Dec 2025 10:00:37 +0800 Subject: [PATCH v2 3/3] riscv: dts: spacemit: Add thermal sensor for K1 SoC Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20251216-patchv2-k1-thermal-v1-3-d4b31fe9c904@163.com> References: <20251216-patchv2-k1-thermal-v1-0-d4b31fe9c904@163.com> In-Reply-To: <20251216-patchv2-k1-thermal-v1-0-d4b31fe9c904@163.com> To: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Yixun Lan , Shuwei Wu , Philipp Zabel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1765850492; l=3136; i=shuweiwoo@163.com; s=20251125; h=from:subject:message-id; bh=y011YJ1uJ0ICDCPPxjeBTXP9an/sM0tsW9o564MeUTs=; b=uYTDOFVmm1ahH9cVHGgDpeVO1j+jLsXKk+qUN3obRjUh1fmGlF2ihXBM5/WY2ftbOs+M6QAdT 914Ea3Y39X4BZcGt+xX3xYv9RiZm0bxSb6bfwyKiCEdpOL6GzQDzA72 X-Developer-Key: i=shuweiwoo@163.com; a=ed25519; pk=qZs6i2UZnXkmjUrwO5HJxcfpCvgSNrR4dcU5cjtfTSk= X-CM-TRANSID: _____wDXUu97vUBpOmJ5Ag--.29S5 X-Coremail-Antispam: 1Uf129KBjvJXoWxZrW8Gw45ZFy3Xw4xJry5Jwb_yoW5Wr48pF ySkws5GFZrJry3Xa13CryDK398Kan5ta48Xan29ryrArn0qFZIk3y0kwn8tF1kGr4rW34j vr1Dt34DuF1Dt3DanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pNg4hQUUUUU= X-CM-SenderInfo: 5vkx4vplzr0qqrwthudrp/xtbC4wP5iGlAvYOdvwAA3k 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 --- 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/spa= cemit/k1.dtsi index 7818ca4979b6a7755722919a5958512aa11950ab..0fe7396ea6e47d10a73e3bcea4f= 5165e5c268da0 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 { }; }; =20 + thermal-zones { + soc-thermal { + polling-delay-passive =3D <0>; + polling-delay =3D <0>; + thermal-sensors =3D <&thermal 0>; + + trips { + soc-crit { + temperature =3D <115000>; + hysteresis =3D <0>; + type =3D "critical"; + }; + }; + }; + + package-thermal { + polling-delay-passive =3D <0>; + polling-delay =3D <0>; + thermal-sensors =3D <&thermal 1>; + + trips { + package-crit { + temperature =3D <115000>; + hysteresis =3D <0>; + type =3D "critical"; + }; + }; + }; + + gpu-thermal { + polling-delay-passive =3D <100>; + polling-delay =3D <0>; + thermal-sensors =3D <&thermal 2>; + + trips { + gpu-alert { + temperature =3D <85000>; + hysteresis =3D <2000>; + type =3D "passive"; + }; + + gpu-crit { + temperature =3D <115000>; + hysteresis =3D <0>; + type =3D "critical"; + }; + }; + }; + + cluster0-thermal { + polling-delay-passive =3D <100>; + polling-delay =3D <0>; + thermal-sensors =3D <&thermal 3>; + + trips { + cluster0-alert { + temperature =3D <85000>; + hysteresis =3D <2000>; + type =3D "passive"; + }; + + cluster0-crit { + temperature =3D <115000>; + hysteresis =3D <0>; + type =3D "critical"; + }; + }; + }; + + cluster1-thermal { + polling-delay-passive =3D <100>; + polling-delay =3D <0>; + thermal-sensors =3D <&thermal 4>; + + trips { + cluster1-alert { + temperature =3D <85000>; + hysteresis =3D <2000>; + type =3D "passive"; + }; + + cluster1-crit { + temperature =3D <115000>; + hysteresis =3D <0>; + type =3D "critical"; + }; + }; + }; + }; + soc { compatible =3D "simple-bus"; interrupt-parent =3D <&plic>; @@ -434,6 +524,17 @@ syscon_apbc: system-controller@d4015000 { #reset-cells =3D <1>; }; =20 + thermal: thermal@d4018000 { + compatible =3D "spacemit,k1-tsensor"; + reg =3D <0x0 0xd4018000 0x0 0x100>; + clocks =3D <&syscon_apbc CLK_TSEN>, + <&syscon_apbc CLK_TSEN_BUS>; + clock-names =3D "core", "bus"; + interrupts =3D <61>; + resets =3D <&syscon_apbc RESET_TSEN>; + #thermal-sensor-cells =3D <1>; + }; + i2c6: i2c@d4018800 { compatible =3D "spacemit,k1-i2c"; reg =3D <0x0 0xd4018800 0x0 0x38>; --=20 2.52.0