From patchwork Tue Sep 6 15:30:30 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: 12967702 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 14D87ECAAA1 for ; Tue, 6 Sep 2022 15:31:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 200F410E6DE; Tue, 6 Sep 2022 15:31:11 +0000 (UTC) Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by gabe.freedesktop.org (Postfix) with ESMTPS id AB34E10E6D9 for ; Tue, 6 Sep 2022 15:30:40 +0000 (UTC) Received: by mail-wr1-x435.google.com with SMTP id bz13so12614236wrb.2 for ; Tue, 06 Sep 2022 08:30:40 -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=TzfY9hsKE+/NMaAr86KQtgckRDntIH8+oY7tsTfeowI=; b=G1z6RtYS4iEJ22psOaMaQE8+oWOg2j5Y9DvwtqNGc2mxRnXdrnKjzbDDwsi1XOqs3u xCA7f0i1vFUdiwAvNJBs7vOW3OzYBYcLQ3zdvjSq+fCAzXd6xHLCWep5vEPfapdH6yoR dZRiKmgypproeCw3VicU1D9DM3CP7n6xjPU2X05/OM6wgAnkJaiO3wib1Lx5gKI6YJ2P Q/xn34rJW5DgahH0BbGkfPfjGhGhhS4mpDPBnjBRwXq0RIckXs9eiHxxbusCVKMteVlv OO2qhBR1hXqVWzp9LYAtzMJrco4RupWBfPsHprVLdUpq6zB5idOiwd6QsB3i4OliAcJZ Nd7g== 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=TzfY9hsKE+/NMaAr86KQtgckRDntIH8+oY7tsTfeowI=; b=wTvxvQfvbC009AQZoe34LCRVhhSeJLGX95EfLiqtvPm9x1hmlCNUIb42sjAx4rNEEF 4XoEH9RSpn8UFRIShkhkYP/Lyodkf6OZBuHYVX970zSJhOlxZ4N3MEH/dgushMsfhQsb lnvd0WqUUCUiM/I0Oz/5O3zkIjP6zNAY0kJLOBKz9xG2wRBxSsisNiZTSdOFEup8cWwj Gz14nfUZKhAqOY6LYNnmqPP8gOWIXCQLHhXVs2dUwA+qdgiG7b0stfx6AUDUEvhTlLpR uXw41F7Ru83NGWWvvyHcVBcF6oe7uVmwG1EHDxc20gU9ibDXDLuoV9MFA/BGrtc+F0je g2Rg== X-Gm-Message-State: ACgBeo3BhZWliui/MQrKxyGqKU2FAS4ndfpprA9UdAQqFTD3zN/xVvjc ZdngA/JMMDQT2a/4CTshOpw= X-Google-Smtp-Source: AA6agR4fDTUAPj150MWqbk6q/AO0tVAXOO+fiKS6HJfjSQzIqcMzESayHrNPSB2h99kexJGm0WHKrA== X-Received: by 2002:adf:e706:0:b0:228:61dc:3dfa with SMTP id c6-20020adfe706000000b0022861dc3dfamr8410720wrm.265.1662478238552; Tue, 06 Sep 2022 08:30:38 -0700 (PDT) Received: from Clement-Blade14.outsight.local (lputeaux-656-1-11-33.w82-127.abo.wanadoo.fr. [82.127.142.33]) by smtp.gmail.com with ESMTPSA id 24-20020a05600c22d800b003a6125562e1sm14922731wmg.46.2022.09.06.08.30.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 08:30:37 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Catalin Marinas , Will Deacon Subject: [PATCH v4 1/5] arm64: defconfig: Enable devfreq cooling device Date: Tue, 6 Sep 2022 17:30:30 +0200 Message-Id: <20220906153034.153321-2-peron.clem@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220906153034.153321-1-peron.clem@gmail.com> References: <20220906153034.153321-1-peron.clem@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-sunxi@lists.linux.dev, linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Devfreq cooling device framework is used in Panfrost to throttle GPU in order to regulate its temperature. Enable this driver for ARM64 SoC. Signed-off-by: Clément Péron Acked-by: Jernej Skrabec --- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig index 91e58cf59c99..e557ccac8d9c 100644 --- a/arch/arm64/configs/defconfig +++ b/arch/arm64/configs/defconfig @@ -582,6 +582,7 @@ CONFIG_SENSORS_INA2XX=m CONFIG_SENSORS_INA3221=m CONFIG_THERMAL_GOV_POWER_ALLOCATOR=y CONFIG_CPU_THERMAL=y +CONFIG_DEVFREQ_THERMAL=y CONFIG_THERMAL_EMULATION=y CONFIG_IMX_SC_THERMAL=m CONFIG_IMX8MM_THERMAL=m From patchwork Tue Sep 6 15:30:31 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: 12967700 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 E80B2ECAAA1 for ; Tue, 6 Sep 2022 15:31:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2B4EA10E6DC; Tue, 6 Sep 2022 15:30:53 +0000 (UTC) Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 41DF510E6D1 for ; Tue, 6 Sep 2022 15:30:42 +0000 (UTC) Received: by mail-wr1-x42b.google.com with SMTP id e20so15986486wri.13 for ; Tue, 06 Sep 2022 08:30:42 -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=i5Fx7IVYwPyLivAgaYsyID9MSMUQe3FGyD8Gwua8VA4=; b=Dpd6+bbXENGWjlJ+Rk/N6aSO+77Eta7XIFQFlzwexijOux30B7jCSrI3nK4/pMPvrV Z3sLxXUbxuzzGFctCsnnkCjsxltRgjMWUy1Mir8HzQhj/kvEXVzpmgLE5dSFST43ApMr htPvRgyEVPmVlgDRW9Q1XwvBCevfw9Zr9IW0SqqYk9u00XIkCv5BDs5Wz3mAdV8A12FC ER7PvRT56Memx7kVLS3YR9Z7r+b3QUd419WJ5H1PWQHCkjVQ0rtyrqhJ71GfdnfiEMBX hXIbNw2SOTjd7XkpPeNfhaFpKailuPfMKx0vCX8FxTygbgsbhZuGhOitkBFO8QOlMvb9 NeNw== 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=i5Fx7IVYwPyLivAgaYsyID9MSMUQe3FGyD8Gwua8VA4=; b=4g2T8MbpDuD56uG4B4up8xSJu8vIVsS1jtlKyaX+pyes1194knz1apWbQtMObyg3B9 t/Al9CmXirI5PZpnyR3UrgJ+PxjgnMuRug2lABmBpCY2QERsjpUyeYwp15i1Bj8uasOm W+RWUaBi1bgoRoKp+g9FLCiBpz57YNVG0dSvkyUh6A5wFXIRbvBozEIiPY0zayWf2rho BeOCGFRHRbuLohuXOZrCgwmKOdYtHQ86vYTfHp3JYvrWY7opMTTPCVFYcJup8EpWKjvf Tf4wRb9gIb7WM7Kq9dcSKeuMLgQMPaRcwmKDZ3Od8kgLFCuKDouxDbeS+GpZqC8Rps3g vpNg== X-Gm-Message-State: ACgBeo0I0NS8qNjg7WtvptEA7eXrTL5azzh732+c06urHY1nv4RjHgsq OTwIXvckNwxoV1YSOh7KlTA= X-Google-Smtp-Source: AA6agR7Gk+SyBM5KEpmW40JfCj1eCWgs4ex/z4EHEwPDBeTPMJA2kA8/BBoluAnx+PZIBZFMAlxOsw== X-Received: by 2002:a05:6000:1566:b0:228:b754:186e with SMTP id 6-20020a056000156600b00228b754186emr4831466wrz.226.1662478240266; Tue, 06 Sep 2022 08:30:40 -0700 (PDT) Received: from Clement-Blade14.outsight.local (lputeaux-656-1-11-33.w82-127.abo.wanadoo.fr. [82.127.142.33]) by smtp.gmail.com with ESMTPSA id 24-20020a05600c22d800b003a6125562e1sm14922731wmg.46.2022.09.06.08.30.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 08:30:39 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Rob Herring , Krzysztof Kozlowski Subject: [PATCH v4 2/5] arm64: dts: allwinner: h6: Add cooling map for GPU Date: Tue, 6 Sep 2022 17:30:31 +0200 Message-Id: <20220906153034.153321-3-peron.clem@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220906153034.153321-1-peron.clem@gmail.com> References: <20220906153034.153321-1-peron.clem@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-sunxi@lists.linux.dev, linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 Acked-by: Jernej Skrabec --- 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..53f6660656ac 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 { + // Forbid the GPU to go over 756MHz + map0 { + trip = <&gpu_alert0>; + cooling-device = <&gpu 1 THERMAL_NO_LIMIT>; + }; + + // Forbid the GPU to go over 624MHz + map1 { + trip = <&gpu_alert1>; + cooling-device = <&gpu 2 THERMAL_NO_LIMIT>; + }; + + // Forbid the GPU to go over 576MHz + map2 { + trip = <&gpu_alert2>; + cooling-device = <&gpu 3 THERMAL_NO_LIMIT>; + }; + }; }; }; }; From patchwork Tue Sep 6 15:30:32 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: 12967698 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 D4E9FC6FA83 for ; Tue, 6 Sep 2022 15:31:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 22BD110E6D9; Tue, 6 Sep 2022 15:30:50 +0000 (UTC) Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by gabe.freedesktop.org (Postfix) with ESMTPS id C056310E6D1 for ; Tue, 6 Sep 2022 15:30:43 +0000 (UTC) Received: by mail-wm1-x32a.google.com with SMTP id d5so7071933wms.5 for ; Tue, 06 Sep 2022 08:30:43 -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=zJZPxQVJEy8FT+BLePfAsrbdveDVonWnxw7E4dm+iGc=; b=jKxJ93rzIhzwM+an4KKX7gs+eUdz1/4iPoMYXEGxDsJrptfsYkEkmpqywMJbpbLAnw 5a7R2dZQP0CiDTDqEDS5h/lCedNJvxUCqcbN+LInDDMZP3HBNGsuL0Hg3IMCkKhE6R+i IuJmwVoyxm+BpJEk85mmEmFWpfH+bz6RMKP/ZrT+LeQ4tDqKNGAIHvty77DmsWKitgli ZyhQwk72QenVaKDKdv5r91j4wclvfUMkjgsdE2rH/IY5vsvwB6ivc+fSeVNvWNwWBZdH 9oYVJEv0jJja/bvp/vqdd/C9mCtzrY91AJt9pc736309slFTFOPOfT3AdAMtQ6Al1xn7 FuoQ== 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=zJZPxQVJEy8FT+BLePfAsrbdveDVonWnxw7E4dm+iGc=; b=j9xBlA86V1U8Eq4I9Pfsq45RA+wnZIHw62oRfZqcihYwqVgHZvurOXjALYHBhz8T6E NyVXKl+BLzDJPixLmJdWM22tP8Kjd+uS76+LN188XRbG6jM126JnbhD+QfSst3FrQTrp z9BgZDL9czeBB7T07tmVhUy6+mD9KoyOHb8WS3OpgJPdWMxg2fcbXkyOLpVDd128YlEd WPD9wzL/lXjv4C5em8WzBn57bFWXH/gHyFR7eVQhqeIktendDUw/5dZLPuH3QgDc2TmV t3XTKfUTA4htsMWtRVb9Z3GYSSJ0/TjM27E0qLJ92YlI/YUedqtvRzS+GmfnwgvNcc9u owGw== X-Gm-Message-State: ACgBeo2dykmyV0bafvAqNFZ9j7l9fj4haTMos2G6b9a96vUMc/PNBhBp ei9SHhfeFJ07WdW5KpD/tmo= X-Google-Smtp-Source: AA6agR6X8fTOGpPx9SyhJ018vZ730P+biN2CXUDw5K/HkGx0KjlSD838vU8LLk6q1i8Pn9Eltxyhsg== X-Received: by 2002:a05:600c:3c96:b0:3a6:59b1:5eb5 with SMTP id bg22-20020a05600c3c9600b003a659b15eb5mr14328095wmb.187.1662478241867; Tue, 06 Sep 2022 08:30:41 -0700 (PDT) Received: from Clement-Blade14.outsight.local (lputeaux-656-1-11-33.w82-127.abo.wanadoo.fr. [82.127.142.33]) by smtp.gmail.com with ESMTPSA id 24-20020a05600c22d800b003a6125562e1sm14922731wmg.46.2022.09.06.08.30.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 08:30:41 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Rob Herring , Krzysztof Kozlowski Subject: [PATCH v4 3/5] arm64: dts: allwinner: h6: Add GPU OPP table Date: Tue, 6 Sep 2022 17:30:32 +0200 Message-Id: <20220906153034.153321-4-peron.clem@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220906153034.153321-1-peron.clem@gmail.com> References: <20220906153034.153321-1-peron.clem@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-sunxi@lists.linux.dev, linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Add an Operating Performance Points table for the GPU to enable Dynamic Voltage & Frequency Scaling on the H6. The voltage range is set with minimal voltage set to the target and the maximal voltage set to 1.2V. This allow DVFS framework to work properly on board with fixed regulator. Signed-off-by: Clément Péron Acked-by: Jernej Skrabec --- .../boot/dts/allwinner/sun50i-h6-gpu-opp.dtsi | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h6-gpu-opp.dtsi diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-gpu-opp.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6-gpu-opp.dtsi new file mode 100644 index 000000000000..b48049c4fc85 --- /dev/null +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-gpu-opp.dtsi @@ -0,0 +1,87 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +// Copyright (C) 2022 Clément Péron + +/ { + gpu_opp_table: opp-table-gpu { + compatible = "operating-points-v2"; + + opp-216000000 { + opp-hz = /bits/ 64 <216000000>; + opp-microvolt = <810000 810000 1200000>; + }; + + opp-264000000 { + opp-hz = /bits/ 64 <264000000>; + opp-microvolt = <810000 810000 1200000>; + }; + + opp-312000000 { + opp-hz = /bits/ 64 <312000000>; + opp-microvolt = <810000 810000 1200000>; + }; + + opp-336000000 { + opp-hz = /bits/ 64 <336000000>; + opp-microvolt = <810000 810000 1200000>; + }; + + opp-360000000 { + opp-hz = /bits/ 64 <360000000>; + opp-microvolt = <820000 820000 1200000>; + }; + + opp-384000000 { + opp-hz = /bits/ 64 <384000000>; + opp-microvolt = <830000 830000 1200000>; + }; + + opp-408000000 { + opp-hz = /bits/ 64 <408000000>; + opp-microvolt = <840000 840000 1200000>; + }; + + opp-420000000 { + opp-hz = /bits/ 64 <420000000>; + opp-microvolt = <850000 850000 1200000>; + }; + + opp-432000000 { + opp-hz = /bits/ 64 <432000000>; + opp-microvolt = <860000 860000 1200000>; + }; + + opp-456000000 { + opp-hz = /bits/ 64 <456000000>; + opp-microvolt = <870000 870000 1200000>; + }; + + opp-504000000 { + opp-hz = /bits/ 64 <504000000>; + opp-microvolt = <890000 890000 1200000>; + }; + + opp-540000000 { + opp-hz = /bits/ 64 <540000000>; + opp-microvolt = <910000 910000 1200000>; + }; + + opp-576000000 { + opp-hz = /bits/ 64 <576000000>; + opp-microvolt = <930000 930000 1200000>; + }; + + opp-624000000 { + opp-hz = /bits/ 64 <624000000>; + opp-microvolt = <950000 950000 1200000>; + }; + + opp-756000000 { + opp-hz = /bits/ 64 <756000000>; + opp-microvolt = <1040000 1040000 1200000>; + }; + }; +}; + +&gpu { + operating-points-v2 = <&gpu_opp_table>; +}; From patchwork Tue Sep 6 15:30:33 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: 12967699 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 24A41ECAAA1 for ; Tue, 6 Sep 2022 15:31:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D491610E6DA; Tue, 6 Sep 2022 15:30:51 +0000 (UTC) Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by gabe.freedesktop.org (Postfix) with ESMTPS id F10DE10E6D9 for ; Tue, 6 Sep 2022 15:30:44 +0000 (UTC) Received: by mail-wr1-x435.google.com with SMTP id e13so16045183wrm.1 for ; Tue, 06 Sep 2022 08:30:44 -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=deNM8qIhqEaf1BX3jHfJgbq+ntr7dEybvk2vQtWGvA8=; b=hQ2ek4yNVW7yd3MqyzdOpp9dpyjXZQcaP3Ka31WgTs7bJBdonNXKn9nFKFVfCZxIkP qwaxe2flVffWR6WHNb5hREtROfAUl2UX9FdyCHFuwXGCrxlBJJYGDIa1zulG11zNHl+w JliIq5ET9TIyvOpGqpx51TD0uG7Ib21wVAdwhYCZmCy5Iqp/aCVgvVZrMmX6OM0pukAU hSKJTFfk8Gka5a2gWpHQa1AzFjYNuSWBgImwH/LyzOrPDOWiEG9hdheSOGjurtS7/HdI 5ENk2RmhTXaaL954QfXE/uc/tR9z4iHn4T0c+Qhgio3RCAWy1hvmzL9S821lInjlwyux /9UQ== 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=deNM8qIhqEaf1BX3jHfJgbq+ntr7dEybvk2vQtWGvA8=; b=6CPXzSbSdG8l3YRDGEoTiEUVqHltM+d/K8a2wFBtXTHh4qjuT0xph9xpUX751ooPzf Bf4gCXqVxfhYGmjB5LeIbosjFZ/Fno/IKJ5iUlxzKoy9nBWn/zkmNdjgwhhttzbr/L06 NUbYqpkq/3fCli1SeFXk0qcuhk6KJiQ1qEO+vhYEyrkDrrNmY1y9wjKbHHF2DnX/ojFo pt8MmWdRyYuIDGM+4CFKdSxd/xLeu84J2bS3+ukf+kScysgZosnZ7E3ncXhj1MBdXE1K BoN+VW/wttzky4lodtZDHCaQXZ4yezcIifPbF17lxaSADvnBlgb+0FCzI+bQp3/VfasR QeyA== X-Gm-Message-State: ACgBeo23aTgtjOyQBCQJodFvM1jtjlPAa2Cq4x0Jl5FuBcewiwXhWVk7 jWbgz7qCYqrFUMgrRmLK67w= X-Google-Smtp-Source: AA6agR7XgMMod/UzqnVyMp/Du84+AgxUL59KAC6k2gnekD3iXBLrlQFzXfkAgYjmWGxaKnWPSA2U5A== X-Received: by 2002:a5d:6e8e:0:b0:220:5fa1:d508 with SMTP id k14-20020a5d6e8e000000b002205fa1d508mr29501866wrz.337.1662478243202; Tue, 06 Sep 2022 08:30:43 -0700 (PDT) Received: from Clement-Blade14.outsight.local (lputeaux-656-1-11-33.w82-127.abo.wanadoo.fr. [82.127.142.33]) by smtp.gmail.com with ESMTPSA id 24-20020a05600c22d800b003a6125562e1sm14922731wmg.46.2022.09.06.08.30.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 08:30:42 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Rob Herring , Tomeu Vizoso , Steven Price , Alyssa Rosenzweig , David Airlie , Daniel Vetter Subject: [PATCH v4 4/5] drm/panfrost: devfreq: set opp to the recommended one to configure regulator Date: Tue, 6 Sep 2022 17:30:33 +0200 Message-Id: <20220906153034.153321-5-peron.clem@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220906153034.153321-1-peron.clem@gmail.com> References: <20220906153034.153321-1-peron.clem@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Viresh Kumar , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-sunxi@lists.linux.dev, linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Enabling panfrost GPU OPP with dynamic regulator will make OPP responsible to enable and configure it. Unfortunatly OPP configure and enable the regulator when an OPP is asked to be set, which is not the case during panfrost_devfreq_init(). This leave the regulator unconfigured and if no GPU load is triggered, no OPP is asked to be set which make the regulator framework switching it off during regulator_late_cleanup() without noticing and therefore make the board hang as any access to GPU memory space make bus locks up. Call dev_pm_opp_set_opp() with the recommend OPP in panfrost_devfreq_init() to enable the regulator, this will properly configure and enable the regulator and will avoid any switch off by regulator_late_cleanup(). Suggested-by: Viresh Kumar Signed-off-by: Clément Péron Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_devfreq.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c index 5110cd9b2425..fe5f12f16a63 100644 --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c @@ -131,6 +131,17 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) return PTR_ERR(opp); panfrost_devfreq_profile.initial_freq = cur_freq; + + /* + * Set the recommend OPP this will enable and configure the regulator + * if any and will avoid a switch off by regulator_late_cleanup() + */ + ret = dev_pm_opp_set_opp(dev, opp); + if (ret) { + DRM_DEV_ERROR(dev, "Couldn't set recommended OPP\n"); + return ret; + } + dev_pm_opp_put(opp); /* From patchwork Tue Sep 6 15:30:34 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: 12967701 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 49EDEECAAD5 for ; Tue, 6 Sep 2022 15:31:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2693010E6DB; Tue, 6 Sep 2022 15:31:03 +0000 (UTC) Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1A61010E6D9 for ; Tue, 6 Sep 2022 15:30:46 +0000 (UTC) Received: by mail-wr1-x42e.google.com with SMTP id b5so16031979wrr.5 for ; Tue, 06 Sep 2022 08:30:45 -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=18ALGCD6WSmdQYtbgKgYJ3c/Y319JyrAAYBhTvLvvok=; b=D+lIKJTJ5gmuLshP9pZR7/p9Uq3yXYg4c6fW1hSumSgSCwDmr/fcsKGBJJYtzoWVcF TN92NA+w2VWWby8boBIRrC14bsNy6GYJyUPzlPtxWzS4vdR7pAtld7jVe9UKiyn/T3n0 mnFsqq4rRCunuO52qB/6Rs/YrSV+UibGc8pmWPOntrv5gMbhCfkfgWHX4dCR8zLDaqL9 kCfQSPl/94cmjytUnDrr4Dls+czbEXkNWUC73gjbfe1dWCc98c4xtUZIa7MxCZu8jtdz teAm6/fXX6x/DcjovAjmyj/7jszu1EpgLa2cmsO0eHBSZ2RJFDtT1FFVcEwih0SifB3g 3E2w== 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=18ALGCD6WSmdQYtbgKgYJ3c/Y319JyrAAYBhTvLvvok=; b=N8BWCW0XQ8mLpfYcFNeK+CHy4ROpUNxqnbD1uTlTxGvU3XuHNuxFlTFNl/D6KdRhTy s/jZCCH8w1G6k26gGq2HAzdR/J5QO40wmjktnoCkni2HXSd59iCv57ydNUabD9U9yPq1 vJ6n3SMM4q0Lnom8QKCDjOBrOm/Cq1xdlHEQOKVJyHri/EO7mrOT6l+kjIFSZre/Qfja fuAyqAFPAQTozn2KUduxoflWad7JTiU6aeYDZxcOX7pkuKsl7d5DngAFxE0G5TBspjmO /13p7CKQBZ/ztCiXn/2Wdjzp1rXSQTfJDf6NJzKOkfQvRfNKMLbnjFFtFvOTLCLDTGtc BesA== X-Gm-Message-State: ACgBeo3/kzpTyuxygAwIvj895TsyhTHqDRK/Qd2Nbvzi8WUC4Qtt8g95 e/8oyQuWiVHnI1J60lRsTKg= X-Google-Smtp-Source: AA6agR6P/RoJFPCp99aXsrvNKO/CW4Xn7PpfrGRr103Jx3gdD14r4PVNgrMIKUUt26sNFdyw2C87+w== X-Received: by 2002:a5d:608d:0:b0:228:d095:4a15 with SMTP id w13-20020a5d608d000000b00228d0954a15mr3792578wrt.499.1662478244524; Tue, 06 Sep 2022 08:30:44 -0700 (PDT) Received: from Clement-Blade14.outsight.local (lputeaux-656-1-11-33.w82-127.abo.wanadoo.fr. [82.127.142.33]) by smtp.gmail.com with ESMTPSA id 24-20020a05600c22d800b003a6125562e1sm14922731wmg.46.2022.09.06.08.30.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 08:30:43 -0700 (PDT) From: =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= To: Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Rob Herring , Krzysztof Kozlowski Subject: [PATCH v4 5/5] arm64: dts: allwinner: beelink-gs1: Enable GPU OPP Date: Tue, 6 Sep 2022 17:30:34 +0200 Message-Id: <20220906153034.153321-6-peron.clem@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220906153034.153321-1-peron.clem@gmail.com> References: <20220906153034.153321-1-peron.clem@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, =?utf-8?b?Q2zDqW1lbnQgUMOpcm9u?= , linux-sunxi@lists.linux.dev, linux-arm-kernel@lists.infradead.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Enable GPU OPP table for Beelink GS1. Signed-off-by: Clément Péron Acked-by: Jernej Skrabec --- arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts index 6249e9e02928..9ec49ac2f6fd 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-beelink-gs1.dts @@ -5,6 +5,7 @@ #include "sun50i-h6.dtsi" #include "sun50i-h6-cpu-opp.dtsi" +#include "sun50i-h6-gpu-opp.dtsi" #include