From nobody Mon Jun 15 13:58:02 2026 Received: from courrier.aliel.fr (courrier.aliel.fr [65.21.61.41]) (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 BC9143E024C; Fri, 10 Apr 2026 16:49:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.21.61.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775839747; cv=none; b=Ud8f1qiVhl1c7AlrjPlbYhqqcqaKtbdAhUYxTRaNOmYITgJQVQK+P4DKnd42uXohuYPKhMHA9aakPqWrSqIJz80iMl9WuyNt66Q1/goX8SDXTMgS/NUbbtED1Xc2z3Vo9xd1QxeplMCgQDLJ27q54JylyFfspmQdMV0FgOKJ8ZQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775839747; c=relaxed/simple; bh=JnH9zOxJRNagemiQv9oYzRiv1ojhPKXvc6QjWfgg8M8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qHnTKGE3WJJdf0GLd6mzA5O4+OkNEeyXTxemPEWH+A/d2NweFMTFC6ZA7I+QAgH9VyDVICaPAPxYtWIz4SZCRbO/8uwnMhNQw9cHogtgTzXyLLgfRkIjS5vPrTf62tSvCNRpaA9aYfEwnf0tgg4tS/mdYwT0HfVJI8DN737HX4k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=aliel.fr; spf=pass smtp.mailfrom=aliel.fr; dkim=pass (1024-bit key) header.d=aliel.fr header.i=@aliel.fr header.b=SCs982he; arc=none smtp.client-ip=65.21.61.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=aliel.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aliel.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=aliel.fr header.i=@aliel.fr header.b="SCs982he" From: Ronald Claveau DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aliel.fr; s=courrier-s1; t=1775839733; bh=JnH9zOxJRNagemiQv9oYzRiv1ojhPKXvc6QjWfgg8M8=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=SCs982hejK1UFmNVnWr8K/Cbi6sBubCOwkRe+97Q0ApaylbdBtBf8rC7Gkn9X3Jjo /lxvY38e3TlgjNq3HyjS7cBYBV171K9g36SJ8xzxIKlBrevwQgkiNfX0qwE868SZBI OC3TD5CHkDkrlf1yQTgOn/mdwxpULIW/ObwTHcEE= Date: Fri, 10 Apr 2026 18:48:02 +0200 Subject: [PATCH 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: <20260410-add-thermal-t7-vim4-v1-1-19f2b8da74d7@aliel.fr> References: <20260410-add-thermal-t7-vim4-v1-0-19f2b8da74d7@aliel.fr> In-Reply-To: <20260410-add-thermal-t7-vim4-v1-0-19f2b8da74d7@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=openssh-sha256; t=1775839730; l=2587; i=linux-kernel-dev@aliel.fr; s=id_ed25519; h=from:subject:message-id; bh=JnH9zOxJRNagemiQv9oYzRiv1ojhPKXvc6QjWfgg8M8=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgMGec55oxeeisqykQiUedekMYyOnR9 BG9E/7rDWyqdNoAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QIown5ndRspw9U+KORP1wl++iWagf/WHOEUwIGEnUXSIOxnigvlQa9Dxfaq2ppb6l2j+JeBWAwO W7lGJSZi92Qk= X-Developer-Key: i=linux-kernel-dev@aliel.fr; a=openssh; fpr=SHA256:kch4osYZ6A1BrPps5AUs6KnfdE2wm4ocMtyTc8TmZMs 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. 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. Signed-off-by: Ronald Claveau --- .../bindings/thermal/amlogic,thermal.yaml | 40 ++++++++++++++++++= +++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml= b/Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml index 70b273271754b..85ee73c6e1161 100644 --- a/Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml +++ b/Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml @@ -22,6 +22,7 @@ properties: - amlogic,g12a-ddr-thermal - const: amlogic,g12a-thermal - const: amlogic,a1-cpu-thermal + - const: amlogic,t7-thermal =20 reg: maxItems: 1 @@ -42,12 +43,40 @@ 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 + required: - compatible - reg - interrupts - clocks - - amlogic,ao-secure + +allOf: + - if: + properties: + compatible: + contains: + enum: + - amlogic,g12a-cpu-thermal + - amlogic,g12a-ddr-thermal + - amlogic,a1-cpu-thermal + then: + required: + - amlogic,ao-secure + - if: + properties: + compatible: + contains: + const: amlogic,t7-thermal + then: + required: + - amlogic,secure-monitor =20 unevaluatedProperties: false =20 @@ -62,4 +91,13 @@ examples: #thermal-sensor-cells =3D <0>; amlogic,ao-secure =3D <&sec_AO>; }; + - | + 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>; + }; ... --=20 2.49.0 From nobody Mon Jun 15 13:58:02 2026 Received: from courrier.aliel.fr (courrier.aliel.fr [65.21.61.41]) (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 6BD863DA5B1; Fri, 10 Apr 2026 16:49:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.21.61.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775839746; cv=none; b=CphlDT4G+nHV3AVRyh1U1vdQdLZ4D4oSvMkS7+elRdebqv/sn3L2DiJwTULkyJEi4m+J2gx0cHsrcMKhonEregGJ8BoPGLUq8OrA8A6OU0fKFJ9oENcsg19mm9CgVwdS7p05ho5shJnm3uqKFRNXyvuB/t0N0xyuInhD0q/Yqyk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775839746; c=relaxed/simple; bh=z46M+rsMVvol/Iu/vuO1m+rAUYrJ82iMmifq0EnDoU0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=oVeapHYTfrG0Ebb3fmYs7kASzms1X1QX5ilt3w0q2meG2fwNo2tA4l/GqRv2Qga+tmEDjPvaEN6oqbnUu12rBz6Ks+j0305uUhCRHRejN/4IRyZ1JMF2f5RE3moqSkWmakzXfsKrx5E4jeAzpYogiEmmeBRfU1s2IXPMJzAHTJM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=aliel.fr; spf=pass smtp.mailfrom=aliel.fr; dkim=pass (1024-bit key) header.d=aliel.fr header.i=@aliel.fr header.b=ULPv0629; arc=none smtp.client-ip=65.21.61.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=aliel.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aliel.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=aliel.fr header.i=@aliel.fr header.b="ULPv0629" From: Ronald Claveau DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aliel.fr; s=courrier-s1; t=1775839734; bh=z46M+rsMVvol/Iu/vuO1m+rAUYrJ82iMmifq0EnDoU0=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=ULPv06292dF3Z01JzJjHzkQEHS0RTwP3l8ol08UdRpR2SxSWUGIk92OPYRnj/Xe67 0BHutzoKS9m69sJVeT973tHHPPBo4KgQDeRk5yUfsr1lTI4wHKJCuemWrDqUEZHqe1 GgxZXYEmB2DLcsLIF3A5+NE5Efbo/6YB4LQJMh4k= Date: Fri, 10 Apr 2026 18:48:03 +0200 Subject: [PATCH 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: <20260410-add-thermal-t7-vim4-v1-2-19f2b8da74d7@aliel.fr> References: <20260410-add-thermal-t7-vim4-v1-0-19f2b8da74d7@aliel.fr> In-Reply-To: <20260410-add-thermal-t7-vim4-v1-0-19f2b8da74d7@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=openssh-sha256; t=1775839730; l=1177; i=linux-kernel-dev@aliel.fr; s=id_ed25519; h=from:subject:message-id; bh=z46M+rsMVvol/Iu/vuO1m+rAUYrJ82iMmifq0EnDoU0=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgMGec55oxeeisqykQiUedekMYyOnR9 BG9E/7rDWyqdNoAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QIdG5PGwnUp/EKo0dNAba95QRzc9WMbqB6dkwPz552jhu4dUiv865FKKJN2fYRYIq3JDT0Uh0og hhFa1LX/r0Q8= X-Developer-Key: i=linux-kernel-dev@aliel.fr; a=openssh; fpr=SHA256:kch4osYZ6A1BrPps5AUs6KnfdE2wm4ocMtyTc8TmZMs 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 --- 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 Mon Jun 15 13:58:02 2026 Received: from courrier.aliel.fr (courrier.aliel.fr [65.21.61.41]) (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 23BFF3DFC9A; Fri, 10 Apr 2026 16:49:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.21.61.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775839747; cv=none; b=jmkXpTlo/QM2BZiF888bJ72IAqJ8puwNuE/ENaEivR079o1SNnKAXwcPUV+DBRMah9kjrQVTtcVDElt7U5rDge5h54WbaMY3n5uzqOrhQotfec42cST8+QhQ0q+2wRr2pnlpbR4emExoLo9ztZOAo5x1VB5C6sw2tuPh3v9QgyQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775839747; c=relaxed/simple; bh=gEByb17aWEuS+y3knfgxZufJ5uAM0e8FrkZagNP6esI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NE6vzmAcPRvDbeauGoE6bPjhXsQhBwYolKxr46TfjjoeMpUsEbxmQuzStuiSxmUgk9MP2MTLCgiFNXs0cCF4Pvr4g2Q99OH3KCd0aMKa5Gi1uC87KnO5901izJiCdi4EEEhhVPKyreY4+Ehj9pC9cNdOBWKtr8qIQ6u7BokFhC4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=aliel.fr; spf=pass smtp.mailfrom=aliel.fr; dkim=pass (1024-bit key) header.d=aliel.fr header.i=@aliel.fr header.b=PGX2gsl1; arc=none smtp.client-ip=65.21.61.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=aliel.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aliel.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=aliel.fr header.i=@aliel.fr header.b="PGX2gsl1" From: Ronald Claveau DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aliel.fr; s=courrier-s1; t=1775839735; bh=gEByb17aWEuS+y3knfgxZufJ5uAM0e8FrkZagNP6esI=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=PGX2gsl1yyc+ElHo9FsLIsNLdz0wCQ4AqJ1oVIagtF+w/VRPb2fJUfeFwtApN/lLT KRzWyKBNiZNnqsfcaEB5V+x9VA08l0z3E8bxPZ/UT5jXnpu3KzWmW85Xqo0bzwuWBK 9JUQsqnU8Y/8WR1RHhlWiSp/efZ8eULlcwPmZebc= Date: Fri, 10 Apr 2026 18:48:04 +0200 Subject: [PATCH 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: <20260410-add-thermal-t7-vim4-v1-3-19f2b8da74d7@aliel.fr> References: <20260410-add-thermal-t7-vim4-v1-0-19f2b8da74d7@aliel.fr> In-Reply-To: <20260410-add-thermal-t7-vim4-v1-0-19f2b8da74d7@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=openssh-sha256; t=1775839730; l=1805; i=linux-kernel-dev@aliel.fr; s=id_ed25519; h=from:subject:message-id; bh=gEByb17aWEuS+y3knfgxZufJ5uAM0e8FrkZagNP6esI=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgMGec55oxeeisqykQiUedekMYyOnR9 BG9E/7rDWyqdNoAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QCZXPWgNcIzEeEI7sgiKyGvolQvqu+W2iXUpuLgewQ+KT9tqCB33rJpAiFgCiRuOXeroJaJ+ZpJ TlX2RqgZqmw4= X-Developer-Key: i=linux-kernel-dev@aliel.fr; a=openssh; fpr=SHA256:kch4osYZ6A1BrPps5AUs6KnfdE2wm4ocMtyTc8TmZMs 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 --- drivers/firmware/meson/meson_sm.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/firmware/meson/meson_sm.c b/drivers/firmware/meson/mes= on_sm.c index 3ab67aaa9e5da..da0dbcd8a2ff2 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,14 @@ struct meson_sm_firmware *meson_sm_get(struct device_n= ode *sm_node) } EXPORT_SYMBOL_GPL(meson_sm_get); =20 +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 Mon Jun 15 13:58:02 2026 Received: from courrier.aliel.fr (courrier.aliel.fr [65.21.61.41]) (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 31D5B3C943D; Fri, 10 Apr 2026 16:49:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.21.61.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775839748; cv=none; b=rGyWBavOrN5JZ8czWCDUEQ3npKzEHOZuEfVc5m/fsQJJXdOOxTl2BqzNCapKcgur6f0E9DBH/9t0Ryijrv6JMOtg0wIRYgAP0dJWuLF5W9cGJzdJcwsx6bGM5+cRzIyOwhG0Ws0fU8WA9OcfMeCwcl7WoSIydmptKjG52836eAg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775839748; c=relaxed/simple; bh=+OPiaJJPEI4198UFVptwbMsLl2t7li0yawHDEA3XDzo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=njYQyRCssZtu8xnQd5UF09CneQIgvbWWNU4DMHNixvn2svzydx29Gj7UEPp55yegSsCox9di3zOwGaJK4oEhImHqMBiYjRJX77e3amjwsI1q2QmrBHavUmKZf23YWJkwWDio7YyvpvQK9MiGsyOzqpRTjdahJm/5h8K8dK+jjY4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=aliel.fr; spf=pass smtp.mailfrom=aliel.fr; dkim=pass (1024-bit key) header.d=aliel.fr header.i=@aliel.fr header.b=TRm0WdMx; arc=none smtp.client-ip=65.21.61.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=aliel.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aliel.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=aliel.fr header.i=@aliel.fr header.b="TRm0WdMx" From: Ronald Claveau DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aliel.fr; s=courrier-s1; t=1775839736; bh=+OPiaJJPEI4198UFVptwbMsLl2t7li0yawHDEA3XDzo=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=TRm0WdMxB3sDXX9YuDs3+oTabgIdG7SZSMOL0SPKw0gVFkG978R6FogbCivhCXjZQ IJm+v8Eu96tEpWD0feuDGZlHZbUWj/AgeSr+gLKpPJP79EbM9Shc/wPp0l14hCXanD v8yCNCMUM/TslLCVzL60UdsCCxSMebg9RI26VjJw= Date: Fri, 10 Apr 2026 18:48:05 +0200 Subject: [PATCH 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: <20260410-add-thermal-t7-vim4-v1-4-19f2b8da74d7@aliel.fr> References: <20260410-add-thermal-t7-vim4-v1-0-19f2b8da74d7@aliel.fr> In-Reply-To: <20260410-add-thermal-t7-vim4-v1-0-19f2b8da74d7@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=openssh-sha256; t=1775839730; l=4382; i=linux-kernel-dev@aliel.fr; s=id_ed25519; h=from:subject:message-id; bh=+OPiaJJPEI4198UFVptwbMsLl2t7li0yawHDEA3XDzo=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgMGec55oxeeisqykQiUedekMYyOnR9 BG9E/7rDWyqdNoAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QCUQjZI3bQPJw0xwSq0Z8zi5xgP7Wkj3xpHgfgq0YKKzdSjJUT1+2BSFH82TitvSjr2G8IM8CId esCXPVjxMYQg= X-Developer-Key: i=linux-kernel-dev@aliel.fr; a=openssh; fpr=SHA256:kch4osYZ6A1BrPps5AUs6KnfdE2wm4ocMtyTc8TmZMs 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. Signed-off-by: Ronald Claveau --- drivers/thermal/amlogic_thermal.c | 58 +++++++++++++++++++++++++++++++++++= ---- 1 file changed, 53 insertions(+), 5 deletions(-) diff --git a/drivers/thermal/amlogic_thermal.c b/drivers/thermal/amlogic_th= ermal.c index 5448d772db12a..11e3948cc0669 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 /* @@ -138,6 +143,12 @@ static int amlogic_thermal_initialize(struct amlogic_t= hermal *pdata) int ret =3D 0; int ver; =20 + if (pdata->data->use_sm) { + return meson_sm_get_thermal_calib(pdata->sm_fw, + &pdata->trim_info, + pdata->tsensor_id); + } + regmap_read(pdata->sec_ao_map, pdata->data->u_efuse_off, &pdata->trim_info); =20 @@ -226,6 +237,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 +256,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,11 +292,38 @@ 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) { + struct device_node *sm_np; + struct of_phandle_args ph_args; + + 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]; + } else { + 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); + } } =20 pdata->tzd =3D devm_thermal_of_zone_register(&pdev->dev, --=20 2.49.0 From nobody Mon Jun 15 13:58:02 2026 Received: from courrier.aliel.fr (courrier.aliel.fr [65.21.61.41]) (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 21AE93E122C; Fri, 10 Apr 2026 16:49:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.21.61.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775839752; cv=none; b=R4+dYDKX5wAZz28Sfzx9exv1n/n+1Dz6nIU1Q7+U6t6yPa3wMCtjo7mirzTW9qUN3DlFwretP4iLivAxZirTBltAKHfvYrs0IkFekHbkItot6BCzNM+2DoA4BQuU0rPOoyrIbKFRWKiQ9aL2AxNnMGiHo+A+1QQwSWvoW4xjSJ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775839752; c=relaxed/simple; bh=WdROqCoECVugDQijrfKUvfX+9RIJRisOOsFej55YKwg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=T3DOzsbTEMs4ZQHEMmiX+iUTJVIiRbNcJYE8K4iiOMSo1pZ0baHtUdNuLxR0Dxf2XP0cny3UHpZluJDTv7vdFGh9Ei+qi8OcdVoCMdl8kea89i66v6hfTy5gJCU6jVaNHuyGryuPAJyZdI015wk2qzVX065ktuI+4oaEHzlZDnA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=aliel.fr; spf=pass smtp.mailfrom=aliel.fr; dkim=pass (1024-bit key) header.d=aliel.fr header.i=@aliel.fr header.b=opqWbYQ7; arc=none smtp.client-ip=65.21.61.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=aliel.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aliel.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=aliel.fr header.i=@aliel.fr header.b="opqWbYQ7" From: Ronald Claveau DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aliel.fr; s=courrier-s1; t=1775839737; bh=WdROqCoECVugDQijrfKUvfX+9RIJRisOOsFej55YKwg=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=opqWbYQ7sf6aabpzxm4KSRCgjtTIn5S/Wt8/TCvY+72UeS6EpU1jbmAEPp8B1NDoT VrLrmuLR3zLcSHEkIHarpN2q9jHdpWoJCK/P9bTzkLwX9T+x12fSaj1vlIUTSVTT5y r4QbhCMqTTxs64xL0eS4pvS/wLKFZ06bUr9ChStI= Date: Fri, 10 Apr 2026 18:48:06 +0200 Subject: [PATCH 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: <20260410-add-thermal-t7-vim4-v1-5-19f2b8da74d7@aliel.fr> References: <20260410-add-thermal-t7-vim4-v1-0-19f2b8da74d7@aliel.fr> In-Reply-To: <20260410-add-thermal-t7-vim4-v1-0-19f2b8da74d7@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=openssh-sha256; t=1775839731; l=2093; i=linux-kernel-dev@aliel.fr; s=id_ed25519; h=from:subject:message-id; bh=WdROqCoECVugDQijrfKUvfX+9RIJRisOOsFej55YKwg=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgMGec55oxeeisqykQiUedekMYyOnR9 BG9E/7rDWyqdNoAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QKwgld/90fnSSYPI1cfBdoimdPnfSWBERAc4+VWy298WxeSWybBWmp8t6VK5lG9t69cBqxWs6b3 J/1uKs0FbxwA= X-Developer-Key: i=linux-kernel-dev@aliel.fr; a=openssh; fpr=SHA256:kch4osYZ6A1BrPps5AUs6KnfdE2wm4ocMtyTc8TmZMs 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 --- 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 Mon Jun 15 13:58:02 2026 Received: from courrier.aliel.fr (courrier.aliel.fr [65.21.61.41]) (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 5851A3E1CE9; Fri, 10 Apr 2026 16:49:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.21.61.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775839755; cv=none; b=KGOkfx1H3VrYK+If96oIRm+SJ++IVAikvUBMpvP87CvpAPtSVLeRf7Ke1yO1gdUkta++SOCXRlrMJJt8/GYR8iUx/fTI5kbWdynDWwnA9XI4vWf2cW/95J1FUspR/vVvRvjSwiJEfPzEEr2U5zsK0gFWlfCEx5Gk7fHmMt3UYWE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775839755; c=relaxed/simple; bh=qZ6yxPYtU0rtSpNUw/qC8lVKNvJcNRQzOAUadiZgg5o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mYHHrh2ErxWp1VDMIXuKBEqPe8W6CcipYqC8dHbtfrZfeTDp4XK7UDFQG4s1GA2iW3eflNRlSpIXahj2/3+9Zweu4NC5H7OswcN1doTleflSzhfPmnRNMBTEiIO1erjO+j2wpKoYOzzAdPQzkx1UE1tO88HsAO6CZn6SPSgU8b0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=aliel.fr; spf=pass smtp.mailfrom=aliel.fr; dkim=pass (1024-bit key) header.d=aliel.fr header.i=@aliel.fr header.b=YRLYA2uD; arc=none smtp.client-ip=65.21.61.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=aliel.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aliel.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=aliel.fr header.i=@aliel.fr header.b="YRLYA2uD" From: Ronald Claveau DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aliel.fr; s=courrier-s1; t=1775839738; bh=qZ6yxPYtU0rtSpNUw/qC8lVKNvJcNRQzOAUadiZgg5o=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=YRLYA2uDBHv+wn7gkNUIH2NW/wcgdNEfhEHtSHlQqu/Tusi5mVGv6agyOxqGdL6JW wZgRwfS8v4OiNNo1AarTIJ/ZG5WMS6g3nna6vH8w9KkXBVB1GV21oLf/ld/6YCbuya p4+HT6WwHQVh1uLXpYX85bYvtaNTZvFvbm4m/zbA= Date: Fri, 10 Apr 2026 18:48:07 +0200 Subject: [PATCH 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: <20260410-add-thermal-t7-vim4-v1-6-19f2b8da74d7@aliel.fr> References: <20260410-add-thermal-t7-vim4-v1-0-19f2b8da74d7@aliel.fr> In-Reply-To: <20260410-add-thermal-t7-vim4-v1-0-19f2b8da74d7@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=openssh-sha256; t=1775839731; l=3074; i=linux-kernel-dev@aliel.fr; s=id_ed25519; h=from:subject:message-id; bh=qZ6yxPYtU0rtSpNUw/qC8lVKNvJcNRQzOAUadiZgg5o=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgMGec55oxeeisqykQiUedekMYyOnR9 BG9E/7rDWyqdNoAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QE3hiE33zwXjN+8DvYaAoyu+NzDpv6HPvzps0mbvEQ5Z9iyiYuWAZSAcUEb2ZTbonlgFnayP4zl VgBC/OG7QVQc= X-Developer-Key: i=linux-kernel-dev@aliel.fr; a=openssh; fpr=SHA256:kch4osYZ6A1BrPps5AUs6KnfdE2wm4ocMtyTc8TmZMs 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 --- 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 Mon Jun 15 13:58:02 2026 Received: from courrier.aliel.fr (courrier.aliel.fr [65.21.61.41]) (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 1DEF33E1228; Fri, 10 Apr 2026 16:49:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.21.61.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775839752; cv=none; b=EPLzVWo2yhhvAln91kTW8vXo5MfQJQXNSGUwnd35TpueNx+QKbzsm4XBO88c+ScOHCIvWOZbKSbE8YB2IUE3KmxkBfSsXB+Nvd70SK4Frco6WQuN+PdtBcv4nojxmlk1Ytw4iik6/0ZM8ljvCKhuG+8NHau3KON4vFzbzM7mMTY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775839752; c=relaxed/simple; bh=gXUyoHvrU7UAwF+TcmnCND7Xo2iI5Rna7hPHjxdZqpk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gOZofB+jyzzKqQBsQaxSAaI7AeliXv62HmH3tBwVEuu8gKTI9sDTMZFJCGAW9KeD4O+Cn+paHNODgyusn6RsaCWV98+w9KCJHbA3ULdovhSeq/PbNjvmM69vqFIN/VMFE/z2ta8MXoqVmQReTwBRBmle+CZRAoSf2VNyR4JgR+o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=aliel.fr; spf=pass smtp.mailfrom=aliel.fr; dkim=pass (1024-bit key) header.d=aliel.fr header.i=@aliel.fr header.b=MBkw5Upp; arc=none smtp.client-ip=65.21.61.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=aliel.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aliel.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=aliel.fr header.i=@aliel.fr header.b="MBkw5Upp" From: Ronald Claveau DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aliel.fr; s=courrier-s1; t=1775839739; bh=gXUyoHvrU7UAwF+TcmnCND7Xo2iI5Rna7hPHjxdZqpk=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=MBkw5Upp5rKf6qQk4+vVxZYhAyQ5zLQoUG+V9+/EijahO6vcSiLRBA2F0IXo6q8VL JE+plDbQlersj5EJxE9PCIhYk1IuRSl+ften4yK9OkjAw2nVsXBmg+25zZRZnG85sY TSylu49SQETiH+XzHE6zZxQGnGssM+5k5/+CJvEU= Date: Fri, 10 Apr 2026 18:48:08 +0200 Subject: [PATCH 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: <20260410-add-thermal-t7-vim4-v1-7-19f2b8da74d7@aliel.fr> References: <20260410-add-thermal-t7-vim4-v1-0-19f2b8da74d7@aliel.fr> In-Reply-To: <20260410-add-thermal-t7-vim4-v1-0-19f2b8da74d7@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=openssh-sha256; t=1775839731; l=5084; i=linux-kernel-dev@aliel.fr; s=id_ed25519; h=from:subject:message-id; bh=gXUyoHvrU7UAwF+TcmnCND7Xo2iI5Rna7hPHjxdZqpk=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgMGec55oxeeisqykQiUedekMYyOnR9 BG9E/7rDWyqdNoAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QO/fcrmlYllJKZ74Lg4OH7deq4Dt7Rw3UAKwqNH3GzSwx6hNlF8nY5t4gExBM93slTCc4FxUxkk 94A37KM69BAY= X-Developer-Key: i=linux-kernel-dev@aliel.fr; a=openssh; fpr=SHA256:kch4osYZ6A1BrPps5AUs6KnfdE2wm4ocMtyTc8TmZMs Add thermal zones for all six sensors: a53, a73, gpu, nna, vpu, and hevc. Signed-off-by: Ronald Claveau --- 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 Mon Jun 15 13:58:02 2026 Received: from courrier.aliel.fr (courrier.aliel.fr [65.21.61.41]) (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 5ADCB3E1CEE; Fri, 10 Apr 2026 16:49:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.21.61.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775839753; cv=none; b=baUNQerAIPDmUpghONy6PRLsOcM0Cj4zbg6v30UhtAmCAUCaCkdxpYThIJ5bETNclwvPeqvHmq0Gj12EpCKuL7/YOMUGCgezCqwlIWHwYvSDH5z43JIoIzuV6Cu2HQJhv99bYiGWS6oR4IIvYQGLBNil2T/oaeEch34Wd3U7QAI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775839753; c=relaxed/simple; bh=zbgRfmKb31HDgkan9Fy8S+p1BOUmWfaoe9tmTB9hGac=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=lEQ7kCVUKXO6OnSTSiwiJD8g5eL2WoHG/V6ml6TCsQvtRjcC5fYpkn8tWuyQS7a2dgs7kAiixRilPx5MTx46F9pbn5y9NjTAGJCBGmpoLUMkA7RpFveovCCn0uvvXjV3Tk5yDOxoaEq+LZnOgCof5UjgNOMiNOBnovq/ghbhoyE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=aliel.fr; spf=pass smtp.mailfrom=aliel.fr; dkim=pass (1024-bit key) header.d=aliel.fr header.i=@aliel.fr header.b=V8cYyD9b; arc=none smtp.client-ip=65.21.61.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=aliel.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aliel.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=aliel.fr header.i=@aliel.fr header.b="V8cYyD9b" From: Ronald Claveau DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aliel.fr; s=courrier-s1; t=1775839740; bh=zbgRfmKb31HDgkan9Fy8S+p1BOUmWfaoe9tmTB9hGac=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=V8cYyD9bEpwmmkTC/R7Qz5FjheScvjl8nZ5M8pQ41u89djP5EFMB8CTdxr004BJzm N70SjO/+XSlnZQ5g3u+y70Puhe46UGJWDTDsn99BXyRXS9y4GDpSEYoAF8DSUnrTsJ vTR+2xxzZQKCX9tDDf11eygThjC1pcZepzqs8tOw= Date: Fri, 10 Apr 2026 18:48:09 +0200 Subject: [PATCH 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: <20260410-add-thermal-t7-vim4-v1-8-19f2b8da74d7@aliel.fr> References: <20260410-add-thermal-t7-vim4-v1-0-19f2b8da74d7@aliel.fr> In-Reply-To: <20260410-add-thermal-t7-vim4-v1-0-19f2b8da74d7@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=openssh-sha256; t=1775839732; l=2874; i=linux-kernel-dev@aliel.fr; s=id_ed25519; h=from:subject:message-id; bh=zbgRfmKb31HDgkan9Fy8S+p1BOUmWfaoe9tmTB9hGac=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgMGec55oxeeisqykQiUedekMYyOnR9 BG9E/7rDWyqdNoAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QC2gP6l2ZGwBwfkdmnqHoopj7P0pXQieYHCsQz4S7Isj+ycLZJpj4jxyYI8NLM4ceXReP/Ntm/y vy0wj2kaYsQY= X-Developer-Key: i=linux-kernel-dev@aliel.fr; a=openssh; fpr=SHA256:kch4osYZ6A1BrPps5AUs6KnfdE2wm4ocMtyTc8TmZMs 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 --- .../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