From patchwork Mon Sep 5 17:15:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= X-Patchwork-Id: 12966444 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 250E7ECAAD5 for ; Mon, 5 Sep 2022 18:58:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NfryvwZESG3K9wikDzZP2CFhbpMghCugBiSR4yOcors=; b=xmY8jxG2ozFhJq /yw/Re5YVO7i8piOSubYwae3LdksO71s9ov1+922car8b4nxWvlBjtu2CqwEyO1RCawqHl1wtQfpi 3Ukjc8nWsQU4o5YajI5jHdIQPQGEWKhCCr1P4kH/c88mr1pZTXytV/cjF0U2qdzu2O46BFAX+h0gS On8OOXNFCQSgPejYxpgbsB28ibu9mr5DGlLgexAVQ4myA5I+li2Saa12xY1x7k9ASnoXFwPHK4Ydf UU5ahqmYocufD9hqwOPTAEVarPQ6tQg3xJeqomIpVNHtUgQyL3uGNvIf/Zl+InUmwgSZWGXQf/25e VFXbbdwGvnJC/D5Kb3EA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVHHO-008pE7-1o; Mon, 05 Sep 2022 18:57:06 +0000 Received: from desiato.infradead.org ([90.155.92.199]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVFvv-007ZwY-2w for linux-arm-kernel@bombadil.infradead.org; Mon, 05 Sep 2022 17:30:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:Content-ID:Content-Description; bh=WUkQWFeaJEpRmCMCeC5H0e01SJTSdoAluI/3ZHffQec=; b=HMV3sNVLXh/mAUfzq/SRbJkHzt 8urc4BFm+ct3VJfqrvDrrTEiMO1nI+uLmApu7swD3XTPgKAsU/xCAtzG1CmGc61qeTUuiOnvzgCjv KUtus6RmrG4Ov0Bxe7S1kgnTVeln9i9V/cUNBPy7TSkP6Krvf0Dv9hudMi/8Ak9gCqj0pC3gzhjwO 7yGqwdnETP5+Hun/1YBznQ+lFLvn1vDPETvv3TsiJU0ymArz5uuMTZIPjv3XB2W68bBA0kJiRcVnu Vroyf0rT/4aLjuLDdvYcJ3EvlWulAAqZqqWp33KtZfzON9LtxLM4plrdT87MOHuZNa7TuIs/X8WaD Ew7SC0ww==; Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVFhk-009rPw-1B for linux-arm-kernel@lists.infradead.org; Mon, 05 Sep 2022 17:16:18 +0000 Received: by mail-wr1-x434.google.com with SMTP id e20so12118931wri.13 for ; Mon, 05 Sep 2022 10:16:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=WUkQWFeaJEpRmCMCeC5H0e01SJTSdoAluI/3ZHffQec=; b=KRzIb9xvRSM6Mplxtn5bTHZHQZGfAhcrIjCCKHU2e93WHngHSu8VlsSJFaGWIyucby bDXFaZKqWnTJc23XyqWhnlPUTrkYR0RoPyG3u/1/pQC27tnQ0Y0gtd5ae0q+sebK3VWY 4vwoHXYDBoq1bEv89Hb/MbDeiaOHeMFPcIqoCEQZRjlEAcqRpbS5MA1YON2IUTbIcAZK lLjsoObOKljR4tvcj/WXqCV2dnmbawFPubd3YPN6N9sa4bBJxSw0bCW9v498ExGdwg6Y NXqLF+7IbA9lxxxkbqamA0IA3PNcBn5yJMSImqP6hFrapcGoFTBuZVOCZKA3TjvPeL18 gY9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=WUkQWFeaJEpRmCMCeC5H0e01SJTSdoAluI/3ZHffQec=; b=Ooa4TSZIbWpHzJqv6Ray0UIuxXC20TJTED9PYTAtLCWiGw1+gfI3ThndNps3wqXQA+ /Do4on9RW2xlVKoGiTHtkDrtN7LbA4t0DsyJn/l1cYTM3GVUxeJaa2dO9OGHuK2gYd36 xnHo4qns7spXSrlXghaZNuTL5M1OfYJnSFEVC1tVwKqM97vjE55v1/7Wz+L19bsm6R5W hq//y1lZcDRTz6rzzE7BK+VnK2TT3jeao319qvASgDnSA+cbq/ttws37+YN9J88glER3 MDez+5L5+08NG22t2uG3EnnMW5YSER6hNQ4KvXN68GPZFznnLe3QML+vfXkxClxXkNr2 LP+Q== X-Gm-Message-State: ACgBeo0rYLFOpJDU0kVsmZghSHlGWCOzes/YXbJItpiQbFkumO99kfl1 LjBV217b2gsVyTxReHs5dzc= X-Google-Smtp-Source: AA6agR5Nxeu56Er6g5rkDeoSz+06KNQ9pCwbj2Yh5prPUnqlQfoaZny43onJt5aJLXnFQEywU5iB8A== X-Received: by 2002:adf:f642:0:b0:226:d4b1:8502 with SMTP id x2-20020adff642000000b00226d4b18502mr23772737wrp.553.1662398168829; Mon, 05 Sep 2022 10:16:08 -0700 (PDT) Received: from Clement-Blade14.home (2a01cb000c0d3d00995730c36491d21b.ipv6.abo.wanadoo.fr. [2a01:cb00:c0d:3d00:9957:30c3:6491:d21b]) by smtp.gmail.com with ESMTPSA id v22-20020a7bcb56000000b003a5ad7f6de2sm11437072wmj.15.2022.09.05.10.16.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Sep 2022 10:16:08 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Rob Herring , Krzysztof Kozlowski , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Catalin Marinas , Will Deacon , Tomeu Vizoso , Steven Price , Alyssa Rosenzweig , David Airlie , Daniel Vetter , Bjorn Andersson , Shawn Guo , Geert Uytterhoeven , Arnd Bergmann , Marcel Ziswiler , Vinod Koul , Dmitry Baryshkov , Biju Das Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= Subject: [PATCH v3 2/5] arm64: dts: allwinner: h6: Add cooling map for GPU Date: Mon, 5 Sep 2022 19:15:58 +0200 Message-Id: <20220905171601.79284-3-peron.clem@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220905171601.79284-1-peron.clem@gmail.com> References: <20220905171601.79284-1-peron.clem@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220905_181614_579937_951CE34D X-CRM114-Status: GOOD ( 14.75 ) 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 Add a simple cooling map for the GPU. This cooling map come from the vendor kernel 4.9 with a 2°C hysteresis added. Signed-off-by: Clément Péron --- arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi | 51 +++++++++++++++++++- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi index 5a28303d3d4c..1259ab0c3956 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6.dtsi @@ -186,6 +186,7 @@ gpu: gpu@1800000 { clocks = <&ccu CLK_GPU>, <&ccu CLK_BUS_GPU>; clock-names = "core", "bus"; resets = <&ccu RST_BUS_GPU>; + #cooling-cells = <2>; status = "disabled"; }; @@ -1072,9 +1073,55 @@ map0 { }; gpu-thermal { - polling-delay-passive = <0>; - polling-delay = <0>; + polling-delay-passive = <1000>; + polling-delay = <2000>; thermal-sensors = <&ths 1>; + + trips { + gpu_alert0: gpu-alert-0 { + temperature = <95000>; + hysteresis = <2000>; + type = "passive"; + }; + + gpu_alert1: gpu-alert-1 { + temperature = <100000>; + hysteresis = <2000>; + type = "passive"; + }; + + gpu_alert2: gpu-alert-2 { + temperature = <105000>; + hysteresis = <2000>; + type = "passive"; + }; + + gpu-crit { + temperature = <115000>; + hysteresis = <0>; + type = "critical"; + }; + }; + + cooling-maps { + // Fordid the GPU to go over 756MHz + map0 { + trip = <&gpu_alert0>; + cooling-device = <&gpu 1 THERMAL_NO_LIMIT>; + }; + + // Fordid the GPU to go over 624MHz + map1 { + trip = <&gpu_alert1>; + cooling-device = <&gpu 2 THERMAL_NO_LIMIT>; + }; + + // Fordid the GPU to go over 576MHz + map2 { + trip = <&gpu_alert2>; + cooling-device = <&gpu 3 THERMAL_NO_LIMIT>; + }; + }; }; }; };