Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp3404537rwb; Mon, 5 Sep 2022 11:02:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR74Y9aOk5hvBLDqqyj6wRiobMOPk63nVVxQJ8giVaWFCsMhsiUrXBq+KFHqoEBhtSLOy8aF X-Received: by 2002:a05:6a00:1492:b0:536:74b1:101d with SMTP id v18-20020a056a00149200b0053674b1101dmr49938520pfu.31.1662400966455; Mon, 05 Sep 2022 11:02:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662400966; cv=none; d=google.com; s=arc-20160816; b=yIwI0vYQZ54sPSL5QEETm6YORMp11gnZ8vAasVc9ZHSYX/J1BCcFfxr1yyipPJrRNS YJSmEokUMQgoDk+fSTMK6/PnSgMedqpxsXGmYVnHGvNeU+dOExBfGRCpBLKR6I+UcyQl N05aAd/7zy+9A1ctEULsCbKdFQST0jNTE8wsumvlF2wh1x4ewmuBGvCNH80BkJTjTTJv j9zkutbRJcRwsHPrEFoyW/yTIN5dXtfGdXKLJZsVAThOn0xmrfFqRpKpUesmUJHEO8Ki TJ5BQxqSUzeQ4CbH4vQlFPzhq7zqrmPwBsKQ7WdV+f1zEKZ8BXdB4UZm6Ne7BjzMQSI7 AEtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WUkQWFeaJEpRmCMCeC5H0e01SJTSdoAluI/3ZHffQec=; b=hwjwSAHyK2So2Q5B4mVa9KDNrLdoeuQa4nzTiiKHXHneZ9SSuLV4qVz9I2VZILm6oq noi1nzp9FCkNlt/mqwUd154HyzQ4a2ptNHewHvCVvBNZxVXRMm/pnq7pu+avjbrOKhsn ctJX3UyUSmSXtPf9vk9usZa0ogG3WByrCgOkXZZ3WH4EPDl/9LX7yBAeKyH0LA1zGoPk MGeBr2VnCEzHlxYtu7S11PhBgEq+thEkFEi7giPN1MCdGpoMJSMy/oFKbt7pH8hJeqFg RU5AjzIptasuvuUwonhQ5sYTrfBjeRQVyl9e9swdYTOtt3Gwr7xhZk07IZN03Cy4m7VS DJ0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KRzIb9xv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x14-20020a170902820e00b00170ad89d371si10153869pln.465.2022.09.05.11.02.30; Mon, 05 Sep 2022 11:02:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=KRzIb9xv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237914AbiIERQT (ORCPT + 99 others); Mon, 5 Sep 2022 13:16:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237822AbiIERQM (ORCPT ); Mon, 5 Sep 2022 13:16:12 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 606815141F; Mon, 5 Sep 2022 10:16:10 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id bp20so11676203wrb.9; 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=CvqoJimp/6e231GUauODrF1CqrZXrVjXMler5o9pB6+nkT34+9aRM8Renby5qjrUNg zxh78tZJkOwJHtpJeOJA+0d7NqmZ6JKPeSDrJDQAvCbMvM4wMIOJvZfc8IZmAO1UzOqV Glq8mu2nOnidAyBiU+Wy+8pRE9cAuHwYOsetEU53KPF1IMqlWO39o6NKfzcoMCEF5tm4 iGShDuj3Kx3tLxyxHIe7KfjcMGLUG5Mk7fnEyzV8sE++fG9l+OjU7V9bodTzkuWsD78m tixMe1j7Rbkec3+yf2qs/QtFBj82IQw26KbBGS1JwbY6U8pggbFdpjgi7QQvCT+RCdkp 7VoA== X-Gm-Message-State: ACgBeo2hfdxq9WWmOISwg16U9Ef5FKhA6YZ8CYz7HePAkBvhW1RZQDym nX/a1pJKe54TeXjCWoZ5YSo= 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?q?Cl=C3=A9ment=20P=C3=A9ron?= 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?q?Cl=C3=A9ment=20P=C3=A9ron?= 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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>; + }; + }; }; }; }; -- 2.34.1