Merge "hikey960: create dedicated .rc files for power parameters" am: 0d6624c2fe am: 76e9a30675 am: d279d53b93
am: 2483153da3

Change-Id: I01b89f66ab7d19bc763c60a5ada5a9e544d29e89
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"