From f88230b9fe71f7eda0f27480e953facd3ef77e54 Mon Sep 17 00:00:00 2001 From: Keita Espinoza Date: Mon, 24 Jul 2017 05:03:01 +0000 Subject: shinano: Rework qcom.power init - Boot phone in interactive mode instead of performance - Add TWRP config Change-Id: I647c09e430bc3904ff526ed662191e7d3b833e0b --- rootdir/init.qcom.power.rc | 54 +++++++++++++++++++++++++++---------------- rootdir/init.recovery.qcom.rc | 3 --- shinano.mk | 5 +++- 3 files changed, 38 insertions(+), 24 deletions(-) delete mode 100644 rootdir/init.recovery.qcom.rc diff --git a/rootdir/init.qcom.power.rc b/rootdir/init.qcom.power.rc index fed2e28..809e37e 100644 --- a/rootdir/init.qcom.power.rc +++ b/rootdir/init.qcom.power.rc @@ -25,7 +25,7 @@ on charger write /sys/devices/system/cpu/cpu2/online 0 write /sys/devices/system/cpu/cpu3/online 0 -on property:sys.boot_completed=1 +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 @@ -43,28 +43,20 @@ on property:sys.boot_completed=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/cpu1/retention/suspend_enabled 1 + write /sys/module/msm_pm/modes/cpu2/retention/suspend_enabled 1 + write /sys/module/msm_pm/modes/cpu3/retention/suspend_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 - write /sys/module/msm_pm/modes/cpu1/retention/suspend_enabled 1 - write /sys/module/msm_pm/modes/cpu2/retention/suspend_enabled 1 - write /sys/module/msm_pm/modes/cpu3/retention/suspend_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/class/devfreq/qcom,cpubw.40/governor "cpubw_hwmon" - # Configure the CPU governor - 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 - write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor interactive - write /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay "19000 1400000:39000 1700000:19000" - write /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load 99 - write /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq 1497600 - write /sys/devices/system/cpu/cpufreq/interactive/io_is_busy 1 - write /sys/devices/system/cpu/cpufreq/interactive/target_loads "85 1500000:90 1800000:70" - write /sys/devices/system/cpu/cpufreq/interactive/min_sample_time 40000 - write /sys/devices/system/cpu/cpufreq/interactive/timer_rate 30000 - write /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor 100000 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 @@ -77,6 +69,21 @@ on property:sys.boot_completed=1 chmod 664 /sys/devices/system/cpu/cpu2/online chmod 664 /sys/devices/system/cpu/cpu3/online + write /dev/cpuctl/cpu.notify_on_migrate 1 + + 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" + write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor "interactive" + write /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay "19000 1400000:39000 1700000:19000" + write /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load 99 + write /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq 1190400 + write /sys/devices/system/cpu/cpufreq/interactive/io_is_busy 1 + write /sys/devices/system/cpu/cpufreq/interactive/target_loads "85 1500000:90 1800000:70" + write /sys/devices/system/cpu/cpufreq/interactive/min_sample_time 40000 + write /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor 100000 + write /sys/devices/system/cpu/cpufreq/interactive/timer_rate 30000 + write /sys/module/msm_thermal/core_control/enabled 1 write /sys/module/cpu_boost/parameters/boost_ms 20 @@ -84,12 +91,19 @@ on property:sys.boot_completed=1 write /sys/module/cpu_boost/parameters/input_boost_freq 1497600 write /sys/module/cpu_boost/parameters/input_boost_ms 40 - write /sys/class/devfreq/qcom,cpubw.40/governor "cpubw_hwmon" +on boot + trigger enable-low-power + +on property:init.svc.recovery=running + trigger enable-low-power + write /sys/class/android_usb/android0/idVendor 0FCE + write /sys/class/android_usb/android0/idProduct 6${ro.usb.pid_suffix} +on property:dev.bootcomplete=1 # Set max mA current for usb/dc charger write /sys/class/power_supply/qpnp-dc/current_max 1800000 write /sys/class/power_supply/usb/current_max 1500000 - setprop sys.io.scheduler bfq rm /data/system/perfd/default_values - start mpdecision \ No newline at end of file + setprop sys.io.scheduler "bfq" + start mpdecision diff --git a/rootdir/init.recovery.qcom.rc b/rootdir/init.recovery.qcom.rc deleted file mode 100644 index dca838c..0000000 --- a/rootdir/init.recovery.qcom.rc +++ /dev/null @@ -1,3 +0,0 @@ -on init - write /sys/class/android_usb/android0/idVendor 0fce - write /sys/class/android_usb/android0/idProduct 6182 diff --git a/shinano.mk b/shinano.mk index 6dc1979..50bc782 100644 --- a/shinano.mk +++ b/shinano.mk @@ -45,10 +45,13 @@ PRODUCT_COPY_FILES += \ $(COMMON_PATH)/rootdir/init.platform-common.rc:root/init.platform-common.rc \ $(COMMON_PATH)/rootdir/init.sony.rc:root/init.sony.rc \ $(COMMON_PATH)/rootdir/init.qcom.power.rc:root/init.qcom.power.rc \ - $(COMMON_PATH)/rootdir/init.recovery.qcom.rc:root/init.recovery.qcom.rc \ $(COMMON_PATH)/rootdir/init.sony.usb.rc:root/init.sony.usb.rc \ $(COMMON_PATH)/rootdir/ueventd.qcom.rc:root/ueventd.qcom.rc +# Recovery Init +PRODUCT_COPY_FILES += \ + $(COMMON_PATH)/rootdir/init.qcom.power.rc:root/init.recovery.qcom.rc + # Camera (stock .575 blobs) PRODUCT_PACKAGES += \ tad_static \ -- cgit v1.2.3