From nobody Mon Jun 15 19:27: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 826601C68F; Mon, 13 Apr 2026 10:56:34 +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=1776077796; cv=none; b=MvMxHVGGuv3Jqd4lE6RMJNlD7c0D7030B44ABhANPScOpb3N4RCNjMQt0Qxh6TptGDS6JcV7xWzLTUImbokhw8+0L/KcUSBykzCFNu1IlGdXNaoyalpMTZjGygaUKxIb1ZBQ7lm4a+JWnBwRXHqQ70B5Z2kgehV3dH6dAiuV7A8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776077796; c=relaxed/simple; bh=4rF5v0oH3zHajGhcO+pdY8F+zBXF1taTiSXYiRiU680=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bOF6Ds4ak2MKgfsgMpnaQFqaCJEi9OfIX57GWYwNmU14EdTo385iOsPKQRQtnzHYsEvs4/OF6fV54ZjEcqU0jM7jDHTA0kBbpQWlBoVz++US9GGhLRKKXEhgXqH7QAH0TC73+DRz0h2W/RUdPMl436cvAj1FwakI3GxbVcgGpb8= 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=rDAM+h6C; 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="rDAM+h6C" From: Ronald Claveau DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aliel.fr; s=courrier-s1; t=1776077792; bh=4rF5v0oH3zHajGhcO+pdY8F+zBXF1taTiSXYiRiU680=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=rDAM+h6CxOhKLlZm3w/dr9qoS6MCuu9J9cdybhcgUfXwU+OCXOfS3OhKRofo4Sb9Q 8DZ3mKdIKEj0kG/lQsgFEYe71Vbw1YHCyMyq+sNao6fB1LJckmjT8ufTIMegl7JnLH /WWYf3b+zwFsU4N4kgnuWgRyP9heDoMVyN7dqKbQ= Date: Mon, 13 Apr 2026 12:52:42 +0200 Subject: [PATCH v2 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: <20260413-add-thermal-t7-vim4-v2-1-1002d90a0602@aliel.fr> References: <20260413-add-thermal-t7-vim4-v2-0-1002d90a0602@aliel.fr> In-Reply-To: <20260413-add-thermal-t7-vim4-v2-0-1002d90a0602@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=1776077789; l=2935; i=linux-kernel-dev@aliel.fr; s=id_ed25519; h=from:subject:message-id; bh=4rF5v0oH3zHajGhcO+pdY8F+zBXF1taTiSXYiRiU680=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgMGec55oxeeisqykQiUedekMYyOnR9 BG9E/7rDWyqdNoAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QEE005bjIEBZUsZ5Fz2BGTRjbXUvqOu0vjSYpQ+sNaSLQOz0OIfmWamV47fF3NnfGQ438XoFROk z20K2YX+Rmwo= 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. 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. Signed-off-by: Ronald Claveau --- .../bindings/thermal/amlogic,thermal.yaml | 42 ++++++++++++++++++= ++-- 1 file changed, 40 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml= b/Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml index 70b273271754b..1c096116b2dda 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,39 @@ 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 + - 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 19:27: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 60C8235E948; Mon, 13 Apr 2026 10:56:35 +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=1776077797; cv=none; b=DNK8oEVJIlinbJjJyS5MbkoA9Vs6Ps7GVSDmOl9BPhXw9uOdhPtkUFPMmJO1EbkCpP6jFpsFftA5dnCU/avtigAQMW/ha/CHIb45IZFRoxVANMZMurTB+sSObvT3c0gzZHLR9eTEGN/ccjF+9iCAgc5QnPT2ffUGAGBqbgdWHoI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776077797; 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=QAHH1wPeIENq4M20w1RHWfKP7wVf0lRD1DXGK00HcjAuFwi7nkCCZkXiKqXz6ec0rOQqa/54PF9ev5w/Lz0p6UHEROqd3ZXiZXekKZOle0NvCjzIrYhSUlAy3m9gMmw0MVtIPbPOiMd7X8Et6gOHJboIOXFKtDmH+NoF0wlNDak= 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=e+Z9NdUl; 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="e+Z9NdUl" From: Ronald Claveau DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aliel.fr; s=courrier-s1; t=1776077793; bh=z46M+rsMVvol/Iu/vuO1m+rAUYrJ82iMmifq0EnDoU0=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=e+Z9NdUlLEKiVA77zXZwO+wgQSPnuIsp3IYC8goGITIA31L6RnZMAnOGJctpVNUsC skp+yMoLhFgAySxCzMe07cYDCZtTbZrcFQFC9HHQipfKVRk3hAdp76EAFwaAMfWBKa xFgTNtCVoQ+eKvwnEbLeUyTuQV2M08wbkK49NWBU= Date: Mon, 13 Apr 2026 12:52:43 +0200 Subject: [PATCH v2 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: <20260413-add-thermal-t7-vim4-v2-2-1002d90a0602@aliel.fr> References: <20260413-add-thermal-t7-vim4-v2-0-1002d90a0602@aliel.fr> In-Reply-To: <20260413-add-thermal-t7-vim4-v2-0-1002d90a0602@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=1776077789; 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 QKl5/Y9C/Phu9TCob/n7ZmcksWMwabTGAuBR/3xovrcEefhi9EiIfhZyxJsTG92CRShfvX6bYao OXJKmyJ+cigU= 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 19:27: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 3C5DB397E64; Mon, 13 Apr 2026 10:56:36 +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=1776077797; cv=none; b=ICb+aOaibE+eInDdzB2zvb1ErQZAzntv+sjjfgFKH0D5V3Xslrv9ETC6+VRAGtzmkk4+wRirS/bxutVpY9StB2xy4VaL8CyLTzNJRXFGIhElio3W1M/E9RD1gQwwu1Q6E3OgztVShbfmJ+z7HJUb9CBvcpmlMDjxzNtlpGWf+Lk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776077797; c=relaxed/simple; bh=QVwXg2rjCHDLPb10isf9/q6yv3hIqKAxTDlkEXCyDmk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MSbgjdWLgAAHBMGLP7UwHYOr4UKJLphRy/PpCMBySK+mJN3kUVKd1DswzuVfZ1CHzZaW3sMdiTGZrcyRVgnqqldN87pEaTDFwyRQwyF1jJ3607b/DT4s244q7Ox6RTwlAExplXOcImE5st69psetTgyG40/vlgNN4ElSMWgzDpw= 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=u8yTL67u; 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="u8yTL67u" From: Ronald Claveau DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aliel.fr; s=courrier-s1; t=1776077794; bh=QVwXg2rjCHDLPb10isf9/q6yv3hIqKAxTDlkEXCyDmk=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=u8yTL67utuyQLS3U5UcVQwP1sKX0xLSrF5yd4Nfbuxk53y+NTo8LDR3yzyrHwe6S/ MsoYzSoQCv60/wbDVl5EYkw+zeXm3ga9PzXzNN71kROZ8mmTXU2a6zBEhZdPdo5dAp gKrl3l/TvZ12L5Jqbt2HNuDdVL1uQZTmuFR6VJaM= Date: Mon, 13 Apr 2026 12:52:44 +0200 Subject: [PATCH v2 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: <20260413-add-thermal-t7-vim4-v2-3-1002d90a0602@aliel.fr> References: <20260413-add-thermal-t7-vim4-v2-0-1002d90a0602@aliel.fr> In-Reply-To: <20260413-add-thermal-t7-vim4-v2-0-1002d90a0602@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=1776077789; l=2173; i=linux-kernel-dev@aliel.fr; s=id_ed25519; h=from:subject:message-id; bh=QVwXg2rjCHDLPb10isf9/q6yv3hIqKAxTDlkEXCyDmk=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgMGec55oxeeisqykQiUedekMYyOnR9 BG9E/7rDWyqdNoAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QKc3Dv3NQvo00Ez9bA6kTFpyqiaQcWU9CIiooPqjwi56UOpWaaxXYMSxUTTXBjHiNEgOwfWQnIp FkahTXaeuSAQ= 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 | 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 Mon Jun 15 19:27: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 0CB213BD62D; Mon, 13 Apr 2026 10:56:37 +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=1776077798; cv=none; b=P2ObehpAnrqg74AFHcGa8iBHtXXs6deTtsogvhiFXI5Fnzyp0tTA8+oVGn5sj02+pOW62qSh1B2O4zz27sBf2Hl9flLqnPUOwSkIXDIyYF+m1g1lHgYFGDvyGfSU/lZu2mFRN9HKyPkoBx0TQ4I7JgSJf3QYpa8nNABYBhLBByo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776077798; c=relaxed/simple; bh=+OPiaJJPEI4198UFVptwbMsLl2t7li0yawHDEA3XDzo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FwdbP2J/D+nVtSWH3bycd6ho1v2uSI7mnmc6UH3/qlahvgM7Qq3RBQjOp82Jj5tXAFiCHSnyk6Dg+AvHrQ466Z6E3e/dlJT+EDHtWvJZJ8/ZkxMU2KSlMz1CKhcZ2zYxRxCYwGPy3yvy7EdiTvH2GWjzxSy6OoAiNJjSEe3NR1c= 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=GHujh2hm; 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="GHujh2hm" From: Ronald Claveau DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aliel.fr; s=courrier-s1; t=1776077795; bh=+OPiaJJPEI4198UFVptwbMsLl2t7li0yawHDEA3XDzo=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=GHujh2hmFVMYidvCxm5fe/yepgdHFU++rbOxhQmDdgU03FbMOTu9qdeeVB6I9fRs0 pUWQhvfXEvnbUrKXarCa7+6LHsJJ3KeTs20OW/NsGKynIQyKEga6OBGmEorPLjDyJA h7HbMaL9XicMo8zskm/UVuaBU5Le1ZKxpeAuyDtI= Date: Mon, 13 Apr 2026 12:52:45 +0200 Subject: [PATCH v2 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: <20260413-add-thermal-t7-vim4-v2-4-1002d90a0602@aliel.fr> References: <20260413-add-thermal-t7-vim4-v2-0-1002d90a0602@aliel.fr> In-Reply-To: <20260413-add-thermal-t7-vim4-v2-0-1002d90a0602@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=1776077790; l=4382; i=linux-kernel-dev@aliel.fr; s=id_ed25519; h=from:subject:message-id; bh=+OPiaJJPEI4198UFVptwbMsLl2t7li0yawHDEA3XDzo=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgMGec55oxeeisqykQiUedekMYyOnR9 BG9E/7rDWyqdNoAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QPwk6IMzZopyLjQ3ncpTCjLo+XSg/DFv9e+fOG+6wUwBWiSii301LkFGbH8Wdnxw1LKUmWclGMb 6xP1ESrMxPQA= 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 19:27: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 5C1E63BF673; Mon, 13 Apr 2026 10:56:38 +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=1776077799; cv=none; b=oIBiwf/TfwIWHpb1+qwIXkMlRvpsRpaXHVA31IATxcvRuTDCj8qEOLOCfrw1h7Bm2711/0PtjhpINI6asg7KvGiFopqGDb8GGo5jk8AvTPt161lUy108QHMO0M1I0dWKvJjXJGULVcy6KSABc5wowrQ8JMuYOVhVwoU1o2ZN+UA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776077799; c=relaxed/simple; bh=WdROqCoECVugDQijrfKUvfX+9RIJRisOOsFej55YKwg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HtgkmvyLvJafpsvKv8lbCNDL2Mu5S4CvERTKcUxHstCwYN2m0V5IwxNd34B6Q0kHnLkAFR4NPTzQI6yHVfg0SeFDPX95+HOHBtIHDNlwHl/cEGGV4mFsAsNtxfYAGrUn60ZUMjjmOEqgu8aSUTpQJrVrjGizs1DeArukRz2iMRc= 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=AS6BkIt5; 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="AS6BkIt5" From: Ronald Claveau DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aliel.fr; s=courrier-s1; t=1776077796; bh=WdROqCoECVugDQijrfKUvfX+9RIJRisOOsFej55YKwg=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=AS6BkIt5uegN1fVBKjr6KsqpNiLOdtVulmcpFNXJgxGLGZ4aYpi/LHoZh3zWGF+oh ZmgcvwwUroIUCO10wepUa7ic01IPsaLvzRhLPi6Ke0VIapcjZwUh3RgiyvhKGRYmUK URFKLpYOyKo9u1ySHGjmvnhMisB96QXzU9jAgpWw= Date: Mon, 13 Apr 2026 12:52:46 +0200 Subject: [PATCH v2 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: <20260413-add-thermal-t7-vim4-v2-5-1002d90a0602@aliel.fr> References: <20260413-add-thermal-t7-vim4-v2-0-1002d90a0602@aliel.fr> In-Reply-To: <20260413-add-thermal-t7-vim4-v2-0-1002d90a0602@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=1776077790; l=2093; i=linux-kernel-dev@aliel.fr; s=id_ed25519; h=from:subject:message-id; bh=WdROqCoECVugDQijrfKUvfX+9RIJRisOOsFej55YKwg=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgMGec55oxeeisqykQiUedekMYyOnR9 BG9E/7rDWyqdNoAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QEaLt8PHHSNy0WGF4+nJ5qBliINe657rDkUCl4G1aECkF0CZSvnYHZDGt6HdDhmhDWxpk+K4qdV pEOvWcVZ5xwA= 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 19:27: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 AFD8E3BF69E; Mon, 13 Apr 2026 10:56:38 +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=1776077800; cv=none; b=uXimRAAwKVC5OhOatqHeV4ICtaxhBWc2zepX8oRKxTxFlbtZlcS5MOCVVks7w1hfWUqO0r4McTTiXK3s73b7cbxCCkn4CSDKpGsRrLifKgFNJbsq3+Plsbp7GGE1nAR+6HVetpVtWPJ51YRLlwHanyZmc+yK2wwSlbR7MpsX/aM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776077800; c=relaxed/simple; bh=qZ6yxPYtU0rtSpNUw/qC8lVKNvJcNRQzOAUadiZgg5o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=aIisAXtVoij2d/hGIhu1sfCWOF1lh3CSFqSBDg57IuciX6P5OCkAcfUwnbPwsb3BkB7L15z0k/ys9UQTwOsoghHXISIobUTuqLfj4L1XuWvJeDzGE3mRWBG0payc8QYdq2F1NxenbdbELVPvH55U/mPZD6sPU8N68Y+LvdlGajQ= 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=PaSZCqo1; 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="PaSZCqo1" From: Ronald Claveau DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aliel.fr; s=courrier-s1; t=1776077797; bh=qZ6yxPYtU0rtSpNUw/qC8lVKNvJcNRQzOAUadiZgg5o=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=PaSZCqo1tE2pOymxSC+Gfs8tW/ffUZvvvueJNk7KUOcCCxCl+qMp0yUa+rp49P7vb IMs9XL/AUpTjZHpkikkGfyZxA48iC7uAqGF0r8a+dtvRSuLLlocnDvSQyzZCcdUksr J4V+7WpIgRGfvDeKjQhKjlg17ExuQkHE+buskrbc= Date: Mon, 13 Apr 2026 12:52:47 +0200 Subject: [PATCH v2 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: <20260413-add-thermal-t7-vim4-v2-6-1002d90a0602@aliel.fr> References: <20260413-add-thermal-t7-vim4-v2-0-1002d90a0602@aliel.fr> In-Reply-To: <20260413-add-thermal-t7-vim4-v2-0-1002d90a0602@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=1776077790; l=3074; i=linux-kernel-dev@aliel.fr; s=id_ed25519; h=from:subject:message-id; bh=qZ6yxPYtU0rtSpNUw/qC8lVKNvJcNRQzOAUadiZgg5o=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgMGec55oxeeisqykQiUedekMYyOnR9 BG9E/7rDWyqdNoAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QGupvvaJ2TG99mzpoQ+rKMO2n7roRSOBoul25RSwNN9D0De8UJ7BTxNj92+VXwyx0iYgQfLiNNY XSGZsVIDY+Qw= 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 19:27: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 952323BD23C; Mon, 13 Apr 2026 10:56:39 +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=1776077801; cv=none; b=etGgBIsI+DXwqL7UaYNRv2NW2vyn63B9yHYM4YJv9hgb5F9O7sT76J8mzjF8lA6M07oWP/uFoPLfR4z/9XGXnjFDHvIKgNdJOksqpTxW9nv2Ns8/xFNd9NKMdtjhGxTqZZOGiZ0oImcH7sLuFUp3Jbp2DfIMet0LpIZPZfQqFp4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776077801; c=relaxed/simple; bh=gXUyoHvrU7UAwF+TcmnCND7Xo2iI5Rna7hPHjxdZqpk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RnpkPEAtp4WIYihYtIOtLWSZXHxi1sbkpsuMQ6Muy1IJdxfsEbbrB1Ukfsp6bXEBS/8phDcDo0bqljzz0MRlBfONcmItyGQnl1hQIkiOkl2z/GptFksHV+Q0qlyfTzf6dX5sc06H3Gb4l/tUCDCXByLTaO0rdFaCyvsUEkaJaYo= 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=WZbSbaA9; 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="WZbSbaA9" From: Ronald Claveau DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aliel.fr; s=courrier-s1; t=1776077798; bh=gXUyoHvrU7UAwF+TcmnCND7Xo2iI5Rna7hPHjxdZqpk=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=WZbSbaA9d6ZaHEO+r68/7f+0Cqzv4xv7meq9VeOfyEEn2Mq833P9df+f9C7HNCit8 cNOpmRPZLfWl3EDZvPe/kwD5dTHS/udSoMQ22/DKEm8FEseDdmYrz5kV3yLBwrI9OJ sgX86wS6yp45jtwmXR6Ow2FZv/clvznXxWP2Kd3s= Date: Mon, 13 Apr 2026 12:52:48 +0200 Subject: [PATCH v2 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: <20260413-add-thermal-t7-vim4-v2-7-1002d90a0602@aliel.fr> References: <20260413-add-thermal-t7-vim4-v2-0-1002d90a0602@aliel.fr> In-Reply-To: <20260413-add-thermal-t7-vim4-v2-0-1002d90a0602@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=1776077790; l=5084; i=linux-kernel-dev@aliel.fr; s=id_ed25519; h=from:subject:message-id; bh=gXUyoHvrU7UAwF+TcmnCND7Xo2iI5Rna7hPHjxdZqpk=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgMGec55oxeeisqykQiUedekMYyOnR9 BG9E/7rDWyqdNoAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QHjXGP1GVQq4SwwZxeI0S2L+HGGnXMAY1YkcjhtFpP1sqRTEuIbYqXqa1US8rpeFRn9uUthGYOU yMJOYxzFkMQ0= 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 19:27: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 93C6E3BE164; Mon, 13 Apr 2026 10:56:40 +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=1776077801; cv=none; b=X7AMJW+k75i3pyIPLI9Gzts2AGxtUdtlmKYWSLCGI75LknFz0UGm964p8mCvin6IEUpW3sx8n5sFJ5kTa/79ieKaJFJIdQ5DBUbzpCMNOn0x40uKMeIMYf/BSdnYzXGqZL9vd8Fn3qD8zcKODg5/G+yDD7bZVYBmQ/AIk+QDTfM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776077801; c=relaxed/simple; bh=zbgRfmKb31HDgkan9Fy8S+p1BOUmWfaoe9tmTB9hGac=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ssMBa1aswLPxgyKDoaXseqvpQBgk3gL7aJwFMtz4EzymKthF4IhbV94YeSWJcrLe+fcGpQaRbqsXpZ6wydcad9l/2PAGFBRcGgtvM1SCzyyrGfCHrolyxREqGyfk4aP1g0O1CdaUFw3KRgBvf8/3GBwiGvpZ7LWGsLB6VNwEZH0= 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=sQmvMCUS; 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="sQmvMCUS" From: Ronald Claveau DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aliel.fr; s=courrier-s1; t=1776077799; bh=zbgRfmKb31HDgkan9Fy8S+p1BOUmWfaoe9tmTB9hGac=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=sQmvMCUSq276NDWZIaAZXluW9oVjSHsLDO8AcIGdOWOgLc8iTPaQ8HZIfNXbpBV6c Cjc504NFB9+iW39jIpf1NduMoVAoACBKO9fzI9DgmxnCpZN5N+IFxqQaQDY6mYskjs m5fmEHEMHpH0bmSpFBYdAGtKdAunZO8ayW2F+z8k= Date: Mon, 13 Apr 2026 12:52:49 +0200 Subject: [PATCH v2 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: <20260413-add-thermal-t7-vim4-v2-8-1002d90a0602@aliel.fr> References: <20260413-add-thermal-t7-vim4-v2-0-1002d90a0602@aliel.fr> In-Reply-To: <20260413-add-thermal-t7-vim4-v2-0-1002d90a0602@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=1776077791; l=2874; i=linux-kernel-dev@aliel.fr; s=id_ed25519; h=from:subject:message-id; bh=zbgRfmKb31HDgkan9Fy8S+p1BOUmWfaoe9tmTB9hGac=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgMGec55oxeeisqykQiUedekMYyOnR9 BG9E/7rDWyqdNoAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QJCVn+qTCfYhdijSA2szasfERHpQ98ZpwWp3CyatIpCwdNiomXtPcIbl3SsLxyXGvdcZFRrYc32 Op0JGbw3B9wM= 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