From patchwork Mon May 20 22:00:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 10952433 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 402D676 for ; Mon, 20 May 2019 22:01:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B8162893F for ; Mon, 20 May 2019 22:01:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1F20028942; Mon, 20 May 2019 22:01:12 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C4DDB2893F for ; Mon, 20 May 2019 22:01:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=/hL6grW1Gg168yYuQEttyaKUE/DN0FlU81VgQdziDrg=; b=oREG5CEd/WIqTZ 2uzEM5JzvbMQuYaVwR403eXaTocss1OJa5ynKQj0FHcTnqupb3FFMm5xwaOzR5HL7WO3CvhxxRxuO MFXqO5eSW35T3Ekf2DJDNuj7HjN2PZ7yEMuvOZB1Oi7QT6KkWQ0dFliDEmbk11kYE2rghf9oH/0yH 0o46cYniQiS4T4Tfxk8vr0Az6HQ8ODGSi9DezHxqqKtKDOFl3oxqRp1q+mnPhuiimPFC1lH7kESZN pMi1QaDwuGZwnhP62/ldz6789xtrRBh18J2VpW5gtpGydQqZW/8+XiaB/TOjgfgf999jQnL0/ZqHy Dhm2wYgeHvneR5Vuhd8w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSqLD-00015M-MW; Mon, 20 May 2019 22:01:07 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSqL5-0000vk-C3 for linux-rockchip@lists.infradead.org; Mon, 20 May 2019 22:01:01 +0000 Received: by mail-pl1-x643.google.com with SMTP id p1so1962524plo.2 for ; Mon, 20 May 2019 15:00:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vtpw37UMclFgwsWmb0g3/F0Vs7Vu7ExQy0ncbvkEDZU=; b=EPZ0X+O4Hu/F2sATps1IWhS7QDdC7Am72erJCLSgGeemHLtkKl4v4yxKaEToIFQPwB N61A4R5TXNaf6/W06obkK79GwzeGrQB9FKapiEMCltkOH9tPsYwgegqkRv19LSHTA3AQ RB7232HKfLvJ0y1uqXxOZmTLCRdGvCWWqo4Cc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vtpw37UMclFgwsWmb0g3/F0Vs7Vu7ExQy0ncbvkEDZU=; b=N+JASzKQO/kGZEGHNh63qb4ZcR7wQ3BjpKVoWP4hXNMsCm+C87cWdIUjtYK2u/idKD Cpt2rAcZgRiyhA1c5gr2gCrB07Jyr+rMwzpfmyACclu4Un5ujEHIOC+ph1uS4fEGtvTg gQYuYt8wCJUGWZagqZ7t9KzSQ4ZdsJ5EUc93U0KRvfn7zaJl4voj1tk5mX10EnrA5kKH 86bfeGkG3Hm6RAYDNnKGMzHi4O8LzIRYPJcuKL5bqaoifraQpTtWBAreCq14jvk36U6Z g7EtVXC6MfLB/MAntn+BHASotPiEdY4vczLvkgtJrjTThAh8Y3NznPRxjX0vmB4ld4so bd9A== X-Gm-Message-State: APjAAAXh+X6fufeXEFL6y1NuaT/rKEZ/SUR5VYt2UJd744o+mKID/2oS wF12irBumZO/frH2Q5T+BlxJ+A== X-Google-Smtp-Source: APXvYqzLoewKhT1vDuz7GtTRsQScroD7YBJPCR6KbPfxnrP99Cz3ZYVhsa75U2HjYsoh8F23esun7g== X-Received: by 2002:a17:902:aa97:: with SMTP id d23mr78594959plr.313.1558389658649; Mon, 20 May 2019 15:00:58 -0700 (PDT) Received: from localhost ([2620:15c:202:1:75a:3f6e:21d:9374]) by smtp.gmail.com with ESMTPSA id k192sm18805998pga.20.2019.05.20.15.00.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 May 2019 15:00:58 -0700 (PDT) From: Matthias Kaehlcke To: Heiko Stuebner , Rob Herring , Mark Rutland Subject: [PATCH v2 1/3] ARM: dts: rockchip: disable GPU 500 MHz OPP for veyron Date: Mon, 20 May 2019 15:00:49 -0700 Message-Id: <20190520220051.54847-1-mka@chromium.org> X-Mailer: git-send-email 2.21.0.1020.gf2820cf01a-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190520_150059_443191_763B98C8 X-CRM114-Status: UNSURE ( 9.88 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Douglas Anderson , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Matthias Kaehlcke , linux-arm-kernel@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The NPLL is the only safe way to generate 500 MHz for the GPU. The downstream Chrome OS 3.14 kernel ('official' kernel for veyron devices) re-purposes NPLL to HDMI and hence disables the OPP for the GPU (see https://crrev.com/c/1574579). Disable it here as well to keep in sync and avoid problems in case someone decides to re-purpose NPLL. Signed-off-by: Matthias Kaehlcke Reviewed-by: Douglas Anderson --- Changes in v2: - patch added to the series --- arch/arm/boot/dts/rk3288-veyron.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/arch/arm/boot/dts/rk3288-veyron.dtsi b/arch/arm/boot/dts/rk3288-veyron.dtsi index 90c8312d01ff..ec10ce4fcf04 100644 --- a/arch/arm/boot/dts/rk3288-veyron.dtsi +++ b/arch/arm/boot/dts/rk3288-veyron.dtsi @@ -174,6 +174,14 @@ temperature = <100000>; }; +/* + * Remove 500 MHz since the only way to make 500 MHz is via the NPLL + * which might be used for HDMI. + */ +&gpu_opp_table { + /delete-node/ opp-500000000; +}; + &hdmi { ddc-i2c-bus = <&i2c5>; status = "okay"; From patchwork Mon May 20 22:00:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 10952437 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9DEC11395 for ; Mon, 20 May 2019 22:01:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8A4E62893F for ; Mon, 20 May 2019 22:01:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7CEAA28942; Mon, 20 May 2019 22:01:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3388F2893F for ; Mon, 20 May 2019 22:01:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uG5L1PDdc0gyIR+2kBtFdkhQZgTfg4nudDhZlXhpb/g=; b=lkImiLI+OVmyPF gDJXK82zpnAssSkW4mHpVVC2TmMCT63PH/pINEiKubQD5fKdqP25v3WtcBMlz4DIMumWNvJnS1BzT 1EQdtmCzIeesxgAFtYHaC5O3Fab6HkuGOUf0IgHu9GdYvVjAUAVgHF2CnpWrMhuQN8ZeayA044zFf Me5bBJGfc5P2MD45weaUj/qFR2fxWcQ6yGIt852pswQwQss783cbMt8W6FCtYaUBxaheiSIHNKzOX kuCAecCzO9i8AK5/fLKlEAyFYSRA2jc+vAaO9YwLs+Op222LGHbNUuRt78yyi1HkvUwvBbZig+vGw 7fOD96cM2GrQO6aiZcqA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSqLQ-0001MU-Io; Mon, 20 May 2019 22:01:20 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSqL6-0000wD-AN for linux-rockchip@lists.infradead.org; Mon, 20 May 2019 22:01:02 +0000 Received: by mail-pl1-x642.google.com with SMTP id f12so7336468plt.8 for ; Mon, 20 May 2019 15:01:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AhecyL2qQDBC3MCxt/zq3Kbo+pVDpSa4FZM2PC318KM=; b=Z29uCy48sLghmNEdhhMQV0TpJwla5O9kSHf07Kq1yjC7hxkrawcDlwcEoypi9ODm+q n2wRZpZ1LIgMMfnJ6PFTBpPuoRTwNeP9123yeA2DpRntUT8mJfxDahavhiUY5qg6j34u VtKZ+kG4sPm3iPzYFN/QPEO/zwnxl/apQ8iGI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AhecyL2qQDBC3MCxt/zq3Kbo+pVDpSa4FZM2PC318KM=; b=ZHzkECLReu0nWZ+tZIGpgmmhnoFnSBZM+uxojuWnlNi9QwePdZRF7K0OAAJblt7Pz9 Y54HR+J08BKL4V/Im/4AA9ZhICSjOahgYtkuv9FWch9aUHPowvyF+t6zRmoa4lIXK1nd hJAPfeA+HeXuCG4xRvEqdf5W4QEmFs7OEKhDtlef+KWi4gojSI5Tza/aKzcVf+rJM5HC cprSfP9cfUrf82X7nKBpFX7kXL9Y8HtjTUrRqd0L1GaU1abJzpyuV/gkzY/I10aRQNcO e3dfRCDBiDnFydVPX5Cn528ZBTg8ijcVEY0PN/TLWSBwzGm6EcRm1jptKjaMW2IIdRxT wHlw== X-Gm-Message-State: APjAAAUqtgP2DUyeWzIfsOcL5cI4qAbXIYOQkOlvDqjQdVcCV71maYM3 bXvFNmOyJuZWVjQWe31eRvatsw== X-Google-Smtp-Source: APXvYqw/+0hzgI+vOKWf7oG9dIM+CdVU0SsWOEYDBUI9M09FHn5cLFKmvyy5ff7yHB0Q6vF8xTU8XQ== X-Received: by 2002:a17:902:8ec4:: with SMTP id x4mr68111479plo.249.1558389659959; Mon, 20 May 2019 15:00:59 -0700 (PDT) Received: from localhost ([2620:15c:202:1:75a:3f6e:21d:9374]) by smtp.gmail.com with ESMTPSA id u66sm21907479pfb.76.2019.05.20.15.00.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 May 2019 15:00:59 -0700 (PDT) From: Matthias Kaehlcke To: Heiko Stuebner , Rob Herring , Mark Rutland Subject: [PATCH v2 2/3] ARM: dts: rockchip: Use the GPU to cool CPU thermal zone of veyron mickey Date: Mon, 20 May 2019 15:00:50 -0700 Message-Id: <20190520220051.54847-2-mka@chromium.org> X-Mailer: git-send-email 2.21.0.1020.gf2820cf01a-goog In-Reply-To: <20190520220051.54847-1-mka@chromium.org> References: <20190520220051.54847-1-mka@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190520_150100_356063_32294B54 X-CRM114-Status: GOOD ( 13.23 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Douglas Anderson , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Matthias Kaehlcke , linux-arm-kernel@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On rk3288 the CPU and GPU temperatures are correlated. Limit the GPU frequency on veyron mickey to 400 MHz for CPU temperatures >= 65°C and to 300 MHz for CPU temperatures >= 85°C. This matches the configuration of the downstream Chrome OS 3.14 kernel, the 'official' kernel for mickey. Signed-off-by: Matthias Kaehlcke Reviewed-by: Douglas Anderson --- Changes in v2: - added 'cpu_warm_limit_gpu' to throttle GPU for T.cpu >= 65°C - removed comment saying that GPU isn't throttled beyond 400 MHz based on CPU temperature - updated commit message Note: this patch depends on "ARM: dts: rockchip: Add #cooling-cells entry for rk3288 GPU" (https://lore.kernel.org/patchwork/patch/1075005/) --- arch/arm/boot/dts/rk3288-veyron-mickey.dts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/rk3288-veyron-mickey.dts b/arch/arm/boot/dts/rk3288-veyron-mickey.dts index 52f6abc22291..34797abe3403 100644 --- a/arch/arm/boot/dts/rk3288-veyron-mickey.dts +++ b/arch/arm/boot/dts/rk3288-veyron-mickey.dts @@ -75,9 +75,7 @@ cooling-maps { /* * After 1st level, throttle the CPU down to as low as 1.4 GHz - * and don't let the GPU go faster than 400 MHz. Note that we - * won't throttle the GPU lower than 400 MHz due to CPU - * heat--we'll let the GPU do the rest itself. + * and don't let the GPU go faster than 400 MHz. */ cpu_warm_limit_cpu { trip = <&cpu_alert_warm>; @@ -86,6 +84,10 @@ <&cpu2 THERMAL_NO_LIMIT 4>, <&cpu3 THERMAL_NO_LIMIT 4>; }; + cpu_warm_limit_gpu { + trip = <&cpu_alert_warm>; + cooling-device = <&gpu 1 1>; + }; /* * Add some discrete steps to help throttling system deal @@ -125,6 +127,12 @@ <&cpu2 8 THERMAL_NO_LIMIT>, <&cpu3 8 THERMAL_NO_LIMIT>; }; + + /* At very hot, don't let GPU go over 300 MHz */ + cpu_very_hot_limit_gpu { + trip = <&cpu_alert_very_hot>; + cooling-device = <&gpu 2 2>; + }; }; }; From patchwork Mon May 20 22:00:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 10952439 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A73FA76 for ; Mon, 20 May 2019 22:01:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9629F2893F for ; Mon, 20 May 2019 22:01:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A69C28942; Mon, 20 May 2019 22:01:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 284912893F for ; Mon, 20 May 2019 22:01:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oXCYDWyUvMtAFgbeV3pfi9yw38Bdjc9NElG9EG8AdGs=; b=T2pfF+WThOx75f swvnvZXlfCO61nMqIB5T/H/mX/5mNFHd+tFJQKR6prixQk/6YR8wzn10sy333GEhrv1+PUoUvgTBj ib0vqhcTjLB0feiaFF55cSZ9qSNnKsghnPf3NwPFuzCxXCuiK0n4U4wguNeXWPcL2phQDl6krvyOw 8euXBcjnlGJfAhVJv6QizwjLfJIi4VpMFJQPFYsNxk91rM/mTsRmuYKppGJCcS5AvZGlbrjZsbJJk JaOgn74KeSZtvbntFDdWmdPWuuQLmaVZVFdlgECbOic1iHTTwqVQy6OaPuTbttv+w/Ilf/mU9vCMT 7HBtWbbERorVRRL6mh8g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSqLS-0001PP-MQ; Mon, 20 May 2019 22:01:22 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hSqL7-0000wu-LQ for linux-rockchip@lists.infradead.org; Mon, 20 May 2019 22:01:03 +0000 Received: by mail-pl1-x643.google.com with SMTP id c5so7318350pll.11 for ; Mon, 20 May 2019 15:01:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=f3Nfs/DRidR4E+JraOJ0QC9J7vTv8+QYMg2eI3k8SAk=; b=ANP+z80ryOBxlhAoD1NQiuq5KGhSBLK6TIAyvMuecyDwGcEkfmwOXtJpj+Du/vSJ2j AoChR4T/+6F80fFzk0rvnVB/EIndYuxLal4f8cCiaqLe05U0GduzYmbOk8ojE8Pj+Wg0 NIMYtysotE4SUuLRlDzMUmTxAtNV3uMR5Rlss= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=f3Nfs/DRidR4E+JraOJ0QC9J7vTv8+QYMg2eI3k8SAk=; b=ewLAhAI+Fmo9cgMzIUdK+IrTXhz7apP4VcnUVtsni6W8tYOtfDeiMcBhOqkXUPR0l8 bdd8lLobcFMIGhuiLLAJW5BljQKzxaoD+XtD1reI+J32XFtAX1sbiI6+RbWsRn8CoNWj kwfuMcR+0HtMmCCoUh9d3wg2FUVVJ9TMzEx9OncVMWP0kQz0Fj9o22m1cKGsMaP5A0a2 wT1Ki19KxkVSdxrYK8RSpKSP4U592xm68K4mmJt4PeXdFOe+GK6nFTOK8wDCz1HjRO1b sXFCJAzUkIRRO5pux7nbuUcO31ePsO+6leX7aRAKCZwPw6JuHr6syN7smdTOC3qB4CwD oAig== X-Gm-Message-State: APjAAAXSe7coNkkEecsRNxGhBdn3VuwuwHoAipholGQ1jEWOjI7kQJ7N ekh2WxDkSEqHDPBEqVlXkXZR9Q== X-Google-Smtp-Source: APXvYqw+HZyUvC1Bqlvj8gcVb1cFFjSgW7AgvPr0buTJwsw1fzt8o6bbctJfe0WWJvLhJCv64ngozw== X-Received: by 2002:a17:902:c85:: with SMTP id 5mr4274125plt.172.1558389661271; Mon, 20 May 2019 15:01:01 -0700 (PDT) Received: from localhost ([2620:15c:202:1:75a:3f6e:21d:9374]) by smtp.gmail.com with ESMTPSA id g17sm8484562pfb.56.2019.05.20.15.01.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 May 2019 15:01:00 -0700 (PDT) From: Matthias Kaehlcke To: Heiko Stuebner , Rob Herring , Mark Rutland Subject: [PATCH v2 3/3] ARM: dts: rockchip: Configure the GPU thermal zone for mickey Date: Mon, 20 May 2019 15:00:51 -0700 Message-Id: <20190520220051.54847-3-mka@chromium.org> X-Mailer: git-send-email 2.21.0.1020.gf2820cf01a-goog In-Reply-To: <20190520220051.54847-1-mka@chromium.org> References: <20190520220051.54847-1-mka@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190520_150101_704793_544CDD40 X-CRM114-Status: GOOD ( 14.76 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Douglas Anderson , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Matthias Kaehlcke , linux-arm-kernel@lists.infradead.org Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP mickey crams a lot of hardware into a tiny package, which requires more aggressive thermal throttling than for devices with a larger footprint. Configure the GPU thermal zone to throttle the GPU progressively at temperatures >= 60°C. Heat dissipated by the CPUs also affects the GPU temperature, hence we cap the CPU frequency to 1.4 GHz for temperatures above 65°C. Further throttling of the CPUs may be performed by the CPU thermal zone. The configuration matches that of the downstream Chrome OS 3.14 kernel, the 'official' kernel for mickey. Signed-off-by: Matthias Kaehlcke Reviewed-by: Douglas Anderson --- Changes in v2: - specify all CPUs as cooling devices - s/downstram/downstream/ in commit message Note: this patch depends on "ARM: dts: rockchip: Add #cooling-cells entry for rk3288 GPU" (https://lore.kernel.org/patchwork/patch/1075005/) --- arch/arm/boot/dts/rk3288-veyron-mickey.dts | 67 ++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/arch/arm/boot/dts/rk3288-veyron-mickey.dts b/arch/arm/boot/dts/rk3288-veyron-mickey.dts index 34797abe3403..945e80801292 100644 --- a/arch/arm/boot/dts/rk3288-veyron-mickey.dts +++ b/arch/arm/boot/dts/rk3288-veyron-mickey.dts @@ -136,6 +136,73 @@ }; }; +&gpu_thermal { + /delete-node/ trips; + /delete-node/ cooling-maps; + + trips { + gpu_alert_warmish: gpu_alert_warmish { + temperature = <60000>; /* millicelsius */ + hysteresis = <2000>; /* millicelsius */ + type = "passive"; + }; + gpu_alert_warm: gpu_alert_warm { + temperature = <65000>; /* millicelsius */ + hysteresis = <2000>; /* millicelsius */ + type = "passive"; + }; + gpu_alert_hotter: gpu_alert_hotter { + temperature = <84000>; /* millicelsius */ + hysteresis = <2000>; /* millicelsius */ + type = "passive"; + }; + gpu_alert_very_very_hot: gpu_alert_very_very_hot { + temperature = <86000>; /* millicelsius */ + hysteresis = <2000>; /* millicelsius */ + type = "passive"; + }; + gpu_crit: gpu_crit { + temperature = <90000>; /* millicelsius */ + hysteresis = <2000>; /* millicelsius */ + type = "critical"; + }; + }; + + cooling-maps { + /* After 1st level throttle the GPU down to as low as 400 MHz */ + gpu_warmish_limit_gpu { + trip = <&gpu_alert_warmish>; + cooling-device = <&gpu THERMAL_NO_LIMIT 1>; + }; + + /* + * Slightly after we throttle the GPU, we'll also make sure that + * the CPU can't go faster than 1.4 GHz. Note that we won't + * throttle the CPU lower than 1.4 GHz due to GPU heat--we'll + * let the CPU do the rest itself. + */ + gpu_warm_limit_cpu { + trip = <&gpu_alert_warm>; + cooling-device = <&cpu0 4 4>, + <&cpu1 4 4>, + <&cpu2 4 4>, + <&cpu3 4 4>; + }; + + /* When hot, GPU goes down to 300 MHz */ + gpu_hotter_limit_gpu { + trip = <&gpu_alert_hotter>; + cooling-device = <&gpu 2 2>; + }; + + /* When really hot, don't let GPU go _above_ 300 MHz */ + gpu_very_very_hot_limit_gpu { + trip = <&gpu_alert_very_very_hot>; + cooling-device = <&gpu 2 THERMAL_NO_LIMIT>; + }; + }; +}; + &i2c2 { status = "disabled"; };