summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Weffers <rcstar6696@gmail.com>2017-03-18 10:08:36 +0100
committerMax Weffers <rcstar6696@gmail.com>2017-03-27 14:08:37 +0200
commit73598c6b9b749d0321b61967d6664316ced812d5 (patch)
treef49c1df8f99a5d22ff29c9ae10e26815b7c50183
parenta101d620fed432c95ed147609f2d7f683900fbfa (diff)
Add cpuquiet config in prop and init
-rw-r--r--BoardConfigCommon.mk3
-rw-r--r--rootdir/init.qcom.power.rc147
-rw-r--r--system.prop15
3 files changed, 102 insertions, 63 deletions
diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk
index 74f78f2..03820ec 100644
--- a/BoardConfigCommon.mk
+++ b/BoardConfigCommon.mk
@@ -59,6 +59,9 @@ TARGET_INIT_VENDOR_LIB := libinit_shinano
# SELinux
BOARD_SEPOLICY_DIRS += \
device/sony/shinano-common/sepolicy
+
+# Props for hotplugging
+TARGET_SYSTEM_PROP += device/sony/shinano-common/system.prop
#Sensors
USE_SENSOR_MULTI_HAL := true
diff --git a/rootdir/init.qcom.power.rc b/rootdir/init.qcom.power.rc
index 0702206..0d6044f 100644
--- a/rootdir/init.qcom.power.rc
+++ b/rootdir/init.qcom.power.rc
@@ -1,35 +1,60 @@
-on early-init
- write /sys/block/mmcblk0/bdi/read_ahead_kb 512
+on init
+ # cpuquiet rqbalance permissions
+ chown system system /sys/devices/system/cpu/cpuquiet/nr_min_cpus
+ chown system system /sys/devices/system/cpu/cpuquiet/nr_power_max_cpus
+ chown system system /sys/devices/system/cpu/cpuquiet/nr_thermal_max_cpus
+ chown system system /sys/devices/system/cpu/cpuquiet/rqbalance/balance_level
+ chown system system /sys/devices/system/cpu/cpuquiet/rqbalance/nr_run_thresholds
+ chown system system /sys/devices/system/cpu/cpuquiet/rqbalance/nr_down_run_thresholds
+ chmod 0660 /sys/devices/system/cpu/cpuquiet/nr_min_cpus
+ chmod 0660 /sys/devices/system/cpu/cpuquiet/nr_power_max_cpus
+ chmod 0660 /sys/devices/system/cpu/cpuquiet/nr_thermal_max_cpus
+ chmod 0660 /sys/devices/system/cpu/cpuquiet/rqbalance/balance_level
+ chmod 0660 /sys/devices/system/cpu/cpuquiet/rqbalance/nr_run_thresholds
+ chmod 0660 /sys/devices/system/cpu/cpuquiet/rqbalance/nr_down_run_thresholds
-on enable-low-power
- write /sys/module/lpm_levels/enable_low_power/l2 4
- write /sys/module/msm_pm/modes/cpu0/power_collapse/suspend_enabled 1
- write /sys/module/msm_pm/modes/cpu1/power_collapse/suspend_enabled 1
- write /sys/module/msm_pm/modes/cpu2/power_collapse/suspend_enabled 1
- write /sys/module/msm_pm/modes/cpu3/power_collapse/suspend_enabled 1
- write /sys/module/msm_pm/modes/cpu0/power_collapse/idle_enabled 1
- write /sys/module/msm_pm/modes/cpu1/power_collapse/idle_enabled 1
- write /sys/module/msm_pm/modes/cpu2/power_collapse/idle_enabled 1
- write /sys/module/msm_pm/modes/cpu3/power_collapse/idle_enabled 1
- write /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/suspend_enabled 1
- write /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/suspend_enabled 1
- write /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/suspend_enabled 1
- write /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/suspend_enabled 1
- write /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/idle_enabled 1
- write /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/idle_enabled 1
- write /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/idle_enabled 1
- write /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/idle_enabled 1
- write /sys/module/msm_pm/modes/cpu0/retention/idle_enabled 1
- write /sys/module/msm_pm/modes/cpu1/retention/idle_enabled 1
- write /sys/module/msm_pm/modes/cpu2/retention/idle_enabled 1
- write /sys/module/msm_pm/modes/cpu3/retention/idle_enabled 1
+on charger
+ # Enable Power modes and set the CPU Freq Sampling rates
+ write /sys/module/msm_thermal/core_control/enabled 0
+ write /sys/devices/system/cpu/cpu1/online 1
+ write /sys/devices/system/cpu/cpu2/online 1
+ write /sys/devices/system/cpu/cpu3/online 1
+ write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "powersave"
+ write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor "powersave"
+ write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor "powersave"
+ write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor "powersave"
+ write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 300000
+ write /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq 300000
+ write /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq 300000
+ write /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq 300000
+ write /sys/module/msm_thermal/core_control/enabled 1
+ write /sys/devices/system/cpu/cpu1/online 0
+ write /sys/devices/system/cpu/cpu2/online 0
+ write /sys/devices/system/cpu/cpu3/online 0
+on boot
+ # Disable thermal
write /sys/module/msm_thermal/core_control/enabled 0
+ # Device boots with performance governor.
+ # Switch one core to interactive to set permissions, for power hal and system server.
+ write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "interactive"
+ chown system system /dev/cpuctl/cpu.notify_on_migrate
+ chmod 0660 /dev/cpuctl/cpu.notify_on_migrate
+ chown root system /sys/devices/system/cpu/cpu1/online
+ chown root system /sys/devices/system/cpu/cpu2/online
+ chown root system /sys/devices/system/cpu/cpu3/online
+ chmod 664 /sys/devices/system/cpu/cpu1/online
+ chmod 664 /sys/devices/system/cpu/cpu2/online
+ chmod 664 /sys/devices/system/cpu/cpu3/online
+
+ # Bring CPUs online
+ write /sys/devices/system/cpu/cpu0/online 1
write /sys/devices/system/cpu/cpu1/online 1
write /sys/devices/system/cpu/cpu2/online 1
write /sys/devices/system/cpu/cpu3/online 1
+on property:init.svc.bootanim=stopped
write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "interactive"
write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor "interactive"
write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor "interactive"
@@ -48,45 +73,41 @@ on enable-low-power
write /sys/devices/system/cpu/cpufreq/interactive/timer_slack 20000
write /sys/class/kgsl/kgsl-3d0/devfreq/governor "msm-adreno-tz"
write /dev/cpuctl/cpu.notify_on_migrate 1
-
- chown root system /sys/devices/system/cpu/cpu1/online
- chown root system /sys/devices/system/cpu/cpu2/online
- chown root system /sys/devices/system/cpu/cpu3/online
- chmod 664 /sys/devices/system/cpu/cpu1/online
- chmod 664 /sys/devices/system/cpu/cpu2/online
- chmod 664 /sys/devices/system/cpu/cpu3/online
-
- write /sys/module/msm_thermal/core_control/enabled 1
- write /sys/class/devfreq/qcom,cpubw.40/governor "cpubw_hwmon"
- write /sys/class/kgsl/kgsl-3d0/devfreq/governor msm-adreno-tz
-
-on charger
- write /sys/module/lpm_levels/enable_low_power/l2 2
- write /sys/module/msm_pm/modes/cpu0/power_collapse/suspend_enabled 1
- write /sys/module/msm_pm/modes/cpu1/power_collapse/suspend_enabled 1
- write /sys/module/msm_pm/modes/cpu2/power_collapse/suspend_enabled 1
- write /sys/module/msm_pm/modes/cpu3/power_collapse/suspend_enabled 1
- write /sys/module/msm_pm/modes/cpu0/power_collapse/idle_enabled 1
- write /sys/module/msm_thermal/core_control/enabled 0
- write /sys/devices/system/cpu/cpu1/online 1
- write /sys/devices/system/cpu/cpu2/online 1
- write /sys/devices/system/cpu/cpu3/online 1
- write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "powersave"
- write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor "powersave"
- write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor "powersave"
- write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor "powersave"
- write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 300000
- write /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq 300000
- write /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq 300000
- write /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq 300000
+ # Enable thermal
write /sys/module/msm_thermal/core_control/enabled 1
- write /sys/devices/system/cpu/cpu1/online 0
- write /sys/devices/system/cpu/cpu2/online 0
- write /sys/devices/system/cpu/cpu3/online 0
-
-on boot
- trigger enable-low-power
-on property:init.svc.recovery=running
- trigger enable-low-power
+ # 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/above_hispeed_delay
+ chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/align_windows
+ chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/align_windows
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/boost
+ chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/boost
+ 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/cpufreq/interactive/boostpulse_duration
+ chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
+ chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
+ chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
+ chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/max_freq_hysteresis
+ chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/max_freq_hysteresis
+ 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/target_loads
+ chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/target_loads
+ 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/timer_slack
+ chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/timer_slack
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/use_migration_notif
+ chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/use_migration_notif
+ chown system system /sys/devices/system/cpu/cpufreq/interactive/use_sched_load
+ chmod 0644 /sys/devices/system/cpu/cpufreq/interactive/use_sched_load
+ chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
+ chown system system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
diff --git a/system.prop b/system.prop
new file mode 100644
index 0000000..fc7e8ee
--- /dev/null
+++ b/system.prop
@@ -0,0 +1,15 @@
+#
+# rqbalance specific values
+#
+
+cpuquiet.low.min_cpus=1
+cpuquiet.low.max_cpus=2
+rqbalance.low.balance_level=80
+rqbalance.low.up_threshold=200 400 600 4294967295
+rqbalance.low.down_threshold=0 100 300 500
+
+cpuquiet.normal.min_cpus=2
+cpuquiet.normal.max_cpus=4
+rqbalance.normal.balance_level=40
+rqbalance.normal.up_threshold=100 250 330 4294967295
+rqbalance.normal.down_threshold=0 130 220 300