Loading Documentation/devicetree/bindings/arm/msm/lpm-levels.txt +2 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,8 @@ Required properties: - qcom,is-reset: This boolean property will tell whether cluster level need power management notifications to be sent out or not for the drivers to prepare for cluster collapse. - qcom,hyp-psci: This property is used to determine if the cpu enters the low power mode within hypervisor. [Node bindings for qcom,pm-cpu] qcom,pm-cpu contains the low power modes that a cpu could enter. Currently it Loading arch/arm/boot/dts/qcom/msm8996-pm.dtsi +61 −39 Original line number Diff line number Diff line /* Copyright (c) 2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -48,8 +48,8 @@ label = "system-wfi"; qcom,psci-mode = <0>; qcom,latency-us = <100>; qcom,ss-power = <725>; qcom,energy-overhead = <85000>; qcom,ss-power = <192>; qcom,energy-overhead = <60000>; qcom,time-overhead = <120>; }; qcom,pm-cluster-level@1{ /* E3-M2 */ Loading @@ -59,9 +59,9 @@ qcom,spm-l3-mode = "fpc"; qcom,psci-mode = <0x23>; qcom,latency-us = <350>; qcom,ss-power = <530>; qcom,energy-overhead = <160000>; qcom,time-overhead = <550>; qcom,ss-power = <160>; qcom,energy-overhead = <69000>; qcom,time-overhead = <150>; qcom,min-child-idx = <1>; }; qcom,pm-cluster-level@2{ /* E4-M3 */ Loading @@ -71,9 +71,9 @@ qcom,spm-l3-mode = "fpc"; qcom,psci-mode = <0x34>; qcom,latency-us = <11000>; qcom,ss-power = <120>; qcom,energy-overhead = <280000>; qcom,time-overhead = <3200>; qcom,ss-power = <72>; qcom,energy-overhead = <1380000>; qcom,time-overhead = <1200>; qcom,min-child-idx = <2>; qcom,notify-rpm; qcom,is-reset; Loading @@ -95,7 +95,7 @@ label = "pwr-l2-wfi"; qcom,psci-mode = <1>; qcom,latency-us = <40>; qcom,ss-power = <740>; qcom,ss-power = <195>; qcom,energy-overhead = <65000>; qcom,time-overhead = <85>; }; Loading @@ -105,10 +105,10 @@ label = "pwr-l2-gdhs"; qcom,psci-mode = <3>; qcom,latency-us = <90>; qcom,ss-power = <660>; qcom,energy-overhead = <135000>; qcom,ss-power = <180>; qcom,energy-overhead = <89070>; qcom,time-overhead = <180>; qcom,min-child-idx = <1>; qcom,min-child-idx = <2>; }; qcom,pm-cluster-level@2{ /* D4 */ Loading @@ -116,10 +116,10 @@ label = "pwr-l2-fpc"; qcom,psci-mode = <4>; qcom,latency-us = <700>; qcom,ss-power = <450>; qcom,energy-overhead = <210000>; qcom,time-overhead = <11500>; qcom,min-child-idx = <1>; qcom,ss-power = <160>; qcom,energy-overhead = <441000>; qcom,time-overhead = <1000>; qcom,min-child-idx = <2>; qcom,is-reset; }; Loading @@ -134,19 +134,30 @@ qcom,psci-cpu-mode = <1>; qcom,spm-cpu-mode = "wfi"; qcom,latency-us = <20>; qcom,ss-power = <750>; qcom,energy-overhead = <32000>; qcom,ss-power = <200>; qcom,energy-overhead = <9000>; qcom,time-overhead = <60>; }; qcom,pm-cpu-level@1 { /* C4 */ reg = <1>; qcom,spm-cpu-mode = "fpc-def"; qcom,psci-cpu-mode = <4>; qcom,latency-us = <40>; qcom,ss-power = <198>; qcom,energy-overhead = <21850>; qcom,time-overhead = <120>; qcom,hyp-psci; }; qcom,pm-cpu-level@2 { /* C4 */ reg = <2>; qcom,spm-cpu-mode = "fpc"; qcom,psci-cpu-mode = <4>; qcom,latency-us = <80>; qcom,ss-power = <700>; qcom,energy-overhead = <126480>; qcom,time-overhead = <160>; qcom,ss-power = <196>; qcom,energy-overhead = <45300>; qcom,time-overhead = <210>; }; }; }; Loading @@ -167,9 +178,9 @@ label = "perf-l2-wfi"; qcom,psci-mode = <1>; qcom,latency-us = <40>; qcom,ss-power = <740>; qcom,energy-overhead = <70000>; qcom,time-overhead = <80>; qcom,ss-power = <195>; qcom,energy-overhead = <65000>; qcom,time-overhead = <85>; }; qcom,pm-cluster-level@1{ /* D3 */ Loading @@ -177,10 +188,10 @@ label = "perf-l2-gdhs"; qcom,psci-mode = <3>; qcom,latency-us = <80>; qcom,ss-power = <660>; qcom,energy-overhead = <142000>; qcom,ss-power = <180>; qcom,energy-overhead = <83500>; qcom,time-overhead = <180>; qcom,min-child-idx = <1>; qcom,min-child-idx = <2>; }; qcom,pm-cluster-level@2{ /* D4 */ Loading @@ -188,10 +199,10 @@ label = "perf-l2-fpc"; qcom,psci-mode = <4>; qcom,latency-us = <800>; qcom,ss-power = <450>; qcom,energy-overhead = <240000>; qcom,time-overhead = <11500>; qcom,min-child-idx = <1>; qcom,ss-power = <160>; qcom,energy-overhead = <441000>; qcom,time-overhead = <1000>; qcom,min-child-idx = <2>; qcom,is-reset; }; Loading @@ -206,19 +217,30 @@ qcom,psci-cpu-mode = <1>; qcom,spm-cpu-mode = "wfi"; qcom,latency-us = <25>; qcom,ss-power = <750>; qcom,energy-overhead = <37000>; qcom,time-overhead = <50>; qcom,ss-power = <200>; qcom,energy-overhead = <9000>; qcom,time-overhead = <60>; }; qcom,pm-cpu-level@1 { /* C4 */ reg = <1>; qcom,spm-cpu-mode = "fpc-def"; qcom,psci-cpu-mode = <4>; qcom,latency-us = <40>; qcom,ss-power = <198>; qcom,energy-overhead = <21850>; qcom,time-overhead = <120>; qcom,hyp-psci; }; qcom,pm-cpu-level@2 { /* C4 */ reg = <2>; qcom,spm-cpu-mode = "fpc"; qcom,psci-cpu-mode = <4>; qcom,latency-us = <80>; qcom,ss-power = <700>; qcom,energy-overhead = <136480>; qcom,time-overhead = <160>; qcom,ss-power = <196>; qcom,energy-overhead = <45300>; qcom,time-overhead = <210>; }; }; }; Loading drivers/cpuidle/lpm-levels-of.c +4 −1 Original line number Diff line number Diff line /* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -563,6 +563,9 @@ static int parse_cpu_mode(struct device_node *n, struct lpm_cpu_level *l) n->name); return ret; } key = "qcom,hyp-psci"; l->hyp_psci = of_property_read_bool(n, key); } else { l->mode = parse_cpu_spm_mode(l->name); Loading drivers/cpuidle/lpm-levels.c +9 −1 Original line number Diff line number Diff line /* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -796,6 +796,7 @@ unlock_and_return: } #if !defined(CONFIG_CPU_V7) asmlinkage int __invoke_psci_fn_smc(u64, u64, u64, u64); bool psci_enter_sleep(struct lpm_cluster *cluster, int idx, bool from_idle) { /* Loading @@ -813,6 +814,13 @@ bool psci_enter_sleep(struct lpm_cluster *cluster, int idx, bool from_idle) PSCI_POWER_STATE(cluster->cpu->levels[idx].is_reset); bool success = false; if (cluster->cpu->levels[idx].hyp_psci) { stop_critical_timings(); __invoke_psci_fn_smc(0xC4000021, 0, 0, 0); start_critical_timings(); return 1; } affinity_level = PSCI_AFFINITY_LEVEL(affinity_level); state_id |= (power_state | affinity_level | cluster->cpu->levels[idx].psci_id); Loading drivers/cpuidle/lpm-levels.h +2 −1 Original line number Diff line number Diff line /* Copyright (c) 2014, 2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -37,6 +37,7 @@ struct lpm_cpu_level { unsigned int psci_id; bool is_reset; bool jtag_save_restore; bool hyp_psci; }; struct lpm_cpu { Loading Loading
Documentation/devicetree/bindings/arm/msm/lpm-levels.txt +2 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,8 @@ Required properties: - qcom,is-reset: This boolean property will tell whether cluster level need power management notifications to be sent out or not for the drivers to prepare for cluster collapse. - qcom,hyp-psci: This property is used to determine if the cpu enters the low power mode within hypervisor. [Node bindings for qcom,pm-cpu] qcom,pm-cpu contains the low power modes that a cpu could enter. Currently it Loading
arch/arm/boot/dts/qcom/msm8996-pm.dtsi +61 −39 Original line number Diff line number Diff line /* Copyright (c) 2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -48,8 +48,8 @@ label = "system-wfi"; qcom,psci-mode = <0>; qcom,latency-us = <100>; qcom,ss-power = <725>; qcom,energy-overhead = <85000>; qcom,ss-power = <192>; qcom,energy-overhead = <60000>; qcom,time-overhead = <120>; }; qcom,pm-cluster-level@1{ /* E3-M2 */ Loading @@ -59,9 +59,9 @@ qcom,spm-l3-mode = "fpc"; qcom,psci-mode = <0x23>; qcom,latency-us = <350>; qcom,ss-power = <530>; qcom,energy-overhead = <160000>; qcom,time-overhead = <550>; qcom,ss-power = <160>; qcom,energy-overhead = <69000>; qcom,time-overhead = <150>; qcom,min-child-idx = <1>; }; qcom,pm-cluster-level@2{ /* E4-M3 */ Loading @@ -71,9 +71,9 @@ qcom,spm-l3-mode = "fpc"; qcom,psci-mode = <0x34>; qcom,latency-us = <11000>; qcom,ss-power = <120>; qcom,energy-overhead = <280000>; qcom,time-overhead = <3200>; qcom,ss-power = <72>; qcom,energy-overhead = <1380000>; qcom,time-overhead = <1200>; qcom,min-child-idx = <2>; qcom,notify-rpm; qcom,is-reset; Loading @@ -95,7 +95,7 @@ label = "pwr-l2-wfi"; qcom,psci-mode = <1>; qcom,latency-us = <40>; qcom,ss-power = <740>; qcom,ss-power = <195>; qcom,energy-overhead = <65000>; qcom,time-overhead = <85>; }; Loading @@ -105,10 +105,10 @@ label = "pwr-l2-gdhs"; qcom,psci-mode = <3>; qcom,latency-us = <90>; qcom,ss-power = <660>; qcom,energy-overhead = <135000>; qcom,ss-power = <180>; qcom,energy-overhead = <89070>; qcom,time-overhead = <180>; qcom,min-child-idx = <1>; qcom,min-child-idx = <2>; }; qcom,pm-cluster-level@2{ /* D4 */ Loading @@ -116,10 +116,10 @@ label = "pwr-l2-fpc"; qcom,psci-mode = <4>; qcom,latency-us = <700>; qcom,ss-power = <450>; qcom,energy-overhead = <210000>; qcom,time-overhead = <11500>; qcom,min-child-idx = <1>; qcom,ss-power = <160>; qcom,energy-overhead = <441000>; qcom,time-overhead = <1000>; qcom,min-child-idx = <2>; qcom,is-reset; }; Loading @@ -134,19 +134,30 @@ qcom,psci-cpu-mode = <1>; qcom,spm-cpu-mode = "wfi"; qcom,latency-us = <20>; qcom,ss-power = <750>; qcom,energy-overhead = <32000>; qcom,ss-power = <200>; qcom,energy-overhead = <9000>; qcom,time-overhead = <60>; }; qcom,pm-cpu-level@1 { /* C4 */ reg = <1>; qcom,spm-cpu-mode = "fpc-def"; qcom,psci-cpu-mode = <4>; qcom,latency-us = <40>; qcom,ss-power = <198>; qcom,energy-overhead = <21850>; qcom,time-overhead = <120>; qcom,hyp-psci; }; qcom,pm-cpu-level@2 { /* C4 */ reg = <2>; qcom,spm-cpu-mode = "fpc"; qcom,psci-cpu-mode = <4>; qcom,latency-us = <80>; qcom,ss-power = <700>; qcom,energy-overhead = <126480>; qcom,time-overhead = <160>; qcom,ss-power = <196>; qcom,energy-overhead = <45300>; qcom,time-overhead = <210>; }; }; }; Loading @@ -167,9 +178,9 @@ label = "perf-l2-wfi"; qcom,psci-mode = <1>; qcom,latency-us = <40>; qcom,ss-power = <740>; qcom,energy-overhead = <70000>; qcom,time-overhead = <80>; qcom,ss-power = <195>; qcom,energy-overhead = <65000>; qcom,time-overhead = <85>; }; qcom,pm-cluster-level@1{ /* D3 */ Loading @@ -177,10 +188,10 @@ label = "perf-l2-gdhs"; qcom,psci-mode = <3>; qcom,latency-us = <80>; qcom,ss-power = <660>; qcom,energy-overhead = <142000>; qcom,ss-power = <180>; qcom,energy-overhead = <83500>; qcom,time-overhead = <180>; qcom,min-child-idx = <1>; qcom,min-child-idx = <2>; }; qcom,pm-cluster-level@2{ /* D4 */ Loading @@ -188,10 +199,10 @@ label = "perf-l2-fpc"; qcom,psci-mode = <4>; qcom,latency-us = <800>; qcom,ss-power = <450>; qcom,energy-overhead = <240000>; qcom,time-overhead = <11500>; qcom,min-child-idx = <1>; qcom,ss-power = <160>; qcom,energy-overhead = <441000>; qcom,time-overhead = <1000>; qcom,min-child-idx = <2>; qcom,is-reset; }; Loading @@ -206,19 +217,30 @@ qcom,psci-cpu-mode = <1>; qcom,spm-cpu-mode = "wfi"; qcom,latency-us = <25>; qcom,ss-power = <750>; qcom,energy-overhead = <37000>; qcom,time-overhead = <50>; qcom,ss-power = <200>; qcom,energy-overhead = <9000>; qcom,time-overhead = <60>; }; qcom,pm-cpu-level@1 { /* C4 */ reg = <1>; qcom,spm-cpu-mode = "fpc-def"; qcom,psci-cpu-mode = <4>; qcom,latency-us = <40>; qcom,ss-power = <198>; qcom,energy-overhead = <21850>; qcom,time-overhead = <120>; qcom,hyp-psci; }; qcom,pm-cpu-level@2 { /* C4 */ reg = <2>; qcom,spm-cpu-mode = "fpc"; qcom,psci-cpu-mode = <4>; qcom,latency-us = <80>; qcom,ss-power = <700>; qcom,energy-overhead = <136480>; qcom,time-overhead = <160>; qcom,ss-power = <196>; qcom,energy-overhead = <45300>; qcom,time-overhead = <210>; }; }; }; Loading
drivers/cpuidle/lpm-levels-of.c +4 −1 Original line number Diff line number Diff line /* Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -563,6 +563,9 @@ static int parse_cpu_mode(struct device_node *n, struct lpm_cpu_level *l) n->name); return ret; } key = "qcom,hyp-psci"; l->hyp_psci = of_property_read_bool(n, key); } else { l->mode = parse_cpu_spm_mode(l->name); Loading
drivers/cpuidle/lpm-levels.c +9 −1 Original line number Diff line number Diff line /* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -796,6 +796,7 @@ unlock_and_return: } #if !defined(CONFIG_CPU_V7) asmlinkage int __invoke_psci_fn_smc(u64, u64, u64, u64); bool psci_enter_sleep(struct lpm_cluster *cluster, int idx, bool from_idle) { /* Loading @@ -813,6 +814,13 @@ bool psci_enter_sleep(struct lpm_cluster *cluster, int idx, bool from_idle) PSCI_POWER_STATE(cluster->cpu->levels[idx].is_reset); bool success = false; if (cluster->cpu->levels[idx].hyp_psci) { stop_critical_timings(); __invoke_psci_fn_smc(0xC4000021, 0, 0, 0); start_critical_timings(); return 1; } affinity_level = PSCI_AFFINITY_LEVEL(affinity_level); state_id |= (power_state | affinity_level | cluster->cpu->levels[idx].psci_id); Loading
drivers/cpuidle/lpm-levels.h +2 −1 Original line number Diff line number Diff line /* Copyright (c) 2014, 2015, The Linux Foundation. All rights reserved. /* Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -37,6 +37,7 @@ struct lpm_cpu_level { unsigned int psci_id; bool is_reset; bool jtag_save_restore; bool hyp_psci; }; struct lpm_cpu { Loading