From nobody Mon Jun 15 13:57:38 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 33EE4332EBD; Fri, 24 Apr 2026 15:47:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777045656; cv=none; b=ibaVWhIfF/42yEcI8sj7r9py5Gg0KoyHnyLx+/iRgZUZPabHIy3PAtEVQKqcuvKlyAOuNuPRPl7ga5k8LNnvItdArp8JhdMXZQmRgM7qF9+D9lgQx5twww+ivrtIojx8cfkyaWYlU9WWNQbMH5+QbpO0SxsT2JKxi0vozqbjIFU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777045656; c=relaxed/simple; bh=wXjL0/ZjPWYklzHHsG/fnHIawjJ0r03LA6jLikwVGTc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qgzBzfxdWRRbC+RTlxb3m9aTU3YiqivvJUvP3fntuGHSjYg+R6V6t2Pi0YGkLXCQg8nHVJavQb2ECx4wpHGA5X+8jEw6c5dGDOfto0a/kt8sRNy6MBU0KfCfKRAv1mdd0UlqigAA9svF540UyG9xEvYUtCJTbCeKKHtYuagt7j4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=N2uqHI6g; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="N2uqHI6g" Received: by smtp.kernel.org (Postfix) with ESMTPS id E0606C2BCB2; Fri, 24 Apr 2026 15:47:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777045656; bh=wXjL0/ZjPWYklzHHsG/fnHIawjJ0r03LA6jLikwVGTc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=N2uqHI6g2nccCrhKt4U1q2AWsmt/Q/pSpOadWj8Sj0WRLETWGzqzmGv18LwQzklub HGJg+fq2jO2+XflrFnuqk5x1xz7QMC/E64aBP3wFZQ6Uy/KQb+Sa+uXWAxaGRb5MFb 4F7IyjDp0jvn3LkZLfG9ZzHZg/bIiIuB2zW652CxL0cEVf56s2t73qM4t6IMw1KOfN 9nM2Mb2Q4h8OgXEVMZvJrWhLXLW9RbjUrhA3F3EOQN2BL1BHQBnY995gLYQJNDK44J fS9EKrCbeFuz58cVtoONNlhIDQ0fQgHixakie71JGMLHOmN60EIy6txu+fZIcxPSPO zEl4XdhXadEnA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCF5BFED3E6; Fri, 24 Apr 2026 15:47:35 +0000 (UTC) From: Ronald Claveau via B4 Relay Date: Fri, 24 Apr 2026 17:45:09 +0200 Subject: [PATCH v5 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: <20260424-add-thermal-t7-vim4-v5-1-9040ca36afe2@aliel.fr> References: <20260424-add-thermal-t7-vim4-v5-0-9040ca36afe2@aliel.fr> In-Reply-To: <20260424-add-thermal-t7-vim4-v5-0-9040ca36afe2@aliel.fr> To: Guillaume La Roque , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: linux-pm@vger.kernel.org, linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ronald Claveau , Conor Dooley X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2861; i=linux-kernel-dev@aliel.fr; h=from:subject:message-id; bh=42FjYfnK8gHAQIf5ZxFekEMwi0ysWDknaNuX/++vGok=; b=owGbwMvMwCWm1SvKXP3cUInxtFoSQ+brCZ0S+09pl0+8nh7FM3H7wwkN88P058d8uWsZ8Uy23 mDtd7GyjlIWBjEuBlkxRZb+uZYn3l0+eubrHvUUmDmsTCBDGLg4BWAicr8ZGd5/+cPbqaz9WXj6 q6Sc/LNi7/6+LrQMuL7bctbWUyfO3FjCyLDi+tenLzxMl3DO2eRnPk/bfZH4P36vX5ycM2OenHm 0mJsTAA== X-Developer-Key: i=linux-kernel-dev@aliel.fr; a=openpgp; fpr=DFD863F61375BF917F0012173953305EF1D0EC3E X-Endpoint-Received: by B4 Relay for linux-kernel-dev@aliel.fr/default with auth_id=744 X-Original-From: Ronald Claveau Reply-To: linux-kernel-dev@aliel.fr From: Ronald Claveau Add the amlogic,t7-thermal compatible for the Amlogic T7 thermal sensor. Unlike existing variants which use a phandle to the ao-secure syscon, the T7 relies on a secure monitor interface described by a phandle and a sensor index argument. The T7 integrates multiple thermal sensors, all accessed through the same SMC call. The sensor index argument is required to identify which sensor's calibration data the secure monitor should return, as a single SM_THERMAL_CALIB_READ command serves all of them. Introduce the amlogic,secure-monitor property as a phandle-array and make amlogic,ao-secure or amlogic,secure-monitor conditionally required depending on the compatible. Acked-by: Conor Dooley Signed-off-by: Ronald Claveau --- .../bindings/thermal/amlogic,thermal.yaml | 37 ++++++++++++++++++= ++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml= b/Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml index 70b273271754b..e28612510d679 100644 --- a/Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml +++ b/Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml @@ -21,7 +21,9 @@ properties: - amlogic,g12a-cpu-thermal - amlogic,g12a-ddr-thermal - const: amlogic,g12a-thermal - - const: amlogic,a1-cpu-thermal + - enum: + - amlogic,a1-cpu-thermal + - amlogic,t7-thermal =20 reg: maxItems: 1 @@ -42,12 +44,34 @@ properties: '#thermal-sensor-cells': const: 0 =20 + amlogic,secure-monitor: + description: phandle to the secure monitor + $ref: /schemas/types.yaml#/definitions/phandle-array + items: + - items: + - description: phandle to the secure monitor + - description: sensor index to get specific calibration data + required: - compatible - reg - interrupts - clocks - - amlogic,ao-secure + +allOf: + - if: + properties: + compatible: + contains: + enum: + - amlogic,a1-cpu-thermal + - amlogic,g12a-thermal + then: + required: + - amlogic,ao-secure + else: + required: + - amlogic,secure-monitor =20 unevaluatedProperties: false =20 @@ -62,4 +86,13 @@ examples: #thermal-sensor-cells =3D <0>; amlogic,ao-secure =3D <&sec_AO>; }; + - | + temperature-sensor@20000 { + compatible =3D "amlogic,t7-thermal"; + reg =3D <0x0 0x20000 0x0 0x50>; + interrupts =3D ; + clocks =3D <&clkc_periphs CLKID_TS>; + #thermal-sensor-cells =3D <0>; + amlogic,secure-monitor =3D <&sm 1>; + }; ... --=20 2.49.0 From nobody Mon Jun 15 13:57:38 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 33DD11A2545; Fri, 24 Apr 2026 15:47:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777045656; cv=none; b=K4jtna+9SHdgGGnyaLYh9wG9nLQ9xc8ovyKPzEe+k8dMr+NeAMO83ZRt7oLa8hbXN7e/6YejzFYUkAWosjSbhqLupgMjUioPl8IW/QWqo5WuZUMgQJrUAO6pZXr9+b74SDrIAWM4wx9eTuIEdMmjwGjL/GpXHZi7L5/aIs7JmJ4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777045656; c=relaxed/simple; bh=cMGDrFg61aGwyz734Xgs5gOHCfTOozPvglCuCWWc0fI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Etv9RNlihrvoXTW73KERuzvtRhveRnjG7Po8nZUZp1GU9oocVyRpQ52Q8D85aRijRLxtNyQfOk28a8vjfOOCHY9s4LtBSbAP7sSGUDXx2XUZaDMQsL1WKp4h1FYe143y2qv9elEUiFMI7CFT6fq+nLCWIOF6wuuczHsvxToZVes= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ByCrqxx6; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ByCrqxx6" Received: by smtp.kernel.org (Postfix) with ESMTPS id F0129C2BCB8; Fri, 24 Apr 2026 15:47:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777045656; bh=cMGDrFg61aGwyz734Xgs5gOHCfTOozPvglCuCWWc0fI=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=ByCrqxx6kY/Vv/bdtP4v3zMgk4MUmk0DbJYXTkzwTdnnl/jDhWWlWIr4tC0NE3kSY ilqtNJoml0hrWQdTs8TJAhnF0AbjZeWwhhIjq21Owm8/lWb18jKlJdQcS0WL/+wApw 38k7rSo+AE7h7bo7BZBN1wMGImsAIOOL0urfqI93McwQMtpKHH3+3jv9Y7/o+GbIzk Fkvp3TpAmOG3xyFpAw4rB8sOmNby8HF8hAsm5hS1Gy1uuGi+VSygcVy1nDfhpB+EAR lbcyobxCAqPvGFanmiugQXU767V1oqHHeHOTzlweMBZPGbwOY8bABtXkvT6D67DzuG rCSzBlr+PqPfw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDC20FED3EC; Fri, 24 Apr 2026 15:47:35 +0000 (UTC) From: Ronald Claveau via B4 Relay Date: Fri, 24 Apr 2026 17:45:10 +0200 Subject: [PATCH v5 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: <20260424-add-thermal-t7-vim4-v5-2-9040ca36afe2@aliel.fr> References: <20260424-add-thermal-t7-vim4-v5-0-9040ca36afe2@aliel.fr> In-Reply-To: <20260424-add-thermal-t7-vim4-v5-0-9040ca36afe2@aliel.fr> To: Guillaume La Roque , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: linux-pm@vger.kernel.org, linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ronald Claveau X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1234; i=linux-kernel-dev@aliel.fr; h=from:subject:message-id; bh=X3csRgyz9ieRxPvJL2SoBHgakr7+scAeWEibnYe+kXA=; b=owGbwMvMwCWm1SvKXP3cUInxtFoSQ+brCd0fZNZwi+q8dzZhOtRy/DJ7qPfOIAen++aXVtccL FX+lHy3o5SFQYyLQVZMkaV/ruWJd5ePnvm6Rz0FZg4rE8gQBi5OAZiI12mG/zXpt8/u22VZKr5b 8rexQyjDv+62Z1U57G06y8QvcBlLsDAyzFIqWfPjzYvw53d/7uSqeHuXb5f1pLotq9muvjFmdJm TzAYA X-Developer-Key: i=linux-kernel-dev@aliel.fr; a=openpgp; fpr=DFD863F61375BF917F0012173953305EF1D0EC3E X-Endpoint-Received: by B4 Relay for linux-kernel-dev@aliel.fr/default with auth_id=744 X-Original-From: Ronald Claveau Reply-To: linux-kernel-dev@aliel.fr From: Ronald Claveau Add SM_THERMAL_CALIB_READ to the secure monitor command enum and introduce meson_sm_get_thermal_calib() to allow drivers to retrieve thermal sensor calibration data through the firmware interface. Reviewed-by: Neil Armstrong Signed-off-by: Ronald Claveau --- include/linux/firmware/meson/meson_sm.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/firmware/meson/meson_sm.h b/include/linux/firmwa= re/meson/meson_sm.h index 8eaf8922ab020..3ebc2bd9a9760 100644 --- a/include/linux/firmware/meson/meson_sm.h +++ b/include/linux/firmware/meson/meson_sm.h @@ -12,6 +12,7 @@ enum { SM_EFUSE_WRITE, SM_EFUSE_USER_MAX, SM_GET_CHIP_ID, + SM_THERMAL_CALIB_READ, SM_A1_PWRC_SET, SM_A1_PWRC_GET, }; @@ -27,5 +28,7 @@ int meson_sm_call_read(struct meson_sm_firmware *fw, void= *buffer, unsigned int bsize, unsigned int cmd_index, u32 arg0, u32 arg1, u32 arg2, u32 arg3, u32 arg4); struct meson_sm_firmware *meson_sm_get(struct device_node *firmware_node); +int meson_sm_get_thermal_calib(struct meson_sm_firmware *fw, u32 *trim_inf= o, + u32 tsensor_id); =20 #endif /* _MESON_SM_FW_H_ */ --=20 2.49.0 From nobody Mon Jun 15 13:57:38 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 33E5E331A41; Fri, 24 Apr 2026 15:47:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777045656; cv=none; b=Vrt1RT62uwl7R0NUntbX/tbdouF/udaUrxL6pY7VL1eneXK3eTl9i2hPWOflbDirJTXhBPdRwYtKixePXfPCMEE22nrYJQg4xd/OqiQef54RaORuEqW/KrY2icnzcI7nJBSUTUZnOIDGBRfe7oT2PwpwjJCdkLQXSPOmsNWQUKA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777045656; c=relaxed/simple; bh=pPT6y+8yDPk/GQWT/vdcn7MpQPzpLNFYEE57p+hOukM=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ae/yxszJSj+paL7lVmjRblYHbyUAbbsapre8GyeaVmCHcc0JILzuXh4ukwD9t6V/shpuRd7Yhkxzbw6lTfFwREfWkLunpPLvpW4zlH58ZiIlNSOTN/DK9TulAeNUO3iPbUOe+dzx9kTJz2y7uWu2Tn3lcEf221MrU00gKdp7dmQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=s1aHISig; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="s1aHISig" Received: by smtp.kernel.org (Postfix) with ESMTPS id 04C28C2BCB5; Fri, 24 Apr 2026 15:47:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777045656; bh=pPT6y+8yDPk/GQWT/vdcn7MpQPzpLNFYEE57p+hOukM=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=s1aHISigFggsjfoyCnx37nWoDwIVBc1j7TebZVO6k8YgUJ3QlF6dO6gQAXnNBG0OW owHjme2YWGUt7KvLbDtiaEhuDB+qntQReflVn1N1VLfPtpL4bQ8Tkfx5OAqer1rzHe +ZL67/nHgUkd6/Al7JRpKN/1UKhGMLGZzz3LZoy3samPIzGOZc6hgqKWGNUvNQaaVe Xkz2yfnWvGAzuMpAWPDeLoIlelWxiYjFOlRuJsDhl3ZCScFuLXpN6fuzmiIE7xOXvd nsQg9xjn7C7dhISIngiopQRFILSmJOI+T5Jg4PLpe6aejbR+SwmK3hj6M32oC8xGmE vuPu0YknMCYHg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDE69FED3D7; Fri, 24 Apr 2026 15:47:35 +0000 (UTC) From: Ronald Claveau via B4 Relay Date: Fri, 24 Apr 2026 17:45:11 +0200 Subject: [PATCH v5 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: <20260424-add-thermal-t7-vim4-v5-3-9040ca36afe2@aliel.fr> References: <20260424-add-thermal-t7-vim4-v5-0-9040ca36afe2@aliel.fr> In-Reply-To: <20260424-add-thermal-t7-vim4-v5-0-9040ca36afe2@aliel.fr> To: Guillaume La Roque , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: linux-pm@vger.kernel.org, linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ronald Claveau X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2230; i=linux-kernel-dev@aliel.fr; h=from:subject:message-id; bh=RboCfSHgRjly95YryQzSIFxNo4U3Gmip5nVqLI2kBVY=; b=owGbwMvMwCWm1SvKXP3cUInxtFoSQ+brCb39+xXWvBRoN724JWn9M+Yq+1T7lPQCKa7zpWYac orZ7zd2lLIwiHExyIopsvTPtTzx7vLRM1/3qKfAzGFlAhnCwMUpABMxOMnI8HiaCpPSvq5FhXwO /kbKTcIHwtxPhxQkC1dmSO3gerJvKiPDEimXlqdSP2qnufzbvTYg4uvq6DkbebYv3MXGJbRs7o9 OJgA= X-Developer-Key: i=linux-kernel-dev@aliel.fr; a=openpgp; fpr=DFD863F61375BF917F0012173953305EF1D0EC3E X-Endpoint-Received: by B4 Relay for linux-kernel-dev@aliel.fr/default with auth_id=744 X-Original-From: Ronald Claveau Reply-To: linux-kernel-dev@aliel.fr From: Ronald Claveau Add SM_THERMAL_CALIB_READ at SMC ID 0x82000047 in the command table and implement meson_sm_get_thermal_calib(), which forwards the tsensor_id argument to the secure monitor and returns the calibration data. Also realign the CMD() column to improve readability. Reviewed-by: Neil Armstrong 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 13:57:38 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F3B3335562; Fri, 24 Apr 2026 15:47:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777045656; cv=none; b=fkXSplgQAyqspsdlE3V8EzYZtxJkMeLTYtQvKSB82+9BUFJyywAinwy8DJ3JaptFiwB+BdRQXOFctpexWFHCXL0Ew/jkXLL+edzhYU370Eb5GxXYcH8IQDywyLSWAkrAXsJrMkerj6wPoFK8BvBiiWR0cS2MNOkYtuEWm/iGq3c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777045656; c=relaxed/simple; bh=II6YdxRKDLVvfEJMB7LL7pb5QlDG5XuxaMUHkvuWk6k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pH8kHcMHznT6leMrwccGS10v+BMsMZL+0v75MncIhvofbMPR03JsfmKbTZbPgJuiLSKa5TLmDOIb3X1T3ZsPnLC/qAGEyhd10MGBEW1EidFwbyjTfvFpP9a7Sl4CX1GflxbYoLleiW8xK5FTuiRy146UKB2qWpjjhxzJKhjuY3k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MJWyU6Ox; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MJWyU6Ox" Received: by smtp.kernel.org (Postfix) with ESMTPS id 151EEC2BCB6; Fri, 24 Apr 2026 15:47:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777045656; bh=II6YdxRKDLVvfEJMB7LL7pb5QlDG5XuxaMUHkvuWk6k=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=MJWyU6OxKZ0xlRnbk9tFp+XBvkMtCl/RgM+d8SudX1mILLS4Uax6HAE+Q7Tz4ShHy gH5L5ksJKpGte9kLjUf3iFlo2YPPJ3upczxTr+LJpOHYjulYTYXxBChXtyM/jsCzFJ n+/WkbVAs2Ct/FcOxTM5v6HGtpbDQbYtphnRYumsHnPT5njqNRyiFm+a490ccibhlk pEcIOjAj1k9ZhCQ4ZVryKXGb8y4Uq8UKSsU1fGVwfBJ0uk2v0sbAkXwOGKDGYckcs1 p3XXrOz2Z+donwIyqcNFFSxBvJpwlXFoeBce5mVzp3CuZYeBZeASTo0rS9Xtqwn8cj 7FAHvE0aL+7Bg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0ABFAFED3ED; Fri, 24 Apr 2026 15:47:36 +0000 (UTC) From: Ronald Claveau via B4 Relay Date: Fri, 24 Apr 2026 17:45:12 +0200 Subject: [PATCH v5 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: <20260424-add-thermal-t7-vim4-v5-4-9040ca36afe2@aliel.fr> References: <20260424-add-thermal-t7-vim4-v5-0-9040ca36afe2@aliel.fr> In-Reply-To: <20260424-add-thermal-t7-vim4-v5-0-9040ca36afe2@aliel.fr> To: Guillaume La Roque , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: linux-pm@vger.kernel.org, linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ronald Claveau X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=6342; i=linux-kernel-dev@aliel.fr; h=from:subject:message-id; bh=hpmbQYKzAOANOL4Nopof62ezzv9RGoucfmyDUhg4E+s=; b=owGbwMvMwCWm1SvKXP3cUInxtFoSQ+brCX2zAov63O4XFDX/K982+6x8kaH/VF62rZ6ZnlbuJ s8eH/nYUcrCIMbFICumyNI/1/LEu8tHz3zdo54CM4eVCWQIAxenAEykKJ+RYeqTC7Ucf1+1Xp43 tW5Hqllj0KyMdqM5PE8b1ny7rcYXw8PI0LjXNv/D/+JUUf3E9b/qVzOGFFlJnyx5LJnyrKHymPR /RgA= X-Developer-Key: i=linux-kernel-dev@aliel.fr; a=openpgp; fpr=DFD863F61375BF917F0012173953305EF1D0EC3E X-Endpoint-Received: by B4 Relay for linux-kernel-dev@aliel.fr/default with auth_id=744 X-Original-From: Ronald Claveau Reply-To: linux-kernel-dev@aliel.fr From: Ronald Claveau Some SoCs (e.g. T7) expose thermal calibration data through the secure monitor rather than a directly accessible eFuse register. Add a use_sm flag to amlogic_thermal_data to select this path, and retrieve the firmware handle and tsensor_id from the "amlogic,secure-monitor" DT phandle with one fixed argument. Also introduce the amlogic,t7-thermal compatible using this new path. While refactoring, fix a pre-existing bug where amlogic_thermal_initialize() was called after devm_thermal_of_zone_register(), causing the thermal framework to read an uninitialized trim_info on zone registration. Reviewed-by: Neil Armstrong Signed-off-by: Ronald Claveau --- drivers/thermal/amlogic_thermal.c | 112 ++++++++++++++++++++++++++++------= ---- 1 file changed, 82 insertions(+), 30 deletions(-) diff --git a/drivers/thermal/amlogic_thermal.c b/drivers/thermal/amlogic_th= ermal.c index 5448d772db12a..a0b530624b60c 100644 --- a/drivers/thermal/amlogic_thermal.c +++ b/drivers/thermal/amlogic_thermal.c @@ -25,6 +25,7 @@ #include #include #include +#include =20 #include "thermal_hwmon.h" =20 @@ -84,12 +85,14 @@ struct amlogic_thermal_soc_calib_data { * @u_efuse_off: register offset to read fused calibration value * @calibration_parameters: calibration parameters structure pointer * @regmap_config: regmap config for the device + * @use_sm: read data from secure monitor instead of efuse * This structure is required for configuration of amlogic thermal driver. */ struct amlogic_thermal_data { int u_efuse_off; const struct amlogic_thermal_soc_calib_data *calibration_parameters; const struct regmap_config *regmap_config; + bool use_sm; }; =20 struct amlogic_thermal { @@ -100,6 +103,8 @@ struct amlogic_thermal { struct clk *clk; struct thermal_zone_device *tzd; u32 trim_info; + struct meson_sm_firmware *sm_fw; + u32 tsensor_id; }; =20 /* @@ -133,26 +138,6 @@ static int amlogic_thermal_code_to_millicelsius(struct= amlogic_thermal *pdata, return temp; } =20 -static int amlogic_thermal_initialize(struct amlogic_thermal *pdata) -{ - int ret =3D 0; - int ver; - - regmap_read(pdata->sec_ao_map, pdata->data->u_efuse_off, - &pdata->trim_info); - - ver =3D TSENSOR_TRIM_VERSION(pdata->trim_info); - - if ((ver & TSENSOR_TRIM_CALIB_VALID_MASK) =3D=3D 0) { - ret =3D -EINVAL; - dev_err(&pdata->pdev->dev, - "tsensor thermal calibration not supported: 0x%x!\n", - ver); - } - - return ret; -} - static int amlogic_thermal_enable(struct amlogic_thermal *data) { int ret; @@ -190,6 +175,67 @@ static int amlogic_thermal_get_temp(struct thermal_zon= e_device *tz, int *temp) return 0; } =20 +static int amlogic_thermal_probe_sm(struct platform_device *pdev, + struct amlogic_thermal *pdata) +{ + struct device *dev =3D &pdev->dev; + struct of_phandle_args ph_args; + int ret; + + ret =3D of_parse_phandle_with_fixed_args(pdev->dev.of_node, + "amlogic,secure-monitor", + 1, 0, &ph_args); + if (ret) + return ret; + + if (!ph_args.np) { + dev_err(dev, "Failed to parse secure monitor phandle\n"); + return -ENODEV; + } + + pdata->sm_fw =3D meson_sm_get(ph_args.np); + of_node_put(ph_args.np); + if (!pdata->sm_fw) { + dev_err(dev, "Failed to get secure monitor firmware\n"); + return -EPROBE_DEFER; + } + + pdata->tsensor_id =3D ph_args.args[0]; + + return meson_sm_get_thermal_calib(pdata->sm_fw, + &pdata->trim_info, + pdata->tsensor_id); +} + +static int amlogic_thermal_probe_syscon(struct platform_device *pdev, + struct amlogic_thermal *pdata) +{ + struct device *dev =3D &pdev->dev; + int ver; + + pdata->sec_ao_map =3D + syscon_regmap_lookup_by_phandle(pdev->dev.of_node, + "amlogic,ao-secure"); + if (IS_ERR(pdata->sec_ao_map)) { + dev_err(dev, "syscon regmap lookup failed.\n"); + return PTR_ERR(pdata->sec_ao_map); + } + + regmap_read(pdata->sec_ao_map, pdata->data->u_efuse_off, + &pdata->trim_info); + + ver =3D TSENSOR_TRIM_VERSION(pdata->trim_info); + + if ((ver & TSENSOR_TRIM_CALIB_VALID_MASK) =3D=3D 0) { + dev_err(&pdata->pdev->dev, + "tsensor thermal calibration not supported: 0x%x!\n", + ver); + return -EINVAL; + } + + return 0; +} + static const struct thermal_zone_device_ops amlogic_thermal_ops =3D { .get_temp =3D amlogic_thermal_get_temp, }; @@ -226,6 +272,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 +291,10 @@ static const struct of_device_id of_amlogic_thermal_ma= tch[] =3D { .compatible =3D "amlogic,a1-cpu-thermal", .data =3D &amlogic_thermal_a1_cpu_param, }, + { + .compatible =3D "amlogic,t7-thermal", + .data =3D &amlogic_thermal_t7_param, + }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, of_amlogic_thermal_match); @@ -271,12 +327,12 @@ static int amlogic_thermal_probe(struct platform_devi= ce *pdev) if (IS_ERR(pdata->clk)) return dev_err_probe(dev, PTR_ERR(pdata->clk), "failed to get clock\n"); =20 - pdata->sec_ao_map =3D syscon_regmap_lookup_by_phandle - (pdev->dev.of_node, "amlogic,ao-secure"); - if (IS_ERR(pdata->sec_ao_map)) { - dev_err(dev, "syscon regmap lookup failed.\n"); - return PTR_ERR(pdata->sec_ao_map); - } + if (pdata->data->use_sm) + ret =3D amlogic_thermal_probe_sm(pdev, pdata); + else + ret =3D amlogic_thermal_probe_syscon(pdev, pdata); + if (ret) + return ret; =20 pdata->tzd =3D devm_thermal_of_zone_register(&pdev->dev, 0, @@ -290,10 +346,6 @@ static int amlogic_thermal_probe(struct platform_devic= e *pdev) =20 devm_thermal_add_hwmon_sysfs(&pdev->dev, pdata->tzd); =20 - ret =3D amlogic_thermal_initialize(pdata); - if (ret) - return ret; - ret =3D amlogic_thermal_enable(pdata); =20 return ret; --=20 2.49.0 From nobody Mon Jun 15 13:57:38 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5EDEC364954; Fri, 24 Apr 2026 15:47:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777045656; cv=none; b=V4E7uTgfShy028LRxkzOYbNKLNnfKcPsJDXEHqsXdjKV4gSlQlxRN4lCr964MayE2r1Q7ineL/i1bdMZIgYtjBMxGCbtJW+OAxgSzMo2ZvrHTz3H1o6Y6ieCdfC9dBZY8VKv22lEHKKPtd1QmI7iH4ZkBHkQ7fLNkmaH2wniyjM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777045656; c=relaxed/simple; bh=elZM1nnUL8tGPNLZHklCcbm+/PN5OiNdRt/TWuoll84=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QEeVpLXhqPLE6e0kSbfMVpJ7tf5/K84SdoXaQZ76HQDNv9+bule8yXHX5BbS5LouAFYDPi05VzsB7GSvBZzPCzWyn0PcfIvxbMDuF670v77yQrJQVCSZhhwT297L7VDty71QVW+sG2JGgoDhM3CLtywUtCImHVI4EB8SWg9PfUo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=rGcu+pf/; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="rGcu+pf/" Received: by smtp.kernel.org (Postfix) with ESMTPS id 2538CC2BCB7; Fri, 24 Apr 2026 15:47:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777045656; bh=elZM1nnUL8tGPNLZHklCcbm+/PN5OiNdRt/TWuoll84=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=rGcu+pf/PBo8iw45HPRBBM2kdNMRjzLBgsEsWKWQaY/8EOpZghSKD7JDXzslsfcvq EEeE6J4LgMYu9g630TceePMEGtd1L5PKmcVE+JiPF2/K6sZnIgfoInJhtBgnjbdQO7 eEAMesjfEcxYyB+NuyDUErB8MhgdVPvpfBvcS26Q4Kd2IG1z25ZQXcb6c7wG+SSl+M N5MpvnNUJ609oW5o6sdwYI5TydgZz8YKxL1TH86vZNS+kzFgXKVMOH4LO47h5lpUqq u7EDeSkgrqJr+Zj71MvW7HTUo9sYpbnx8GQ90txQlfk7zfLNPPUfdOmgUf9ft8HnPj ELglw3Do02xgw== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D106FED3EF; Fri, 24 Apr 2026 15:47:36 +0000 (UTC) From: Ronald Claveau via B4 Relay Date: Fri, 24 Apr 2026 17:45:13 +0200 Subject: [PATCH v5 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: <20260424-add-thermal-t7-vim4-v5-5-9040ca36afe2@aliel.fr> References: <20260424-add-thermal-t7-vim4-v5-0-9040ca36afe2@aliel.fr> In-Reply-To: <20260424-add-thermal-t7-vim4-v5-0-9040ca36afe2@aliel.fr> To: Guillaume La Roque , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: linux-pm@vger.kernel.org, linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ronald Claveau X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2150; i=linux-kernel-dev@aliel.fr; h=from:subject:message-id; bh=XrCMAL0ahuPAin/Bi3StAQs4xZcZCs3qAU91y4l1Ouo=; b=owGbwMvMwCWm1SvKXP3cUInxtFoSQ+brCf2ff0zY+PFZt2VQqo0w+9I8jojUB/Lynx3vlDsyf Fqbnq/dUcrCIMbFICumyNI/1/LEu8tHz3zdo54CM4eVCWQIAxenAExEJJmR4XpcoiXL1oUxNqyZ 8n92z+s+fftZ1xwDjjM3L9nOz1h4fj0jw4Pzhqs8bmx5/4oxsdFzxW3vrbpZlwU3r/azeVJ664r TA0YA X-Developer-Key: i=linux-kernel-dev@aliel.fr; a=openpgp; fpr=DFD863F61375BF917F0012173953305EF1D0EC3E X-Endpoint-Received: by B4 Relay for linux-kernel-dev@aliel.fr/default with auth_id=744 X-Original-From: Ronald Claveau Reply-To: linux-kernel-dev@aliel.fr From: Ronald Claveau Add #cooling-cells =3D <2> to all CPU nodes (both little and big cluster) to allow them to be used as cooling devices in thermal zone mappings. Reviewed-by: Neil Armstrong Signed-off-by: Ronald Claveau --- arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi b/arch/arm64/boot/= dts/amlogic/amlogic-t7.dtsi index 560c9dce35266..7aec65f036a9c 100644 --- a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi +++ b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi @@ -63,6 +63,7 @@ cpu100: cpu@100 { i-cache-size =3D <0x8000>; i-cache-sets =3D <32>; next-level-cache =3D <&l2_cache_l>; + #cooling-cells =3D <2>; }; =20 cpu101: cpu@101 { @@ -77,6 +78,7 @@ cpu101: cpu@101 { i-cache-size =3D <0x8000>; i-cache-sets =3D <32>; next-level-cache =3D <&l2_cache_l>; + #cooling-cells =3D <2>; }; =20 cpu102: cpu@102 { @@ -91,6 +93,7 @@ cpu102: cpu@102 { i-cache-size =3D <0x8000>; i-cache-sets =3D <32>; next-level-cache =3D <&l2_cache_l>; + #cooling-cells =3D <2>; }; =20 cpu103: cpu@103 { @@ -105,6 +108,7 @@ cpu103: cpu@103 { i-cache-size =3D <0x8000>; i-cache-sets =3D <32>; next-level-cache =3D <&l2_cache_l>; + #cooling-cells =3D <2>; }; =20 cpu0: cpu@0 { @@ -119,6 +123,7 @@ cpu0: cpu@0 { i-cache-size =3D <0x10000>; i-cache-sets =3D <64>; next-level-cache =3D <&l2_cache_b>; + #cooling-cells =3D <2>; }; =20 cpu1: cpu@1 { @@ -133,6 +138,7 @@ cpu1: cpu@1 { i-cache-size =3D <0x10000>; i-cache-sets =3D <64>; next-level-cache =3D <&l2_cache_b>; + #cooling-cells =3D <2>; }; =20 cpu2: cpu@2 { @@ -147,6 +153,7 @@ cpu2: cpu@2 { i-cache-size =3D <0x10000>; i-cache-sets =3D <64>; next-level-cache =3D <&l2_cache_b>; + #cooling-cells =3D <2>; }; =20 cpu3: cpu@3 { @@ -161,6 +168,7 @@ cpu3: cpu@3 { i-cache-size =3D <0x10000>; i-cache-sets =3D <64>; next-level-cache =3D <&l2_cache_b>; + #cooling-cells =3D <2>; }; =20 l2_cache_l: l2-cache-cluster0 { --=20 2.49.0 From nobody Mon Jun 15 13:57:38 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C48836167E; Fri, 24 Apr 2026 15:47:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777045656; cv=none; b=nAysfC4uLFYS+VwdeCXrvy4LhNZFAzDJ/dIcMhna/Zxxs84Ivqp7e2x4mYlz2j1nkSBVALT8b4jAwe2yxIhmch0+wo9NYgiIWf51DfV/3jd8/nbkaW7Mloms0pcfEIvACypnCbKmAB2rqSV6wioBl+YmOWpDjJjL+PIY6soKeG8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777045656; c=relaxed/simple; bh=FWFOLyF0x63/LZtObhZ1J4jCUtWE2TThSzrDcSn/OZ4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Y2Gc+lDCQveo4QJYRUzrKHLz5TPzHa5MbFdDqgN7rh2HXyxP7BeJXfumQR5Jvxs6HZDEU4C1gwXDwvDJYmVYTnC5AgOsXdqABzyR1CNNvLJgKXHtm47yMqHqm5qepoac7Ynb2s22hE1l6bo/wVNbxuDehGNQ9bg1Mu0LUqb6M5w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=YkPaXvEh; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="YkPaXvEh" Received: by smtp.kernel.org (Postfix) with ESMTPS id 35ECEC2BCF5; Fri, 24 Apr 2026 15:47:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777045656; bh=FWFOLyF0x63/LZtObhZ1J4jCUtWE2TThSzrDcSn/OZ4=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=YkPaXvEhFirAM1TLs8tPKmtOxcP/Q2eDBqOh1XoQobziFGpR4j9ef74jPhce/Ylj+ d9+h6cfCvKEzKGxF7KFaPJskbsMa2y86vRhsssxYlp8rRPnEw5puvXduMtKXR6eECP 8tekguDeNggNAKkfnHO1YH8CJLY7ltuTrsYXmi8huQ+f/VC/gglvv+BpGJ2Xai55vw 76ku3Ubk/SPA0iLtlybfoTAJLfzoqTBJ9zHy5LInaWExmnI/0xZHBFOx/LqR7HYf91 rBmV8dHrfZHLysyrPe8OcoezzGN3skBg1Zjs3sncTiBqos1ZAXnT1O9MjYESvAUEy4 UcdymyBStb5/g== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DC4EFED3EC; Fri, 24 Apr 2026 15:47:36 +0000 (UTC) From: Ronald Claveau via B4 Relay Date: Fri, 24 Apr 2026 17:45:14 +0200 Subject: [PATCH v5 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: <20260424-add-thermal-t7-vim4-v5-6-9040ca36afe2@aliel.fr> References: <20260424-add-thermal-t7-vim4-v5-0-9040ca36afe2@aliel.fr> In-Reply-To: <20260424-add-thermal-t7-vim4-v5-0-9040ca36afe2@aliel.fr> To: Guillaume La Roque , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: linux-pm@vger.kernel.org, linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ronald Claveau X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3131; i=linux-kernel-dev@aliel.fr; h=from:subject:message-id; bh=a30MjY4dgn60IwOqeBdliR8IJEpyrJadRABAdDxz05M=; b=owGbwMvMwCWm1SvKXP3cUInxtFoSQ+brCRPqWg3qp8zRLXr2rFp++43GJXO6lsX5Vb3bGufG+ EPuo6BSRykLgxgXg6yYIkv/XMsT7y4fPfN1j3oKzBxWJpAhDFycAjCRbe8ZGY551a22thf1jvjx Zn3/xdtB/rKlbf8DZRYFV19eFM59tZrhv8uP111rpJ2eFx2Q6PQ9uvvvil0fP0tLOnotebKgrGD jEWYA X-Developer-Key: i=linux-kernel-dev@aliel.fr; a=openpgp; fpr=DFD863F61375BF917F0012173953305EF1D0EC3E X-Endpoint-Received: by B4 Relay for linux-kernel-dev@aliel.fr/default with auth_id=744 X-Original-From: Ronald Claveau Reply-To: linux-kernel-dev@aliel.fr From: Ronald Claveau Add six temperature sensor nodes using the amlogic,t7-thermal compatible: a73, a53, gpu, nna, vpu, and hevc. Each sensor retrieves its calibration data from the secure monitor via the amlogic,secure-monitor phandle with the corresponding tsensor_id argument. Reviewed-by: Neil Armstrong Signed-off-by: Ronald Claveau --- arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 58 +++++++++++++++++++++++++= ++++ 1 file changed, 58 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi b/arch/arm64/boot/= dts/amlogic/amlogic-t7.dtsi index 7aec65f036a9c..62f259b2b17d2 100644 --- a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi +++ b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi @@ -656,6 +656,24 @@ sec_ao: ao-secure@10220 { amlogic,has-chip-id; }; =20 + a73_tsensor: temperature-sensor@20000 { + compatible =3D "amlogic,t7-thermal"; + reg =3D <0x0 0x20000 0x0 0x50>; + interrupts =3D ; + clocks =3D <&clkc_periphs CLKID_TS>; + #thermal-sensor-cells =3D <0>; + amlogic,secure-monitor =3D <&sm 1>; + }; + + a53_tsensor: temperature-sensor@22000 { + compatible =3D "amlogic,t7-thermal"; + reg =3D <0x0 0x22000 0x0 0x50>; + interrupts =3D ; + clocks =3D <&clkc_periphs CLKID_TS>; + #thermal-sensor-cells =3D <0>; + amlogic,secure-monitor =3D <&sm 2>; + }; + pwm_ao_ef: pwm@30000 { compatible =3D "amlogic,t7-pwm", "amlogic,meson-s4-pwm"; reg =3D <0x0 0x30000 0x0 0x24>; @@ -770,6 +788,46 @@ sd_emmc_c: mmc@8c000 { assigned-clock-parents =3D <&xtal>; status =3D "disabled"; }; + + gpu_tsensor: temperature-sensor@94000 { + compatible =3D "amlogic,t7-thermal"; + reg =3D <0x0 0x94000 0x0 0x50>; + interrupts =3D ; + clocks =3D <&clkc_periphs CLKID_TS>; + power-domains =3D <&pwrc PWRC_T7_MALI_TOP_ID>; + #thermal-sensor-cells =3D <0>; + amlogic,secure-monitor =3D <&sm 3>; + }; + + nna_tsensor: temperature-sensor@96000 { + compatible =3D "amlogic,t7-thermal"; + reg =3D <0x0 0x96000 0x0 0x50>; + interrupts =3D ; + clocks =3D <&clkc_periphs CLKID_TS>; + power-domains =3D <&pwrc PWRC_T7_NNA_TOP_ID>; + #thermal-sensor-cells =3D <0>; + amlogic,secure-monitor =3D <&sm 4>; + }; + + vpu_tsensor: temperature-sensor@98000 { + compatible =3D "amlogic,t7-thermal"; + reg =3D <0x0 0x98000 0x0 0x50>; + interrupts =3D ; + clocks =3D <&clkc_periphs CLKID_TS>; + power-domains =3D <&pwrc PWRC_T7_VPU_HDMI_ID>; + #thermal-sensor-cells =3D <0>; + amlogic,secure-monitor =3D <&sm 6>; + }; + + hevc_tsensor: temperature-sensor@9a000 { + compatible =3D "amlogic,t7-thermal"; + reg =3D <0x0 0x9a000 0x0 0x50>; + interrupts =3D ; + clocks =3D <&clkc_periphs CLKID_TS>; + power-domains =3D <&pwrc PWRC_T7_DOS_HEVC_ID>; + #thermal-sensor-cells =3D <0>; + amlogic,secure-monitor =3D <&sm 5>; + }; }; =20 }; --=20 2.49.0 From nobody Mon Jun 15 13:57:38 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 696B136DA0A; Fri, 24 Apr 2026 15:47:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777045656; cv=none; b=vC3QHvA8nN+DqO7bLsjjrKFdddNV9xzgKCusz7echUpdhTvuUSSgP5vStSq5TgAe8eJ5MQx9PTZRZDZSuribI8Qk2FFSfdHq0m+dHOfMvj4iFDAG5dVm38q64R/jO7bvq8iQzBhhSyFDLjxecKEm5QI7Lvll7nH3PBbCM5xfJ6Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777045656; c=relaxed/simple; bh=b0sJzhXWCqGK/WgH1LmP4aRPKR+3mieZ0ehqwBuS5yU=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Wt4i9IMaO/S5Y+7DAEuEGTflZA+QGFGjXbrCIGQCsKykGbxJwELhg0VguFCp07M3K33RPHDZTkjjXatM4K8wiHjQzV8uQFcoQ6R58b6TBVM5wlUwzkR03cDQjQ8TxeSjvCi2TZEI4wBzpFDucfEtx8K7HDjI64mk5mNH2nH8sHE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=IrB/AhvN; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="IrB/AhvN" Received: by smtp.kernel.org (Postfix) with ESMTPS id 459A6C2BCB9; Fri, 24 Apr 2026 15:47:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777045656; bh=b0sJzhXWCqGK/WgH1LmP4aRPKR+3mieZ0ehqwBuS5yU=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=IrB/AhvN7xy6CEubIlvy4rvGLTb+FpP+duK3HkxvxZqneFId34zAFCAfelpOJQGSN 7dmfYX1YoqmWCe8q6Ew+QsLisAb0YUGTv3RhVUJbL+4EFwXFEv+zd5RL4/786dIVpw gUgl7U5dKT1PCKtNVmZWJAY/PTKvfDG5qClbfMY0EEeLw7LYKJj4a4tXQm6IAU+I7i W1gRUZ/OHInsfXSnWDsp+0ghkuLJrMD0m18RD2BpA1OunQnsQkdwanbBWgums0By6a AXt08PvQIv2NwQdB0XbJQT/ADHhvamawWpHycnslvjvf+bsZyveub2z0CIoLvM22MR biml4YYiZuKMA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DECFFED3D7; Fri, 24 Apr 2026 15:47:36 +0000 (UTC) From: Ronald Claveau via B4 Relay Date: Fri, 24 Apr 2026 17:45:15 +0200 Subject: [PATCH v5 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: <20260424-add-thermal-t7-vim4-v5-7-9040ca36afe2@aliel.fr> References: <20260424-add-thermal-t7-vim4-v5-0-9040ca36afe2@aliel.fr> In-Reply-To: <20260424-add-thermal-t7-vim4-v5-0-9040ca36afe2@aliel.fr> To: Guillaume La Roque , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: linux-pm@vger.kernel.org, linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ronald Claveau X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=5141; i=linux-kernel-dev@aliel.fr; h=from:subject:message-id; bh=TCDtxClAEv57+xqTU2EszbWME/8cFOV0lk0gt9hjEiY=; b=owGbwMvMwCWm1SvKXP3cUInxtFoSQ+brCZMeVbw01DN0l0zcUnaV//ya/c4hzBtZQrOXf97qp 8JeeaK9o5SFQYyLQVZMkaV/ruWJd5ePnvm6Rz0FZg4rE8gQBi5OAZiI3TeGfxqrb4l8Vkw/5ZDC 2R9Vu9z0vWLLz29aAvvD4udvWHR+aycjw4HIgxNm+e0+klh+6odr19f1e7JNjtrtr2qyq9hXvX/ tP14A X-Developer-Key: i=linux-kernel-dev@aliel.fr; a=openpgp; fpr=DFD863F61375BF917F0012173953305EF1D0EC3E X-Endpoint-Received: by B4 Relay for linux-kernel-dev@aliel.fr/default with auth_id=744 X-Original-From: Ronald Claveau Reply-To: linux-kernel-dev@aliel.fr From: Ronald Claveau Add thermal zones for all six sensors: a53, a73, gpu, nna, vpu, and hevc. Reviewed-by: Neil Armstrong Signed-off-by: Ronald Claveau --- arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi | 179 ++++++++++++++++++++++++= ++++ 1 file changed, 179 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi b/arch/arm64/boot/= dts/amlogic/amlogic-t7.dtsi index 62f259b2b17d2..c6ea0f20a879f 100644 --- a/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi +++ b/arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi @@ -9,6 +9,7 @@ #include #include #include +#include =20 / { interrupt-parent =3D <&gic>; @@ -829,6 +830,184 @@ hevc_tsensor: temperature-sensor@9a000 { amlogic,secure-monitor =3D <&sm 5>; }; }; + }; + + thermal-zones { + a53_thermal: a53-thermal { + polling-delay =3D <1000>; + polling-delay-passive =3D <100>; + thermal-sensors =3D <&a53_tsensor>; + + trips { + a53_passive: a53-passive { + temperature =3D <85000>; /* millicelsius */ + hysteresis =3D <2000>; /* millicelsius */ + type =3D "passive"; + }; + + a53_hot: a53-hot { + temperature =3D <95000>; /* millicelsius */ + hysteresis =3D <2000>; /* millicelsius */ + type =3D "hot"; + }; + + a53_critical: a53-critical { + temperature =3D <110000>; /* millicelsius */ + hysteresis =3D <2000>; /* millicelsius */ + type =3D "critical"; + }; + }; + + cooling-maps { + map-a53 { + trip =3D <&a53_passive>; + cooling-device =3D + <&cpu100 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu101 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu102 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu103 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + }; + + a73_thermal: a73-thermal { + polling-delay =3D <1000>; + polling-delay-passive =3D <100>; + thermal-sensors =3D <&a73_tsensor>; + + trips { + a73_passive: a73-passive { + temperature =3D <85000>; /* millicelsius */ + hysteresis =3D <2000>; /* millicelsius */ + type =3D "passive"; + }; + + a73_hot: a73-hot { + temperature =3D <95000>; /* millicelsius */ + hysteresis =3D <2000>; /* millicelsius */ + type =3D "hot"; + }; + + a73_critical: a73-critical { + temperature =3D <110000>; /* millicelsius */ + hysteresis =3D <2000>; /* millicelsius */ + type =3D "critical"; + }; + }; + + cooling-maps { + map-a73 { + trip =3D <&a73_passive>; + cooling-device =3D <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; + }; + + gpu_thermal: gpu-thermal { + polling-delay =3D <1000>; + polling-delay-passive =3D <100>; + thermal-sensors =3D <&gpu_tsensor>; + + trips { + gpu_passive: gpu-passive { + temperature =3D <95000>; + hysteresis =3D <5000>; + type =3D "passive"; + }; + + gpu_hot: gpu-hot { + temperature =3D <105000>; + hysteresis =3D <5000>; + type =3D "passive"; + }; =20 + gpu_critical: gpu-critical { + temperature =3D <115000>; + hysteresis =3D <1000>; + type =3D "critical"; + }; + }; + }; + + hevc_thermal: hevc-thermal { + polling-delay =3D <1000>; + polling-delay-passive =3D <100>; + thermal-sensors =3D <&hevc_tsensor>; + + trips { + hevc_passive: hevc-passive { + temperature =3D <95000>; + hysteresis =3D <5000>; + type =3D "passive"; + }; + + hevc_hot: hevc-hot { + temperature =3D <105000>; + hysteresis =3D <5000>; + type =3D "passive"; + }; + + hevc_critical: hevc-critical { + temperature =3D <115000>; + hysteresis =3D <1000>; + type =3D "critical"; + }; + }; + }; + + nna_thermal: nna-thermal { + polling-delay =3D <1000>; + polling-delay-passive =3D <100>; + thermal-sensors =3D <&nna_tsensor>; + + trips { + nna_passive: nna-passive { + temperature =3D <95000>; + hysteresis =3D <5000>; + type =3D "passive"; + }; + + nna_hot: nna-hot { + temperature =3D <105000>; + hysteresis =3D <5000>; + type =3D "passive"; + }; + + nna_critical: nna-critical { + temperature =3D <115000>; + hysteresis =3D <1000>; + type =3D "critical"; + }; + }; + }; + + vpu_thermal: vpu-thermal { + polling-delay =3D <1000>; + polling-delay-passive =3D <100>; + thermal-sensors =3D <&vpu_tsensor>; + + trips { + vpu_passive: vpu-passive { + temperature =3D <95000>; + hysteresis =3D <5000>; + type =3D "passive"; + }; + + vpu_hot: vpu-hot { + temperature =3D <105000>; + hysteresis =3D <5000>; + type =3D "passive"; + }; + + vpu_critical: vpu-critical { + temperature =3D <115000>; + hysteresis =3D <1000>; + type =3D "critical"; + }; + }; + }; }; }; --=20 2.49.0 From nobody Mon Jun 15 13:57:38 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7CB1537E30F; Fri, 24 Apr 2026 15:47:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777045656; cv=none; b=U3pZjkbf9f2jUfArx1K3SvVM4NU6g3Lii4D/xMNNesv7XEPjHWv4xIOT9mNX1n9Ut2I2WkkOXjgCd+Z0siP2uCb5rl6EC8I5yvL5LnCh5+5jhYb1DdakIYx28L8qsIz5T2XA3mgAw9R7nwKXw03ZvtZeqemFNFPKJ30RrKif+Hg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777045656; c=relaxed/simple; bh=0OS0O2le0mzHMAbxRNl1A/VObEVx8TTq/lX1ZilvR08=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MblASqxQxahthX39bjTSyEerWBTFA37PUG8nTq/aXhX3k9pEV3SB3R9QQyw2kVHC9YX8k4/cKP+jQkuVGED9MDTsfL1r2z6/PVAgv/MrkyzzkkGwFuAsicXed/bvxJk74dolB0HruAB6wwKa/FEqU1gwe1YsQlgQvFNVrY3N9hQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OCq1KwLu; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OCq1KwLu" Received: by smtp.kernel.org (Postfix) with ESMTPS id 5985FC19425; Fri, 24 Apr 2026 15:47:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1777045656; bh=0OS0O2le0mzHMAbxRNl1A/VObEVx8TTq/lX1ZilvR08=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=OCq1KwLuyiwQgpW1oN5p/FLcYXcVA36EIszpXNd2P1ZyJRR3L748v5W+Kp6ExUzwC aZMuw1X9OIWiADRDQ0X3S7UTzSjsi6xj0k6xxGekKxjD3mqqPykDmaJUos+4ib7mlR uCq6prm/pwqdYauxkxN0fzJhHCcyXnDvPIhfTaFaRt3kAp0UNTmp23ZwWYxph9/+H4 pgB6bcfiHACy0FiipRBOxJ0Rb/GPTjvA+2z2sDnt6o8O17Pwi21gQQxpyjO76rhgfI V6ZwpqADaOlQIaXGwXZrp/ayLC0+dk85oGeLiXyF613F6hDJ0kYhTmqb0kOValGviz bVttkJukxvDiQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FF62FED3EC; Fri, 24 Apr 2026 15:47:36 +0000 (UTC) From: Ronald Claveau via B4 Relay Date: Fri, 24 Apr 2026 17:45:16 +0200 Subject: [PATCH v5 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: <20260424-add-thermal-t7-vim4-v5-8-9040ca36afe2@aliel.fr> References: <20260424-add-thermal-t7-vim4-v5-0-9040ca36afe2@aliel.fr> In-Reply-To: <20260424-add-thermal-t7-vim4-v5-0-9040ca36afe2@aliel.fr> To: Guillaume La Roque , "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Neil Armstrong , Kevin Hilman , Jerome Brunet , Martin Blumenstingl Cc: linux-pm@vger.kernel.org, linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ronald Claveau X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=2931; i=linux-kernel-dev@aliel.fr; h=from:subject:message-id; bh=QDl6XRK0bbX2myAi5/KhL6pv37d0zhbhr8IIj0YHBpM=; b=owGbwMvMwCWm1SvKXP3cUInxtFoSQ+brCZNdzrbuX9w8w1VW1l352MHH9r7zZX7P09w16eVJ6 8uZa7ZEdZSyMIhxMciKKbL0z7U88e7y0TNf96inwMxhZQIZwsDFKQAT6RZhZJj4cnut1ZvwOcw3 TkzKu/CAPe+t6+6gNQv6s2yaz+7isBFnZDixIjfzyLeCz73BZ/4d+WN3WGzbNW4tWeOs7MK8e1d uVjEBAA== X-Developer-Key: i=linux-kernel-dev@aliel.fr; a=openpgp; fpr=DFD863F61375BF917F0012173953305EF1D0EC3E X-Endpoint-Received: by B4 Relay for linux-kernel-dev@aliel.fr/default with auth_id=744 X-Original-From: Ronald Claveau Reply-To: linux-kernel-dev@aliel.fr From: Ronald Claveau Add an active trip at 50=C2=B0C to all six thermal zones and map it to the khadas_mcu fan controller, using cooling states 30 to 100. Reviewed-by: Neil Armstrong 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