From patchwork Mon Dec 21 00:29:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Danny Lin X-Patchwork-Id: 11984033 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B5B77C4332D for ; Mon, 21 Dec 2020 00:30:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8B645225AA for ; Mon, 21 Dec 2020 00:30:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727079AbgLUAaY (ORCPT ); Sun, 20 Dec 2020 19:30:24 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:58099 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726896AbgLUAaT (ORCPT ); Sun, 20 Dec 2020 19:30:19 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 99DF15C0132; Sun, 20 Dec 2020 19:29:32 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 20 Dec 2020 19:29:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kdrag0n.dev; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=XfXwBu1lAywXz Oqe8KLsmzFtPHG5VX9dz1KKhwLxkNw=; b=JRROtOIMJzhZWcpF4Kuk/PJuFQNum 3sLBR6StlSNRqInPqDE3Gw87PnUZ6OXQ/MrZhEutoSDKqr9EYt/kua6AKnhQU8OZ LbYz+ydP7Kyxf0G79v3LkXE/DHbKOUJSLA5aTsOxV5g7yRI9d2qJkDviEDdteiey xbZuaGrI2/Pl4stRjqNm8AUTB9JXvFr7VSyesBHdUJt8DxQ5gFbrenUyrSRhUHfd qbf7ewMQyl6DzxZb7JEprG0Jsq5EdHYSb5E+vrzI1dTqjaIC+5b/DcXOIcL88thp oANpbL4YUFCAYceiVnAMj7Ub6GDhk5pi+lQknPPJkso6xqAWLS8DJwMqQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=XfXwBu1lAywXzOqe8KLsmzFtPHG5VX9dz1KKhwLxkNw=; b=RSaD2Uwd 5xTunwFMIvdUobimshgSAGjiUeg1ZEeqyyzKch7l/eZlSZlTosGdJuw7/KUYNKcS Win67Rfnf2u7+uhtmSXYNxcdh6l5wHIf241XN1rwv4jmzFkGulbCWZYNXevxQOtD 216fdvyR72RFjkyqlov3vyQ8/ThUBnpdgrGGUbZBOD6xdkmBMhBnvmtOKI2CCqMb WVO9o1DeBpP3h17NMmxrfYL4bdFPpIa8bTQ2hmyc5RtGoqRgJQGeyNx0f5IFTE2m k5eQXUqL+FQJQHxgbKj5h3ImnKLlvleZjKygnkclnj4EKQFZMo9WAf3nZqFVEY3z 4Y3UkMia2ElQew== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvddtuddgvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne hmihhsshhinhhgucfvqfcufhhivghlugculdeftddmnegoteeftdduqddtudculdduhedm necujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeffrghnnh ihucfnihhnuceouggrnhhnhieskhgurhgrghdtnhdruggvvheqnecuggftrfgrthhtvghr nheptefghfehteeugefgueeviedutdduheetheeghfevjeelvefhgfetleduheduuedune cukfhppedutdegrddvtddtrdduvdelrddvuddvnecuvehluhhsthgvrhfuihiivgepuden ucfrrghrrghmpehmrghilhhfrhhomhepuggrnhhnhieskhgurhgrghdtnhdruggvvh X-ME-Proxy: Received: from pinwheel.localdomain (unknown [104.200.129.212]) by mail.messagingengine.com (Postfix) with ESMTPA id C47E0240057; Sun, 20 Dec 2020 19:29:31 -0500 (EST) From: Danny Lin Cc: Danny Lin , Andy Gross , Bjorn Andersson , Rob Herring , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] arm64: dts: qcom: sm8150: Add PSCI idle states Date: Sun, 20 Dec 2020 16:29:06 -0800 Message-Id: <20201221002907.2870059-3-danny@kdrag0n.dev> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201221002907.2870059-1-danny@kdrag0n.dev> References: <20201221002907.2870059-1-danny@kdrag0n.dev> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Like other Qualcomm SoCs, sm8150 exposes CPU and cluster idle states through PSCI. Define the idle states to save power when the CPU is not in active use. These idle states, latency, and residency values match the downstream 4.14 kernel from Qualcomm as of LA.UM.8.1.r1-15600-sm8150.0. It's worth noting that the CPU has an additional C3 power collapse idle state between WFI and rail power collapse (with PSCI mode 0x40000003), but it is not officially used in downstream kernels due to "thermal throttling issues." Signed-off-by: Danny Lin --- arch/arm64/boot/dts/qcom/sm8150.dtsi | 50 ++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/sm8150.dtsi b/arch/arm64/boot/dts/qcom/sm8150.dtsi index 75ed38ee5d88..edc1fe6d7f1b 100644 --- a/arch/arm64/boot/dts/qcom/sm8150.dtsi +++ b/arch/arm64/boot/dts/qcom/sm8150.dtsi @@ -50,6 +50,8 @@ CPU0: cpu@0 { compatible = "qcom,kryo485"; reg = <0x0 0x0>; enable-method = "psci"; + cpu-idle-states = <&LITTLE_CPU_SLEEP_0 + &CLUSTER_SLEEP_0>; next-level-cache = <&L2_0>; qcom,freq-domain = <&cpufreq_hw 0>; #cooling-cells = <2>; @@ -67,6 +69,8 @@ CPU1: cpu@100 { compatible = "qcom,kryo485"; reg = <0x0 0x100>; enable-method = "psci"; + cpu-idle-states = <&LITTLE_CPU_SLEEP_0 + &CLUSTER_SLEEP_0>; next-level-cache = <&L2_100>; qcom,freq-domain = <&cpufreq_hw 0>; #cooling-cells = <2>; @@ -82,6 +86,8 @@ CPU2: cpu@200 { compatible = "qcom,kryo485"; reg = <0x0 0x200>; enable-method = "psci"; + cpu-idle-states = <&LITTLE_CPU_SLEEP_0 + &CLUSTER_SLEEP_0>; next-level-cache = <&L2_200>; qcom,freq-domain = <&cpufreq_hw 0>; #cooling-cells = <2>; @@ -96,6 +102,8 @@ CPU3: cpu@300 { compatible = "qcom,kryo485"; reg = <0x0 0x300>; enable-method = "psci"; + cpu-idle-states = <&LITTLE_CPU_SLEEP_0 + &CLUSTER_SLEEP_0>; next-level-cache = <&L2_300>; qcom,freq-domain = <&cpufreq_hw 0>; #cooling-cells = <2>; @@ -110,6 +118,8 @@ CPU4: cpu@400 { compatible = "qcom,kryo485"; reg = <0x0 0x400>; enable-method = "psci"; + cpu-idle-states = <&BIG_CPU_SLEEP_0 + &CLUSTER_SLEEP_0>; next-level-cache = <&L2_400>; qcom,freq-domain = <&cpufreq_hw 1>; #cooling-cells = <2>; @@ -124,6 +134,8 @@ CPU5: cpu@500 { compatible = "qcom,kryo485"; reg = <0x0 0x500>; enable-method = "psci"; + cpu-idle-states = <&BIG_CPU_SLEEP_0 + &CLUSTER_SLEEP_0>; next-level-cache = <&L2_500>; qcom,freq-domain = <&cpufreq_hw 1>; #cooling-cells = <2>; @@ -138,6 +150,8 @@ CPU6: cpu@600 { compatible = "qcom,kryo485"; reg = <0x0 0x600>; enable-method = "psci"; + cpu-idle-states = <&BIG_CPU_SLEEP_0 + &CLUSTER_SLEEP_0>; next-level-cache = <&L2_600>; qcom,freq-domain = <&cpufreq_hw 1>; #cooling-cells = <2>; @@ -152,6 +166,8 @@ CPU7: cpu@700 { compatible = "qcom,kryo485"; reg = <0x0 0x700>; enable-method = "psci"; + cpu-idle-states = <&BIG_CPU_SLEEP_0 + &CLUSTER_SLEEP_0>; next-level-cache = <&L2_700>; qcom,freq-domain = <&cpufreq_hw 2>; #cooling-cells = <2>; @@ -196,6 +212,40 @@ core7 { }; }; }; + + idle-states { + entry-method = "psci"; + + LITTLE_CPU_SLEEP_0: cpu-sleep-0-0 { + compatible = "arm,idle-state"; + idle-state-name = "little-rail-power-collapse"; + arm,psci-suspend-param = <0x40000004>; + entry-latency-us = <355>; + exit-latency-us = <909>; + min-residency-us = <3934>; + local-timer-stop; + }; + + BIG_CPU_SLEEP_0: cpu-sleep-1-0 { + compatible = "arm,idle-state"; + idle-state-name = "big-rail-power-collapse"; + arm,psci-suspend-param = <0x40000004>; + entry-latency-us = <241>; + exit-latency-us = <1461>; + min-residency-us = <4488>; + local-timer-stop; + }; + + CLUSTER_SLEEP_0: cluster-sleep-0 { + compatible = "arm,idle-state"; + idle-state-name = "cluster-power-collapse"; + arm,psci-suspend-param = <0x400000F4>; + entry-latency-us = <3263>; + exit-latency-us = <6562>; + min-residency-us = <9987>; + local-timer-stop; + }; + }; }; firmware {