From patchwork Wed Aug 14 21:43:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "A. Zini" X-Patchwork-Id: 13764174 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CC0B1C52D7F for ; Wed, 14 Aug 2024 21:45:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=GjhiRS8yozzeIZl8Y9QecMUTSAsMNfDPfShDO0czdT8=; b=YUFuvll+vK5J7FpwKM4ia3NpwD RYKMZTw9RKgOn0bcfLO3mT17NkXEibm+JRtA3jwZuHm8TbC9lmNVZHaTjcTuE8P7Tn7TOPeOfEt5T EQGmy573LAMNXdG9CGrvKh3L1EjMIvxz3ISA+BXaTuN2Jr/XwiAvYblpibovJCK+py8ex8Os/ndFi QAs4KLwG5LbCvNa3Nkwfe5BHGmd7xHdL2wDBZhCaDO9Oe/WGxgmyFcvdvtwyvwkhlCcCIAvZ48B6k hnucFOQGEKbb2KwV9/iKvzIANXwAQs2FL0z863XbnjADW7fJM/Y26X9ainynh7U9nEDmaR/KPOvTd S3iXpKQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1seLnW-00000008MJe-1IK8; Wed, 14 Aug 2024 21:44:50 +0000 Received: from mta-65-227.siemens.flowmailer.net ([185.136.65.227]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1seLmn-00000008MEZ-1rQb for linux-arm-kernel@lists.infradead.org; Wed, 14 Aug 2024 21:44:09 +0000 Received: by mta-65-227.siemens.flowmailer.net with ESMTPSA id 202408142144001db725e606c30b3b12 for ; Wed, 14 Aug 2024 23:44:00 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=alessandro.zini@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc; bh=GjhiRS8yozzeIZl8Y9QecMUTSAsMNfDPfShDO0czdT8=; b=QY+y66X6JrNLESGQaQKg9K0C08+XXTTESGzvk3Y/2gj2V51HBzSe3YEzYWz9KJm67GTlHd tW/X2xcNndXP2VJJLuuOuUyBZR+5nlGQmk4RugBoFC6cW6f53maRoWII2ZflsAY7izwK78Ur prVYFGQ2Z6e0ozcppUnMuGnEzmQHek19SHzU14d+wNqj2Fw0ji9mbM3eWkeE71MZDf0U5cd4 LRKZV/hXsuRtp1edFL7JCNRtgOajqnRE5A7PUYFNyyCYbfukjuwiQ1vUj8IMixCnajpk/L/N G4Jw+pPIeEw2XbrRbY0iOFF+WePoCPfAvzQw9O11FLXwPyxH2YILXYUQ==; From: "A. Zini" To: linux-arm-kernel@lists.infradead.org Cc: Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Rob Herring , Krzysztof Kozlowski , Conor Dooley , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Alessandro Zini Subject: [PATCH] arm64: dts: ti: k3-am62: enable cpu freq throttling on thermal alert Date: Wed, 14 Aug 2024 23:43:28 +0200 Message-ID: <20240814214328.14155-1-alessandro.zini@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1327013:519-21489:flowmailer X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240814_144406_165499_3DB266F8 X-CRM114-Status: GOOD ( 10.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Alessandro Zini Enable throttling down the cpu frequency when an alert temperature threshold (lower than the critical threshold) is reached. Signed-off-by: Alessandro Zini --- arch/arm64/boot/dts/ti/k3-am62-thermal.dtsi | 34 +++++++++++++++++++++ arch/arm64/boot/dts/ti/k3-am625.dtsi | 4 +++ 2 files changed, 38 insertions(+) diff --git a/arch/arm64/boot/dts/ti/k3-am62-thermal.dtsi b/arch/arm64/boot/dts/ti/k3-am62-thermal.dtsi index a358757e26f0..c1683bbb241d 100644 --- a/arch/arm64/boot/dts/ti/k3-am62-thermal.dtsi +++ b/arch/arm64/boot/dts/ti/k3-am62-thermal.dtsi @@ -9,12 +9,29 @@ main0_thermal: main0-thermal { thermal-sensors = <&wkup_vtm0 0>; trips { + main0_alert: main0-alert { + temperature = <95000>; + hysteresis = <2000>; + type = "passive"; + }; + main0_crit: main0-crit { temperature = <105000>; /* milliCelsius */ hysteresis = <2000>; /* milliCelsius */ type = "critical"; }; }; + + cooling-maps { + map0 { + trip = <&main0_alert>; + cooling-device = + <&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>; + }; + }; }; main1_thermal: main1-thermal { @@ -23,11 +40,28 @@ main1_thermal: main1-thermal { thermal-sensors = <&wkup_vtm0 1>; trips { + main1_alert: main1-alert { + temperature = <95000>; + hysteresis = <2000>; + type = "passive"; + }; + main1_crit: main1-crit { temperature = <105000>; /* milliCelsius */ hysteresis = <2000>; /* milliCelsius */ type = "critical"; }; }; + + cooling-maps { + map0 { + trip = <&main1_alert>; + cooling-device = + <&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>; + }; + }; }; }; diff --git a/arch/arm64/boot/dts/ti/k3-am625.dtsi b/arch/arm64/boot/dts/ti/k3-am625.dtsi index 4193c2b3eed6..091aebb41dd9 100644 --- a/arch/arm64/boot/dts/ti/k3-am625.dtsi +++ b/arch/arm64/boot/dts/ti/k3-am625.dtsi @@ -50,6 +50,7 @@ cpu0: cpu@0 { next-level-cache = <&L2_0>; operating-points-v2 = <&a53_opp_table>; clocks = <&k3_clks 135 0>; + #cooling-cells = <2>; }; cpu1: cpu@1 { @@ -66,6 +67,7 @@ cpu1: cpu@1 { next-level-cache = <&L2_0>; operating-points-v2 = <&a53_opp_table>; clocks = <&k3_clks 136 0>; + #cooling-cells = <2>; }; cpu2: cpu@2 { @@ -82,6 +84,7 @@ cpu2: cpu@2 { next-level-cache = <&L2_0>; operating-points-v2 = <&a53_opp_table>; clocks = <&k3_clks 137 0>; + #cooling-cells = <2>; }; cpu3: cpu@3 { @@ -98,6 +101,7 @@ cpu3: cpu@3 { next-level-cache = <&L2_0>; operating-points-v2 = <&a53_opp_table>; clocks = <&k3_clks 138 0>; + #cooling-cells = <2>; }; };