diff options
| author | Alberto97 <albertop2197@gmail.com> | 2016-08-22 19:46:48 +0200 |
|---|---|---|
| committer | Trafalgar-Square <schneller.demian@gmail.com> | 2016-08-25 18:48:29 +0200 |
| commit | 0db1af8e5148f96cba76f2bea6d35e55c6f49ca4 (patch) | |
| tree | e632dfff0ba0b89dcce7207b58344ebc2d46a0a9 | |
| parent | 4ed9b6366f918f976a1147854f30c1616f9d4356 (diff) | |
surnia: Add Custom PowerHAL headermm6.0
With this PowerHAL cpu-boost is not needed, so disable it.
Change-Id: Ic579c464652da6ec119e80ca5b594dd0089d2d1a
| -rw-r--r-- | BoardConfig.mk | 2 | ||||
| -rw-r--r-- | power/power_device.h | 84 | ||||
| -rw-r--r-- | rootdir/etc/init.target.rc | 39 |
3 files changed, 106 insertions, 19 deletions
diff --git a/BoardConfig.mk b/BoardConfig.mk index ab9925e..7ea24e4 100644 --- a/BoardConfig.mk +++ b/BoardConfig.mk @@ -40,7 +40,7 @@ BOARD_CACHEIMAGE_PARTITION_SIZE := 268435456 #524288 * 512 mmcblk0p43 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 # Power -TARGET_POWERHAL_VARIANT := qcom +TARGET_POWERHAL_HEADER_PATH := $(DEVICE_PATH)/power # Properties TARGET_SYSTEM_PROP += $(DEVICE_PATH)/system.prop diff --git a/power/power_device.h b/power/power_device.h new file mode 100644 index 0000000..c38f36e --- /dev/null +++ b/power/power_device.h @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2016 The CyanogenMod Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +static power_profile profiles[PROFILE_MAX] = { + [PROFILE_POWER_SAVE] = { + .boost = 0, + .boostpulse_duration = 0, + .go_hispeed_load = 90, + .go_hispeed_load_off = 90, + .hispeed_freq = 800000, + .hispeed_freq_off = 800000, + .min_sample_time = 60000, + .timer_rate = 20000, + .above_hispeed_delay = 20000, + .target_loads = 90, + .target_loads_off = 90, + .scaling_max_freq = 998400, + .scaling_min_freq = 400000, + .scaling_min_freq_off = 200000, + }, + [PROFILE_BALANCED] = { + .boost = 0, + .boostpulse_duration = 60000, + .go_hispeed_load = 80, + .go_hispeed_load_off = 90, + .hispeed_freq = 998400, + .hispeed_freq_off = 800000, + .min_sample_time = 60000, + .timer_rate = 20000, + .above_hispeed_delay = 20000, + .target_loads = 80, + .target_loads_off = 90, + .scaling_max_freq = 1209600, + .scaling_min_freq = 800000, + .scaling_min_freq_off = 200000, + }, + [PROFILE_HIGH_PERFORMANCE] = { + .boost = 1, + /* The CPU is already boosted, set duration to zero + * to avoid unneccessary writes to boostpulse */ + .boostpulse_duration = 0, + .go_hispeed_load = 60, + .go_hispeed_load_off = 70, + .hispeed_freq = 998400, + .hispeed_freq_off = 998400, + .min_sample_time = 60000, + .timer_rate = 20000, + .above_hispeed_delay = 20000, + .target_loads = 60, + .target_loads_off = 70, + .scaling_max_freq = 1209600, + .scaling_min_freq = 800000, + .scaling_min_freq_off = 200000, + }, + [PROFILE_BIAS_POWER_SAVE] = { + .boost = 0, + .boostpulse_duration = 40000, + .go_hispeed_load = 90, + .go_hispeed_load_off = 90, + .hispeed_freq = 800000, + .hispeed_freq_off = 800000, + .min_sample_time = 60000, + .timer_rate = 20000, + .above_hispeed_delay = 20000, + .target_loads = 90, + .target_loads_off = 90, + .scaling_max_freq = 1209600, + .scaling_min_freq = 400000, + .scaling_min_freq_off = 200000, + }, +}; diff --git a/rootdir/etc/init.target.rc b/rootdir/etc/init.target.rc index 95e909c..fe0c2cc 100644 --- a/rootdir/etc/init.target.rc +++ b/rootdir/etc/init.target.rc @@ -26,6 +26,26 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # +on boot + # Switch to interactive and let PowerHAL configure it + write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive + chown system system /sys/devices/system/cpu/cpufreq/interactive/boostpulse + chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/boostpulse + chown system system /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load + chmod 0644 /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load + chown system system /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq + chmod 0644 /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq + chown system system /sys/devices/system/cpu/cpufreq/interactive/min_sample_time + chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/min_sample_time + chown system system /sys/devices/system/cpu/cpufreq/interactive/timer_rate + chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/timer_rate + chown system system /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay + chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay + chown system system /sys/devices/system/cpu/cpufreq/interactive/target_loads + chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/target_loads + chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq + chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq + on post-fs-data copy /system/etc/eri.xml /data/eri.xml chmod 0644 /data/eri.xml @@ -43,26 +63,9 @@ on property:sys.boot_completed=1 # HMP Task packing settings for 8916 write /proc/sys/kernel/sched_small_task 50 - # disable thermal core_control to update scaling_min_freq - write /sys/module/msm_thermal/core_control/enabled 0 - write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 400000 - write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "interactive" - # enable thermal core_control now + # enable thermal core_control write /sys/module/msm_thermal/core_control/enabled 1 - # Interactive governor setup - write /sys/devices/system/cpu/cpufreq/interactive/timer_rate 20000 - write /sys/devices/system/cpu/cpufreq/interactive/min_sample_time 60000 - write /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq 998400 - write /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load 80 - write /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay 20000 - write /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration 60000 - write /sys/devices/system/cpu/cpufreq/interactive/target_loads 80 - - write /sys/module/cpu_boost/parameters/boost_ms 20 - write /sys/module/cpu_boost/parameters/sync_threshold 998400 - write /sys/module/cpu_boost/parameters/input_boost_freq 1094400 - write /sys/module/cpu_boost/parameters/input_boost_ms 40 start batt_health write /sys/class/devfreq/1c00000.qcom,kgsl-3d0/governor "msm-adreno-tz" |
