init.hardware.rc: schedtune for boottime

Set stune.boost to 100 to boost process to big cores and prefer_idle to
1 to spread tasks. This saves ~370ms from kernel boot to boot_complete.

Before CL:
BootComplete                  : 10.046  0.067631

Post CL:
BootComplete                  : 9.6713  0.083226

Test: boottime
Bug: 80345258
Change-Id: I29159ba3102a23f302ddc2a2747879fd1ca39c27
diff --git a/init.hardware.rc b/init.hardware.rc
index f0a5c36..522a8ff 100644
--- a/init.hardware.rc
+++ b/init.hardware.rc
@@ -17,6 +17,10 @@
 import /vendor/etc/init/hw/init.${ro.hardware}.usb.rc
 
 on charger
+    # Set runtime stune value
+    write /dev/stune/schedtune.prefer_idle 0
+    write /dev/stune/schedtune.boost 0
+    # Offline CPUs
     write /sys/devices/system/cpu/cpu2/online 0
     write /sys/devices/system/cpu/cpu3/online 0
     write /sys/devices/system/cpu/cpu4/online 0
@@ -80,6 +84,10 @@
     write /sys/devices/system/cpu/cpufreq/policy4/schedutil/up_rate_limit_us 500
     write /sys/devices/system/cpu/cpufreq/policy4/schedutil/down_rate_limit_us 20000
 
+    # Set boottime stune value
+    write /dev/stune/schedtune.prefer_idle 1
+    write /dev/stune/schedtune.boost 100
+
     # set default schedTune value for foreground/top-app
     write /dev/stune/foreground/schedtune.prefer_idle 1
     write /dev/stune/top-app/schedtune.boost 10
@@ -546,6 +554,10 @@
     setprop vendor.powerhal.init 1
 
 on property:sys.boot_completed=1
+    # Set runtime stune value
+    write /dev/stune/schedtune.prefer_idle 0
+    write /dev/stune/schedtune.boost 0
+
     # Enable power setting and set sys.post_boot.parsed to 1
     start vendor.power_sh