Home | History | Annotate | Download | only in marlin
      1 #!/system/bin/sh
      2 
      3 ################################################################################
      4 # helper functions to allow Android init like script
      5 
      6 function write() {
      7     echo -n $2 > $1
      8 }
      9 
     10 function copy() {
     11     cat $1 > $2
     12 }
     13 
     14 ################################################################################
     15 
     16 # disable thermal hotplug to switch governor
     17 write /sys/module/msm_thermal/core_control/enabled 0
     18 
     19 # bring back main cores CPU 0,2
     20 write /sys/devices/system/cpu/cpu0/online 1
     21 write /sys/devices/system/cpu/cpu2/online 1
     22 
     23 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive
     24 write /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_sched_load 1
     25 write /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_migration_notif 1
     26 write /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay 19000
     27 write /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load 90
     28 write /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate 20000
     29 write /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq 960000
     30 write /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy 1
     31 write /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads 80
     32 write /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time 19000
     33 write /sys/devices/system/cpu/cpu0/cpufreq/interactive/max_freq_hysteresis 79000
     34 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 300000
     35 write /sys/devices/system/cpu/cpu0/cpufreq/interactive/ignore_hispeed_on_notif 0
     36 
     37 # EAS: Capping the max frequency of silver core to 1.6GHz
     38 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 1593600
     39 
     40 write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor interactive
     41 write /sys/devices/system/cpu/cpu2/cpufreq/interactive/use_sched_load 1
     42 write /sys/devices/system/cpu/cpu2/cpufreq/interactive/use_migration_notif 1
     43 write /sys/devices/system/cpu/cpu2/cpufreq/interactive/above_hispeed_delay "19000 1400000:39000 1700000:39000"
     44 
     45 write /sys/devices/system/cpu/cpu2/cpufreq/interactive/go_hispeed_load 90
     46 write /sys/devices/system/cpu/cpu2/cpufreq/interactive/timer_rate 20000
     47 write /sys/devices/system/cpu/cpu2/cpufreq/interactive/hispeed_freq 1248000
     48 write /sys/devices/system/cpu/cpu2/cpufreq/interactive/io_is_busy 1
     49 write /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads "85 1500000:90 1800000:95"
     50 
     51 write /sys/devices/system/cpu/cpu2/cpufreq/interactive/min_sample_time 19000
     52 write /sys/devices/system/cpu/cpu2/cpufreq/interactive/max_freq_hysteresis 39000
     53 write /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq 300000
     54 write /sys/devices/system/cpu/cpu2/cpufreq/interactive/ignore_hispeed_on_notif 0
     55 
     56 # if EAS is present, switch to sched governor (no effect if not EAS)
     57 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "sched"
     58 write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor "sched"
     59 
     60 # re-enable thermal hotplug
     61 write /sys/module/msm_thermal/core_control/enabled 1
     62 
     63 # input boost configuration
     64 write /sys/module/cpu_boost/parameters/input_boost_freq "0:1324800 2:1324800"
     65 write /sys/module/cpu_boost/parameters/input_boost_ms 40
     66 
     67 # Setting b.L scheduler parameters
     68 write /proc/sys/kernel/sched_boost 0
     69 write /proc/sys/kernel/sched_migration_fixup 1
     70 write /proc/sys/kernel/sched_upmigrate 95
     71 write /proc/sys/kernel/sched_downmigrate 90
     72 write /proc/sys/kernel/sched_freq_inc_notify 400000
     73 write /proc/sys/kernel/sched_freq_dec_notify 400000
     74 write /proc/sys/kernel/sched_spill_nr_run 3
     75 write /proc/sys/kernel/sched_init_task_load 100
     76 
     77 # Enable bus-dcvs
     78 for cpubw in /sys/class/devfreq/*qcom,cpubw* ; do
     79     write $cpubw/governor "bw_hwmon"
     80     write $cpubw/polling_interval 50
     81     write $cpubw/min_freq 1525
     82     write $cpubw/bw_hwmon/mbps_zones "1525 5195 11863 13763"
     83     write $cpubw/bw_hwmon/sample_ms 4
     84     write $cpubw/bw_hwmon/io_percent 34
     85     write $cpubw/bw_hwmon/hist_memory 20
     86     write $cpubw/bw_hwmon/hyst_length 10
     87     write $cpubw/bw_hwmon/low_power_ceil_mbps 0
     88     write $cpubw/bw_hwmon/low_power_io_percent 34
     89     write $cpubw/bw_hwmon/low_power_delay 20
     90     write $cpubw/bw_hwmon/guard_band_mbps 0
     91     write $cpubw/bw_hwmon/up_scale 250
     92     write $cpubw/bw_hwmon/idle_mbps 1600
     93 done
     94 
     95 for memlat in /sys/class/devfreq/*qcom,memlat-cpu* ; do
     96     write $memlat/governor "mem_latency"
     97     write $memlat/polling_interval 10
     98 done
     99 
    100 # Enable all LPMs by default
    101 # This will enable C4, D4, D3, E4 and M3 LPMs
    102 write /sys/module/lpm_levels/parameters/sleep_disabled N
    103