hikey960: create dedicated .rc files for power parameters
Hikey960 has different CPU architecture with Hikey, these two platforms
should use their own dedicate configurations for power, especially for
EAS related settings.
This patch is to split the power related settings into two files, one
is init.hikey.power.rc and another is init.hikey960.power.rc. The main
different setting for power setting is related with EAS parameters in
proc nodes.
For Hikey we set the parameters as below:
write /proc/sys/kernel/sched_is_big_little 0
write /proc/sys/kernel/sched_cstate_aware 1
write /proc/sys/kernel/sched_sync_hint_enable 1
write /proc/sys/kernel/sched_initial_task_util 0
For Hikey960 we set the parameters as below:
write /sys/kernel/debug/sched_features "ENERGY_AWARE"
write /proc/sys/kernel/sched_is_big_little 1
write /proc/sys/kernel/sched_cstate_aware 1
write /proc/sys/kernel/sched_sync_hint_enable 0
write /proc/sys/kernel/sched_initial_task_util 0
On Hikey960 we also set default boost margin to 50%, and
touch-boost to 100%. This will let the CPU frequency to reach
highest OPP so can reduce scheduling latency; this is used to
improve the GPU rendering performance.
write /dev/stune/top-app/schedtune.boost 50
write /dev/stune/foreground/schedtune.boost 50
Change-Id: I641f5c78075012153fb73e830cb31dfc8dfd6e87
Signed-off-by: Leo Yan <leo.yan@linaro.org>
[jstultz: Added and tweaked some of the parameters to work with
the parameterized powerHAL]
Signed-off-by: John Stultz <john.stultz@linaro.org>
diff --git a/hikey/device-hikey.mk b/hikey/device-hikey.mk
index 9c84e60..b5b6bd9 100644
--- a/hikey/device-hikey.mk
+++ b/hikey/device-hikey.mk
@@ -18,6 +18,7 @@
$(TARGET_PREBUILT_DTB):hi6220-hikey.dtb \
$(LOCAL_PATH)/$(TARGET_FSTAB):root/fstab.hikey \
device/linaro/hikey/init.common.rc:root/init.hikey.rc \
+ device/linaro/hikey/init.hikey.power.rc:root/init.hikey.power.rc \
device/linaro/hikey/init.common.usb.rc:root/init.hikey.usb.rc \
device/linaro/hikey/ueventd.common.rc:root/ueventd.hikey.rc \
device/linaro/hikey/common.kl:system/usr/keylayout/hikey.kl
diff --git a/hikey960/device-hikey960.mk b/hikey960/device-hikey960.mk
index 95d8750..2843b16 100644
--- a/hikey960/device-hikey960.mk
+++ b/hikey960/device-hikey960.mk
@@ -19,6 +19,7 @@
PRODUCT_COPY_FILES += $(LOCAL_PATH)/fstab.hikey960:root/fstab.hikey960 \
device/linaro/hikey/init.common.rc:root/init.hikey960.rc \
+ device/linaro/hikey/init.hikey960.power.rc:root/init.hikey960.power.rc \
device/linaro/hikey/init.common.usb.rc:root/init.hikey960.usb.rc \
device/linaro/hikey/ueventd.common.rc:root/ueventd.hikey960.rc \
device/linaro/hikey/common.kl:system/usr/keylayout/hikey960.kl
diff --git a/init.common.rc b/init.common.rc
index 8d7a35d..41f582a 100644
--- a/init.common.rc
+++ b/init.common.rc
@@ -1,4 +1,5 @@
import init.${ro.hardware}.usb.rc
+import init.${ro.hardware}.power.rc
on init
# mount debugfs
@@ -41,21 +42,6 @@
# Set supported opengles version
setprop ro.opengles.version 196608
- #
- # EAS stune boosting interfaces
- #
- chown system system /dev/stune/top-app/schedtune.boost
- chown system system /dev/stune/top-app/schedtune.prefer_idle
- chown system system /dev/stune/foreground/schedtune.boost
- chown system system /dev/stune/foreground/schedtune.prefer_idle
- chown system system /dev/stune/schedtune.boost
-
- write /dev/stune/top-app/schedtune.boost 10
- write /dev/stune/top-app/schedtune.prefer_idle 1
- write /dev/stune/foreground/schedtune.boost 0
- write /dev/stune/foreground/schedtune.prefer_idle 1
- write /dev/stune/schedtune.boost 0
-
# enable Google-specific location features,
# like NetworkLocationProvider and LocationCollector
diff --git a/init.hikey.power.rc b/init.hikey.power.rc
new file mode 100644
index 0000000..cc268c6
--- /dev/null
+++ b/init.hikey.power.rc
@@ -0,0 +1,30 @@
+on post-fs
+ #
+ # EAS feature enabling
+ #
+ write /sys/kernel/debug/sched_features "ENERGY_AWARE"
+ write /proc/sys/kernel/sched_is_big_little 0
+ write /proc/sys/kernel/sched_cstate_aware 1
+ write /proc/sys/kernel/sched_sync_hint_enable 1
+ write /proc/sys/kernel/sched_initial_task_util 0
+
+ #
+ # EAS stune boosting interfaces
+ #
+ chown system system /dev/stune/top-app/schedtune.boost
+ chown system system /dev/stune/top-app/schedtune.prefer_idle
+ chown system system /dev/stune/foreground/schedtune.boost
+ chown system system /dev/stune/foreground/schedtune.prefer_idle
+ chown system system /dev/stune/schedtune.boost
+
+ write /dev/stune/top-app/schedtune.boost 10
+ write /dev/stune/top-app/schedtune.prefer_idle 1
+ write /dev/stune/foreground/schedtune.boost 0
+ write /dev/stune/foreground/schedtune.prefer_idle 1
+ write /dev/stune/schedtune.boost 0
+
+ setprop ro.config.schetune.touchboost.value 40
+ setprop ro.config.schetune.touchboost.time_ns 1000000000
+
+ setprop ro.config.cpufreq.max_freq.cluster0 "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"
+ setprop ro.config.cpufreq.low_power_max.cluster0 "729000"
diff --git a/init.hikey960.power.rc b/init.hikey960.power.rc
new file mode 100644
index 0000000..13fb587
--- /dev/null
+++ b/init.hikey960.power.rc
@@ -0,0 +1,32 @@
+on post-fs
+ #
+ # EAS feature enabling
+ #
+ write /sys/kernel/debug/sched_features "ENERGY_AWARE"
+ write /proc/sys/kernel/sched_is_big_little 1
+ write /proc/sys/kernel/sched_cstate_aware 1
+ write /proc/sys/kernel/sched_sync_hint_enable 0
+ write /proc/sys/kernel/sched_initial_task_util 0
+
+ #
+ # EAS stune boosting interfaces
+ #
+ chown system system /dev/stune/top-app/schedtune.boost
+ chown system system /dev/stune/top-app/schedtune.prefer_idle
+ chown system system /dev/stune/foreground/schedtune.boost
+ chown system system /dev/stune/foreground/schedtune.prefer_idle
+ chown system system /dev/stune/schedtune.boost
+
+ write /dev/stune/top-app/schedtune.boost 50
+ write /dev/stune/top-app/schedtune.prefer_idle 1
+ write /dev/stune/foreground/schedtune.boost 50
+ write /dev/stune/foreground/schedtune.prefer_idle 1
+ write /dev/stune/schedtune.boost 0
+
+ setprop ro.config.schetune.touchboost.value 100
+ setprop ro.config.schetune.touchboost.time_ns 1000000000
+
+ setprop ro.config.cpufreq.max_freq.cluster0 "/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"
+ setprop ro.config.cpufreq.low_power_max.cluster0 "999000"
+ setprop ro.config.cpufreq.max_freq.cluster1 "/sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq"
+ setprop ro.config.cpufreq.low_power_max.cluster1 "903000"