From patchwork Mon Jul 17 08:14:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caesar Wang X-Patchwork-Id: 9844185 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 BE02860392 for ; Mon, 17 Jul 2017 08:15:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AEEBD27FC0 for ; Mon, 17 Jul 2017 08:15:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A349A2823E; Mon, 17 Jul 2017 08:15:30 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable 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 4388627FC0 for ; Mon, 17 Jul 2017 08:15:30 +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=EgI0DK4JHqJKuojZ4wnJu1YhvV9TXVf1m1KF2GHA1L0=; b=sE2dFcv/0KysVPvDg/iRrgoaOQ jFtRzwcOYBUKX2P99LxYlX3y5/3ixkQWtDv9D0EUe8WAwlz2cKQH0bdvvOPiWyo9tA2MvC+gZ+EN5 wXOwmEdtvw2acQuBU4fBa8lLt4DeJU6K3doZ9kh4oun71N8ZCgZ+uxjm0NiY90tK0dcToB+riG6VA QBoWYgb37TkGLAbYiByRx4oP+HHnQuAhudNQVWz5JSuA7dt1cpYrSrOGxpOMbVZBt74BuZ8sSOQSq qAoma5Jt2Xbz43q5TTkYvHkptKQrTZn9Q4XOFjV07DdGcCZhzgAmZfkrmo0VXTc/8bE5A8hb0oedC XoSqqtnA==; 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 1dX1Bh-0003tr-H5; Mon, 17 Jul 2017 08:15:29 +0000 Received: from mail-pf0-f196.google.com ([209.85.192.196]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dX1BS-0002Lh-9W; Mon, 17 Jul 2017 08:15:18 +0000 Received: by mail-pf0-f196.google.com with SMTP id q85so18786786pfq.2; Mon, 17 Jul 2017 01:15:01 -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=Dl5WCB3MWlOAfbw/ZZB/WOu9bFOUxPg3c4dVl2sNm30=; b=HCY7FthrjnJEl4tmTWl63aja3w+vGpFxvzXRSfpHYyQYhlcdUpLUVyWjB9Gc4s3Hop 2sj1Qn/70dvwby9YlcDP2VPnHuWRgQNjtHdapmfWaCHj/EKckDRySj6MruzaazK/Taup MunwjMDKkKtEH8Gw8hEYUAJDxdO0PnZP7ITjRTW78zmX0vkla9GgOMgPj/ILe4PS1rXS +oNciTBhBVO2oicZwNuIvOcNec9rP3sqmeDC5mJkFwAno16FkZ80ykAOnfg5o3XnSUm0 kmreA8EtFgeJidMIhC9MMyEiA7oHnujZgcICHnwapx4pZndADQaD0t6LJoFRLFuEE7mZ j36w== X-Gm-Message-State: AIVw110WPnbGjeYpBbm68sbguLWWPZMTaMybLGmqThNtBpefpTv4/3Hp x3/71/IT3WvSEw== X-Received: by 10.98.139.11 with SMTP id j11mr18042579pfe.18.1500279301386; Mon, 17 Jul 2017 01:15:01 -0700 (PDT) Received: from localhost.localdomain ([103.29.142.67]) by smtp.gmail.com with ESMTPSA id n83sm3224003pfi.1.2017.07.17.01.14.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Jul 2017 01:15:00 -0700 (PDT) From: Caesar Wang To: Heiko Stuebner Subject: [PATCH v2 5/5] arm64: dts: rockchip: update the thermal zones for RK3399 SoCs Date: Mon, 17 Jul 2017 16:14:31 +0800 Message-Id: <1500279271-15249-6-git-send-email-wxt@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1500279271-15249-1-git-send-email-wxt@rock-chips.com> References: <1500279271-15249-1-git-send-email-wxt@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170717_011514_634745_64E308B4 X-CRM114-Status: GOOD ( 10.62 ) 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: 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-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=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. The Thermal power allocator governor works optimatly with two passive trip points, for the better performance we will use the trip-point0 with 70 degree above which the governor control starts operating and trip-point1 with 85 degree is the target temperature by controlling. Signed-off-by: Caesar Wang --- Changes in v2: - foo@ will produce warnings when used without reg property. - update the commit to explain the two passive trip points changed. 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 77d67cb..6d8a5eb 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-point0 { temperature = <70000>; hysteresis = <2000>; type = "passive"; }; - cpu_alert1: cpu_alert1 { - temperature = <75000>; + target: trip-point1 { + 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>; - }; - }; }; }; @@ -1451,8 +1438,17 @@ ; interrupt-names = "gpu", "job", "mmu"; clocks = <&cru ACLK_GPU>; + #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 {