From nobody Tue Jun 16 20:39:47 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 0CAE839EF39; Tue, 21 Apr 2026 07:20:27 +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=1776756031; cv=none; b=jh2rQNePoYU6Vgho8qJ1bZW5xenkLcFBT3HfokZilNLZpWpnpar29PTcdArIB5A4ObaQltYE3bRs3dlHdvLBBLyd0ISZT3Ns7z0RV5UxnwM1LqMFiFYmnpPaGVhW2Xol5Lve+aJA2yMeAQW1e/SWv26w/cZnUaqOVbktcUVtxNM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776756031; c=relaxed/simple; bh=AmejprhLldM6oZ8f+d8kGaiPXU+JF3BuBfnTDRSpD20=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rmd25+AxK6Ax1G9zAtdPcgEHFgQfHpq5BbtvRZfy3Uj6VQUlbjZLyag5jnxaq3HR1VIKwkgfrSQOQgJE/Y4XloJeLWV3XXO/ZC9i52n0hDXwV2rI7Aoc0ZW6pG6pKPWzhIYl18VD0rTYS4JFCs3a6DcfzSdonRJgrSbTw5M1fcA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=BSO9alBg; arc=none smtp.client-ip=65.21.61.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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="BSO9alBg" From: Ronald Claveau DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aliel.fr; s=courrier-s1; t=1776756026; bh=AmejprhLldM6oZ8f+d8kGaiPXU+JF3BuBfnTDRSpD20=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=BSO9alBg/vwbQ5A+6MAoVfqzNbuY1d4mhx2MS5qDwRHmQPi/fC5EPi819xUzXTPew RPXmMpPmiRJbRh8jLVajlURxdiYxM2pTMykHbuCY/NuMAC+J2KCi6OUS5kj+DfHrps 5kVVL0evBz5SIC/UHSN/eevyd0IjNaGoKaGJSfYk= Date: Tue, 21 Apr 2026 09:19:43 +0200 Subject: [PATCH v3 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: <20260421-add-thermal-t7-vim4-v3-1-a2e7215ed003@aliel.fr> References: <20260421-add-thermal-t7-vim4-v3-0-a2e7215ed003@aliel.fr> In-Reply-To: <20260421-add-thermal-t7-vim4-v3-0-a2e7215ed003@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=1776756022; l=2808; i=linux-kernel-dev@aliel.fr; s=id_ed25519; h=from:subject:message-id; bh=AmejprhLldM6oZ8f+d8kGaiPXU+JF3BuBfnTDRSpD20=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgMGec55oxeeisqykQiUedekMYyOnR9 BG9E/7rDWyqdNoAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QE75Txt22IRPssZjtowuGnQkhVlNuKDNMpbLCRT9IY5Yith9r0cR6GUXJW26+VRQS2RxRRJ48Sx oWMtjCGNuxQw= 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 Acked-by: Conor Dooley --- .../bindings/thermal/amlogic,thermal.yaml | 37 ++++++++++++++++++= ++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml= b/Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml index 70b273271754b..e28612510d679 100644 --- a/Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml +++ b/Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml @@ -21,7 +21,9 @@ properties: - amlogic,g12a-cpu-thermal - amlogic,g12a-ddr-thermal - const: amlogic,g12a-thermal - - const: amlogic,a1-cpu-thermal + - enum: + - amlogic,a1-cpu-thermal + - amlogic,t7-thermal =20 reg: maxItems: 1 @@ -42,12 +44,34 @@ properties: '#thermal-sensor-cells': const: 0 =20 + amlogic,secure-monitor: + description: phandle to the secure monitor + $ref: /schemas/types.yaml#/definitions/phandle-array + items: + - items: + - description: phandle to the secure monitor + - description: sensor index to get specific calibration data + required: - compatible - reg - interrupts - clocks - - amlogic,ao-secure + +allOf: + - if: + properties: + compatible: + contains: + enum: + - amlogic,a1-cpu-thermal + - amlogic,g12a-thermal + then: + required: + - amlogic,ao-secure + else: + required: + - amlogic,secure-monitor =20 unevaluatedProperties: false =20 @@ -62,4 +86,13 @@ examples: #thermal-sensor-cells =3D <0>; amlogic,ao-secure =3D <&sec_AO>; }; + - | + temperature-sensor@20000 { + compatible =3D "amlogic,t7-thermal"; + reg =3D <0x0 0x20000 0x0 0x50>; + interrupts =3D ; + clocks =3D <&clkc_periphs CLKID_TS>; + #thermal-sensor-cells =3D <0>; + amlogic,secure-monitor =3D <&sm 1>; + }; ... --=20 2.49.0 From nobody Tue Jun 16 20:39:47 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 9A55E38F636; Tue, 21 Apr 2026 07:20:28 +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=1776756030; cv=none; b=LnyRslUk1l61DXeVLn442AHTkPGQrphkNTYQM0CDrdX5uCN+W6wbzpppqfRjEMClPX7B3VibHhkdKeNxO40CC3N+ldtnjSrsjaZ1xo5ivmGaDjhDc2RkcwJiOeG5/8e9O6ZysVkVAIbP3ZJvrw2aUyYMv4clMGVnoiqTMNb7x+M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776756030; 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=WP3OshepbTvfdOZ8hS67qAL8brmam89o1d9Ph4CXwi+zppWd6bvbkUvbyT9AZtvwl9iHmJEJq7q8oZrIVypKndzojdKZ7i/M2Opq9hIp+f2Y3y+urH4w+tHZZjS0WLli+5c2tNhHH3VU7kJ9vCtlHB19khdlCDk99tjcrp5zCMU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=t8AHtK2E; arc=none smtp.client-ip=65.21.61.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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="t8AHtK2E" From: Ronald Claveau DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aliel.fr; s=courrier-s1; t=1776756027; bh=z46M+rsMVvol/Iu/vuO1m+rAUYrJ82iMmifq0EnDoU0=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=t8AHtK2EX9i/gzkqXxw7p+QJzt8P7+yqCZ44d1i+mxpXkXTSmbAKfURFl3/Em9qbf a/9mk0HzM/cOxYFs1kO6xOYx6WqV/U15h7/6y3C0OaFaAFvFPcLEGldOicvJTf+8sl udiOfxhVQbCLOeaADLkH8ztmxYOh6bOg6cvnZtUw= Date: Tue, 21 Apr 2026 09:19:44 +0200 Subject: [PATCH v3 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: <20260421-add-thermal-t7-vim4-v3-2-a2e7215ed003@aliel.fr> References: <20260421-add-thermal-t7-vim4-v3-0-a2e7215ed003@aliel.fr> In-Reply-To: <20260421-add-thermal-t7-vim4-v3-0-a2e7215ed003@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=1776756022; 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 QJKNx7kRUJdcW4jCyJRZPCiAu14rzIQw/X9FaYOtCVn/CYs+zGp/yhA5iWu9agts209keDEPtKF DxHswTIu0qwE= 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 Tue Jun 16 20:39:47 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 8149E35C18C; Tue, 21 Apr 2026 07:20:29 +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=1776756031; cv=none; b=ZL9KYQN5lYossJxWWub4iqJlF5yIwvHUJn1EvSzUMVjKGJTr66hQ9AlqXkcmvIKZSApmaUu0RhI8C2KVAEMErudgAAy3Ps7Trswf3Y+D/EJw3JI4QNBO42vXVmTOw7CzHts51E1m2tKF9/FGDZXzrXCx9coz8MzdREA6dd/DlCE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776756031; c=relaxed/simple; bh=QVwXg2rjCHDLPb10isf9/q6yv3hIqKAxTDlkEXCyDmk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ahceb8vNk2mkQcPgAyuAHLmAxgNPCLIhetJhVZVSmneXA+6h1nE65G5JCbpZ7tLDs60ZvWfDDNyN020oOX5rxcVAYywTilLyQu0yyWrTY3EPYoXfbEudhWiH9LWkQcL64VqhStRLd+NTovj/dD/rnAM54msp8IJfSoyahYd0KYc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=bYrz4pBX; arc=none smtp.client-ip=65.21.61.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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="bYrz4pBX" From: Ronald Claveau DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aliel.fr; s=courrier-s1; t=1776756028; bh=QVwXg2rjCHDLPb10isf9/q6yv3hIqKAxTDlkEXCyDmk=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=bYrz4pBXpxRjAhjmybXDP0vXtXs6gMCuXotxaQfkG0trIW30oPYdd526016yHy7Sv NuQo2DBgni3thFcyOZ90iDGqJSNajcF/CYnD7egPDpY0bHAVmMlYOTkUB3aSmwIEhb gmEbypZvezlt7zFi9mUt09Dr2UFkFewdesZ1BOzY= Date: Tue, 21 Apr 2026 09:19:45 +0200 Subject: [PATCH v3 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: <20260421-add-thermal-t7-vim4-v3-3-a2e7215ed003@aliel.fr> References: <20260421-add-thermal-t7-vim4-v3-0-a2e7215ed003@aliel.fr> In-Reply-To: <20260421-add-thermal-t7-vim4-v3-0-a2e7215ed003@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=1776756023; l=2173; i=linux-kernel-dev@aliel.fr; s=id_ed25519; h=from:subject:message-id; bh=QVwXg2rjCHDLPb10isf9/q6yv3hIqKAxTDlkEXCyDmk=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgMGec55oxeeisqykQiUedekMYyOnR9 BG9E/7rDWyqdNoAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QImkxPxX0+BT1xAnZ0BrNzFKZdGiTw0b2KgOL333+7QF7i63jpAfOedT8PIzA9qW/Fl0VuQYU29 IAhmLmwVdkg8= 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 Tue Jun 16 20:39:47 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 7CA0438F949; Tue, 21 Apr 2026 07:20:30 +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=1776756032; cv=none; b=jFSmtIn6WegqjWaCdIkUvzh5G/zODjR5Qbv6VULhG5wurN1mY5ppFGKkENMek8mQlS1Yb8X0iFlqUQ8LxweUBMwkNlNWHUOlQiI0ChDDv06Gu8gzYOb5qNb9uI0ZqdQPUDnyvDE4c7Y6Nu5qfFlWOBLfpAusLgvH6IJ/o/ETbUE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776756032; c=relaxed/simple; bh=+OPiaJJPEI4198UFVptwbMsLl2t7li0yawHDEA3XDzo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QkRrXkxyV5DSLdPwGCJ+FaBl0ymX3rRzsAWessKjgDTUhSmzPSwcmftxfOO5Z73L0JSgchz+JDqdiWF78uUV/0FWuAWTSp60s2cniBCV1M8suKjF04nZjyt7hJLMF64lzEYEoWdSEjXmOEMfvBCxxGNmypL1gtNB2CtB032rRl8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=BUiA4cyL; arc=none smtp.client-ip=65.21.61.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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="BUiA4cyL" From: Ronald Claveau DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aliel.fr; s=courrier-s1; t=1776756028; bh=+OPiaJJPEI4198UFVptwbMsLl2t7li0yawHDEA3XDzo=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=BUiA4cyLV5JH+ZcTO4oMpVxRc//ZqQlaBE6oxfrBC6QrhqIgXGvZnB6kHYg4qFli9 yiNC6/ZNvwAwIhC7bH0Ks3ZoNqgmdkrqVk6fXxU2WuH1+Ee0S4OmCTKLqK3A+drHsA +ILwwV/mKvS8iVeW+/hNtIhNRtFVw5tPQsb3k96I= Date: Tue, 21 Apr 2026 09:19:46 +0200 Subject: [PATCH v3 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: <20260421-add-thermal-t7-vim4-v3-4-a2e7215ed003@aliel.fr> References: <20260421-add-thermal-t7-vim4-v3-0-a2e7215ed003@aliel.fr> In-Reply-To: <20260421-add-thermal-t7-vim4-v3-0-a2e7215ed003@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=1776756023; l=4382; i=linux-kernel-dev@aliel.fr; s=id_ed25519; h=from:subject:message-id; bh=+OPiaJJPEI4198UFVptwbMsLl2t7li0yawHDEA3XDzo=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgMGec55oxeeisqykQiUedekMYyOnR9 BG9E/7rDWyqdNoAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QNoBMoSWvVWsCyLCd1eEWvZ1jgQJpmPRJy+mxKgaG9hWR67FeO2pV71cL+j8+JVS+T5l+dDXtU2 2R84MvXh0cAA= 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 Tue Jun 16 20:39:47 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 298F33A5E73; Tue, 21 Apr 2026 07:20:31 +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=1776756033; cv=none; b=NPar5ByN1Wk0o5tZhrbQqCblUQGyTSXPlzX2V1VhuHSn4BPs7M6akb+1e0LaKpTHafPlX09oZc0trnyjp1C/8mTDyYP/CBcXEThqt0sdeGzWq9SR5i+BZyWf/IjD02jzPfWhVZbuVmdX6oj8ptUM/xGAjA2omgLgzvOxAbzURds= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776756033; c=relaxed/simple; bh=WdROqCoECVugDQijrfKUvfX+9RIJRisOOsFej55YKwg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=VhvTjaCdvtYe8a3HfTfoAGgWsE5O9TbaLhx46IvWgJc1FVAk5jugSqtYT30A9KmHZBBA1Tv+qJB773HpfIWanjLfizT6WyVnimpbtrI8BIXjsh//Q9WuMWY3ZthBeyaq8h7u61/9pqE1S23wah6avZhMqLHG6tk7hYbCYQjeWpc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=C2kYRXjx; arc=none smtp.client-ip=65.21.61.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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="C2kYRXjx" From: Ronald Claveau DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aliel.fr; s=courrier-s1; t=1776756029; bh=WdROqCoECVugDQijrfKUvfX+9RIJRisOOsFej55YKwg=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=C2kYRXjx6wHCwCToT4z7uGsPWoFJg2CB71X3pZuwdAg05An3vy66NBOOX+e+N0BfH ESnYQm7BOyACU9s0Aw5Wcz/1MnTy433auKFxj18HJ+wqn3+2NHJpcyfILe+YmFBxph ZrH3nXIqlvfPOqO2UWORV3nBscUR8px/Exwz0hVU= Date: Tue, 21 Apr 2026 09:19:47 +0200 Subject: [PATCH v3 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: <20260421-add-thermal-t7-vim4-v3-5-a2e7215ed003@aliel.fr> References: <20260421-add-thermal-t7-vim4-v3-0-a2e7215ed003@aliel.fr> In-Reply-To: <20260421-add-thermal-t7-vim4-v3-0-a2e7215ed003@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=1776756023; l=2093; i=linux-kernel-dev@aliel.fr; s=id_ed25519; h=from:subject:message-id; bh=WdROqCoECVugDQijrfKUvfX+9RIJRisOOsFej55YKwg=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgMGec55oxeeisqykQiUedekMYyOnR9 BG9E/7rDWyqdNoAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QG/xLpnE536q2Jd8UJHJxn6bepNeVu5IniFHpBRNzgO0skb/54ejibzGCyP4X5+0iyPzCTXgHra Pie/9EBeWBgY= 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 Tue Jun 16 20:39:47 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 164463A5E6D; Tue, 21 Apr 2026 07:20:32 +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=1776756033; cv=none; b=VzbSArNodiO+0RIvLdH5LpVobYaJz1rVlc2k+zPijOfNYYy3I1ZfYq8xqPJHu9yyAIYnmy3Syjo+eR2UKRJz65CjfCdgmncQcgpv5CVzlRXhvKrVcXIFBAr7zhZEZXCh2Ip0umdnup4cI+oCipxKj6Bo41pwhp9DgnnUiKKpnKo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776756033; c=relaxed/simple; bh=qZ6yxPYtU0rtSpNUw/qC8lVKNvJcNRQzOAUadiZgg5o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tiUoJ96V3iZZmeckcYduP50/YGedgGVXu/1C+MYD67UgiyydhjxsBPtygYQbWBJEPSv1NxMwCI6AZMXtvgcfyD0vWvxknsiYv1vH81OufZbVvbBd/DB51XZgPCQlGMHkI1T+F0WzZPbKVFGhm1+vR+XQm9KnNeikp8D9eoKxt80= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=dJyrSO23; arc=none smtp.client-ip=65.21.61.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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="dJyrSO23" From: Ronald Claveau DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aliel.fr; s=courrier-s1; t=1776756030; bh=qZ6yxPYtU0rtSpNUw/qC8lVKNvJcNRQzOAUadiZgg5o=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=dJyrSO23yAUk7Hlt2DFIniZkT7/cYXgIbNp+XrGslShDo2dlBhSMwEeS6Um7J5+H7 h6bdEMdGr94Q7p5V0VSt6ynO19Yb1qsMHwyGn85cHlcsGVPLCNmYqNqY3s+rtDx2mf j94UpVBL2cy0xJSvbij7ODoOUOZBy7x2BOeIgLnQ= Date: Tue, 21 Apr 2026 09:19:48 +0200 Subject: [PATCH v3 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: <20260421-add-thermal-t7-vim4-v3-6-a2e7215ed003@aliel.fr> References: <20260421-add-thermal-t7-vim4-v3-0-a2e7215ed003@aliel.fr> In-Reply-To: <20260421-add-thermal-t7-vim4-v3-0-a2e7215ed003@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=1776756023; l=3074; i=linux-kernel-dev@aliel.fr; s=id_ed25519; h=from:subject:message-id; bh=qZ6yxPYtU0rtSpNUw/qC8lVKNvJcNRQzOAUadiZgg5o=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgMGec55oxeeisqykQiUedekMYyOnR9 BG9E/7rDWyqdNoAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QBEPHIysLPZi3PtoEvvR9e0DZmiK74Fp0YMFXp7hSdVK/bTIxAdizcBPFwVmH0kRlkHvGABAN6/ BJTk2D4G0SA4= 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 Tue Jun 16 20:39:47 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 E17023A63FB; Tue, 21 Apr 2026 07:20:32 +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=1776756034; cv=none; b=mmviRaBkgFPV54YQPyyhfTDkVj+N/3AJeqUUmvrEN7WdJ1AlmiqOU4fXwj9sXPdqbXJYo2JX1Xcdhy5rnCATChvdg2nre+HiAk0i027udHn25PSETHYj2j+0zvhQHCYJTdCdU/Ysy1q1OKC9VCc2lP9mVfnXigvi11I/1l7L1Oc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776756034; c=relaxed/simple; bh=gXUyoHvrU7UAwF+TcmnCND7Xo2iI5Rna7hPHjxdZqpk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=mYZU2EDqgXXm1a4o1sOXBpdL7G+nfzof1b6kZld5eHtV1YhrGdMGv4c0hSHHIQlIy4W302E+MntspD3sFgxAYPWYcYdzcmLyS9RWSlHiSGWk3rrH1k/qdc3ei20f3TuN4ERq5zzCm/Zg0z+EO1MZ73meH2OYVTqW12buRo3aR8s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=Nbbn12k6; arc=none smtp.client-ip=65.21.61.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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="Nbbn12k6" From: Ronald Claveau DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aliel.fr; s=courrier-s1; t=1776756031; bh=gXUyoHvrU7UAwF+TcmnCND7Xo2iI5Rna7hPHjxdZqpk=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=Nbbn12k63JNruu171FiGS4O/qBDQQFtUML9O/LrY57h2kLForQkUCFHLthzemD1VQ lAbmuLTp/T613ZBW/r1sfVbWzPSNzc2eCMoGN96IZMiJVvNTscvgQ51Bf9VrQGoy+x s4k3VFDCPMwjHwzcvdtL2Fline2DZG6XYPJWb3GU= Date: Tue, 21 Apr 2026 09:19:49 +0200 Subject: [PATCH v3 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: <20260421-add-thermal-t7-vim4-v3-7-a2e7215ed003@aliel.fr> References: <20260421-add-thermal-t7-vim4-v3-0-a2e7215ed003@aliel.fr> In-Reply-To: <20260421-add-thermal-t7-vim4-v3-0-a2e7215ed003@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=1776756024; l=5084; i=linux-kernel-dev@aliel.fr; s=id_ed25519; h=from:subject:message-id; bh=gXUyoHvrU7UAwF+TcmnCND7Xo2iI5Rna7hPHjxdZqpk=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgMGec55oxeeisqykQiUedekMYyOnR9 BG9E/7rDWyqdNoAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QM47v1wszwrAAIsSPK5uCnDc545PQSmNexZZEQD9de+D3eGv6BswyU1IRrpHNX+7ipotgG+ekm/ O89vLZH9ZUwA= 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 Tue Jun 16 20:39:47 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 D39B73A6B71; Tue, 21 Apr 2026 07:20:33 +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=1776756035; cv=none; b=HQwk/TXutgDVH2IV/TtUgVrg/5phNfT568Xops18mE1zksiPGKG01WI5xeptU4ZOUKXm4Ww3jm0z1Tr5axavhbfqwbFKhqUFTWE28w/PzZ8l/gxC/jkYi1ryuJesiE24LQrSO1m3Elx7Fu8BMn/kKKOyKjvVaGVkqEq5oLSw/m8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776756035; c=relaxed/simple; bh=zbgRfmKb31HDgkan9Fy8S+p1BOUmWfaoe9tmTB9hGac=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YmCkupmY54iyR6q8Ay+7sRzLMZUqdHaqPY6am3uDBFbbKqUXdc+XUvEkE9ESUAOnDr15qs3LE60gsklxhVUZyAY02CDwyVVPIUtsolRUMdXm7Vi4f2+OiyKqulD8Yfz31wV3MdUZCsxzdvEkSiUb54xvh2QyC0ngkVhl5LRxqG4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=uygkk2Et; arc=none smtp.client-ip=65.21.61.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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="uygkk2Et" From: Ronald Claveau DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=aliel.fr; s=courrier-s1; t=1776756032; bh=zbgRfmKb31HDgkan9Fy8S+p1BOUmWfaoe9tmTB9hGac=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=uygkk2EtdmfhzVT3+789ag2/JVQq1lEmx5yBezGZSWxLc36V4YN+iiqMnZyFBd6mp 8P5O5qBW5dkj8+CwyW07evLebn0+Qd9KHFkYAKQA/dC4aLjDtn/pYqEQK9PTq9d3XA cCfUzpp3E8w3HA7/00wIQlxrBgXJjGmAQrD6L0GM= Date: Tue, 21 Apr 2026 09:19:50 +0200 Subject: [PATCH v3 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: <20260421-add-thermal-t7-vim4-v3-8-a2e7215ed003@aliel.fr> References: <20260421-add-thermal-t7-vim4-v3-0-a2e7215ed003@aliel.fr> In-Reply-To: <20260421-add-thermal-t7-vim4-v3-0-a2e7215ed003@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=1776756024; l=2874; i=linux-kernel-dev@aliel.fr; s=id_ed25519; h=from:subject:message-id; bh=zbgRfmKb31HDgkan9Fy8S+p1BOUmWfaoe9tmTB9hGac=; b=U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgMGec55oxeeisqykQiUedekMYyOnR9 BG9E/7rDWyqdNoAAAAGcGF0YXR0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5AAAA QN4/E0s7WbZdPSpM0peJA+qrRW42bBl7baU+STKvFE8bJDm+AXaM6vUs8u8XnD43UqI8Q7hvTj1 RzKDl0Dfz8gY= 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