From nobody Wed Jun 17 07:29:05 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 20F3A361660; Thu, 23 Apr 2026 16:08:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776960491; cv=none; b=Izqeudf2RYfrhxtu0nbvqpP9SXAAsiO+KK7Faq+V/8VWAvF6UUXtpEKMt/UXy4rl10gCIFOmWO8046BVnCkIyZ/pUlaYRwJ8SLOGtR8s2TdSiOj+0f+ZB4XMOnUfC0uOWTQhHGhOq7mac/7/Woa20wiq/XRXqCuehJgaj8NLrqU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776960491; c=relaxed/simple; bh=wXjL0/ZjPWYklzHHsG/fnHIawjJ0r03LA6jLikwVGTc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=q6sc5ZW6/7SVkeF3UCnGXmPXxIY6yKdVtnrEjNWJc9iF9OCYuS+05M/fmsI7JC2ZVVTW65owfTyduyLCnjPJk6Lk0Ixe/4E3KTuYRjtDdh0pRrEME1EqSOYoibs4yeoFD1o7/Kfn3fBI+THZT75parQxNxYOPHWKYN0B+ev93Zc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lBbau/8J; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lBbau/8J" Received: by smtp.kernel.org (Postfix) with ESMTPS id DD790C2BCB4; Thu, 23 Apr 2026 16:08:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776960490; bh=wXjL0/ZjPWYklzHHsG/fnHIawjJ0r03LA6jLikwVGTc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=lBbau/8JGaGZrZ70Dg6tqGCO2fPy08Hyc/EKUc7+dqaadWU/UjzV21H//95ovUI5p w9tbFg9Ll9KLRwsRkD6wNEQ4OG0G7RKOSyzyUd5/W+KmgmSSZR29tXdBSmJJUpCZKM 0BDzu6pbsmMcgKedernpAgH6we1YkEBeTngcDRv6X05vBP0ywwhwkeufmXvhKC4h6r pfUl1HVsWwMpOohiBauqGQDbtbWQ7pkVizkoW2cRbK0umNKdBEUsa28wUfOUT5+VVl gsHKQFiXggeKVbewT073vP4A7dSUoXsYYDtyz5muKFWKLJoTc2rMQFI9u5T8hc8vVd ND3ftKfj3IxCg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB144FC0360; Thu, 23 Apr 2026 16:08:10 +0000 (UTC) From: Ronald Claveau via B4 Relay Date: Thu, 23 Apr 2026 18:07:16 +0200 Subject: [PATCH v4 1/8] dt-bindings: thermal: amlogic: Add support for T7 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: <20260423-add-thermal-t7-vim4-v4-1-d4c1528d5044@aliel.fr> References: <20260423-add-thermal-t7-vim4-v4-0-d4c1528d5044@aliel.fr> In-Reply-To: <20260423-add-thermal-t7-vim4-v4-0-d4c1528d5044@aliel.fr> To: Guillaume La Roque , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: linux-pm@vger.kernel.org, linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ronald Claveau , Conor Dooley X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2861; i=linux-kernel-dev@aliel.fr; h=from:subject:message-id; bh=42FjYfnK8gHAQIf5ZxFekEMwi0ysWDknaNuX/++vGok=; b=owGbwMvMwCWm1SvKXP3cUInxtFoSQ+Yr5/vzP+b9+GgtcciWXWbJXJbJL69L3k19eftz+rG2/ /4H6xIXdZSyMIhxMciKKbL0z7U88e7y0TNf96inwMxhZQIZwsDFKQATEV3AyHAka+k6gdXRidnJ /l63ij6ITDL9OFWN15v598fA/b+nLLVm+O/1Wmirw717DW8Nbiru+8x9YX+gasTH5kndy/k5WSs Nb/MDAA== X-Developer-Key: i=linux-kernel-dev@aliel.fr; a=openpgp; fpr=DFD863F61375BF917F0012173953305EF1D0EC3E X-Endpoint-Received: by B4 Relay for linux-kernel-dev@aliel.fr/default with auth_id=744 X-Original-From: Ronald Claveau Reply-To: linux-kernel-dev@aliel.fr From: Ronald Claveau Add the amlogic,t7-thermal compatible for the Amlogic T7 thermal sensor. Unlike existing variants which use a phandle to the ao-secure syscon, the T7 relies on a secure monitor interface described by a phandle and a sensor index argument. The T7 integrates multiple thermal sensors, all accessed through the same SMC call. The sensor index argument is required to identify which sensor's calibration data the secure monitor should return, as a single SM_THERMAL_CALIB_READ command serves all of them. Introduce the amlogic,secure-monitor property as a phandle-array and make amlogic,ao-secure or amlogic,secure-monitor conditionally required depending on the compatible. Acked-by: Conor Dooley Signed-off-by: Ronald Claveau --- .../bindings/thermal/amlogic,thermal.yaml | 37 ++++++++++++++++++= ++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml= b/Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml index 70b273271754b..e28612510d679 100644 --- a/Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml +++ b/Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml @@ -21,7 +21,9 @@ properties: - amlogic,g12a-cpu-thermal - amlogic,g12a-ddr-thermal - const: amlogic,g12a-thermal - - const: amlogic,a1-cpu-thermal + - enum: + - amlogic,a1-cpu-thermal + - amlogic,t7-thermal =20 reg: maxItems: 1 @@ -42,12 +44,34 @@ properties: '#thermal-sensor-cells': const: 0 =20 + amlogic,secure-monitor: + description: phandle to the secure monitor + $ref: /schemas/types.yaml#/definitions/phandle-array + items: + - items: + - description: phandle to the secure monitor + - description: sensor index to get specific calibration data + required: - compatible - reg - interrupts - clocks - - amlogic,ao-secure + +allOf: + - if: + properties: + compatible: + contains: + enum: + - amlogic,a1-cpu-thermal + - amlogic,g12a-thermal + then: + required: + - amlogic,ao-secure + else: + required: + - amlogic,secure-monitor =20 unevaluatedProperties: false =20 @@ -62,4 +86,13 @@ examples: #thermal-sensor-cells =3D <0>; amlogic,ao-secure =3D <&sec_AO>; }; + - | + temperature-sensor@20000 { + compatible =3D "amlogic,t7-thermal"; + reg =3D <0x0 0x20000 0x0 0x50>; + interrupts =3D ; + clocks =3D <&clkc_periphs CLKID_TS>; + #thermal-sensor-cells =3D <0>; + amlogic,secure-monitor =3D <&sm 1>; + }; ... --=20 2.49.0 From nobody Wed Jun 17 07:29:05 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2BB8B36E49B; Thu, 23 Apr 2026 16:08:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776960491; cv=none; b=GpD0GhVq7JD0UkLQXQW7kLDjj2qXjWYqIWPpcmKFlVcqZEvUMvbxD6QAv458Apmq6MS2+QWtEigT83K4EWjQvysBz8WTCvaDSK6nBFU0S2B422qD1QoNOMzAbt7EW3e53BxoCgw7Wz9ijzkeFRgMynykNs4pieUBeh1DpsmRWqc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776960491; c=relaxed/simple; bh=kmxFj256ZqyHHjW0JUrAO7Zmt5qTIX49xsO6Ct108OU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=k0MsYb4JtggnJLkxlouBkpI4lJbhYY7NApg1jHJiwUDhuTPRU0zI29HZpKDUX2aKBzMtdIqanGkNZJ+YYjre86joW0AzaZc8stNMISjCYkhMnNlHGTOa6cb/w1RHEVMqGUFuI/ps5srbRgf26CRY/PQSpBVXV90GqD3hVvjjXSU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=L3xMb9Y/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="L3xMb9Y/" Received: by smtp.kernel.org (Postfix) with ESMTPS id E765DC2BCB7; Thu, 23 Apr 2026 16:08:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776960491; bh=kmxFj256ZqyHHjW0JUrAO7Zmt5qTIX49xsO6Ct108OU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=L3xMb9Y/ushFC9+3dS23UJfFvPmkTG9sQi//20kGlL2F0CCfXWC5+k1mT7WLjzsvy RvlaKhLDls0BH37Cb7uJzkJf3ck68SPx9hlGp7EN3uMKqkNvMF7c1UyK614FxJf3Y2 cT4dMx+uiQOipcQjS+uT0jnjFP/OuuKvfKJWEZ52CM4je3AYoVOvddDLyuUDZmYWsj G1R5MFRt1O95Q7jEHFB4KamBIjaNT/UCfW3nsLEzPf2nHAH/0Kh9X20bQLr8tbVcij 6vUlEE+g/U6DlZFUyAdgv93Te3qDuoCOakQip5uPbZD9t7DTNLd91AvkhA5afbG6kD LLQMGx4EJkonw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA764F589D9; Thu, 23 Apr 2026 16:08:10 +0000 (UTC) From: Ronald Claveau via B4 Relay Date: Thu, 23 Apr 2026 18:07:17 +0200 Subject: [PATCH v4 2/8] firmware: meson: sm: Thermal calibration read via secure monitor 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: <20260423-add-thermal-t7-vim4-v4-2-d4c1528d5044@aliel.fr> References: <20260423-add-thermal-t7-vim4-v4-0-d4c1528d5044@aliel.fr> In-Reply-To: <20260423-add-thermal-t7-vim4-v4-0-d4c1528d5044@aliel.fr> To: Guillaume La Roque , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: linux-pm@vger.kernel.org, linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ronald Claveau X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1177; i=linux-kernel-dev@aliel.fr; h=from:subject:message-id; bh=z46M+rsMVvol/Iu/vuO1m+rAUYrJ82iMmifq0EnDoU0=; b=owGbwMvMwCWm1SvKXP3cUInxtFoSQ+Yr5wd19ruFs27aWU42aw5k55HewVi6/0sc32XtCv4O5 WO1ZRs6SlkYxLgYZMUUWfrnWp54d/noma971FNg5rAygQxh4OIUgIlktTMyHPfQWLq7ha3QvZPl ZtAshjNGEyW09nUqnta2/+7sW6zmx/CHm00zOkon53rbO3H+9GSjI+ahpcZbnlbccH+13fOhwyI mAA== X-Developer-Key: i=linux-kernel-dev@aliel.fr; a=openpgp; fpr=DFD863F61375BF917F0012173953305EF1D0EC3E X-Endpoint-Received: by B4 Relay for linux-kernel-dev@aliel.fr/default with auth_id=744 X-Original-From: Ronald Claveau Reply-To: linux-kernel-dev@aliel.fr From: Ronald Claveau Add SM_THERMAL_CALIB_READ to the secure monitor command enum and introduce meson_sm_get_thermal_calib() to allow drivers to retrieve thermal sensor calibration data through the firmware interface. Signed-off-by: Ronald Claveau Reviewed-by: Neil Armstrong --- include/linux/firmware/meson/meson_sm.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/firmware/meson/meson_sm.h b/include/linux/firmwa= re/meson/meson_sm.h index 8eaf8922ab020..3ebc2bd9a9760 100644 --- a/include/linux/firmware/meson/meson_sm.h +++ b/include/linux/firmware/meson/meson_sm.h @@ -12,6 +12,7 @@ enum { SM_EFUSE_WRITE, SM_EFUSE_USER_MAX, SM_GET_CHIP_ID, + SM_THERMAL_CALIB_READ, SM_A1_PWRC_SET, SM_A1_PWRC_GET, }; @@ -27,5 +28,7 @@ int meson_sm_call_read(struct meson_sm_firmware *fw, void= *buffer, unsigned int bsize, unsigned int cmd_index, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 arg4); struct meson_sm_firmware *meson_sm_get(struct device_node *firmware_node); +int meson_sm_get_thermal_calib(struct meson_sm_firmware *fw, u32 *trim_inf= o, + u32 tsensor_id); =20 #endif /* _MESON_SM_FW_H_ */ --=20 2.49.0 From nobody Wed Jun 17 07:29:05 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 40783372EC0; Thu, 23 Apr 2026 16:08:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776960491; cv=none; b=RtmWIy8K/z1zwwnS1gWHjnge9ke/DPvsKVeG7bLToBT8rh6SQ19EMeO3sdtOBZH5l+CkS3bnXXVHK/V95vYRdtjYafqmqy/290sx+Hw6tHa0eVOCWsZP+sKvEHcESDpUD5VWDS6ztyUp2tfBaneEYYduFHrj5sFJ7wQiCQ7v4MU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776960491; c=relaxed/simple; bh=BEGT7QGuXKZN1/TyxTNzOGeUptM2L1qa4oyYW8iXDC0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=CnF/0VZNtNT3d5galykRS2I41ZmAuA5b4dcIvWwFkNqy61eUCOOKXyrfBZxAoH48w95+phuVvCPchNsrr235W8yy4L9UEHHQTa/ZXIqfRC+xFJxvXnp13A6RYAeY9xtBqRnD1RRZJOKA7o5vp3vH1doLE/y3WvHsf+gKGGwJH0o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rjbhVxhm; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rjbhVxhm" Received: by smtp.kernel.org (Postfix) with ESMTPS id 023FAC2BCB9; Thu, 23 Apr 2026 16:08:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776960491; bh=BEGT7QGuXKZN1/TyxTNzOGeUptM2L1qa4oyYW8iXDC0=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=rjbhVxhmHgVZZjoPWaU7066lR5LruzPiO+4IPp/2qwmj+prtPplgKKJj8YiCmSX2a 3OL1fYxmDrvDKxIyZn44A7GqsViQnnLWRFzeHBazFEFnqwWNkOQTdElPSdJWo1zH10 mRcJC4n1fQfo7+LuqV1gE5RiJQtqNWqQSL/KuAaBo8WPbBr2W8327lvWcBPGWNyUul p1YXulFSoJ2WtzJBuOdcJHaw1INr3nNlA1KvbBz+mWViCPNhMj1Nt4O/IXOmZpu2wO 3lffSGrIIUeLRl2MNfJxA2y/Wy5PkF1a3dAGQSlppD///f+ysgtXGRaLwUfEW8IV3A 2BKz4i6tu/BFQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA1E7FC0379; Thu, 23 Apr 2026 16:08:10 +0000 (UTC) From: Ronald Claveau via B4 Relay Date: Thu, 23 Apr 2026 18:07:18 +0200 Subject: [PATCH v4 3/8] firmware: meson: sm: Add thermal calibration SMC call 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: <20260423-add-thermal-t7-vim4-v4-3-d4c1528d5044@aliel.fr> References: <20260423-add-thermal-t7-vim4-v4-0-d4c1528d5044@aliel.fr> In-Reply-To: <20260423-add-thermal-t7-vim4-v4-0-d4c1528d5044@aliel.fr> To: Guillaume La Roque , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: linux-pm@vger.kernel.org, linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ronald Claveau X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2173; i=linux-kernel-dev@aliel.fr; h=from:subject:message-id; bh=QVwXg2rjCHDLPb10isf9/q6yv3hIqKAxTDlkEXCyDmk=; b=owGbwMvMwCWm1SvKXP3cUInxtFoSQ+Yr50ez3ocqrml4N/nmpWX9Kounm235ZJE1W8R/g/yVz 9+qbrM96yhlYRDjYpAVU2Tpn2t54t3lo2e+7lFPgZnDygQyhIGLUwAmwveT4Q/fab/4TS2sBd8s NJ/oL+ifJtSyX/VCksC0MoFnaSFn5r1iZDht8M7A+sa09S/LE3WnX2Ndpp8o1merKZ+XeMSy5YJ aITcA X-Developer-Key: i=linux-kernel-dev@aliel.fr; a=openpgp; fpr=DFD863F61375BF917F0012173953305EF1D0EC3E X-Endpoint-Received: by B4 Relay for linux-kernel-dev@aliel.fr/default with auth_id=744 X-Original-From: Ronald Claveau Reply-To: linux-kernel-dev@aliel.fr From: Ronald Claveau Add SM_THERMAL_CALIB_READ at SMC ID 0x82000047 in the command table and implement meson_sm_get_thermal_calib(), which forwards the tsensor_id argument to the secure monitor and returns the calibration data. Also realign the CMD() column to improve readability. Signed-off-by: Ronald Claveau Reviewed-by: Neil Armstrong --- drivers/firmware/meson/meson_sm.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/drivers/firmware/meson/meson_sm.c b/drivers/firmware/meson/mes= on_sm.c index 3ab67aaa9e5da..4e57986724212 100644 --- a/drivers/firmware/meson/meson_sm.c +++ b/drivers/firmware/meson/meson_sm.c @@ -41,12 +41,13 @@ static const struct meson_sm_chip gxbb_chip =3D { .cmd_shmem_in_base =3D 0x82000020, .cmd_shmem_out_base =3D 0x82000021, .cmd =3D { - CMD(SM_EFUSE_READ, 0x82000030), - CMD(SM_EFUSE_WRITE, 0x82000031), + CMD(SM_EFUSE_READ, 0x82000030), + CMD(SM_EFUSE_WRITE, 0x82000031), CMD(SM_EFUSE_USER_MAX, 0x82000033), - CMD(SM_GET_CHIP_ID, 0x82000044), - CMD(SM_A1_PWRC_SET, 0x82000093), - CMD(SM_A1_PWRC_GET, 0x82000095), + CMD(SM_GET_CHIP_ID, 0x82000044), + CMD(SM_THERMAL_CALIB_READ, 0x82000047), + CMD(SM_A1_PWRC_SET, 0x82000093), + CMD(SM_A1_PWRC_GET, 0x82000095), { /* sentinel */ }, }, }; @@ -245,6 +246,24 @@ struct meson_sm_firmware *meson_sm_get(struct device_n= ode *sm_node) } EXPORT_SYMBOL_GPL(meson_sm_get); =20 +/** + * + * meson_sm_get_thermal_calib - Read thermal sensor calibration data. + * @fw: Pointer to secure-monitor firmware. + * @trim_info: Pointer to store the returned calibration data. + * @tsensor_id: Sensor index to identify which sensor's calibration data + * to retrieve + * + * Return: 0 on success, negative error code on failure. + */ +int meson_sm_get_thermal_calib(struct meson_sm_firmware *fw, u32 *trim_inf= o, + u32 tsensor_id) +{ + return meson_sm_call(fw, SM_THERMAL_CALIB_READ, trim_info, tsensor_id, + 0, 0, 0, 0); +} +EXPORT_SYMBOL_GPL(meson_sm_get_thermal_calib); + #define SM_CHIP_ID_LENGTH 119 #define SM_CHIP_ID_OFFSET 4 #define SM_CHIP_ID_SIZE 12 --=20 2.49.0 From nobody Wed Jun 17 07:29:05 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 50341377EAF; Thu, 23 Apr 2026 16:08:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776960491; cv=none; b=oFZ2Obn2v6TeiEOFwMwdTZ+piIvfc+vcaC6g5uIiCx68puO8mVezvzSM6qZP8+uWCnImDToT5WFXiuuPWCRrr5Gk0nT7Ht2K0wKnCXtpiEucKxuPVhzIwFoxwBVBm7spAuTA2yOKDMUNe+3WYLlAMsAOq0R8jVIRaoRt/Z5Rkgc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776960491; c=relaxed/simple; bh=Jnu26GqpRqta4b0VDzfrrRbzqQcMNeNztp6nUK+SEd4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=c5mP0C/E3hJDRyat3TUWAuAjYoiO5CrdnfbsL9ldYi/LJdfyV3URbJEuBup76IWB0xuzfeD715pDOrbl8ZnomSqc/0gsMGVvn+aJdY70KqsWXBplz40BYJoXzLjWQczRYOH7PNsQnn8MOQotpwNpHobc6oENhJNH0JeYUE29jOc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Uhsizbp4; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Uhsizbp4" Received: by smtp.kernel.org (Postfix) with ESMTPS id 1228FC2BCC7; Thu, 23 Apr 2026 16:08:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776960491; bh=Jnu26GqpRqta4b0VDzfrrRbzqQcMNeNztp6nUK+SEd4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Uhsizbp4E6opDbgCHWJ0iO04aDpIrZyLKdmrzI/vftt19r+V6vXeVFnavDdGC5I3N VIgOmn0TZURLA+Zt2WNckJ6rBM7oZRjTSFdsVJOgs40oo28d7Nx54msPbuy2FHPMbm gLju7UB9VUgwL05Yw6uVS3T/tyUi2RLtjrzgJpGqmo1uD3CBL4R52AcHKlvIzOo1za 503JQ+HA3TgdltmSRo63RZ/6QwIck3qRBkRwqfCs5CHVcm1Vo39K+OmZw/2y7ijUbj dVz/uHGoDaO1pPfTgjdckJCLuLFJ5W0UCDFl4z+BcFBWFzy1XWmr585jKrlNAkmwu9 Hv01XdOCfui0g== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07D8DFC037F; Thu, 23 Apr 2026 16:08:11 +0000 (UTC) From: Ronald Claveau via B4 Relay Date: Thu, 23 Apr 2026 18:07:19 +0200 Subject: [PATCH v4 4/8] thermal: amlogic: Add support for secure monitor calibration readout 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: <20260423-add-thermal-t7-vim4-v4-4-d4c1528d5044@aliel.fr> References: <20260423-add-thermal-t7-vim4-v4-0-d4c1528d5044@aliel.fr> In-Reply-To: <20260423-add-thermal-t7-vim4-v4-0-d4c1528d5044@aliel.fr> To: Guillaume La Roque , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: linux-pm@vger.kernel.org, linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ronald Claveau X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=6338; i=linux-kernel-dev@aliel.fr; h=from:subject:message-id; bh=qeq7CmoCVHNHWCj/bIX1HdhJMGDCbtiJ3F/tbHGtGxA=; b=owGbwMvMwCWm1SvKXP3cUInxtFoSQ+Yr58fCL61b5Y//D5Q+U7nD0+y/3PkrtUfzur/klB7Nj G5nevqqo5SFQYyLQVZMkaV/ruWJd5ePnvm6Rz0FZg4rE8gQBi5OAZjI7weMDL1Ne058ip09K8Rg 5rtFfSsu6W7m7TqxLrtu0bt7RtkrTnEzMvydrHy981h08kfxpEkZqzfqyQrpr2JsEWNbo3HjZ8Y RT24A X-Developer-Key: i=linux-kernel-dev@aliel.fr; a=openpgp; fpr=DFD863F61375BF917F0012173953305EF1D0EC3E X-Endpoint-Received: by B4 Relay for linux-kernel-dev@aliel.fr/default with auth_id=744 X-Original-From: Ronald Claveau Reply-To: linux-kernel-dev@aliel.fr From: Ronald Claveau Some SoCs (e.g. T7) expose thermal calibration data through the secure monitor rather than a directly accessible eFuse register. Add a use_sm flag to amlogic_thermal_data to select this path, and retrieve the firmware handle and tsensor_id from the "amlogic,secure-monitor" DT phandle with one fixed argument. Also introduce the amlogic,t7-thermal compatible using this new path. While refactoring, fix a pre-existing bug where amlogic_thermal_initialize() was called after devm_thermal_of_zone_register(), causing the thermal framework to read an uninitialized trim_info on zone registration. Signed-off-by: Ronald Claveau --- drivers/thermal/amlogic_thermal.c | 115 ++++++++++++++++++++++++++++------= ---- 1 file changed, 85 insertions(+), 30 deletions(-) diff --git a/drivers/thermal/amlogic_thermal.c b/drivers/thermal/amlogic_th= ermal.c index 5448d772db12a..0d0c01e57b85e 100644 --- a/drivers/thermal/amlogic_thermal.c +++ b/drivers/thermal/amlogic_thermal.c @@ -25,6 +25,7 @@ #include #include #include +#include =20 #include "thermal_hwmon.h" =20 @@ -84,12 +85,14 @@ struct amlogic_thermal_soc_calib_data { * @u_efuse_off: register offset to read fused calibration value * @calibration_parameters: calibration parameters structure pointer * @regmap_config: regmap config for the device + * @use_sm: read data from secure monitor instead of efuse * This structure is required for configuration of amlogic thermal driver. */ struct amlogic_thermal_data { int u_efuse_off; const struct amlogic_thermal_soc_calib_data *calibration_parameters; const struct regmap_config *regmap_config; + bool use_sm; }; =20 struct amlogic_thermal { @@ -100,6 +103,8 @@ struct amlogic_thermal { struct clk *clk; struct thermal_zone_device *tzd; u32 trim_info; + struct meson_sm_firmware *sm_fw; + u32 tsensor_id; }; =20 /* @@ -133,26 +138,6 @@ static int amlogic_thermal_code_to_millicelsius(struct= amlogic_thermal *pdata, return temp; } =20 -static int amlogic_thermal_initialize(struct amlogic_thermal *pdata) -{ - int ret =3D 0; - int ver; - - regmap_read(pdata->sec_ao_map, pdata->data->u_efuse_off, - &pdata->trim_info); - - ver =3D TSENSOR_TRIM_VERSION(pdata->trim_info); - - if ((ver & TSENSOR_TRIM_CALIB_VALID_MASK) =3D=3D 0) { - ret =3D -EINVAL; - dev_err(&pdata->pdev->dev, - "tsensor thermal calibration not supported: 0x%x!\n", - ver); - } - - return ret; -} - static int amlogic_thermal_enable(struct amlogic_thermal *data) { int ret; @@ -190,6 +175,70 @@ static int amlogic_thermal_get_temp(struct thermal_zon= e_device *tz, int *temp) return 0; } =20 +static int amlogic_thermal_probe_sm(struct platform_device *pdev, + struct amlogic_thermal *pdata) +{ + struct device *dev =3D &pdev->dev; + struct device_node *sm_np; + struct of_phandle_args ph_args; + int ret; + + ret =3D of_parse_phandle_with_fixed_args(pdev->dev.of_node, + "amlogic,secure-monitor", + 1, 0, &ph_args); + if (ret) + return ret; + + sm_np =3D ph_args.np; + if (!sm_np) { + dev_err(dev, + "Failed to parse secure monitor phandle\n"); + return -ENODEV; + } + + pdata->sm_fw =3D meson_sm_get(sm_np); + of_node_put(sm_np); + if (!pdata->sm_fw) { + dev_err(dev, "Failed to get secure monitor firmware\n"); + return -EPROBE_DEFER; + } + + pdata->tsensor_id =3D ph_args.args[0]; + + return meson_sm_get_thermal_calib(pdata->sm_fw, + &pdata->trim_info, + pdata->tsensor_id); +} + +static int amlogic_thermal_probe_syscon(struct platform_device *pdev, + struct amlogic_thermal *pdata) +{ + struct device *dev =3D &pdev->dev; + int ret =3D 0; + int ver; + + pdata->sec_ao_map =3D syscon_regmap_lookup_by_phandle + (pdev->dev.of_node, "amlogic,ao-secure"); + if (IS_ERR(pdata->sec_ao_map)) { + dev_err(dev, "syscon regmap lookup failed.\n"); + return PTR_ERR(pdata->sec_ao_map); + } + + regmap_read(pdata->sec_ao_map, pdata->data->u_efuse_off, + &pdata->trim_info); + + ver =3D TSENSOR_TRIM_VERSION(pdata->trim_info); + + if ((ver & TSENSOR_TRIM_CALIB_VALID_MASK) =3D=3D 0) { + ret =3D -EINVAL; + dev_err(&pdata->pdev->dev, + "tsensor thermal calibration not supported: 0x%x!\n", + ver); + } + + return ret; +} + static const struct thermal_zone_device_ops amlogic_thermal_ops =3D { .get_temp =3D amlogic_thermal_get_temp, }; @@ -226,6 +275,12 @@ static const struct amlogic_thermal_data amlogic_therm= al_a1_cpu_param =3D { .regmap_config =3D &amlogic_thermal_regmap_config_g12a, }; =20 +static const struct amlogic_thermal_data amlogic_thermal_t7_param =3D { + .use_sm =3D true, + .calibration_parameters =3D &amlogic_thermal_g12a, + .regmap_config =3D &amlogic_thermal_regmap_config_g12a, +}; + static const struct of_device_id of_amlogic_thermal_match[] =3D { { .compatible =3D "amlogic,g12a-ddr-thermal", @@ -239,6 +294,10 @@ static const struct of_device_id of_amlogic_thermal_ma= tch[] =3D { .compatible =3D "amlogic,a1-cpu-thermal", .data =3D &amlogic_thermal_a1_cpu_param, }, + { + .compatible =3D "amlogic,t7-thermal", + .data =3D &amlogic_thermal_t7_param, + }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, of_amlogic_thermal_match); @@ -271,12 +330,12 @@ static int amlogic_thermal_probe(struct platform_devi= ce *pdev) if (IS_ERR(pdata->clk)) return dev_err_probe(dev, PTR_ERR(pdata->clk), "failed to get clock\n"); =20 - pdata->sec_ao_map =3D syscon_regmap_lookup_by_phandle - (pdev->dev.of_node, "amlogic,ao-secure"); - if (IS_ERR(pdata->sec_ao_map)) { - dev_err(dev, "syscon regmap lookup failed.\n"); - return PTR_ERR(pdata->sec_ao_map); - } + if (pdata->data->use_sm) + ret =3D amlogic_thermal_probe_sm(pdev, pdata); + else + ret =3D amlogic_thermal_probe_syscon(pdev, pdata); + if (ret) + return ret; =20 pdata->tzd =3D devm_thermal_of_zone_register(&pdev->dev, 0, @@ -290,10 +349,6 @@ static int amlogic_thermal_probe(struct platform_devic= e *pdev) =20 devm_thermal_add_hwmon_sysfs(&pdev->dev, pdata->tzd); =20 - ret =3D amlogic_thermal_initialize(pdata); - if (ret) - return ret; - ret =3D amlogic_thermal_enable(pdata); =20 return ret; --=20 2.49.0 From nobody Wed Jun 17 07:29:05 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 5CA653783B0; Thu, 23 Apr 2026 16:08:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776960491; cv=none; b=Td6Tcyik/FKEHb8QlnvWCsCyvv0ncgVz4sjsxHmkLOZEaMabwqH7LjBlFs2EgZSnlq6SnetGCj8/YMyftZgAPJRmEIXycs+luA1vIIaQkePqNplQpkbiXRKVz9zCHA2f2rw0ACByx5EhAJ068S3yOp4kZN1MGql08mngnZWnAMc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776960491; c=relaxed/simple; bh=+Ba/0p0exztxBZJCXH18p2/KEK4pBqeXoGLCbhprcaI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YdUpy2ill7NvQNszAzCBhzDAB8WziMUPgehBPJR/b1/KmLTXwXJnaT6hZ0bnP2sRfZP4CXJfqVhQ/CBX54DBRBieT1XvYNQQ3oiZNJYnLXj02FuWs/muSFyw3Dcj7k7mPbttuPhRydaqNElS3l0e/fpXRHNVb1HvU0TzjbXIXAw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZxSftGga; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZxSftGga" Received: by smtp.kernel.org (Postfix) with ESMTPS id 201BAC2BCF5; Thu, 23 Apr 2026 16:08:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776960491; bh=+Ba/0p0exztxBZJCXH18p2/KEK4pBqeXoGLCbhprcaI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ZxSftGgaoh0hvr4luYh6DavMzdMLs0OtjyfmHfPzoYF0G+P2V4C4Ti5PuThRhBa8W JtvqzkML2+OVC1VPM5Y7VoT+larg1JlqAHqbZsOc0P38pyeAnz9WEzMqM5yoNkEXZA e//TPkUnykIHC/Uxdb0t3LPuEAFRaXb6pWzr9SBtsJW5lmqGPCspRgLb6lU5/usE2f WZ8H3DbsF7kXUJjQqfKcWpe1J6fe0sCU4tZ/zvmsgifO4eomdUfDMtaoyq7kedV1CG trdnDnPihTPhHs364pwKNl8LOKxJ1MbtZrC65Wa/tenZxxGDdAe4nUEa+w80FMNyhK SQ0G8877NDV1g== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18697F589DF; Thu, 23 Apr 2026 16:08:11 +0000 (UTC) From: Ronald Claveau via B4 Relay Date: Thu, 23 Apr 2026 18:07:20 +0200 Subject: [PATCH v4 5/8] arm64: dts: amlogic: t7: Add cooling cells to all CPUs 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: <20260423-add-thermal-t7-vim4-v4-5-d4c1528d5044@aliel.fr> References: <20260423-add-thermal-t7-vim4-v4-0-d4c1528d5044@aliel.fr> In-Reply-To: <20260423-add-thermal-t7-vim4-v4-0-d4c1528d5044@aliel.fr> To: Guillaume La Roque , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: linux-pm@vger.kernel.org, linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ronald Claveau X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2093; i=linux-kernel-dev@aliel.fr; h=from:subject:message-id; bh=WdROqCoECVugDQijrfKUvfX+9RIJRisOOsFej55YKwg=; b=owGbwMvMwCWm1SvKXP3cUInxtFoSQ+Yr5yeeqzn2iaepn511bYG0mlymX4JSgURKcW16R9Gun NezH8/qKGVhEONikBVTZOmfa3ni3eWjZ77uUU+BmcPKBDKEgYtTACbyzpbhf7XenzkFh09Wzcl4 ZlZnFHNA0flVbgnjBamrqf4H9C5nCjIy3BBJ2tgz76WjQuvcteZsF75zBcxefLm7R3SG17/cfpF tvAA= X-Developer-Key: i=linux-kernel-dev@aliel.fr; a=openpgp; fpr=DFD863F61375BF917F0012173953305EF1D0EC3E X-Endpoint-Received: by B4 Relay for linux-kernel-dev@aliel.fr/default with auth_id=744 X-Original-From: Ronald Claveau Reply-To: linux-kernel-dev@aliel.fr From: Ronald Claveau Add #cooling-cells =3D <2> to all CPU nodes (both little and big cluster) to allow them to be used as cooling devices in thermal zone mappings. Signed-off-by: Ronald Claveau Reviewed-by: Neil Armstrong --- arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi b/arch/arm64/boot/= dts/amlogic/amlogic-t7.dtsi index 560c9dce35266..7aec65f036a9c 100644 --- a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi +++ b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi @@ -63,6 +63,7 @@ cpu100: cpu@100 { i-cache-size =3D <0x8000>; i-cache-sets =3D <32>; next-level-cache =3D <&l2_cache_l>; + #cooling-cells =3D <2>; }; =20 cpu101: cpu@101 { @@ -77,6 +78,7 @@ cpu101: cpu@101 { i-cache-size =3D <0x8000>; i-cache-sets =3D <32>; next-level-cache =3D <&l2_cache_l>; + #cooling-cells =3D <2>; }; =20 cpu102: cpu@102 { @@ -91,6 +93,7 @@ cpu102: cpu@102 { i-cache-size =3D <0x8000>; i-cache-sets =3D <32>; next-level-cache =3D <&l2_cache_l>; + #cooling-cells =3D <2>; }; =20 cpu103: cpu@103 { @@ -105,6 +108,7 @@ cpu103: cpu@103 { i-cache-size =3D <0x8000>; i-cache-sets =3D <32>; next-level-cache =3D <&l2_cache_l>; + #cooling-cells =3D <2>; }; =20 cpu0: cpu@0 { @@ -119,6 +123,7 @@ cpu0: cpu@0 { i-cache-size =3D <0x10000>; i-cache-sets =3D <64>; next-level-cache =3D <&l2_cache_b>; + #cooling-cells =3D <2>; }; =20 cpu1: cpu@1 { @@ -133,6 +138,7 @@ cpu1: cpu@1 { i-cache-size =3D <0x10000>; i-cache-sets =3D <64>; next-level-cache =3D <&l2_cache_b>; + #cooling-cells =3D <2>; }; =20 cpu2: cpu@2 { @@ -147,6 +153,7 @@ cpu2: cpu@2 { i-cache-size =3D <0x10000>; i-cache-sets =3D <64>; next-level-cache =3D <&l2_cache_b>; + #cooling-cells =3D <2>; }; =20 cpu3: cpu@3 { @@ -161,6 +168,7 @@ cpu3: cpu@3 { i-cache-size =3D <0x10000>; i-cache-sets =3D <64>; next-level-cache =3D <&l2_cache_b>; + #cooling-cells =3D <2>; }; =20 l2_cache_l: l2-cache-cluster0 { --=20 2.49.0 From nobody Wed Jun 17 07:29:05 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 681C83793B8; Thu, 23 Apr 2026 16:08:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776960491; cv=none; b=pSdUAnFqbeh6bEnrBV71QV6QZQZOfN3GXxHYJRAwypD3RquyMH2imCOlqsbp1bjypK17WzYLOJSBXP7BKGyg8AmyyM+yvWq6NqL5wujFyBu3ZSHqQXdKHBenkxFN1Udu/E70zzsoyGQ+52X4+vUbEz6ttYTqbhZ1MGDDuiN7aWs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776960491; c=relaxed/simple; bh=ppNpmKpIg/LkrchRD2fchGkO1iZ6NOOF+2pVJoyViMc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QN7NwgX3twMo4kvITze2qw3LLini01fXA3+A2h6/aRgR8WMs+Ir89qYrGEL6lfwAZZjvFsBBflnKnbSJM4NE+njTQnkz/nshuoFv2u3li2E390uVZS8lTe9ZkQlwG2pkLFQTgTIoPgYfBDnCw/2jbNjYV75SgrJP5rPH7kerjrw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YzhjQhTf; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YzhjQhTf" Received: by smtp.kernel.org (Postfix) with ESMTPS id 31700C2BCC4; Thu, 23 Apr 2026 16:08:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776960491; bh=ppNpmKpIg/LkrchRD2fchGkO1iZ6NOOF+2pVJoyViMc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=YzhjQhTfs4Fuk8ceWHI/AJlwj/SS49f4PBUt8nYNb0l13qHafiDTFAvybKBga+hR3 HswKi4Q12OAzsF9cgQ/nMAp2u2kkay9ioKr3Sp87BA0pvhMPj3l5sSvQi6K7EQjT77 3f2WTTOK71zeD33qrwiiSG8w+s5YUO0SVGhe/xyuhejG+UVYAY6dH8Fy82v/q08kso 0OzxUc5ElJ0y8Fja3IyR3WocmFJfh076FAT1kuPISWY9d0fkrzMwfHaZUUK5rVWlYj 5x/7HY2lwHcgQKnsMY2GapZtXiBC9xLKel0gil5Gr+6BtCl4zZ3r3mBG/FgFViftLg v/SKrxpa4O8uQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 287D3FAD3FB; Thu, 23 Apr 2026 16:08:11 +0000 (UTC) From: Ronald Claveau via B4 Relay Date: Thu, 23 Apr 2026 18:07:21 +0200 Subject: [PATCH v4 6/8] arm64: dts: amlogic: t7: Add thermal sensor nodes 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: <20260423-add-thermal-t7-vim4-v4-6-d4c1528d5044@aliel.fr> References: <20260423-add-thermal-t7-vim4-v4-0-d4c1528d5044@aliel.fr> In-Reply-To: <20260423-add-thermal-t7-vim4-v4-0-d4c1528d5044@aliel.fr> To: Guillaume La Roque , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: linux-pm@vger.kernel.org, linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ronald Claveau X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3074; i=linux-kernel-dev@aliel.fr; h=from:subject:message-id; bh=qZ6yxPYtU0rtSpNUw/qC8lVKNvJcNRQzOAUadiZgg5o=; b=owGbwMvMwCWm1SvKXP3cUInxtFoSQ+Yr56cbU0+GrzIKaHC71Rf/pzM2VcW5anFvVsXBis5lZ oxRPBM6SlkYxLgYZMUUWfrnWp54d/noma971FNg5rAygQxh4OIUgIkwOTEyPExNsjYUfJlu4P/W u8qTda2pi7VU/1fTi5cO9NucZLtdx/BX8Ou5H1Orpk20mF/yYavEEy9T9vDrduwVbsZid7uz6jK 4AQ== X-Developer-Key: i=linux-kernel-dev@aliel.fr; a=openpgp; fpr=DFD863F61375BF917F0012173953305EF1D0EC3E X-Endpoint-Received: by B4 Relay for linux-kernel-dev@aliel.fr/default with auth_id=744 X-Original-From: Ronald Claveau Reply-To: linux-kernel-dev@aliel.fr From: Ronald Claveau Add six temperature sensor nodes using the amlogic,t7-thermal compatible: a73, a53, gpu, nna, vpu, and hevc. Each sensor retrieves its calibration data from the secure monitor via the amlogic,secure-monitor phandle with the corresponding tsensor_id argument. Signed-off-by: Ronald Claveau Reviewed-by: Neil Armstrong --- arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 58 +++++++++++++++++++++++++= ++++ 1 file changed, 58 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi b/arch/arm64/boot/= dts/amlogic/amlogic-t7.dtsi index 7aec65f036a9c..62f259b2b17d2 100644 --- a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi +++ b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi @@ -656,6 +656,24 @@ sec_ao: ao-secure@10220 { amlogic,has-chip-id; }; =20 + a73_tsensor: temperature-sensor@20000 { + compatible =3D "amlogic,t7-thermal"; + reg =3D <0x0 0x20000 0x0 0x50>; + interrupts =3D ; + clocks =3D <&clkc_periphs CLKID_TS>; + #thermal-sensor-cells =3D <0>; + amlogic,secure-monitor =3D <&sm 1>; + }; + + a53_tsensor: temperature-sensor@22000 { + compatible =3D "amlogic,t7-thermal"; + reg =3D <0x0 0x22000 0x0 0x50>; + interrupts =3D ; + clocks =3D <&clkc_periphs CLKID_TS>; + #thermal-sensor-cells =3D <0>; + amlogic,secure-monitor =3D <&sm 2>; + }; + pwm_ao_ef: pwm@30000 { compatible =3D "amlogic,t7-pwm", "amlogic,meson-s4-pwm"; reg =3D <0x0 0x30000 0x0 0x24>; @@ -770,6 +788,46 @@ sd_emmc_c: mmc@8c000 { assigned-clock-parents =3D <&xtal>; status =3D "disabled"; }; + + gpu_tsensor: temperature-sensor@94000 { + compatible =3D "amlogic,t7-thermal"; + reg =3D <0x0 0x94000 0x0 0x50>; + interrupts =3D ; + clocks =3D <&clkc_periphs CLKID_TS>; + power-domains =3D <&pwrc PWRC_T7_MALI_TOP_ID>; + #thermal-sensor-cells =3D <0>; + amlogic,secure-monitor =3D <&sm 3>; + }; + + nna_tsensor: temperature-sensor@96000 { + compatible =3D "amlogic,t7-thermal"; + reg =3D <0x0 0x96000 0x0 0x50>; + interrupts =3D ; + clocks =3D <&clkc_periphs CLKID_TS>; + power-domains =3D <&pwrc PWRC_T7_NNA_TOP_ID>; + #thermal-sensor-cells =3D <0>; + amlogic,secure-monitor =3D <&sm 4>; + }; + + vpu_tsensor: temperature-sensor@98000 { + compatible =3D "amlogic,t7-thermal"; + reg =3D <0x0 0x98000 0x0 0x50>; + interrupts =3D ; + clocks =3D <&clkc_periphs CLKID_TS>; + power-domains =3D <&pwrc PWRC_T7_VPU_HDMI_ID>; + #thermal-sensor-cells =3D <0>; + amlogic,secure-monitor =3D <&sm 6>; + }; + + hevc_tsensor: temperature-sensor@9a000 { + compatible =3D "amlogic,t7-thermal"; + reg =3D <0x0 0x9a000 0x0 0x50>; + interrupts =3D ; + clocks =3D <&clkc_periphs CLKID_TS>; + power-domains =3D <&pwrc PWRC_T7_DOS_HEVC_ID>; + #thermal-sensor-cells =3D <0>; + amlogic,secure-monitor =3D <&sm 5>; + }; }; =20 }; --=20 2.49.0 From nobody Wed Jun 17 07:29:05 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 6E04B37C10A; Thu, 23 Apr 2026 16:08:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776960491; cv=none; b=olsCrdTmG2c+Z0+IYTjcDnIov5rHpvLQtsXf+pnjCdH40webEpF3IAM1E444QE8dJ0v5ilo/u4cZesuGDzliaOepSClyPeg202bQcHZwaB5waIsjalwSS1t1dgy4V6UvK8Z4m+/ANO4CWsHaJAZjdo+WW6xAa3+0RSe/+9P0OeA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776960491; c=relaxed/simple; bh=/rHcPdtLifVRpQWA0pD4xaKz0Tudx/zEU/4kl8CAidc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UyvcCY9ssexSa7OXI7qNMDxxthaFnDZzAwPC4KLg5V3nESwyzjYBK/ibUpXFzYMm5+3hCjUnxVo3gI35KfXRjT8OES96uf5xjnFxXnYRaxlt3YSpUaZJjRlsxc88/T7DssFA99g1o2JSZi4xjseuBfF1LjjxIakAUuZoaSfv3j8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=jPuBgajN; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="jPuBgajN" Received: by smtp.kernel.org (Postfix) with ESMTPS id 43838C2BCFA; Thu, 23 Apr 2026 16:08:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776960491; bh=/rHcPdtLifVRpQWA0pD4xaKz0Tudx/zEU/4kl8CAidc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=jPuBgajNFmUoYAdkjp2wzHuug93jYq+h9eTse5LkT2QHWGvHLbFZY5OgDJuSgXMHy ojis91xAcS61rH+e8FNYYHHmMLpISEBnJbvD12FpDu7pCwdsDXZf55UAdhusDSxBq1 aCdQazBdp8YLzZxZf4R5PpIuycEfVEa9oFc6EJcj1Ca2y2oOtmer+59r6o2H+1NAL7 dfiAw4fQ27PS/oDjJjLPfM0xnku76zHdgXye8g1NwFFMLzkf6i9pNlyBFZKF43ndf6 h4EGRwgrK0rOenQGZSZKH/5MlczExXXNbKgUnqaRaA/kGlTVjc2lOQuhunQxDArbak e/8DKtm1uz5Rg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3AAC6FC0379; Thu, 23 Apr 2026 16:08:11 +0000 (UTC) From: Ronald Claveau via B4 Relay Date: Thu, 23 Apr 2026 18:07:22 +0200 Subject: [PATCH v4 7/8] arm64: dts: amlogic: t7: Add thermal zones 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: <20260423-add-thermal-t7-vim4-v4-7-d4c1528d5044@aliel.fr> References: <20260423-add-thermal-t7-vim4-v4-0-d4c1528d5044@aliel.fr> In-Reply-To: <20260423-add-thermal-t7-vim4-v4-0-d4c1528d5044@aliel.fr> To: Guillaume La Roque , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: linux-pm@vger.kernel.org, linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ronald Claveau X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=5084; i=linux-kernel-dev@aliel.fr; h=from:subject:message-id; bh=gXUyoHvrU7UAwF+TcmnCND7Xo2iI5Rna7hPHjxdZqpk=; b=owGbwMvMwCWm1SvKXP3cUInxtFoSQ+Yr5+fPo3JjFqxavf/0qda0Oee+S3LHTF659dfdzHcW1 xxWPTnN1FHKwiDGxSArpsjSP9fyxLvLR8983aOeAjOHlQlkCAMXpwBMZJ0GI8MUZrUvCkFHnl/m CMnlEiu5IyJh8iQ+kknpYDe3V3rKlCUM/1TUd9bfm31r3onz++97aqwteeHGeKGgjHXpdvOXjhO sf/MBAA== X-Developer-Key: i=linux-kernel-dev@aliel.fr; a=openpgp; fpr=DFD863F61375BF917F0012173953305EF1D0EC3E X-Endpoint-Received: by B4 Relay for linux-kernel-dev@aliel.fr/default with auth_id=744 X-Original-From: Ronald Claveau Reply-To: linux-kernel-dev@aliel.fr From: Ronald Claveau Add thermal zones for all six sensors: a53, a73, gpu, nna, vpu, and hevc. Signed-off-by: Ronald Claveau Reviewed-by: Neil Armstrong --- arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 179 ++++++++++++++++++++++++= ++++ 1 file changed, 179 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi b/arch/arm64/boot/= dts/amlogic/amlogic-t7.dtsi index 62f259b2b17d2..c6ea0f20a879f 100644 --- a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi +++ b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi @@ -9,6 +9,7 @@ #include #include #include +#include =20 / { interrupt-parent =3D <&gic>; @@ -829,6 +830,184 @@ hevc_tsensor: temperature-sensor@9a000 { amlogic,secure-monitor =3D <&sm 5>; }; }; + }; + + thermal-zones { + a53_thermal: a53-thermal { + polling-delay =3D <1000>; + polling-delay-passive =3D <100>; + thermal-sensors =3D <&a53_tsensor>; + + trips { + a53_passive: a53-passive { + temperature =3D <85000>; /* millicelsius */ + hysteresis =3D <2000>; /* millicelsius */ + type =3D "passive"; + }; + + a53_hot: a53-hot { + temperature =3D <95000>; /* millicelsius */ + hysteresis =3D <2000>; /* millicelsius */ + type =3D "hot"; + }; + + a53_critical: a53-critical { + temperature =3D <110000>; /* millicelsius */ + hysteresis =3D <2000>; /* millicelsius */ + type =3D "critical"; + }; + }; + + cooling-maps { + map-a53 { + trip =3D <&a53_passive>; + cooling-device =3D + <&cpu100 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu101 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu102 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu103 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + }; + + a73_thermal: a73-thermal { + polling-delay =3D <1000>; + polling-delay-passive =3D <100>; + thermal-sensors =3D <&a73_tsensor>; + + trips { + a73_passive: a73-passive { + temperature =3D <85000>; /* millicelsius */ + hysteresis =3D <2000>; /* millicelsius */ + type =3D "passive"; + }; + + a73_hot: a73-hot { + temperature =3D <95000>; /* millicelsius */ + hysteresis =3D <2000>; /* millicelsius */ + type =3D "hot"; + }; + + a73_critical: a73-critical { + temperature =3D <110000>; /* millicelsius */ + hysteresis =3D <2000>; /* millicelsius */ + type =3D "critical"; + }; + }; + + cooling-maps { + map-a73 { + trip =3D <&a73_passive>; + cooling-device =3D <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + }; + + gpu_thermal: gpu-thermal { + polling-delay =3D <1000>; + polling-delay-passive =3D <100>; + thermal-sensors =3D <&gpu_tsensor>; + + trips { + gpu_passive: gpu-passive { + temperature =3D <95000>; + hysteresis =3D <5000>; + type =3D "passive"; + }; + + gpu_hot: gpu-hot { + temperature =3D <105000>; + hysteresis =3D <5000>; + type =3D "passive"; + }; =20 + gpu_critical: gpu-critical { + temperature =3D <115000>; + hysteresis =3D <1000>; + type =3D "critical"; + }; + }; + }; + + hevc_thermal: hevc-thermal { + polling-delay =3D <1000>; + polling-delay-passive =3D <100>; + thermal-sensors =3D <&hevc_tsensor>; + + trips { + hevc_passive: hevc-passive { + temperature =3D <95000>; + hysteresis =3D <5000>; + type =3D "passive"; + }; + + hevc_hot: hevc-hot { + temperature =3D <105000>; + hysteresis =3D <5000>; + type =3D "passive"; + }; + + hevc_critical: hevc-critical { + temperature =3D <115000>; + hysteresis =3D <1000>; + type =3D "critical"; + }; + }; + }; + + nna_thermal: nna-thermal { + polling-delay =3D <1000>; + polling-delay-passive =3D <100>; + thermal-sensors =3D <&nna_tsensor>; + + trips { + nna_passive: nna-passive { + temperature =3D <95000>; + hysteresis =3D <5000>; + type =3D "passive"; + }; + + nna_hot: nna-hot { + temperature =3D <105000>; + hysteresis =3D <5000>; + type =3D "passive"; + }; + + nna_critical: nna-critical { + temperature =3D <115000>; + hysteresis =3D <1000>; + type =3D "critical"; + }; + }; + }; + + vpu_thermal: vpu-thermal { + polling-delay =3D <1000>; + polling-delay-passive =3D <100>; + thermal-sensors =3D <&vpu_tsensor>; + + trips { + vpu_passive: vpu-passive { + temperature =3D <95000>; + hysteresis =3D <5000>; + type =3D "passive"; + }; + + vpu_hot: vpu-hot { + temperature =3D <105000>; + hysteresis =3D <5000>; + type =3D "passive"; + }; + + vpu_critical: vpu-critical { + temperature =3D <115000>; + hysteresis =3D <1000>; + type =3D "critical"; + }; + }; + }; }; }; --=20 2.49.0 From nobody Wed Jun 17 07:29:05 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7405537C915; Thu, 23 Apr 2026 16:08:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776960491; cv=none; b=Y9FtRZDJF3gSJclozNOqyMhvc/ozpj0HnuhFNJBEMScngMZ0Fn3e/QiwEW61tU5oe8hkwLq7imASTyjEACtJ+7xdXwC/VpKg/i+9+cgFOFlA4I6OGL6DyuUI0UWYkuYv2kGS/0KJX7ud6rb9SqJosjBwOLm0cNp9tUy1qyqtC3k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776960491; c=relaxed/simple; bh=REA0gNXQwhTgCiXosbKBoReZLjNSpbkwmsoqkYdMspE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BowPBFwNIVEP+6o7v7AJfyzfwF7DuclqsKo5s6AnB9j68nHzevB7B38C20ufp16vFOnz0F6SLAX0ozrDHBiePPv5fyQIan3QhbVRDO4OtPj3wFcedmgTrbhLQGog0XZYkJ/hi51WJ+8oX3sjBlDQuK+t34DYZzRcEL0baQxx7HE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uxx9nzwl; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uxx9nzwl" Received: by smtp.kernel.org (Postfix) with ESMTPS id 534BBC2BCFD; Thu, 23 Apr 2026 16:08:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1776960491; bh=REA0gNXQwhTgCiXosbKBoReZLjNSpbkwmsoqkYdMspE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=uxx9nzwlxousgqAuQESJz5CCiKeNPP5ordUUqhTuqSOfJYPceHLhJNOTsAZYHgnOv jAczcQohHh79Ch8GPQ50X6PWVYdw/VdZzfrzOvFk1U4c8a+DO2PKqjOuKTAdJ5JuTr ZD2bzQYsZIN3I8aFKnzGg+VSE9Y26SnuhqeEaItDf24v7K/pHWuHKEbLeVz1l11FGQ E4hJlgAc09OBUtd8plwTb/ptnQDc08Lg6132mRzKUvo8pThuV+llFRB4uBam9rx2aA zGFVcCfhLb8I58OA0LXLGdyYCQ0oszL5JjNo4sDDdDMcajzYJcQE3AcmXvFNTovjAY AZz/OyyliW7oA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B498FC0360; Thu, 23 Apr 2026 16:08:11 +0000 (UTC) From: Ronald Claveau via B4 Relay Date: Thu, 23 Apr 2026 18:07:23 +0200 Subject: [PATCH v4 8/8] arm64: dts: amlogic: t7: khadas-vim4: Add fan cooling to thermal zones 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: <20260423-add-thermal-t7-vim4-v4-8-d4c1528d5044@aliel.fr> References: <20260423-add-thermal-t7-vim4-v4-0-d4c1528d5044@aliel.fr> In-Reply-To: <20260423-add-thermal-t7-vim4-v4-0-d4c1528d5044@aliel.fr> To: Guillaume La Roque , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: linux-pm@vger.kernel.org, linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ronald Claveau X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2874; i=linux-kernel-dev@aliel.fr; h=from:subject:message-id; bh=zbgRfmKb31HDgkan9Fy8S+p1BOUmWfaoe9tmTB9hGac=; b=owGbwMvMwCWm1SvKXP3cUInxtFoSQ+Yr5xflybeZjF97/jKcsPDNNNUFOfG/L6VGLSyOu3FYw I7R7nx7RykLgxgXg6yYIkv/XMsT7y4fPfN1j3oKzBxWJpAhDFycAjCR79sY/vuzcdw5ksW24vr2 fZfURadVXE+XnBp1JXnNohcOnVNmPJrAyLDG8ozr0qcxP+bN85hn4yJ2RiyfN2NR+CURSWdbkQ9 ec3gB X-Developer-Key: i=linux-kernel-dev@aliel.fr; a=openpgp; fpr=DFD863F61375BF917F0012173953305EF1D0EC3E X-Endpoint-Received: by B4 Relay for linux-kernel-dev@aliel.fr/default with auth_id=744 X-Original-From: Ronald Claveau Reply-To: linux-kernel-dev@aliel.fr From: Ronald Claveau Add an active trip at 50=C2=B0C to all six thermal zones and map it to the khadas_mcu fan controller, using cooling states 30 to 100. Signed-off-by: Ronald Claveau Reviewed-by: Neil Armstrong --- .../dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts | 102 +++++++++++++++++= ++++ 1 file changed, 102 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts = b/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts index 5d7f5390f3a66..ba9219073dd0a 100644 --- a/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts +++ b/arch/arm64/boot/dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts @@ -157,6 +157,74 @@ wifi32k: wifi32k { }; }; =20 +&a53_thermal { + trips { + a53_active: a53-active { + temperature =3D <50000>; /* millicelsius */ + hysteresis =3D <2000>; /* millicelsius */ + type =3D "active"; + }; + }; + + cooling-maps { + map { + trip =3D <&a53_active>; + cooling-device =3D <&khadas_mcu 30 100>; + }; + }; +}; + +&a73_thermal { + trips { + a73_active: a73-active { + temperature =3D <50000>; /* millicelsius */ + hysteresis =3D <2000>; /* millicelsius */ + type =3D "active"; + }; + }; + + cooling-maps { + map { + trip =3D <&a73_active>; + cooling-device =3D <&khadas_mcu 30 100>; + }; + }; +}; + +&gpu_thermal { + trips { + gpu_active: gpu-active { + temperature =3D <50000>; /* millicelsius */ + hysteresis =3D <2000>; /* millicelsius */ + type =3D "active"; + }; + }; + + cooling-maps { + map { + trip =3D <&gpu_active>; + cooling-device =3D <&khadas_mcu 30 100>; + }; + }; +}; + +&hevc_thermal { + trips { + hevc_active: hevc-active { + temperature =3D <50000>; /* millicelsius */ + hysteresis =3D <2000>; /* millicelsius */ + type =3D "active"; + }; + }; + + cooling-maps { + map { + trip =3D <&hevc_active>; + cooling-device =3D <&khadas_mcu 30 100>; + }; + }; +}; + &i2c_m_ao_a { status =3D "okay"; pinctrl-0 =3D <&i2c0_ao_d_pins>; @@ -170,6 +238,23 @@ khadas_mcu: system-controller@18 { }; }; =20 +&nna_thermal { + trips { + nna_active: nna-active { + temperature =3D <50000>; /* millicelsius */ + hysteresis =3D <2000>; /* millicelsius */ + type =3D "active"; + }; + }; + + cooling-maps { + map { + trip =3D <&nna_active>; + cooling-device =3D <&khadas_mcu 30 100>; + }; + }; +}; + &pwm_ab { status =3D "okay"; pinctrl-0 =3D <&pwm_a_pins>; @@ -266,3 +351,20 @@ &uart_a { clocks =3D <&xtal>, <&xtal>, <&xtal>; clock-names =3D "xtal", "pclk", "baud"; }; + +&vpu_thermal { + trips { + vpu_active: vpu-active { + temperature =3D <50000>; /* millicelsius */ + hysteresis =3D <2000>; /* millicelsius */ + type =3D "active"; + }; + }; + + cooling-maps { + map { + trip =3D <&vpu_active>; + cooling-device =3D <&khadas_mcu 30 100>; + }; + }; +}; --=20 2.49.0