arm64: dts: qcom: sm8150: Add PSCI idle states
authorDanny Lin <danny@kdrag0n.dev>
Mon, 21 Dec 2020 00:29:06 +0000 (16:29 -0800)
committerBjorn Andersson <bjorn.andersson@linaro.org>
Tue, 5 Jan 2021 22:36:18 +0000 (16:36 -0600)
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 <danny@kdrag0n.dev>
Link: https://lore.kernel.org/r/20201221002907.2870059-3-danny@kdrag0n.dev
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
arch/arm64/boot/dts/qcom/sm8150.dtsi

index d2159b1aa97e14d21e15aa4aa1bf7539e83872e0..1b10bc80e483225b1ead344d7b2cd0227fa536f6 100644 (file)
@@ -47,6 +47,8 @@
                        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>;
@@ -64,6 +66,8 @@
                        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>;
@@ -79,6 +83,8 @@
                        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>;
@@ -93,6 +99,8 @@
                        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>;
                        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>;
                        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>;
                        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>;
                        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>;
                                };
                        };
                };
+
+               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 {