From patchwork Wed Jul 12 06:29:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caesar Wang X-Patchwork-Id: 9835951 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CB718602BD for ; Wed, 12 Jul 2017 06:30:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8289285A1 for ; Wed, 12 Jul 2017 06:30:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AC93A285E7; Wed, 12 Jul 2017 06:30:52 +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=-1.4 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_SORBS_SPAM autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 5B873285A1 for ; Wed, 12 Jul 2017 06:30:52 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=0VAqLwr1GHJzldCqaczvbqicRLAiLGVlAsex2DQxaQE=; b=uG6qcri1nfbgYolw0htaG9BW1R 0QJa/AGRO74hcrNifzyvxzXbPZKqm+Ae/fHi34P8frWMbmV60WaBtUbyiWxUgGtKCJmocssWtOImn L1TGHbBQtiebDdJonBff5VFW2FX4z5TRNGnuFlZI4rPozxEo7ZurTXQkjlpn6QZaAO3zb6L9iup21 0FIECJdMlNW6ChQ7eTYPPsmgqiE9CTyP6qMaM1P39H225cSTbkxPEA2yu3RFX6HhKqun7b4TSwXF2 W4wr5XWWM5yFYy4M1xz9tQf7f9rTHnS1yQKvZKsb0hYHFtIZT8tLDdkrh88KHQM8ZoN/+TsfQkNhj 6QnKJlhA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dVBAg-0005no-TL; Wed, 12 Jul 2017 06:30:50 +0000 Received: from mail-pg0-f66.google.com ([74.125.83.66]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dVBAJ-00059X-FK; Wed, 12 Jul 2017 06:30:30 +0000 Received: by mail-pg0-f66.google.com with SMTP id j186so1842734pge.1; Tue, 11 Jul 2017 23:30:09 -0700 (PDT) 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; bh=GlkxFcUFeJrWoQdc2BpZ/LKPoi4+1ckPo8qcdS6ggLk=; b=VVW14gdjDuW3V86oAFwla2WVwBGFdjXHgXwcwalwWbBJsbOgw4EpezHsBx/7UkpUCi 00f5QaR9VElVQ0d7nGH7scJnwLa6IburJGSbjGjRm3i98DzuSHMvLnBOVmupefVTQe+9 BxlMw3fn/Aq7FwxnSKN8r+HPi9dqDaTZbYR34T1fq5TmUhqyNM5oaN25sLO9sFL3scQ9 Jjiwkc3SamU9OGr35u5W6US8kjAjdeGVDHTN4WgCrbLd2bvaLNQtDVyIbx+KtxnIvN1c +gCMeozbKEZnuSsLBpDNTaM9zMHWc+5SbuiuGuUubBT2JFMs7qibF78VKksLjJeYehKu GxQg== X-Gm-Message-State: AIVw112eGve3vNU9CC6gj1M7WeIX2jWW2wguemwF1+U8rtBW5fm2sJ4X mbmdq9vgTYX0iQ== X-Received: by 10.98.24.202 with SMTP id 193mr54692590pfy.24.1499841009546; Tue, 11 Jul 2017 23:30:09 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id b8sm2623839pfd.65.2017.07.11.23.30.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Jul 2017 23:30:09 -0700 (PDT) From: Caesar Wang To: Heiko Stuebner Subject: [PATCH 4/4] arm64: dts: rockchip: update the thermal zones for RK3399 SoCs Date: Wed, 12 Jul 2017 14:29:30 +0800 Message-Id: <1499840971-20392-5-git-send-email-wxt@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1499840971-20392-1-git-send-email-wxt@rock-chips.com> References: <1499840971-20392-1-git-send-email-wxt@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170711_233027_920901_CE4A5890 X-CRM114-Status: GOOD ( 10.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Brian Norris , linux-kernel@vger.kernel.org, Shawn Lin , Elaine Zhang , Will Deacon , Douglas Anderson , Kever Yang , linux-rockchip@lists.infradead.org, Rob Herring , Roger Chen , Catalin Marinas , William wu , rocky.hao@rock-chips.com, linux-arm-kernel@lists.infradead.org, Caesar Wang MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP As RK3399 had used the Power allocator thermal governor by default, enabled this to manage thermals by dynamically allocating and limiting power to devices. Also, this patch supported the dynamic-power-coefficient/sustainable_power and GPU's power model for needed parameters with thermal IPA. Signed-off-by: Caesar Wang --- arch/arm64/boot/dts/rockchip/rk3399.dtsi | 62 +++++++++++++++----------------- 1 file changed, 29 insertions(+), 33 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi index 8c6438b..139f58c 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi @@ -147,7 +147,7 @@ enable-method = "psci"; #cooling-cells = <2>; /* min followed by max */ clocks = <&cru ARMCLKB>; - dynamic-power-coefficient = <100>; + dynamic-power-coefficient = <436>; }; cpu_b1: cpu@101 { @@ -156,7 +156,7 @@ reg = <0x0 0x101>; enable-method = "psci"; clocks = <&cru ARMCLKB>; - dynamic-power-coefficient = <100>; + dynamic-power-coefficient = <436>; }; }; @@ -690,24 +690,25 @@ }; thermal_zones: thermal-zones { - cpu_thermal: cpu { + soc_thermal: soc-thermal { polling-delay-passive = <100>; polling-delay = <1000>; + sustainable-power = <1000>; thermal-sensors = <&tsadc 0>; trips { - cpu_alert0: cpu_alert0 { + threshold: trip-point@0 { temperature = <70000>; hysteresis = <2000>; type = "passive"; }; - cpu_alert1: cpu_alert1 { - temperature = <75000>; + target: trip-point@1 { + temperature = <85000>; hysteresis = <2000>; type = "passive"; }; - cpu_crit: cpu_crit { + soc_crit: soc-crit { temperature = <95000>; hysteresis = <2000>; type = "critical"; @@ -716,45 +717,31 @@ cooling-maps { map0 { - trip = <&cpu_alert0>; + trip = <&target>; cooling-device = - <&cpu_b0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + <&cpu_l0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + contribution = <4096>; }; map1 { - trip = <&cpu_alert1>; + trip = <&target>; cooling-device = - <&cpu_l0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, <&cpu_b0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + contribution = <1024>; + }; + map2 { + trip = <&target>; + cooling-device = + <&gpu THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + contribution = <4096>; }; }; }; - gpu_thermal: gpu { + gpu_thermal: gpu-thermal { polling-delay-passive = <100>; polling-delay = <1000>; thermal-sensors = <&tsadc 1>; - - trips { - gpu_alert0: gpu_alert0 { - temperature = <75000>; - hysteresis = <2000>; - type = "passive"; - }; - gpu_crit: gpu_crit { - temperature = <95000>; - hysteresis = <2000>; - type = "critical"; - }; - }; - - cooling-maps { - map0 { - trip = <&gpu_alert0>; - cooling-device = - <&cpu_b0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; - }; - }; }; }; @@ -1455,8 +1442,17 @@ interrupt-names = "GPU", "JOB", "MMU"; clocks = <&cru ACLK_GPU>; clock-names = "clk_mali"; + #cooling-cells = <2>; power-domains = <&power RK3399_PD_GPU>; status = "disabled"; + + gpu_power_model: power_model { + compatible = "arm,mali-simple-power-model"; + static-coefficient = <1079403>; + dynamic-coefficient = <977>; + ts = <32000 4700 (-80) 2>; + thermal-zone = "gpu-thermal"; + }; }; pinctrl: pinctrl {