diff options
Diffstat (limited to 'rootdir')
-rw-r--r-- | rootdir/Android.mk | 8 | ||||
-rwxr-xr-x | rootdir/bin/init.class_main.sh | 102 | ||||
-rwxr-xr-x | rootdir/bin/init.mdm.sh | 34 | ||||
-rwxr-xr-x | rootdir/bin/init.qcom.early_boot.sh | 293 | ||||
-rwxr-xr-x | rootdir/bin/init.qcom.post_boot.sh | 1723 | ||||
-rwxr-xr-x | rootdir/bin/init.qcom.sensors.sh (renamed from rootdir/bin/init.crda.sh) | 27 | ||||
-rwxr-xr-x | rootdir/bin/init.qcom.sh | 174 | ||||
-rwxr-xr-x | rootdir/bin/init.qcom.usb.sh | 382 | ||||
-rwxr-xr-x | rootdir/bin/init.qti.qseecomd.sh | 2 | ||||
-rwxr-xr-x | rootdir/etc/init.msm.usb.configfs.rc | 477 | ||||
-rwxr-xr-x | rootdir/etc/init.qcom.rc | 846 | ||||
-rwxr-xr-x | rootdir/etc/init.qcom.usb.rc | 129 | ||||
-rwxr-xr-x | rootdir/etc/init.target.rc | 403 | ||||
-rw-r--r-- | rootdir/etc/ueventd.qcom.rc | 67 |
14 files changed, 3349 insertions, 1318 deletions
diff --git a/rootdir/Android.mk b/rootdir/Android.mk index 41661ff..d95981c 100644 --- a/rootdir/Android.mk +++ b/rootdir/Android.mk @@ -20,6 +20,14 @@ LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES) include $(BUILD_PREBUILT) include $(CLEAR_VARS) +LOCAL_MODULE := init.qcom.sensors.sh +LOCAL_MODULE_TAGS := optional eng +LOCAL_MODULE_CLASS := ETC +LOCAL_SRC_FILES := bin/init.qcom.sensors.sh +LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES) +include $(BUILD_PREBUILT) + +include $(CLEAR_VARS) LOCAL_MODULE := init.qcom.rc LOCAL_MODULE_TAGS := optional eng LOCAL_MODULE_CLASS := ETC diff --git a/rootdir/bin/init.class_main.sh b/rootdir/bin/init.class_main.sh index 074fb9d..9368ac9 100755 --- a/rootdir/bin/init.class_main.sh +++ b/rootdir/bin/init.class_main.sh @@ -32,21 +32,84 @@ # baseband=`getprop ro.baseband` sgltecsfb=`getprop persist.vendor.radio.sglte_csfb` -datamode=`getprop persist.data.mode` +datamode=`getprop persist.vendor.data.mode` +rild_status=`getprop init.svc.ril-daemon` +vendor_rild_status=`getprop init.svc.vendor.ril-daemon` case "$baseband" in - "apq" | "sda" ) - setprop ro.radio.noril yes - stop ril-daemon + "apq" | "sda" | "qcs" ) + setprop ro.vendor.radio.noril yes + if [ -n "$rild_status" ] || [ -n "$vendor_rild_status" ]; then + stop ril-daemon + stop vendor.ril-daemon + start vendor.ipacm + fi esac case "$baseband" in "msm" | "csfb" | "svlte2a" | "mdm" | "mdm2" | "sglte" | "sglte2" | "dsda2" | "unknown" | "dsda3") - start qmuxd + start vendor.qmuxd esac case "$baseband" in - "msm" | "csfb" | "svlte2a" | "mdm" | "mdm2" | "sglte" | "sglte2" | "dsda2" | "unknown" | "dsda3" | "sdm" | "sdx") + "msm" | "csfb" | "svlte2a" | "mdm" | "mdm2" | "sglte" | "sglte2" | "dsda2" | "unknown" | "dsda3" | "sdm" | "sdx" | "sm6") + + if [ -f /vendor/firmware_mnt/verinfo/ver_info.txt ]; then + modem=`cat /vendor/firmware_mnt/verinfo/ver_info.txt | + sed -n 's/^[^:]*modem[^:]*:[[:blank:]]*//p' | + sed 's/.*MPSS.\(.*\)/\1/g' | cut -d \. -f 1` + # Check if this is AT 3.0 or below. If so, start ril-daemon + if [ "$modem" = "AT" ]; then + version=`cat /vendor/firmware_mnt/verinfo/ver_info.txt | + sed -n 's/^[^:]*modem[^:]*:[[:blank:]]*//p' | + sed 's/.*AT.\(.*\)/\1/g' | cut -d \- -f 1` + if [ ! -z $version ]; then + if [ "$version" \< "3.1" ]; then + # For OTA targets, ril-daemon will be defined and for new vendor.ril-daemon + # To keep this script agnostic,start both of them as only valid one will start. + start ril-daemon + start vendor.ril-daemon + fi + fi + # For older than TA 3.0 start ril-daemon + elif [ "$modem" = "TA" ]; then + version=`cat /vendor/firmware_mnt/verinfo/ver_info.txt | + sed -n 's/^[^:]*modem[^:]*:[[:blank:]]*//p' | + sed 's/.*TA.\(.*\)/\1/g' | cut -d \- -f 1` + if [ ! -z $version ]; then + if [ "$version" \< "3.0" ]; then + # For OTA targets, ril-daemon will be defined and for new vendor.ril-daemon + # To keep this script agnostic,start both of them as only valid one will start. + start ril-daemon + start vendor.ril-daemon + fi + fi + # For older than JO 3.2 start ril-daemon + elif [ "$modem" = "JO" ]; then + version=`cat /vendor/firmware_mnt/verinfo/ver_info.txt | + sed -n 's/^[^:]*modem[^:]*:[[:blank:]]*//p' | + sed 's/.*JO.\(.*\)/\1/g' | cut -d \- -f 1` + if [ ! -z $version ]; then + if [ "$version" \< "3.2" ]; then + # For OTA targets, ril-daemon will be defined and for new vendor.ril-daemon + # To keep this script agnostic,start both of them as only valid one will start. + start ril-daemon + start vendor.ril-daemon + fi + fi + else + start ril-daemon + start vendor.ril-daemon + fi + fi + + # Get ril-daemon status again to ensure that we have latest info + rild_status=`getprop init.svc.ril-daemon` + vendor_rild_status=`getprop init.svc.vendor.ril-daemon` + + if [[ -z "$rild_status" || "$rild_status" = "stopped" ]] && [[ -z "$vendor_rild_status" || "$vendor_rild_status" = "stopped" ]]; then + start vendor.qcrild + fi start vendor.ipacm-diag start vendor.ipacm case "$baseband" in @@ -60,26 +123,35 @@ case "$baseband" in setprop persist.vendor.radio.voice.modem.index 0 fi ;; - "dsda2") - setprop persist.radio.multisim.config dsda esac multisim=`getprop persist.radio.multisim.config` if [ "$multisim" = "dsds" ] || [ "$multisim" = "dsda" ]; then - start vendor.ril-daemon2 + if [[ -z "$rild_status" || "$rild_status" = "stopped" ]] && [[ -z "$vendor_rild_status" || "$vendor_rild_status" = "stopped" ]]; then + start vendor.qcrild2 + else + start vendor.ril-daemon2 + fi elif [ "$multisim" = "tsts" ]; then - start vendor.ril-daemon2 - start vendor.ril-daemon3 + if [[ -z "$rild_status" || "$rild_status" = "stopped" ]] && [[ -z "$vendor_rild_status" || "$vendor_rild_status" = "stopped" ]]; then + start vendor.qcrild2 + start vendor.qcrild3 + else + start vendor.ril-daemon2 + start vendor.ril-daemon3 + fi fi case "$datamode" in "tethered") - start vendor.qti + start vendor.dataqti + start vendor.dataadpl start vendor.port-bridge ;; "concurrent") - start vendor.qti + start vendor.dataqti + start vendor.dataadpl start vendor.netmgrd start vendor.port-bridge ;; @@ -91,9 +163,9 @@ esac # # Allow persistent faking of bms -# User needs to set fake bms charge in persist.bms.fake_batt_capacity +# User needs to set fake bms charge in persist.vendor.bms.fake_batt_capacity # -fake_batt_capacity=`getprop persist.bms.fake_batt_capacity` +fake_batt_capacity=`getprop persist.vendor.bms.fake_batt_capacity` case "$fake_batt_capacity" in "") ;; #Do nothing here * ) diff --git a/rootdir/bin/init.mdm.sh b/rootdir/bin/init.mdm.sh deleted file mode 100755 index 840c8cd..0000000 --- a/rootdir/bin/init.mdm.sh +++ /dev/null @@ -1,34 +0,0 @@ -#! /vendor/bin/sh - -# Copyright (c) 2013, The Linux Foundation. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# * Neither the name of Linux Foundation nor -# the names of its contributors may be used to endorse or promote -# products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -# IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -# NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF -# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - -baseband=`getprop ro.baseband` -if [ "$baseband" = "mdm" ] || [ "$baseband" = "mdm2" ]; then - start mdm_helper -fi - diff --git a/rootdir/bin/init.qcom.early_boot.sh b/rootdir/bin/init.qcom.early_boot.sh index 839945a..bba8a5f 100755 --- a/rootdir/bin/init.qcom.early_boot.sh +++ b/rootdir/bin/init.qcom.early_boot.sh @@ -1,6 +1,6 @@ #! /vendor/bin/sh -# Copyright (c) 2012-2013,2016 The Linux Foundation. All rights reserved. +# Copyright (c) 2012-2013,2016,2018 The Linux Foundation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -46,7 +46,14 @@ else soc_hwver=`cat /sys/devices/system/soc/soc0/platform_version` 2> /dev/null fi -if [ -f /sys/class/graphics/fb0/virtual_size ]; then +if [ -f /sys/class/drm/card0-DSI-1/modes ]; then + echo "detect" > /sys/class/drm/card0-DSI-1/status + mode_file=/sys/class/drm/card0-DSI-1/modes + while read line; do + fb_width=${line%x*}; + break; + done < $mode_file +elif [ -f /sys/class/graphics/fb0/virtual_size ]; then res=`cat /sys/class/graphics/fb0/virtual_size` 2> /dev/null fb_width=${res%,*} fi @@ -64,21 +71,24 @@ fi function set_density_by_fb() { #put default density based on width if [ -z $fb_width ]; then - setprop ro.sf.lcd_density 320 + setprop vendor.display.lcd_density 320 else - if [ $fb_width -ge 1440 ]; then - setprop ro.sf.lcd_density 560 + if [ $fb_width -ge 1600 ]; then + setprop vendor.display.lcd_density 640 + elif [ $fb_width -ge 1440 ]; then + setprop vendor.display.lcd_density 560 elif [ $fb_width -ge 1080 ]; then - setprop ro.sf.lcd_density 480 + setprop vendor.display.lcd_density 480 elif [ $fb_width -ge 720 ]; then - setprop ro.sf.lcd_density 320 #for 720X1280 resolution + setprop vendor.display.lcd_density 320 #for 720X1280 resolution elif [ $fb_width -ge 480 ]; then - setprop ro.sf.lcd_density 240 #for 480X854 QRD resolution + setprop vendor.display.lcd_density 240 #for 480X854 QRD resolution else - setprop ro.sf.lcd_density 160 + setprop vendor.display.lcd_density 160 fi fi } + target=`getprop ro.board.platform` case "$target" in "msm7630_surf" | "msm7630_1x" | "msm7630_fusion") @@ -89,7 +99,7 @@ case "$target" in ln -s /system/usr/keychars/surf_keypad_qwerty.kcm.bin /system/usr/keychars/surf_keypad.kcm.bin ;; "Fluid") - setprop ro.sf.lcd_density 240 + setprop vendor.display.lcd_density 240 setprop qcom.bt.dev_power_class 2 ;; *) @@ -101,7 +111,7 @@ case "$target" in "msm8660") case "$soc_hwplatform" in "Fluid") - setprop ro.sf.lcd_density 240 + setprop vendor.display.lcd_density 240 ;; "Dragon") setprop ro.sound.alsa "WM8903" @@ -117,18 +127,18 @@ case "$target" in setprop ro.sf.hwrotation 90 fi - setprop ro.sf.lcd_density 160 + setprop vendor.display.lcd_density 160 ;; "MTP") - setprop ro.sf.lcd_density 240 + setprop vendor.display.lcd_density 240 ;; *) case "$soc_hwid" in "109") - setprop ro.sf.lcd_density 160 + setprop vendor.display.lcd_density 160 ;; *) - setprop ro.sf.lcd_density 240 + setprop vendor.display.lcd_density 240 ;; esac ;; @@ -151,16 +161,16 @@ case "$target" in "msm8974") case "$soc_hwplatform" in "Liquid") - setprop ro.sf.lcd_density 160 + setprop vendor.display.lcd_density 160 # Liquid do not have hardware navigation keys, so enable # Android sw navigation bar setprop ro.hw.nav_keys 0 ;; "Dragon") - setprop ro.sf.lcd_density 240 + setprop vendor.display.lcd_density 240 ;; *) - setprop ro.sf.lcd_density 320 + setprop vendor.display.lcd_density 320 ;; esac ;; @@ -168,7 +178,7 @@ case "$target" in "msm8226") case "$soc_hwplatform" in *) - setprop ro.sf.lcd_density 320 + setprop vendor.display.lcd_density 320 ;; esac ;; @@ -176,65 +186,65 @@ case "$target" in "msm8610" | "apq8084" | "mpq8092") case "$soc_hwplatform" in *) - setprop ro.sf.lcd_density 240 + setprop vendor.display.lcd_density 240 ;; esac ;; "apq8084") case "$soc_hwplatform" in "Liquid") - setprop ro.sf.lcd_density 320 + setprop vendor.display.lcd_density 320 # Liquid do not have hardware navigation keys, so enable # Android sw navigation bar setprop ro.hw.nav_keys 0 ;; "SBC") - setprop ro.sf.lcd_density 200 + setprop vendor.display.lcd_density 200 # SBC do not have hardware navigation keys, so enable # Android sw navigation bar setprop qemu.hw.mainkeys 0 ;; *) - setprop ro.sf.lcd_density 480 + setprop vendor.display.lcd_density 480 ;; esac ;; "msm8996") case "$soc_hwplatform" in "Dragon") - setprop ro.sf.lcd_density 240 + setprop vendor.display.lcd_density 240 setprop qemu.hw.mainkeys 0 ;; "ADP") - setprop ro.sf.lcd_density 160 + setprop vendor.display.lcd_density 160 setprop qemu.hw.mainkeys 0 ;; "SBC") - setprop ro.sf.lcd_density 240 + setprop vendor.display.lcd_density 240 setprop qemu.hw.mainkeys 0 ;; *) - setprop ro.sf.lcd_density 560 + setprop vendor.display.lcd_density 560 ;; esac ;; "msm8937" | "msm8940") - # Set ro.opengles.version based on chip id. + # Set vendor.opengles.version based on chip id. # MSM8937 and MSM8940 variants supports OpenGLES 3.1 # 196608 is decimal for 0x30000 to report version 3.0 # 196609 is decimal for 0x30001 to report version 3.1 # 196610 is decimal for 0x30002 to report version 3.2 case "$soc_hwid" in - 294|295|296|297|298|313) - setprop ro.opengles.version 196610 + 294|295|296|297|298|313|353|354|363|364) + setprop vendor.opengles.version 196610 ;; 303|307|308|309|320) # Vulkan is not supported for 8917 variants - setprop ro.opengles.version 196608 + setprop vendor.opengles.version 196608 setprop persist.graphics.vulkan.disable true ;; *) - setprop ro.opengles.version 196608 + setprop vendor.opengles.version 196608 ;; esac ;; @@ -248,161 +258,75 @@ case "$target" in "msm8998" | "apq8098_latv") case "$soc_hwplatform" in *) - setprop ro.sf.lcd_density 560 - if [ ! -e /dev/kgsl-3d0 ]; then - setprop persist.sys.force_sw_gles 1 - setprop sdm.idle_time 0 + setprop vendor.display.lcd_density 560 + ;; + esac + ;; + "sdm845") + case "$soc_hwplatform" in + *) + if [ $fb_width -le 1600 ]; then + setprop vendor.display.lcd_density 560 + setprop dalvik.vm.heapgrowthlimit 256m else - setprop persist.sys.force_sw_gles 0 + setprop vendor.display.lcd_density 640 + setprop dalvik.vm.heapgrowthlimit 512m fi ;; esac - case "$soc_hwid" in - "319") #apq8098_latv - echo "\n==Loading ALX module==\n" - insmod /system/lib/modules/alx.ko - ;; - esac ;; - "sdm845") + "msmnile") case "$soc_hwplatform" in *) - setprop ro.sf.lcd_density 560 - if [ ! -e /dev/kgsl-3d0 ]; then - setprop persist.sys.force_sw_gles 1 - setprop sdm.idle_time 0 + if [ $fb_width -le 1600 ]; then + setprop vendor.display.lcd_density 560 + setprop dalvik.vm.heapgrowthlimit 256m else - setprop persist.sys.force_sw_gles 0 + setprop vendor.display.lcd_density 640 + setprop dalvik.vm.heapgrowthlimit 512m + fi + ;; + esac + ;; + "sdm710" | "msmpeafowl") + case "$soc_hwplatform" in + *) + sku_ver=`cat /sys/devices/platform/soc/aa00000.qcom,vidc1/sku_version` 2> /dev/null + if [ $sku_ver -eq 1 ]; then + setprop vendor.media.sdm710.version 1 fi ;; esac ;; "msm8953") - cap_ver=`cat /sys/devices/soc/1d00000.qcom,vidc/capability_version` 2> /dev/null - if [ $cap_ver -eq 1 ]; then - setprop media.msm8953.version 1 - fi + cap_ver = 1 + if [ -e "/sys/devices/platform/soc/1d00000.qcom,vidc/capability_version" ]; then + cap_ver=`cat /sys/devices/platform/soc/1d00000.qcom,vidc/capability_version` 2> /dev/null + else + cap_ver=`cat /sys/devices/soc/1d00000.qcom,vidc/capability_version` 2> /dev/null + fi + + if [ $cap_ver -eq 1 ]; then + setprop vendor.media.msm8953.version 1 + fi + ;; + #Set property to differentiate SDM660 & SDM455 + #SOC ID for SDM455 is 385 + "sdm660") + case "$soc_hwid" in + 385) + setprop vendor.media.sdm660.version 1 + esac ;; - "msm8952") - case "$soc_hwid" in - 278) - setprop media.msm8956hw 1 - if [ -f /sys/devices/soc0/platform_version ]; then - hw_ver=`cat /sys/devices/soc.0/1d00000.qcom,vidc/version` 2> /dev/null - if [ $hw_ver -eq 1 ]; then - setprop media.msm8956.version 1 - fi - fi - ;; - 266|277) - setprop media.msm8956hw 1 - if [ -f /sys/devices/soc0/platform_version ]; then - hw_ver=`cat /sys/devices/soc.0/1d00000.qcom,vidc/version` 2> /dev/null - if [ $hw_ver -eq 1 ]; then - setprop media.msm8956.version 1 - fi - fi - ;; - 264) - setprop persist.graphics.vulkan.disable true - ;; - esac - ;; esac -# In mpss AT version is greater than 3.1, need -# to use the new vendor-ril which supports L+L feature -# otherwise use the existing old one. -if [ -f /firmware/verinfo/ver_info.txt ]; then - modem=`cat /firmware/verinfo/ver_info.txt | - sed -n 's/^[^:]*modem[^:]*:[[:blank:]]*//p' | - sed 's/.*AT.\(.*\)/\1/g' | cut -d \- -f 1` - zygote=`getprop ro.zygote` - case "$zygote" in - "zygote64_32") - if [ "$modem" \< "3.1" ]; then - setprop vendor.rild.libpath "/vendor/lib64/libril-qc-qmi-1.so" - else - setprop vendor.rild.libpath "/vendor/lib64/libril-qc-hal-qmi.so" - fi - ;; - "zygote32") - if [ "$modem" \< "3.1" ]; then - setprop vendor.rild.libpath "/vendor/lib/libril-qc-qmi-1.so" - else - setprop vendor.rild.libpath "/vendor/lib/libril-qc-hal-qmi.so" - fi - ;; - esac -fi - -if [ -f /firmware/verinfo/ver_info.txt ]; then - # In mpss AT version is greater than 3.1, need - # to use the new vendor-ril which supports L+L feature - # otherwise use the existing old one. - modem=`cat /firmware/verinfo/ver_info.txt | - sed -n 's/^[^:]*modem[^:]*:[[:blank:]]*//p' | - sed 's/.*MPSS.\(.*\)/\1/g' | cut -d \. -f 1` - if [ "$modem" = "AT" ]; then - version=`cat /firmware/verinfo/ver_info.txt | - sed -n 's/^[^:]*modem[^:]*:[[:blank:]]*//p' | - sed 's/.*AT.\(.*\)/\1/g' | cut -d \- -f 1` - if [ ! -z $version ]; then - zygote=`getprop ro.zygote` - case "$zygote" in - "zygote64_32") - if [ "$version" \< "3.1" ]; then - setprop vendor.rild.libpath "/vendor/lib64/libril-qc-qmi-1.so" - else - setprop vendor.rild.libpath "/vendor/lib64/libril-qc-hal-qmi.so" - fi - ;; - "zygote32") - if [ "$version" \< "3.1" ]; then - echo "legacy qmi load for TA less than 3.1" - setprop vendor.rild.libpath "/vendor/lib/libril-qc-qmi-1.so" - else - setprop vendor.rild.libpath "/vendor/lib/libril-qc-hal-qmi.so" - fi - ;; - esac - fi - # In mpss TA version is greater than 3.0, need - # to use the new vendor-ril which supports L+L feature - # otherwise use the existing old one. - elif [ "$modem" = "TA" ]; then - version=`cat /firmware/verinfo/ver_info.txt | - sed -n 's/^[^:]*modem[^:]*:[[:blank:]]*//p' | - sed 's/.*TA.\(.*\)/\1/g' | cut -d \- -f 1` - if [ ! -z $version ]; then - zygote=`getprop ro.zygote` - case "$zygote" in - "zygote64_32") - if [ "$version" \< "3.0" ]; then - setprop vendor.rild.libpath "/vendor/lib64/libril-qc-qmi-1.so" - else - setprop vendor.rild.libpath "/vendor/lib64/libril-qc-hal-qmi.so" - fi - ;; - "zygote32") - if [ "$version" \< "3.0" ]; then - setprop vendor.rild.libpath "/vendor/lib/libril-qc-qmi-1.so" - else - setprop vendor.rild.libpath "/vendor/lib/libril-qc-hal-qmi.so" - fi - ;; - esac - fi - fi; -fi - baseband=`getprop ro.baseband` #enable atfwd daemon all targets except sda, apq, qcs case "$baseband" in "apq" | "sda" | "qcs" ) - setprop persist.radio.atfwd.start false;; + setprop persist.vendor.radio.atfwd.start false;; *) - setprop persist.radio.atfwd.start true;; + setprop persist.vendor.radio.atfwd.start true;; esac #set default lcd density @@ -411,6 +335,18 @@ esac #property if any target is setting forcefully. set_density_by_fb + +# set Lilliput LCD density for ADP +product=`getprop ro.build.product` + +case "$product" in + "msmnile_au") + setprop vendor.display.lcd_density 160 + ;; + *) + ;; +esac + # Setup display nodes & permissions # HDMI can be fb1 or fb2 # Loop through the sysfs nodes and determine @@ -443,10 +379,8 @@ function setHDMIPermission() { set_perms $file/pa system.graphics 0664 set_perms $file/cec/wr_msg system.graphics 0600 set_perms $file/hdcp/tp system.graphics 0664 + set_perms $file/hdcp2p2/min_level_change system.graphics 0660 set_perms $file/hdmi_audio_cb audioserver.audio 0600 - set_perms $file/pll_enable system.graphics 0664 - set_perms $file/hdmi_ppm system.graphics 0664 - ln -s $dev_file $dev_gfx_hdmi } @@ -476,12 +410,12 @@ then file=/sys/class/graphics/fb0/mdp/caps if [ -f "$file" ] then - setprop debug.gralloc.gfx_ubwc_disable 1 + setprop vendor.gralloc.disable_ubwc 1 cat $file | while read line; do case "$line" in *"ubwc"*) - setprop debug.gralloc.enable_fb_ubwc 1 - setprop debug.gralloc.gfx_ubwc_disable 0 + setprop vendor.gralloc.enable_fb_ubwc 1 + setprop vendor.gralloc.disable_ubwc 0 esac done fi @@ -508,23 +442,20 @@ then set_perms $file/msm_fb_persist_mode system.graphics 0664 fi done +else + set_perms /sys/devices/virtual/hdcp/msm_hdcp/min_level_change system.graphics 0660 fi boot_reason=`cat /proc/sys/kernel/boot_reason` reboot_reason=`getprop ro.boot.alarmboot` -power_off_alarm_file=`cat /mnt/vendor/persist/alarm/powerOffAlarmSet` if [ "$boot_reason" = "3" ] || [ "$reboot_reason" = "true" ]; then - if [ "$power_off_alarm_file" = "1" ] - then - setprop ro.alarm_boot true - setprop debug.sf.nobootanimation 1 - fi + setprop ro.vendor.alarm_boot true else - setprop ro.alarm_boot false + setprop ro.vendor.alarm_boot false fi -# copy GPU frequencies to system property +# copy GPU frequencies to vendor property if [ -f /sys/class/kgsl/kgsl-3d0/gpu_available_frequencies ]; then gpu_freq=`cat /sys/class/kgsl/kgsl-3d0/gpu_available_frequencies` 2> /dev/null - setprop ro.gpu.available_frequencies "$gpu_freq" + setprop vendor.gpu.available_frequencies "$gpu_freq" fi diff --git a/rootdir/bin/init.qcom.post_boot.sh b/rootdir/bin/init.qcom.post_boot.sh index a7986ae..12600b0 100755 --- a/rootdir/bin/init.qcom.post_boot.sh +++ b/rootdir/bin/init.qcom.post_boot.sh @@ -1,6 +1,6 @@ #! /vendor/bin/sh -# Copyright (c) 2012-2013, 2016-2017, The Linux Foundation. All rights reserved. +# Copyright (c) 2012-2013, 2016-2018, The Linux Foundation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -27,6 +27,199 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # +function 8953_sched_dcvs_eas() +{ + #governor settings + echo 1 > /sys/devices/system/cpu/cpu0/online + echo "schedutil" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor + echo 0 > /sys/devices/system/cpu/cpufreq/schedutil/rate_limit_us + #set the hispeed_freq + echo 1401600 > /sys/devices/system/cpu/cpufreq/schedutil/hispeed_freq + #default value for hispeed_load is 90, for 8953 and sdm450 it should be 85 + echo 85 > /sys/devices/system/cpu/cpufreq/schedutil/hispeed_load +} + +function 8917_sched_dcvs_eas() +{ + #governor settings + echo 1 > /sys/devices/system/cpu/cpu0/online + echo "schedutil" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor + echo 0 > /sys/devices/system/cpu/cpufreq/schedutil/rate_limit_us + #set the hispeed_freq + echo 1094400 > /sys/devices/system/cpu/cpufreq/schedutil/hispeed_freq + #default value for hispeed_load is 90, for 8917 it should be 85 + echo 85 > /sys/devices/system/cpu/cpufreq/schedutil/hispeed_load +} + +function 8937_sched_dcvs_eas() +{ + # enable governor for perf cluster + echo 1 > /sys/devices/system/cpu/cpu0/online + echo "schedutil" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor + echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/rate_limit_us + #set the hispeed_freq + echo 1094400 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/hispeed_freq + #default value for hispeed_load is 90, for 8937 it should be 85 + echo 85 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/hispeed_load + ## enable governor for power cluster + echo 1 > /sys/devices/system/cpu/cpu4/online + echo "schedutil" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor + echo 0 > /sys/devices/system/cpu/cpu4/cpufreq/schedutil/rate_limit_us + #set the hispeed_freq + echo 768000 > /sys/devices/system/cpu/cpu4/cpufreq/schedutil/hispeed_freq + #default value for hispeed_load is 90, for 8937 it should be 85 + echo 85 > /sys/devices/system/cpu/cpu4/cpufreq/schedutil/hispeed_load + +} + +function 8953_sched_dcvs_hmp() +{ + #scheduler settings + echo 3 > /proc/sys/kernel/sched_window_stats_policy + echo 3 > /proc/sys/kernel/sched_ravg_hist_size + #task packing settings + echo 0 > /sys/devices/system/cpu/cpu0/sched_static_cpu_pwr_cost + echo 0 > /sys/devices/system/cpu/cpu1/sched_static_cpu_pwr_cost + echo 0 > /sys/devices/system/cpu/cpu2/sched_static_cpu_pwr_cost + echo 0 > /sys/devices/system/cpu/cpu3/sched_static_cpu_pwr_cost + echo 0 > /sys/devices/system/cpu/cpu4/sched_static_cpu_pwr_cost + echo 0 > /sys/devices/system/cpu/cpu5/sched_static_cpu_pwr_cost + echo 0 > /sys/devices/system/cpu/cpu6/sched_static_cpu_pwr_cost + echo 0 > /sys/devices/system/cpu/cpu7/sched_static_cpu_pwr_cost + # spill load is set to 100% by default in the kernel + echo 3 > /proc/sys/kernel/sched_spill_nr_run + # Apply inter-cluster load balancer restrictions + echo 1 > /proc/sys/kernel/sched_restrict_cluster_spill + # set sync wakee policy tunable + echo 1 > /proc/sys/kernel/sched_prefer_sync_wakee_to_waker + + #governor settings + echo 1 > /sys/devices/system/cpu/cpu0/online + echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor + echo "19000 1401600:39000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay + echo 85 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load + echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate + echo 1401600 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq + echo 0 > /sys/devices/system/cpu/cpufreq/interactive/io_is_busy + echo "85 1401600:80" > /sys/devices/system/cpu/cpufreq/interactive/target_loads + echo 39000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time + echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor + echo 19 > /proc/sys/kernel/sched_upmigrate_min_nice + # Enable sched guided freq control + echo 1 > /sys/devices/system/cpu/cpufreq/interactive/use_sched_load + echo 1 > /sys/devices/system/cpu/cpufreq/interactive/use_migration_notif + echo 200000 > /proc/sys/kernel/sched_freq_inc_notify + echo 200000 > /proc/sys/kernel/sched_freq_dec_notify + +} + +function 8917_sched_dcvs_hmp() +{ + # HMP scheduler settings + echo 3 > /proc/sys/kernel/sched_window_stats_policy + echo 3 > /proc/sys/kernel/sched_ravg_hist_size + echo 1 > /proc/sys/kernel/sched_restrict_tasks_spread + # HMP Task packing settings + echo 20 > /proc/sys/kernel/sched_small_task + echo 30 > /sys/devices/system/cpu/cpu0/sched_mostly_idle_load + echo 30 > /sys/devices/system/cpu/cpu1/sched_mostly_idle_load + echo 30 > /sys/devices/system/cpu/cpu2/sched_mostly_idle_load + echo 30 > /sys/devices/system/cpu/cpu3/sched_mostly_idle_load + + echo 3 > /sys/devices/system/cpu/cpu0/sched_mostly_idle_nr_run + echo 3 > /sys/devices/system/cpu/cpu1/sched_mostly_idle_nr_run + echo 3 > /sys/devices/system/cpu/cpu2/sched_mostly_idle_nr_run + echo 3 > /sys/devices/system/cpu/cpu3/sched_mostly_idle_nr_run + + echo 0 > /sys/devices/system/cpu/cpu0/sched_prefer_idle + echo 0 > /sys/devices/system/cpu/cpu1/sched_prefer_idle + echo 0 > /sys/devices/system/cpu/cpu2/sched_prefer_idle + echo 0 > /sys/devices/system/cpu/cpu3/sched_prefer_idle + + echo 1 > /sys/devices/system/cpu/cpu0/online + echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor + echo "19000 1094400:39000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay + echo 85 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load + echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate + echo 1094400 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq + echo 0 > /sys/devices/system/cpu/cpufreq/interactive/io_is_busy + echo "1 960000:85 1094400:90" > /sys/devices/system/cpu/cpufreq/interactive/target_loads + echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time + echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor + + # Enable sched guided freq control + echo 1 > /sys/devices/system/cpu/cpufreq/interactive/use_sched_load + echo 1 > /sys/devices/system/cpu/cpufreq/interactive/use_migration_notif + echo 50000 > /proc/sys/kernel/sched_freq_inc_notify + echo 50000 > /proc/sys/kernel/sched_freq_dec_notify +} + +function 8937_sched_dcvs_hmp() +{ + # HMP scheduler settings + echo 3 > /proc/sys/kernel/sched_window_stats_policy + echo 3 > /proc/sys/kernel/sched_ravg_hist_size + # HMP Task packing settings + echo 20 > /proc/sys/kernel/sched_small_task + echo 30 > /sys/devices/system/cpu/cpu0/sched_mostly_idle_load + echo 30 > /sys/devices/system/cpu/cpu1/sched_mostly_idle_load + echo 30 > /sys/devices/system/cpu/cpu2/sched_mostly_idle_load + echo 30 > /sys/devices/system/cpu/cpu3/sched_mostly_idle_load + echo 30 > /sys/devices/system/cpu/cpu4/sched_mostly_idle_load + echo 30 > /sys/devices/system/cpu/cpu5/sched_mostly_idle_load + echo 30 > /sys/devices/system/cpu/cpu6/sched_mostly_idle_load + echo 30 > /sys/devices/system/cpu/cpu7/sched_mostly_idle_load + + echo 3 > /sys/devices/system/cpu/cpu0/sched_mostly_idle_nr_run + echo 3 > /sys/devices/system/cpu/cpu1/sched_mostly_idle_nr_run + echo 3 > /sys/devices/system/cpu/cpu2/sched_mostly_idle_nr_run + echo 3 > /sys/devices/system/cpu/cpu3/sched_mostly_idle_nr_run + echo 3 > /sys/devices/system/cpu/cpu4/sched_mostly_idle_nr_run + echo 3 > /sys/devices/system/cpu/cpu5/sched_mostly_idle_nr_run + echo 3 > /sys/devices/system/cpu/cpu6/sched_mostly_idle_nr_run + echo 3 > /sys/devices/system/cpu/cpu7/sched_mostly_idle_nr_run + + echo 0 > /sys/devices/system/cpu/cpu0/sched_prefer_idle + echo 0 > /sys/devices/system/cpu/cpu1/sched_prefer_idle + echo 0 > /sys/devices/system/cpu/cpu2/sched_prefer_idle + echo 0 > /sys/devices/system/cpu/cpu3/sched_prefer_idle + echo 0 > /sys/devices/system/cpu/cpu4/sched_prefer_idle + echo 0 > /sys/devices/system/cpu/cpu5/sched_prefer_idle + echo 0 > /sys/devices/system/cpu/cpu6/sched_prefer_idle + echo 0 > /sys/devices/system/cpu/cpu7/sched_prefer_idle + # enable governor for perf cluster + echo 1 > /sys/devices/system/cpu/cpu0/online + echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor + echo "19000 1094400:39000" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay + echo 85 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load + echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate + echo 1094400 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq + echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy + echo "1 960000:85 1094400:90 1344000:80" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads + echo 40000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time + echo 40000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/sampling_down_factor + + # enable governor for power cluster + echo 1 > /sys/devices/system/cpu/cpu4/online + echo "interactive" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor + echo 39000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay + echo 90 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/go_hispeed_load + echo 20000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_rate + echo 768000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq + echo 0 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy + echo "1 768000:90" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads + echo 40000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time + echo 40000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/sampling_down_factor + + # Enable sched guided freq control + echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_sched_load + echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_migration_notif + echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_sched_load + echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_migration_notif + echo 50000 > /proc/sys/kernel/sched_freq_inc_notify + echo 50000 > /proc/sys/kernel/sched_freq_dec_notify + +} target=`getprop ro.board.platform` function configure_zram_parameters() { @@ -36,134 +229,207 @@ function configure_zram_parameters() { low_ram=`getprop ro.config.low_ram` # Zram disk - 75% for Go devices. - # For 512MB Go device, size = 384MB - # For 1GB Go device, size = 768MB - # Others - 512MB size - # And enable lz4 zram compression for Go devices - zram_enable=`getprop ro.vendor.qti.config.zram` - if [ "$zram_enable" == "true" ]; then - if [ $MemTotal -le 524288 ] && [ "$low_ram" == "true" ]; then - echo lz4 > /sys/block/zram0/comp_algorithm + # For 512MB Go device, size = 384MB, set same for Non-Go. + # For 1GB Go device, size = 768MB, set same for Non-Go. + # For 2GB and 3GB Non-Go device, size = 1GB + # For 4GB and 6GB Non-Go device, size = 2GB + # And enable lz4 zram compression for Go targets. + + if [ "$low_ram" == "true" ]; then + echo lz4 > /sys/block/zram0/comp_algorithm + fi + + if [ -f /sys/block/zram0/disksize ]; then + if [ $MemTotal -le 524288 ]; then echo 402653184 > /sys/block/zram0/disksize - elif [ $MemTotal -le 1048576 ] && [ "$low_ram" == "true" ]; then - echo lz4 > /sys/block/zram0/comp_algorithm + elif [ $MemTotal -le 1048576 ]; then echo 805306368 > /sys/block/zram0/disksize - else - echo 536870912 > /sys/block/zram0/disksize + elif [ $MemTotal -le 3145728 ]; then + echo 1073741824 > /sys/block/zram0/disksize + elif [ $MemTotal -le 6291456 ]; then + echo 2147483648 > /sys/block/zram0/disksize fi mkswap /dev/block/zram0 swapon /dev/block/zram0 -p 32758 fi } +function configure_read_ahead_kb_values() { + MemTotalStr=`cat /proc/meminfo | grep MemTotal` + MemTotal=${MemTotalStr:16:8} + + # Set 128 for <= 3GB & + # set 512 for >= 4GB targets. + if [ $MemTotal -le 3145728 ]; then + echo 128 > /sys/block/mmcblk0/bdi/read_ahead_kb + echo 128 > /sys/block/mmcblk0/queue/read_ahead_kb + echo 128 > /sys/block/mmcblk0rpmb/bdi/read_ahead_kb + echo 128 > /sys/block/mmcblk0rpmb/queue/read_ahead_kb + echo 128 > /sys/block/dm-0/queue/read_ahead_kb + echo 128 > /sys/block/dm-1/queue/read_ahead_kb + else + echo 512 > /sys/block/mmcblk0/bdi/read_ahead_kb + echo 512 > /sys/block/mmcblk0/queue/read_ahead_kb + echo 512 > /sys/block/mmcblk0rpmb/bdi/read_ahead_kb + echo 512 > /sys/block/mmcblk0rpmb/queue/read_ahead_kb + echo 512 > /sys/block/dm-0/queue/read_ahead_kb + echo 512 > /sys/block/dm-1/queue/read_ahead_kb + fi +} + +function disable_core_ctl() { + if [ -f /sys/devices/system/cpu/cpu0/core_ctl/enable ]; then + echo 0 > /sys/devices/system/cpu/cpu0/core_ctl/enable + else + echo 1 > /sys/devices/system/cpu/cpu0/core_ctl/disable + fi +} + +function enable_swap() { + MemTotalStr=`cat /proc/meminfo | grep MemTotal` + MemTotal=${MemTotalStr:16:8} + + SWAP_ENABLE_THRESHOLD=1048576 + swap_enable=`getprop ro.vendor.qti.config.swap` + + # Enable swap initially only for 1 GB targets + if [ "$MemTotal" -le "$SWAP_ENABLE_THRESHOLD" ] && [ "$swap_enable" == "true" ]; then + # Static swiftness + echo 1 > /proc/sys/vm/swap_ratio_enable + echo 70 > /proc/sys/vm/swap_ratio + + # Swap disk - 200MB size + if [ ! -f /data/vendor/swap/swapfile ]; then + dd if=/dev/zero of=/data/vendor/swap/swapfile bs=1m count=200 + fi + mkswap /data/vendor/swap/swapfile + swapon /data/vendor/swap/swapfile -p 32758 + fi +} + function configure_memory_parameters() { - # Set Memory paremeters. + # Set Memory parameters. # # Set per_process_reclaim tuning parameters - # 2GB 64-bit will have aggressive settings when compared to 1GB 32-bit - # 1GB and less will use vmpressure range 50-70, 2GB will use 10-70 - # 1GB and less will use 512 pages swap size, 2GB will use 1024 + # All targets will use vmpressure range 50-70, + # All targets will use 512 pages swap size. # # Set Low memory killer minfree parameters - # 32 bit all memory configurations will use 15K series - # 64 bit up to 2GB with use 14K, and above 2GB will use 18K + # 32 bit Non-Go, all memory configurations will use 15K series + # 32 bit Go, all memory configurations will use uLMK + Memcg + # 64 bit will use Google default LMK series. # # Set ALMK parameters (usually above the highest minfree values) - # 32 bit will have 53K & 64 bit will have 81K + # vmpressure_file_min threshold is always set slightly higher + # than LMK minfree's last bin value for all targets. It is calculated as + # vmpressure_file_min = (last bin - second last bin ) + last bin + # + # Set allocstall_threshold to 0 for all targets. # ProductName=`getprop ro.product.name` low_ram=`getprop ro.config.low_ram` -if [ "$ProductName" == "msm8996" ]; then - # Enable Adaptive LMK - echo 1 > /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk - echo 81250 > /sys/module/lowmemorykiller/parameters/vmpressure_file_min - +if [ "$ProductName" == "msmnile" ]; then + # Enable ZRAM configure_zram_parameters + configure_read_ahead_kb_values else arch_type=`uname -m` MemTotalStr=`cat /proc/meminfo | grep MemTotal` MemTotal=${MemTotalStr:16:8} - # Read adj series and set adj threshold for PPR and ALMK. - # This is required since adj values change from framework to framework. - adj_series=`cat /sys/module/lowmemorykiller/parameters/adj` - adj_1="${adj_series#*,}" - set_almk_ppr_adj="${adj_1%%,*}" - - # PPR and ALMK should not act on HOME adj and below. - # Normalized ADJ for HOME is 6. Hence multiply by 6 - # ADJ score represented as INT in LMK params, actual score can be in decimal - # Hence add 6 considering a worst case of 0.9 conversion to INT (0.9*6). - # For uLMK + Memcg, this will be set as 6 since adj is zero. - set_almk_ppr_adj=$(((set_almk_ppr_adj * 6) + 6)) - echo $set_almk_ppr_adj > /sys/module/lowmemorykiller/parameters/adj_max_shift - echo $set_almk_ppr_adj > /sys/module/process_reclaim/parameters/min_score_adj - - #Set other memory parameters - echo 0 > /sys/module/process_reclaim/parameters/enable_process_reclaim - echo 70 > /sys/module/process_reclaim/parameters/pressure_max - echo 30 > /sys/module/process_reclaim/parameters/swap_opt_eff - echo 1 > /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk - if [ "$arch_type" == "aarch64" ] && [ $MemTotal -gt 4194304 ]; then - echo 10 > /sys/module/process_reclaim/parameters/pressure_min - echo 1024 > /sys/module/process_reclaim/parameters/per_swap_size - echo "18432,23040,27648,32256,55296,80640" > /sys/module/lowmemorykiller/parameters/minfree - echo 81250 > /sys/module/lowmemorykiller/parameters/vmpressure_file_min - elif [ "$arch_type" == "aarch64" ] && [ $MemTotal -gt 2097152 ]; then - echo 10 > /sys/module/process_reclaim/parameters/pressure_min - echo 1024 > /sys/module/process_reclaim/parameters/per_swap_size - echo "18432,23040,27648,32256,80640,140640" > /sys/module/lowmemorykiller/parameters/minfree - echo 81250 > /sys/module/lowmemorykiller/parameters/vmpressure_file_min - elif [ "$arch_type" == "aarch64" ] && [ $MemTotal -gt 1048576 ]; then - echo 10 > /sys/module/process_reclaim/parameters/pressure_min - echo 1024 > /sys/module/process_reclaim/parameters/per_swap_size - echo "14746,18432,22118,25805,40000,55000" > /sys/module/lowmemorykiller/parameters/minfree - echo 81250 > /sys/module/lowmemorykiller/parameters/vmpressure_file_min - elif [ "$arch_type" == "aarch64" ]; then - echo 50 > /sys/module/process_reclaim/parameters/pressure_min - echo 512 > /sys/module/process_reclaim/parameters/per_swap_size - echo "14746,18432,22118,25805,40000,55000" > /sys/module/lowmemorykiller/parameters/minfree - echo 81250 > /sys/module/lowmemorykiller/parameters/vmpressure_file_min + # Set parameters for 32-bit Go targets. + if [ $MemTotal -le 1048576 ] && [ "$low_ram" == "true" ]; then + # Disable KLMK, ALMK, PPR & Core Control for Go devices + echo 0 > /sys/module/lowmemorykiller/parameters/enable_lmk + echo 0 > /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk + echo 0 > /sys/module/process_reclaim/parameters/enable_process_reclaim + disable_core_ctl else - if [ $MemTotal -le 1048576 ] && [ "$low_ram" == "true" ]; then - # Disable KLMK, ALMK & PPR for Go devices - echo 0 > /sys/module/lowmemorykiller/parameters/enable_lmk - echo 0 > /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk - echo 0 > /sys/module/process_reclaim/parameters/enable_process_reclaim + + # Read adj series and set adj threshold for PPR and ALMK. + # This is required since adj values change from framework to framework. + adj_series=`cat /sys/module/lowmemorykiller/parameters/adj` + adj_1="${adj_series#*,}" + set_almk_ppr_adj="${adj_1%%,*}" + + # PPR and ALMK should not act on HOME adj and below. + # Normalized ADJ for HOME is 6. Hence multiply by 6 + # ADJ score represented as INT in LMK params, actual score can be in decimal + # Hence add 6 considering a worst case of 0.9 conversion to INT (0.9*6). + # For uLMK + Memcg, this will be set as 6 since adj is zero. + set_almk_ppr_adj=$(((set_almk_ppr_adj * 6) + 6)) + echo $set_almk_ppr_adj > /sys/module/lowmemorykiller/parameters/adj_max_shift + + # Calculate vmpressure_file_min as below & set for 64 bit: + # vmpressure_file_min = last_lmk_bin + (last_lmk_bin - last_but_one_lmk_bin) + if [ "$arch_type" == "aarch64" ]; then + minfree_series=`cat /sys/module/lowmemorykiller/parameters/minfree` + minfree_1="${minfree_series#*,}" ; rem_minfree_1="${minfree_1%%,*}" + minfree_2="${minfree_1#*,}" ; rem_minfree_2="${minfree_2%%,*}" + minfree_3="${minfree_2#*,}" ; rem_minfree_3="${minfree_3%%,*}" + minfree_4="${minfree_3#*,}" ; rem_minfree_4="${minfree_4%%,*}" + minfree_5="${minfree_4#*,}" + + vmpres_file_min=$((minfree_5 + (minfree_5 - rem_minfree_4))) + echo $vmpres_file_min > /sys/module/lowmemorykiller/parameters/vmpressure_file_min else - echo 50 > /sys/module/process_reclaim/parameters/pressure_min - echo 512 > /sys/module/process_reclaim/parameters/per_swap_size - echo "15360,19200,23040,26880,34415,43737" > /sys/module/lowmemorykiller/parameters/minfree - echo 53059 > /sys/module/lowmemorykiller/parameters/vmpressure_file_min + # Set LMK series, vmpressure_file_min for 32 bit non-go targets. + # Disable Core Control, enable KLMK for non-go 8909. + if [ "$ProductName" == "msm8909" ]; then + disable_core_ctl + echo 1 > /sys/module/lowmemorykiller/parameters/enable_lmk + fi + echo "15360,19200,23040,26880,34415,43737" > /sys/module/lowmemorykiller/parameters/minfree + echo 53059 > /sys/module/lowmemorykiller/parameters/vmpressure_file_min fi - fi - configure_zram_parameters + # Enable adaptive LMK for all targets & + # use Google default LMK series for all 64-bit targets >=2GB. + echo 1 > /sys/module/lowmemorykiller/parameters/enable_adaptive_lmk - SWAP_ENABLE_THRESHOLD=1048576 - swap_enable=`getprop ro.vendor.qti.config.swap` + # Enable oom_reaper + if [ -f /sys/module/lowmemorykiller/parameters/oom_reaper ]; then + echo 1 > /sys/module/lowmemorykiller/parameters/oom_reaper + fi - if [ -f /sys/devices/soc0/soc_id ]; then - soc_id=`cat /sys/devices/soc0/soc_id` - else - soc_id=`cat /sys/devices/system/soc/soc0/id` + # Set PPR parameters + if [ -f /sys/devices/soc0/soc_id ]; then + soc_id=`cat /sys/devices/soc0/soc_id` + else + soc_id=`cat /sys/devices/system/soc/soc0/id` + fi + + case "$soc_id" in + # Do not set PPR parameters for premium targets + # sdm845 - 321, 341 + # msm8998 - 292, 319 + # msm8996 - 246, 291, 305, 312 + "321" | "341" | "292" | "319" | "246" | "291" | "305" | "312") + ;; + *) + #Set PPR parameters for all other targets. + echo $set_almk_ppr_adj > /sys/module/process_reclaim/parameters/min_score_adj + echo 0 > /sys/module/process_reclaim/parameters/enable_process_reclaim + echo 50 > /sys/module/process_reclaim/parameters/pressure_min + echo 70 > /sys/module/process_reclaim/parameters/pressure_max + echo 30 > /sys/module/process_reclaim/parameters/swap_opt_eff + echo 512 > /sys/module/process_reclaim/parameters/per_swap_size + ;; + esac fi - # Enable swap initially only for 1 GB targets - if [ "$MemTotal" -le "$SWAP_ENABLE_THRESHOLD" ] && [ "$swap_enable" == "true" ]; then - # Static swiftness - echo 1 > /proc/sys/vm/swap_ratio_enable - echo 70 > /proc/sys/vm/swap_ratio + # Set allocstall_threshold to 0 for all targets. + # Set swappiness to 100 for all targets + echo 0 > /sys/module/vmpressure/parameters/allocstall_threshold + echo 100 > /proc/sys/vm/swappiness - # Swap disk - 200MB size - if [ ! -f /data/system/swap/swapfile ]; then - dd if=/dev/zero of=/data/system/swap/swapfile bs=1m count=200 - fi - mkswap /data/system/swap/swapfile - swapon /data/system/swap/swapfile -p 32758 - fi + configure_zram_parameters + + configure_read_ahead_kb_values + + enable_swap fi } @@ -188,7 +454,7 @@ function start_hbtp() # Start the Host based Touch processing but not in the power off mode. bootmode=`getprop ro.bootmode` if [ "charger" != $bootmode ]; then - start hbtp + start vendor.hbtp fi } @@ -461,7 +727,7 @@ case "$target" in echo 100000 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor echo 1497600 > /sys/module/cpu_boost/parameters/input_boost_freq echo 40 > /sys/module/cpu_boost/parameters/input_boost_ms - setprop ro.qualcomm.perf.cores_online 2 + setprop ro.vendor.perf.cores_online 2 ;; *) echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor @@ -1336,7 +1602,7 @@ case "$target" in case "$soc_id" in "277" | "278") # Start energy-awareness for 8976 - start vendor.energy-awareness + start energy-awareness ;; esac @@ -1352,6 +1618,7 @@ case "$target" in esac #Enable Memory Features enable_memory_features + restorecon -R /sys/devices/system/cpu ;; esac @@ -1370,8 +1637,14 @@ case "$target" in hw_platform=`cat /sys/devices/system/soc/soc0/hw_platform` fi + if [ -f /sys/devices/soc0/platform_subtype_id ]; then + platform_subtype_id=`cat /sys/devices/soc0/platform_subtype_id` + fi + + echo 0 > /proc/sys/kernel/sched_boost + case "$soc_id" in - "293" | "304" | "338" | "351" ) + "293" | "304" | "338" | "351") # Start Host based Touch processing case "$hw_platform" in @@ -1385,28 +1658,18 @@ case "$target" in ;; esac - #scheduler settings - echo 3 > /proc/sys/kernel/sched_window_stats_policy - echo 3 > /proc/sys/kernel/sched_ravg_hist_size - #task packing settings - echo 0 > /sys/devices/system/cpu/cpu0/sched_static_cpu_pwr_cost - echo 0 > /sys/devices/system/cpu/cpu1/sched_static_cpu_pwr_cost - echo 0 > /sys/devices/system/cpu/cpu2/sched_static_cpu_pwr_cost - echo 0 > /sys/devices/system/cpu/cpu3/sched_static_cpu_pwr_cost - echo 0 > /sys/devices/system/cpu/cpu4/sched_static_cpu_pwr_cost - echo 0 > /sys/devices/system/cpu/cpu5/sched_static_cpu_pwr_cost - echo 0 > /sys/devices/system/cpu/cpu6/sched_static_cpu_pwr_cost - echo 0 > /sys/devices/system/cpu/cpu7/sched_static_cpu_pwr_cost + if [ $soc_id -eq "338" ]; then + case "$hw_platform" in + "QRD" ) + if [ $platform_subtype_id -eq "1" ]; then + start_hbtp + fi + ;; + esac + fi #init task load, restrict wakeups to preferred cluster echo 15 > /proc/sys/kernel/sched_init_task_load - # spill load is set to 100% by default in the kernel - echo 3 > /proc/sys/kernel/sched_spill_nr_run - # Apply inter-cluster load balancer restrictions - echo 1 > /proc/sys/kernel/sched_restrict_cluster_spill - - # set sync wakee policy tunable - echo 1 > /proc/sys/kernel/sched_prefer_sync_wakee_to_waker for devfreq_gov in /sys/class/devfreq/qcom,mincpubw*/governor do @@ -1467,29 +1730,6 @@ case "$target" in echo 40 > $gpu_bimc_io_percent done - # Configure DCC module to capture critical register contents when device crashes - for DCC_PATH in /sys/bus/platform/devices/*.dcc* - do - echo 0 > $DCC_PATH/enable - echo cap > $DCC_PATH/func_type - echo sram > $DCC_PATH/data_sink - echo 1 > $DCC_PATH/config_reset - - # Register specifies APC CPR closed-loop settled voltage for current voltage corner - echo 0xb1d2c18 1 > $DCC_PATH/config - - # Register specifies SW programmed open-loop voltage for current voltage corner - echo 0xb1d2900 1 > $DCC_PATH/config - - # Register specifies APM switch settings and APM FSM state - echo 0xb1112b0 1 > $DCC_PATH/config - - # Register specifies CPR mode change state and also #online cores input to CPR HW - echo 0xb018798 1 > $DCC_PATH/config - - echo 1 > $DCC_PATH/enable - done - # disable thermal & BCL core_control to update interactive gov settings echo 0 > /sys/module/msm_thermal/core_control/enabled for mode in /sys/devices/soc.0/qcom,bcl.*/mode @@ -1511,19 +1751,30 @@ case "$target" in echo -n enable > $mode done - #governor settings - echo 1 > /sys/devices/system/cpu/cpu0/online - echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor - echo "19000 1401600:39000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay - echo 85 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load - echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate - echo 1401600 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq - echo 0 > /sys/devices/system/cpu/cpufreq/interactive/io_is_busy - echo "85 1401600:80" > /sys/devices/system/cpu/cpufreq/interactive/target_loads - echo 39000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time - echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor + #if the kernel version >=4.9,use the schedutil governor + KernelVersionStr=`cat /proc/sys/kernel/osrelease` + KernelVersionS=${KernelVersionStr:2:2} + KernelVersionA=${KernelVersionStr:0:1} + KernelVersionB=${KernelVersionS%.*} + if [ $KernelVersionA -ge 4 ] && [ $KernelVersionB -ge 9 ]; then + 8953_sched_dcvs_eas + else + 8953_sched_dcvs_hmp + fi echo 652800 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq + # Bring up all cores online + echo 1 > /sys/devices/system/cpu/cpu1/online + echo 1 > /sys/devices/system/cpu/cpu2/online + echo 1 > /sys/devices/system/cpu/cpu3/online + echo 1 > /sys/devices/system/cpu/cpu4/online + echo 1 > /sys/devices/system/cpu/cpu5/online + echo 1 > /sys/devices/system/cpu/cpu6/online + echo 1 > /sys/devices/system/cpu/cpu7/online + + # Enable low power modes + echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled + # re-enable thermal & BCL core_control now echo 1 > /sys/module/msm_thermal/core_control/enabled for mode in /sys/devices/soc.0/qcom,bcl.*/mode @@ -1543,34 +1794,176 @@ case "$target" in echo -n enable > $mode done - # Bring up all cores online - echo 1 > /sys/devices/system/cpu/cpu1/online - echo 1 > /sys/devices/system/cpu/cpu2/online - echo 1 > /sys/devices/system/cpu/cpu3/online - echo 1 > /sys/devices/system/cpu/cpu4/online - echo 1 > /sys/devices/system/cpu/cpu5/online - echo 1 > /sys/devices/system/cpu/cpu6/online - echo 1 > /sys/devices/system/cpu/cpu7/online - - # Enable low power modes - echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled - # SMP scheduler echo 85 > /proc/sys/kernel/sched_upmigrate echo 85 > /proc/sys/kernel/sched_downmigrate - echo 19 > /proc/sys/kernel/sched_upmigrate_min_nice - - # Enable sched guided freq control - echo 1 > /sys/devices/system/cpu/cpufreq/interactive/use_sched_load - echo 1 > /sys/devices/system/cpu/cpufreq/interactive/use_migration_notif - echo 200000 > /proc/sys/kernel/sched_freq_inc_notify - echo 200000 > /proc/sys/kernel/sched_freq_dec_notify # Set Memory parameters configure_memory_parameters - ;; - esac - ;; + ;; + esac + case "$soc_id" in + "349" | "350") + + # Start Host based Touch processing + case "$hw_platform" in + "MTP" | "Surf" | "RCM" | "QRD" ) + start_hbtp + ;; + esac + + for devfreq_gov in /sys/class/devfreq/qcom,mincpubw*/governor + do + echo "cpufreq" > $devfreq_gov + done + for cpubw in /sys/class/devfreq/*qcom,cpubw* + do + echo "bw_hwmon" > $cpubw/governor + echo 50 > $cpubw/polling_interval + echo "1611 3221 5859 6445 7104" > $cpubw/bw_hwmon/mbps_zones + echo 4 > $cpubw/bw_hwmon/sample_ms + echo 34 > $cpubw/bw_hwmon/io_percent + echo 20 > $cpubw/bw_hwmon/hist_memory + echo 80 > $cpubw/bw_hwmon/down_thres + echo 0 > $cpubw/bw_hwmon/hyst_length + echo 0 > $cpubw/bw_hwmon/guard_band_mbps + echo 250 > $cpubw/bw_hwmon/up_scale + echo 1600 > $cpubw/bw_hwmon/idle_mbps + done + + # Configure DCC module to capture critical register contents when device crashes + for DCC_PATH in /sys/bus/platform/devices/*.dcc* + do + echo 0 > $DCC_PATH/enable + echo cap > $DCC_PATH/func_type + echo sram > $DCC_PATH/data_sink + echo 1 > $DCC_PATH/config_reset + + # Register specifies APC CPR closed-loop settled voltage for current voltage corner + echo 0xb1d2c18 1 > $DCC_PATH/config + + # Register specifies SW programmed open-loop voltage for current voltage corner + echo 0xb1d2900 1 > $DCC_PATH/config + + # Register specifies APM switch settings and APM FSM state + echo 0xb1112b0 1 > $DCC_PATH/config + + # Register specifies CPR mode change state and also #online cores input to CPR HW + echo 0xb018798 1 > $DCC_PATH/config + + echo 1 > $DCC_PATH/enable + done + + # disable thermal & BCL core_control to update interactive gov settings + echo 0 > /sys/module/msm_thermal/core_control/enabled + for mode in /sys/devices/soc.0/qcom,bcl.*/mode + do + echo -n disable > $mode + done + for hotplug_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_mask + do + bcl_hotplug_mask=`cat $hotplug_mask` + echo 0 > $hotplug_mask + done + for hotplug_soc_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_soc_mask + do + bcl_soc_hotplug_mask=`cat $hotplug_soc_mask` + echo 0 > $hotplug_soc_mask + done + for mode in /sys/devices/soc.0/qcom,bcl.*/mode + do + echo -n enable > $mode + done + + # configure governor settings for little cluster + echo 1 > /sys/devices/system/cpu/cpu0/online + echo "schedutil" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor + echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/rate_limit_us + echo 1363200 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/hispeed_freq + #default value for hispeed_load is 90, for sdm632 it should be 85 + echo 85 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/hispeed_load + # sched_load_boost as -6 is equivalent to target load as 85. + echo -6 > /sys/devices/system/cpu/cpu0/sched_load_boost + echo -6 > /sys/devices/system/cpu/cpu1/sched_load_boost + echo -6 > /sys/devices/system/cpu/cpu2/sched_load_boost + echo -6 > /sys/devices/system/cpu/cpu3/sched_load_boost + + # configure governor settings for big cluster + echo 1 > /sys/devices/system/cpu/cpu4/online + echo "schedutil" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor + echo 0 > /sys/devices/system/cpu/cpu4/cpufreq/schedutil/rate_limit_us + echo 1401600 > /sys/devices/system/cpu/cpu4/cpufreq/schedutil/hispeed_freq + #default value for hispeed_load is 90, for sdm632 it should be 85 + echo 85 > /sys/devices/system/cpu/cpu4/cpufreq/schedutil/hispeed_load + # sched_load_boost as -6 is equivalent to target load as 85. + echo -6 > /sys/devices/system/cpu/cpu4/sched_load_boost + echo -6 > /sys/devices/system/cpu/cpu5/sched_load_boost + echo -6 > /sys/devices/system/cpu/cpu7/sched_load_boost + echo -6 > /sys/devices/system/cpu/cpu6/sched_load_boost + + echo 614400 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq + echo 633600 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq + + # cpuset settings + echo 0-3 > /dev/cpuset/background/cpus + echo 0-3 > /dev/cpuset/system-background/cpus + # choose idle CPU for top app tasks + echo 1 > /dev/stune/top-app/schedtune.prefer_idle + + # re-enable thermal & BCL core_control now + echo 1 > /sys/module/msm_thermal/core_control/enabled + for mode in /sys/devices/soc.0/qcom,bcl.*/mode + do + echo -n disable > $mode + done + for hotplug_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_mask + do + echo $bcl_hotplug_mask > $hotplug_mask + done + for hotplug_soc_mask in /sys/devices/soc.0/qcom,bcl.*/hotplug_soc_mask + do + echo $bcl_soc_hotplug_mask > $hotplug_soc_mask + done + for mode in /sys/devices/soc.0/qcom,bcl.*/mode + do + echo -n enable > $mode + done + + # Disable Core control + echo 0 > /sys/devices/system/cpu/cpu0/core_ctl/enable + echo 0 > /sys/devices/system/cpu/cpu4/core_ctl/enable + + # Bring up all cores online + echo 1 > /sys/devices/system/cpu/cpu1/online + echo 1 > /sys/devices/system/cpu/cpu2/online + echo 1 > /sys/devices/system/cpu/cpu3/online + echo 1 > /sys/devices/system/cpu/cpu4/online + echo 1 > /sys/devices/system/cpu/cpu5/online + echo 1 > /sys/devices/system/cpu/cpu6/online + echo 1 > /sys/devices/system/cpu/cpu7/online + + # Enable low power modes + echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled + + # Set Memory parameters + configure_memory_parameters + + # Setting b.L scheduler parameters + echo 76 > /proc/sys/kernel/sched_downmigrate + echo 86 > /proc/sys/kernel/sched_upmigrate + echo 80 > /proc/sys/kernel/sched_group_downmigrate + echo 90 > /proc/sys/kernel/sched_group_upmigrate + echo 1 > /proc/sys/kernel/sched_walt_rotate_big_tasks + + # Enable min frequency adjustment for big cluster + if [ -f /sys/module/big_cluster_min_freq_adjust/parameters/min_freq_cluster ]; then + echo "4-7" > /sys/module/big_cluster_min_freq_adjust/parameters/min_freq_cluster + fi + echo 1 > /sys/module/big_cluster_min_freq_adjust/parameters/min_freq_adjust + + ;; + esac + ;; esac case "$target" in @@ -1610,32 +2003,11 @@ case "$target" in esac # Apply Scheduler and Governor settings for 8917 / 8920 - # HMP scheduler settings - echo 3 > /proc/sys/kernel/sched_window_stats_policy - echo 3 > /proc/sys/kernel/sched_ravg_hist_size echo 20000000 > /proc/sys/kernel/sched_ravg_window - echo 1 > /proc/sys/kernel/sched_restrict_tasks_spread #disable sched_boost in 8917 echo 0 > /proc/sys/kernel/sched_boost - # HMP Task packing settings - echo 20 > /proc/sys/kernel/sched_small_task - echo 30 > /sys/devices/system/cpu/cpu0/sched_mostly_idle_load - echo 30 > /sys/devices/system/cpu/cpu1/sched_mostly_idle_load - echo 30 > /sys/devices/system/cpu/cpu2/sched_mostly_idle_load - echo 30 > /sys/devices/system/cpu/cpu3/sched_mostly_idle_load - - echo 3 > /sys/devices/system/cpu/cpu0/sched_mostly_idle_nr_run - echo 3 > /sys/devices/system/cpu/cpu1/sched_mostly_idle_nr_run - echo 3 > /sys/devices/system/cpu/cpu2/sched_mostly_idle_nr_run - echo 3 > /sys/devices/system/cpu/cpu3/sched_mostly_idle_nr_run - - echo 0 > /sys/devices/system/cpu/cpu0/sched_prefer_idle - echo 0 > /sys/devices/system/cpu/cpu1/sched_prefer_idle - echo 0 > /sys/devices/system/cpu/cpu2/sched_prefer_idle - echo 0 > /sys/devices/system/cpu/cpu3/sched_prefer_idle - # core_ctl is not needed for 8917. Disable it. echo 1 > /sys/devices/system/cpu/cpu0/core_ctl/disable @@ -1665,18 +2037,16 @@ case "$target" in # disable thermal core_control to update interactive gov settings echo 0 > /sys/module/msm_thermal/core_control/enabled - echo 1 > /sys/devices/system/cpu/cpu0/online - echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor - echo "19000 1094400:39000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay - echo 85 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load - echo 20000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate - echo 1094400 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq - echo 0 > /sys/devices/system/cpu/cpufreq/interactive/io_is_busy - echo "1 960000:85 1094400:90" > /sys/devices/system/cpu/cpufreq/interactive/target_loads - echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time - echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor + KernelVersionStr=`cat /proc/sys/kernel/osrelease` + KernelVersionS=${KernelVersionStr:2:2} + KernelVersionA=${KernelVersionStr:0:1} + KernelVersionB=${KernelVersionS%.*} + if [ $KernelVersionA -ge 4 ] && [ $KernelVersionB -ge 9 ]; then + 8917_sched_dcvs_eas + else + 8917_sched_dcvs_hmp + fi echo 960000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq - # re-enable thermal core_control now echo 1 > /sys/module/msm_thermal/core_control/enabled @@ -1692,12 +2062,6 @@ case "$target" in # Enable low power modes echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled - # Enable sched guided freq control - echo 1 > /sys/devices/system/cpu/cpufreq/interactive/use_sched_load - echo 1 > /sys/devices/system/cpu/cpufreq/interactive/use_migration_notif - echo 50000 > /proc/sys/kernel/sched_freq_inc_notify - echo 50000 > /proc/sys/kernel/sched_freq_dec_notify - # Set rps mask echo 2 > /sys/class/net/rmnet0/queues/rx-0/rps_cpus @@ -1732,35 +2096,6 @@ case "$target" in #disable sched_boost in 8937 echo 0 > /proc/sys/kernel/sched_boost - # HMP Task packing settings - echo 20 > /proc/sys/kernel/sched_small_task - echo 30 > /sys/devices/system/cpu/cpu0/sched_mostly_idle_load - echo 30 > /sys/devices/system/cpu/cpu1/sched_mostly_idle_load - echo 30 > /sys/devices/system/cpu/cpu2/sched_mostly_idle_load - echo 30 > /sys/devices/system/cpu/cpu3/sched_mostly_idle_load - echo 30 > /sys/devices/system/cpu/cpu4/sched_mostly_idle_load - echo 30 > /sys/devices/system/cpu/cpu5/sched_mostly_idle_load - echo 30 > /sys/devices/system/cpu/cpu6/sched_mostly_idle_load - echo 30 > /sys/devices/system/cpu/cpu7/sched_mostly_idle_load - - echo 3 > /sys/devices/system/cpu/cpu0/sched_mostly_idle_nr_run - echo 3 > /sys/devices/system/cpu/cpu1/sched_mostly_idle_nr_run - echo 3 > /sys/devices/system/cpu/cpu2/sched_mostly_idle_nr_run - echo 3 > /sys/devices/system/cpu/cpu3/sched_mostly_idle_nr_run - echo 3 > /sys/devices/system/cpu/cpu4/sched_mostly_idle_nr_run - echo 3 > /sys/devices/system/cpu/cpu5/sched_mostly_idle_nr_run - echo 3 > /sys/devices/system/cpu/cpu6/sched_mostly_idle_nr_run - echo 3 > /sys/devices/system/cpu/cpu7/sched_mostly_idle_nr_run - - echo 0 > /sys/devices/system/cpu/cpu0/sched_prefer_idle - echo 0 > /sys/devices/system/cpu/cpu1/sched_prefer_idle - echo 0 > /sys/devices/system/cpu/cpu2/sched_prefer_idle - echo 0 > /sys/devices/system/cpu/cpu3/sched_prefer_idle - echo 0 > /sys/devices/system/cpu/cpu4/sched_prefer_idle - echo 0 > /sys/devices/system/cpu/cpu5/sched_prefer_idle - echo 0 > /sys/devices/system/cpu/cpu6/sched_prefer_idle - echo 0 > /sys/devices/system/cpu/cpu7/sched_prefer_idle - for devfreq_gov in /sys/class/devfreq/qcom,mincpubw*/governor do echo "cpufreq" > $devfreq_gov @@ -1787,32 +2122,17 @@ case "$target" in # disable thermal core_control to update interactive gov and core_ctl settings echo 0 > /sys/module/msm_thermal/core_control/enabled - # enable governor for perf cluster - echo 1 > /sys/devices/system/cpu/cpu0/online - echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor - echo "19000 1094400:39000" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay - echo 85 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load - echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate - echo 1094400 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq - echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy - echo "1 960000:85 1094400:90 1344000:80" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads - echo 40000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time - echo 40000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/sampling_down_factor + KernelVersionStr=`cat /proc/sys/kernel/osrelease` + KernelVersionS=${KernelVersionStr:2:2} + KernelVersionA=${KernelVersionStr:0:1} + KernelVersionB=${KernelVersionS%.*} + if [ $KernelVersionA -ge 4 ] && [ $KernelVersionB -ge 9 ]; then + 8937_sched_dcvs_eas + else + 8937_sched_dcvs_hmp + fi echo 960000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq - - # enable governor for power cluster - echo 1 > /sys/devices/system/cpu/cpu4/online - echo "interactive" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor - echo 39000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay - echo 90 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/go_hispeed_load - echo 20000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_rate - echo 768000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq - echo 0 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy - echo "1 768000:90" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads - echo 40000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time - echo 40000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/sampling_down_factor echo 768000 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq - # Disable L2-GDHS low power modes echo N > /sys/module/lpm_levels/system/pwr/pwr-l2-gdhs/idle_enabled echo N > /sys/module/lpm_levels/system/pwr/pwr-l2-gdhs/suspend_enabled @@ -1835,14 +2155,6 @@ case "$target" in echo 93 > /proc/sys/kernel/sched_upmigrate echo 83 > /proc/sys/kernel/sched_downmigrate - # Enable sched guided freq control - echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_sched_load - echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_migration_notif - echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_sched_load - echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_migration_notif - echo 50000 > /proc/sys/kernel/sched_freq_inc_notify - echo 50000 > /proc/sys/kernel/sched_freq_dec_notify - # Enable core control echo 2 > /sys/devices/system/cpu/cpu0/core_ctl/min_cpus echo 4 > /sys/devices/system/cpu/cpu0/core_ctl/max_cpus @@ -1865,6 +2177,147 @@ case "$target" in ;; esac + + case "$soc_id" in + "354" | "364" | "353" | "363" ) + + # Start Host based Touch processing + case "$hw_platform" in + "MTP" | "Surf" | "RCM" | "QRD" ) + start_hbtp + ;; + esac + + # Apply settings for sdm429/sda429/sdm439/sda439 + + for cpubw in /sys/class/devfreq/*qcom,mincpubw* + do + echo "cpufreq" > $cpubw/governor + done + + for cpubw in /sys/class/devfreq/*qcom,cpubw* + do + echo "bw_hwmon" > $cpubw/governor + echo 20 > $cpubw/bw_hwmon/io_percent + echo 30 > $cpubw/bw_hwmon/guard_band_mbps + done + + for gpu_bimc_io_percent in /sys/class/devfreq/soc:qcom,gpubw/bw_hwmon/io_percent + do + echo 40 > $gpu_bimc_io_percent + done + + case "$soc_id" in + "353" | "363" ) + # Apply settings for sdm439/sda439 + # configure schedutil governor settings + # enable governor for perf cluster + echo 1 > /sys/devices/system/cpu/cpu0/online + echo "schedutil" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor + echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/rate_limit_us + #set the hispeed_freq + echo 1497600 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/hispeed_freq + echo 80 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/hispeed_load + echo 960000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq + # sched_load_boost as -6 is equivalent to target load as 85. + echo -6 > /sys/devices/system/cpu/cpu0/sched_load_boost + echo -6 > /sys/devices/system/cpu/cpu1/sched_load_boost + echo -6 > /sys/devices/system/cpu/cpu2/sched_load_boost + echo -6 > /sys/devices/system/cpu/cpu3/sched_load_boost + + ## enable governor for power cluster + echo 1 > /sys/devices/system/cpu/cpu4/online + echo "schedutil" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor + echo 0 > /sys/devices/system/cpu/cpu4/cpufreq/schedutil/rate_limit_us + #set the hispeed_freq + echo 998400 > /sys/devices/system/cpu/cpu4/cpufreq/schedutil/hispeed_freq + echo 85 > /sys/devices/system/cpu/cpu4/cpufreq/schedutil/hispeed_load + echo 768000 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq + # sched_load_boost as -6 is equivalent to target load as 85. + echo -6 > /sys/devices/system/cpu/cpu4/sched_load_boost + echo -6 > /sys/devices/system/cpu/cpu5/sched_load_boost + echo -6 > /sys/devices/system/cpu/cpu6/sched_load_boost + echo -6 > /sys/devices/system/cpu/cpu7/sched_load_boost + + # EAS scheduler (big.Little cluster related) settings + echo 93 > /proc/sys/kernel/sched_upmigrate + echo 83 > /proc/sys/kernel/sched_downmigrate + echo 140 > /proc/sys/kernel/sched_group_upmigrate + echo 120 > /proc/sys/kernel/sched_group_downmigrate + + # cpuset settings + #echo 0-3 > /dev/cpuset/background/cpus + #echo 0-3 > /dev/cpuset/system-background/cpus + + # Bring up all cores online + echo 1 > /sys/devices/system/cpu/cpu1/online + echo 1 > /sys/devices/system/cpu/cpu2/online + echo 1 > /sys/devices/system/cpu/cpu3/online + echo 1 > /sys/devices/system/cpu/cpu4/online + echo 1 > /sys/devices/system/cpu/cpu5/online + echo 1 > /sys/devices/system/cpu/cpu6/online + echo 1 > /sys/devices/system/cpu/cpu7/online + + # Enable core control + echo 2 > /sys/devices/system/cpu/cpu0/core_ctl/min_cpus + echo 4 > /sys/devices/system/cpu/cpu0/core_ctl/max_cpus + echo 68 > /sys/devices/system/cpu/cpu0/core_ctl/busy_up_thres + echo 40 > /sys/devices/system/cpu/cpu0/core_ctl/busy_down_thres + echo 100 > /sys/devices/system/cpu/cpu0/core_ctl/offline_delay_ms + echo 1 > /sys/devices/system/cpu/cpu0/core_ctl/is_big_cluster + echo 4 > /sys/devices/system/cpu/cpu0/core_ctl/task_thres + + # Big cluster min frequency adjust settings + if [ -f /sys/module/big_cluster_min_freq_adjust/parameters/min_freq_cluster ]; then + echo "0-3" > /sys/module/big_cluster_min_freq_adjust/parameters/min_freq_cluster + fi + echo 1305600 > /sys/module/big_cluster_min_freq_adjust/parameters/min_freq_floor + ;; + *) + # Apply settings for sdm429/sda429 + # configure schedutil governor settings + echo 1 > /sys/devices/system/cpu/cpu0/online + echo "schedutil" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor + echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/rate_limit_us + #set the hispeed_freq + echo 1305600 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/hispeed_freq + echo 80 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/hispeed_load + echo 960000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq + # sched_load_boost as -6 is equivalent to target load as 85. + echo -6 > /sys/devices/system/cpu/cpu0/sched_load_boost + echo -6 > /sys/devices/system/cpu/cpu1/sched_load_boost + echo -6 > /sys/devices/system/cpu/cpu2/sched_load_boost + echo -6 > /sys/devices/system/cpu/cpu3/sched_load_boost + + # Bring up all cores online + echo 1 > /sys/devices/system/cpu/cpu1/online + echo 1 > /sys/devices/system/cpu/cpu2/online + echo 1 > /sys/devices/system/cpu/cpu3/online + ;; + esac + + # Set Memory parameters + configure_memory_parameters + + #disable sched_boost + echo 0 > /proc/sys/kernel/sched_boost + + # Disable L2-GDHS low power modes + echo N > /sys/module/lpm_levels/system/pwr/pwr-l2-gdhs/idle_enabled + echo N > /sys/module/lpm_levels/system/pwr/pwr-l2-gdhs/suspend_enabled + echo N > /sys/module/lpm_levels/system/perf/perf-l2-gdhs/idle_enabled + echo N > /sys/module/lpm_levels/system/perf/perf-l2-gdhs/suspend_enabled + + # Enable low power modes + echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled + + case "$soc_id" in + "353" | "363" ) + echo 1 > /sys/module/big_cluster_min_freq_adjust/parameters/min_freq_adjust + ;; + esac + ;; + esac ;; esac @@ -1925,6 +2378,7 @@ case "$target" in echo 1 > /proc/sys/kernel/sched_restrict_cluster_spill echo 100000 > /proc/sys/kernel/sched_short_burst_ns echo 1 > /proc/sys/kernel/sched_prefer_sync_wakee_to_waker + echo 20 > /proc/sys/kernel/sched_small_wakee_task_load # cpuset settings echo 0-7 > /dev/cpuset/top-app/cpus @@ -2000,11 +2454,12 @@ case "$target" in # re-enable thermal and BCL hotplug echo 1 > /sys/module/msm_thermal/core_control/enabled - #Add-begin-HMI_L8866_A01-794,lijiang@longcheer.com,2018-01-20 + #Add-begin-HMI_M6100_A01-422,lijiang@longcheer.com,2018-10-12 #Enable input boost configuration echo "0:1401600" > /sys/module/cpu_boost/parameters/input_boost_freq - echo 60 > /sys/module/cpu_boost/parameters/input_boost_ms - #Add-end-HMI_L8866_A01-794 + echo 40 > /sys/module/cpu_boost/parameters/input_boost_ms + #Add-end-HMI_M6100_A01-422 + # Set Memory parameters configure_memory_parameters @@ -2038,25 +2493,28 @@ case "$target" in done echo "cpufreq" > /sys/class/devfreq/soc:qcom,mincpubw/governor - - # Start Host based Touch processing - # case "$hw_platform" in - # "MTP" | "Surf" | "RCM" | "QRD" ) - # start_hbtp - # ;; - # esac + # Start cdsprpcd only for sdm660 and disable for sdm630 + start vendor.cdsprpcd +##D2SP&F7A has no hbtp feature +# # Start Host based Touch processing +# case "$hw_platform" in +# "MTP" | "Surf" | "RCM" | "QRD" ) +# start_hbtp +# ;; +# esac +#end ;; esac - #Apply settings for sdm630 + #Apply settings for sdm630 and Tahaa case "$soc_id" in - "318" | "327" ) + "318" | "327" | "385" ) # Start Host based Touch processing - #case "$hw_platform" in - # "MTP" | "Surf" | "RCM" | "QRD" ) - # start_hbtp - # ;; - #esac + case "$hw_platform" in + "MTP" | "Surf" | "RCM" | "QRD" ) + start_hbtp + ;; + esac # Setting b.L scheduler parameters echo 85 > /proc/sys/kernel/sched_upmigrate @@ -2214,6 +2672,388 @@ case "$target" in esac case "$target" in + "sdm710") + + #Apply settings for sdm710 + # Set the default IRQ affinity to the silver cluster. When a + # CPU is isolated/hotplugged, the IRQ affinity is adjusted + # to one of the CPU from the default IRQ affinity mask. + echo 3f > /proc/irq/default_smp_affinity + + if [ -f /sys/devices/soc0/soc_id ]; then + soc_id=`cat /sys/devices/soc0/soc_id` + else + soc_id=`cat /sys/devices/system/soc/soc0/id` + fi + + if [ -f /sys/devices/soc0/hw_platform ]; then + hw_platform=`cat /sys/devices/soc0/hw_platform` + else + hw_platform=`cat /sys/devices/system/soc/soc0/hw_platform` + fi + + case "$soc_id" in + "336" | "337" | "347" | "360" ) + + # Start Host based Touch processing + case "$hw_platform" in + "MTP" | "Surf" | "RCM" | "QRD" ) + start_hbtp + ;; + esac + + # Core control parameters on silver + echo 0 0 0 0 1 1 > /sys/devices/system/cpu/cpu0/core_ctl/not_preferred + echo 4 > /sys/devices/system/cpu/cpu0/core_ctl/min_cpus + echo 60 > /sys/devices/system/cpu/cpu0/core_ctl/busy_up_thres + echo 40 > /sys/devices/system/cpu/cpu0/core_ctl/busy_down_thres + echo 100 > /sys/devices/system/cpu/cpu0/core_ctl/offline_delay_ms + echo 0 > /sys/devices/system/cpu/cpu0/core_ctl/is_big_cluster + echo 8 > /sys/devices/system/cpu/cpu0/core_ctl/task_thres + + # Setting b.L scheduler parameters + echo 96 > /proc/sys/kernel/sched_upmigrate + echo 90 > /proc/sys/kernel/sched_downmigrate + echo 140 > /proc/sys/kernel/sched_group_upmigrate + echo 120 > /proc/sys/kernel/sched_group_downmigrate + echo 1 > /proc/sys/kernel/sched_walt_rotate_big_tasks + + # configure governor settings for little cluster + echo "schedutil" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor + echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/rate_limit_us + echo 1209600 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/hispeed_freq + echo 576000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq + + # configure governor settings for big cluster + echo "schedutil" > /sys/devices/system/cpu/cpu6/cpufreq/scaling_governor + echo 0 > /sys/devices/system/cpu/cpu6/cpufreq/schedutil/rate_limit_us + echo 1344000 > /sys/devices/system/cpu/cpu6/cpufreq/schedutil/hispeed_freq + echo 652800 > /sys/devices/system/cpu/cpu6/cpufreq/scaling_min_freq + + # sched_load_boost as -6 is equivalent to target load as 85. It is per cpu tunable. + echo -6 > /sys/devices/system/cpu/cpu6/sched_load_boost + echo -6 > /sys/devices/system/cpu/cpu7/sched_load_boost + echo 85 > /sys/devices/system/cpu/cpu6/cpufreq/schedutil/hispeed_load + + echo "0:1209600" > /sys/module/cpu_boost/parameters/input_boost_freq + echo 40 > /sys/module/cpu_boost/parameters/input_boost_ms + + # Set Memory parameters + configure_memory_parameters + + # Enable bus-dcvs + for cpubw in /sys/class/devfreq/*qcom,cpubw* + do + echo "bw_hwmon" > $cpubw/governor + echo 50 > $cpubw/polling_interval + echo "1144 1720 2086 2929 3879 5931 6881" > $cpubw/bw_hwmon/mbps_zones + echo 4 > $cpubw/bw_hwmon/sample_ms + echo 68 > $cpubw/bw_hwmon/io_percent + echo 20 > $cpubw/bw_hwmon/hist_memory + echo 0 > $cpubw/bw_hwmon/hyst_length + echo 80 > $cpubw/bw_hwmon/down_thres + echo 0 > $cpubw/bw_hwmon/guard_band_mbps + echo 250 > $cpubw/bw_hwmon/up_scale + echo 1600 > $cpubw/bw_hwmon/idle_mbps + done + + #Enable mem_latency governor for DDR scaling + for memlat in /sys/class/devfreq/*qcom,memlat-cpu* + do + echo "mem_latency" > $memlat/governor + echo 10 > $memlat/polling_interval + echo 400 > $memlat/mem_latency/ratio_ceil + done + + #Enable mem_latency governor for L3 scaling + for memlat in /sys/class/devfreq/*qcom,l3-cpu* + do + echo "mem_latency" > $memlat/governor + echo 10 > $memlat/polling_interval + echo 400 > $memlat/mem_latency/ratio_ceil + done + + #Enable userspace governor for L3 cdsp nodes + for l3cdsp in /sys/class/devfreq/*qcom,l3-cdsp* + do + echo "userspace" > $l3cdsp/governor + chown -h system $l3cdsp/userspace/set_freq + done + + echo "cpufreq" > /sys/class/devfreq/soc:qcom,mincpubw/governor + + # Disable CPU Retention + echo N > /sys/module/lpm_levels/L3/cpu0/ret/idle_enabled + echo N > /sys/module/lpm_levels/L3/cpu1/ret/idle_enabled + echo N > /sys/module/lpm_levels/L3/cpu2/ret/idle_enabled + echo N > /sys/module/lpm_levels/L3/cpu3/ret/idle_enabled + echo N > /sys/module/lpm_levels/L3/cpu4/ret/idle_enabled + echo N > /sys/module/lpm_levels/L3/cpu5/ret/idle_enabled + echo N > /sys/module/lpm_levels/L3/cpu6/ret/idle_enabled + echo N > /sys/module/lpm_levels/L3/cpu7/ret/idle_enabled + + # cpuset parameters + echo 0-5 > /dev/cpuset/background/cpus + echo 0-5 > /dev/cpuset/system-background/cpus + + # Turn off scheduler boost at the end + echo 0 > /proc/sys/kernel/sched_boost + + # Turn on sleep modes. + echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled + ;; + esac + ;; +esac + +case "$target" in + "talos") + + #Apply settings for talos + # Set the default IRQ affinity to the silver cluster. When a + # CPU is isolated/hotplugged, the IRQ affinity is adjusted + # to one of the CPU from the default IRQ affinity mask. + echo 3f > /proc/irq/default_smp_affinity + + if [ -f /sys/devices/soc0/soc_id ]; then + soc_id=`cat /sys/devices/soc0/soc_id` + else + soc_id=`cat /sys/devices/system/soc/soc0/id` + fi + + case "$soc_id" in + "355" | "369" ) + + # Core control parameters on silver + echo 0 0 0 0 1 1 > /sys/devices/system/cpu/cpu0/core_ctl/not_preferred + echo 4 > /sys/devices/system/cpu/cpu0/core_ctl/min_cpus + echo 60 > /sys/devices/system/cpu/cpu0/core_ctl/busy_up_thres + echo 40 > /sys/devices/system/cpu/cpu0/core_ctl/busy_down_thres + echo 100 > /sys/devices/system/cpu/cpu0/core_ctl/offline_delay_ms + echo 0 > /sys/devices/system/cpu/cpu0/core_ctl/is_big_cluster + echo 8 > /sys/devices/system/cpu/cpu0/core_ctl/task_thres + echo 0 > /sys/devices/system/cpu/cpu6/core_ctl/enable + + + # Setting b.L scheduler parameters + # default sched up and down migrate values are 90 and 85 + echo 65 > /proc/sys/kernel/sched_downmigrate + echo 71 > /proc/sys/kernel/sched_upmigrate + # default sched up and down migrate values are 100 and 95 + echo 85 > /proc/sys/kernel/sched_group_downmigrate + echo 100 > /proc/sys/kernel/sched_group_upmigrate + echo 1 > /proc/sys/kernel/sched_walt_rotate_big_tasks + + # configure governor settings for little cluster + echo "schedutil" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor + echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/rate_limit_us + echo 1209600 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/hispeed_freq + echo 576000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq + + # configure governor settings for big cluster + echo "schedutil" > /sys/devices/system/cpu/cpu6/cpufreq/scaling_governor + echo 0 > /sys/devices/system/cpu/cpu6/cpufreq/schedutil/rate_limit_us + echo 1209600 > /sys/devices/system/cpu/cpu6/cpufreq/schedutil/hispeed_freq + echo 768000 > /sys/devices/system/cpu/cpu6/cpufreq/scaling_min_freq + + # sched_load_boost as -6 is equivalent to target load as 85. It is per cpu tunable. + echo -6 > /sys/devices/system/cpu/cpu6/sched_load_boost + echo -6 > /sys/devices/system/cpu/cpu7/sched_load_boost + echo 85 > /sys/devices/system/cpu/cpu6/cpufreq/schedutil/hispeed_load + + echo "0:1209600" > /sys/module/cpu_boost/parameters/input_boost_freq + echo 40 > /sys/module/cpu_boost/parameters/input_boost_ms + + # Set Memory parameters + configure_memory_parameters + + # Enable bus-dcvs + for device in /sys/devices/platform/soc + do + for cpubw in $device/*cpu-cpu-llcc-bw/devfreq/*cpu-cpu-llcc-bw + do + echo "bw_hwmon" > $cpubw/governor + echo 50 > $cpubw/polling_interval + echo "2288 4577 7110 9155 12298 14236" > $cpubw/bw_hwmon/mbps_zones + echo 4 > $cpubw/bw_hwmon/sample_ms + echo 68 > $cpubw/bw_hwmon/io_percent + echo 20 > $cpubw/bw_hwmon/hist_memory + echo 0 > $cpubw/bw_hwmon/hyst_length + echo 80 > $cpubw/bw_hwmon/down_thres + echo 0 > $cpubw/bw_hwmon/guard_band_mbps + echo 250 > $cpubw/bw_hwmon/up_scale + echo 1600 > $cpubw/bw_hwmon/idle_mbps + done + + for llccbw in $device/*cpu-llcc-ddr-bw/devfreq/*cpu-llcc-ddr-bw + do + echo "bw_hwmon" > $llccbw/governor + echo 40 > $llccbw/polling_interval + echo "1144 1720 2086 2929 3879 5931 6881" > $llccbw/bw_hwmon/mbps_zones + echo 4 > $llccbw/bw_hwmon/sample_ms + echo 68 > $llccbw/bw_hwmon/io_percent + echo 20 > $llccbw/bw_hwmon/hist_memory + echo 0 > $llccbw/bw_hwmon/hyst_length + echo 80 > $llccbw/bw_hwmon/down_thres + echo 0 > $llccbw/bw_hwmon/guard_band_mbps + echo 250 > $llccbw/bw_hwmon/up_scale + echo 1600 > $llccbw/bw_hwmon/idle_mbps + done + + #Enable mem_latency governor for L3, LLCC, and DDR scaling + for memlat in $device/*cpu*-lat/devfreq/*cpu*-lat + do + echo "mem_latency" > $memlat/governor + echo 10 > $memlat/polling_interval + echo 400 > $memlat/mem_latency/ratio_ceil + done + + #Enable compute governor for gold latfloor + for latfloor in $device/*cpu*-ddr-latfloor*/devfreq/*cpu-ddr-latfloor* + do + echo "compute" > $latfloor/governor + echo 10 > $latfloor/polling_interval + done + + done + + + # cpuset parameters + echo 0-5 > /dev/cpuset/background/cpus + echo 0-5 > /dev/cpuset/system-background/cpus + + # Turn off scheduler boost at the end + echo 0 > /proc/sys/kernel/sched_boost + + # Turn on sleep modes. + echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled + ;; + esac + ;; +esac + +case "$target" in + "qcs605") + + #Apply settings for qcs605 + # Set the default IRQ affinity to the silver cluster. When a + # CPU is isolated/hotplugged, the IRQ affinity is adjusted + # to one of the CPU from the default IRQ affinity mask. + echo 3f > /proc/irq/default_smp_affinity + + if [ -f /sys/devices/soc0/soc_id ]; then + soc_id=`cat /sys/devices/soc0/soc_id` + else + soc_id=`cat /sys/devices/system/soc/soc0/id` + fi + + if [ -f /sys/devices/soc0/hw_platform ]; then + hw_platform=`cat /sys/devices/soc0/hw_platform` + else + hw_platform=`cat /sys/devices/system/soc/soc0/hw_platform` + fi + + if [ -f /sys/devices/soc0/platform_subtype_id ]; then + platform_subtype_id=`cat /sys/devices/soc0/platform_subtype_id` + fi + + case "$soc_id" in + "347" ) + + # Start Host based Touch processing + case "$hw_platform" in + "Surf" | "RCM" | "QRD" ) + start_hbtp + ;; + "MTP" ) + if [ $platform_subtype_id != 5 ]; then + start_hbtp + fi + ;; + esac + + # Core control parameters on silver + echo 4 > /sys/devices/system/cpu/cpu0/core_ctl/min_cpus + echo 60 > /sys/devices/system/cpu/cpu0/core_ctl/busy_up_thres + echo 40 > /sys/devices/system/cpu/cpu0/core_ctl/busy_down_thres + echo 100 > /sys/devices/system/cpu/cpu0/core_ctl/offline_delay_ms + echo 0 > /sys/devices/system/cpu/cpu0/core_ctl/is_big_cluster + echo 8 > /sys/devices/system/cpu/cpu0/core_ctl/task_thres + + # Setting b.L scheduler parameters + echo 96 > /proc/sys/kernel/sched_upmigrate + echo 90 > /proc/sys/kernel/sched_downmigrate + echo 140 > /proc/sys/kernel/sched_group_upmigrate + echo 120 > /proc/sys/kernel/sched_group_downmigrate + + # configure governor settings for little cluster + echo "schedutil" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor + echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/rate_limit_us + echo 1209600 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/hispeed_freq + echo 576000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq + + # configure governor settings for big cluster + echo "schedutil" > /sys/devices/system/cpu/cpu6/cpufreq/scaling_governor + echo 0 > /sys/devices/system/cpu/cpu6/cpufreq/schedutil/rate_limit_us + echo 1344000 > /sys/devices/system/cpu/cpu6/cpufreq/schedutil/hispeed_freq + echo 825600 > /sys/devices/system/cpu/cpu6/cpufreq/scaling_min_freq + + echo "0:1209600" > /sys/module/cpu_boost/parameters/input_boost_freq + echo 40 > /sys/module/cpu_boost/parameters/input_boost_ms + + # Enable bus-dcvs + for cpubw in /sys/class/devfreq/*qcom,cpubw* + do + echo "bw_hwmon" > $cpubw/governor + echo 50 > $cpubw/polling_interval + echo "1144 1720 2086 2929 3879 5931 6881" > $cpubw/bw_hwmon/mbps_zones + echo 4 > $cpubw/bw_hwmon/sample_ms + echo 68 > $cpubw/bw_hwmon/io_percent + echo 20 > $cpubw/bw_hwmon/hist_memory + echo 0 > $cpubw/bw_hwmon/hyst_length + echo 80 > $cpubw/bw_hwmon/down_thres + echo 0 > $cpubw/bw_hwmon/low_power_ceil_mbps + echo 68 > $cpubw/bw_hwmon/low_power_io_percent + echo 20 > $cpubw/bw_hwmon/low_power_delay + echo 0 > $cpubw/bw_hwmon/guard_band_mbps + echo 250 > $cpubw/bw_hwmon/up_scale + echo 1600 > $cpubw/bw_hwmon/idle_mbps + done + + #Enable mem_latency governor for DDR scaling + for memlat in /sys/class/devfreq/*qcom,memlat-cpu* + do + echo "mem_latency" > $memlat/governor + echo 10 > $memlat/polling_interval + echo 400 > $memlat/mem_latency/ratio_ceil + done + + #Enable mem_latency governor for L3 scaling + for memlat in /sys/class/devfreq/*qcom,l3-cpu* + do + echo "mem_latency" > $memlat/governor + echo 10 > $memlat/polling_interval + echo 400 > $memlat/mem_latency/ratio_ceil + done + + echo "cpufreq" > /sys/class/devfreq/soc:qcom,mincpubw/governor + + # cpuset parameters + echo 0-5 > /dev/cpuset/background/cpus + echo 0-5 > /dev/cpuset/system-background/cpus + + # Turn off scheduler boost at the end + echo 0 > /proc/sys/kernel/sched_boost + + # Turn on sleep modes. + echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled + echo 100 > /proc/sys/vm/swappiness + ;; + esac + ;; +esac + +case "$target" in "apq8084") echo 4 > /sys/module/lpm_levels/enable_low_power/l2 echo 1 > /sys/module/msm_pm/modes/cpu0/power_collapse/suspend_enabled @@ -2264,7 +3104,7 @@ case "$target" in echo 300000 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq echo 300000 > /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq echo 1 > /sys/module/msm_thermal/core_control/enabled - setprop ro.qualcomm.perf.cores_online 2 + setprop ro.vendor.perf.cores_online 2 chown -h system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq chown -h system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq chown -h root.system /sys/devices/system/cpu/mfreq @@ -2620,17 +3460,39 @@ case "$target" in # to one of the CPU from the default IRQ affinity mask. echo f > /proc/irq/default_smp_affinity - if [ -f /sys/devices/soc0/soc_id ]; then + if [ -f /sys/devices/soc0/soc_id ]; then soc_id=`cat /sys/devices/soc0/soc_id` else soc_id=`cat /sys/devices/system/soc/soc0/id` fi - case "$soc_id" in - "321") #sdm845 - start_hbtp - ;; - esac + if [ -f /sys/devices/soc0/hw_platform ]; then + hw_platform=`cat /sys/devices/soc0/hw_platform` + fi + + if [ -f /sys/devices/soc0/platform_subtype_id ]; then + platform_subtype_id=`cat /sys/devices/soc0/platform_subtype_id` + fi + + case "$soc_id" in + "321" | "341") + # Start Host based Touch processing + case "$hw_platform" in + "QRD" ) + case "$platform_subtype_id" in + "32") #QVR845 do nothing + ;; + *) + start_hbtp + ;; + esac + ;; + *) + start_hbtp + ;; + esac + ;; + esac # Core control parameters echo 2 > /sys/devices/system/cpu/cpu4/core_ctl/min_cpus echo 60 > /sys/devices/system/cpu/cpu4/core_ctl/busy_up_thres @@ -2644,23 +3506,27 @@ case "$target" in echo 85 > /proc/sys/kernel/sched_downmigrate echo 100 > /proc/sys/kernel/sched_group_upmigrate echo 95 > /proc/sys/kernel/sched_group_downmigrate - echo 0 > /proc/sys/kernel/sched_select_prev_cpu_us - echo 400000 > /proc/sys/kernel/sched_freq_inc_notify - echo 400000 > /proc/sys/kernel/sched_freq_dec_notify - echo 5 > /proc/sys/kernel/sched_spill_nr_run - echo 1 > /proc/sys/kernel/sched_restrict_cluster_spill + echo 1 > /proc/sys/kernel/sched_walt_rotate_big_tasks # configure governor settings for little cluster echo "schedutil" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/rate_limit_us echo 1209600 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/hispeed_freq + echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/schedutil/pl + echo 576000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq # configure governor settings for big cluster echo "schedutil" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor echo 0 > /sys/devices/system/cpu/cpu4/cpufreq/schedutil/rate_limit_us echo 1574400 > /sys/devices/system/cpu/cpu4/cpufreq/schedutil/hispeed_freq + echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/schedutil/pl echo "0:1324800" > /sys/module/cpu_boost/parameters/input_boost_freq echo 120 > /sys/module/cpu_boost/parameters/input_boost_ms + # Limit the min frequency to 825MHz + echo 825000 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq + + # Enable oom_reaper + echo 1 > /sys/module/lowmemorykiller/parameters/oom_reaper # Enable bus-dcvs for cpubw in /sys/class/devfreq/*qcom,cpubw* @@ -2669,12 +3535,9 @@ case "$target" in echo 50 > $cpubw/polling_interval echo "2288 4577 6500 8132 9155 10681" > $cpubw/bw_hwmon/mbps_zones echo 4 > $cpubw/bw_hwmon/sample_ms - echo 34 > $cpubw/bw_hwmon/io_percent + echo 50 > $cpubw/bw_hwmon/io_percent echo 20 > $cpubw/bw_hwmon/hist_memory echo 10 > $cpubw/bw_hwmon/hyst_length - echo 0 > $cpubw/bw_hwmon/low_power_ceil_mbps - echo 34 > $cpubw/bw_hwmon/low_power_io_percent - echo 20 > $cpubw/bw_hwmon/low_power_delay echo 0 > $cpubw/bw_hwmon/guard_band_mbps echo 250 > $cpubw/bw_hwmon/up_scale echo 1600 > $cpubw/bw_hwmon/idle_mbps @@ -2684,14 +3547,11 @@ case "$target" in do echo "bw_hwmon" > $llccbw/governor echo 50 > $llccbw/polling_interval - echo "1720 2929 4943 5931 6881" > $llccbw/bw_hwmon/mbps_zones + echo "1720 2929 3879 5931 6881" > $llccbw/bw_hwmon/mbps_zones echo 4 > $llccbw/bw_hwmon/sample_ms - echo 68 > $llccbw/bw_hwmon/io_percent + echo 80 > $llccbw/bw_hwmon/io_percent echo 20 > $llccbw/bw_hwmon/hist_memory echo 10 > $llccbw/bw_hwmon/hyst_length - echo 0 > $llccbw/bw_hwmon/low_power_ceil_mbps - echo 68 > $llccbw/bw_hwmon/low_power_io_percent - echo 20 > $llccbw/bw_hwmon/low_power_delay echo 0 > $llccbw/bw_hwmon/guard_band_mbps echo 250 > $llccbw/bw_hwmon/up_scale echo 1600 > $llccbw/bw_hwmon/idle_mbps @@ -2713,10 +3573,18 @@ case "$target" in echo 400 > $memlat/mem_latency/ratio_ceil done + #Enable userspace governor for L3 cdsp nodes + for l3cdsp in /sys/class/devfreq/*qcom,l3-cdsp* + do + echo "userspace" > $l3cdsp/governor + chown -h system $l3cdsp/userspace/set_freq + done + #Gold L3 ratio ceil echo 4000 > /sys/class/devfreq/soc:qcom,l3-cpu4/mem_latency/ratio_ceil - echo "cpufreq" > /sys/class/devfreq/soc:qcom,mincpubw/governor + echo "compute" > /sys/class/devfreq/soc:qcom,mincpubw/governor + echo 10 > /sys/class/devfreq/soc:qcom,mincpubw/polling_interval # cpuset parameters echo 0-3 > /dev/cpuset/background/cpus @@ -2733,9 +3601,192 @@ case "$target" in echo N > /sys/module/lpm_levels/L3/cpu5/ret/idle_enabled echo N > /sys/module/lpm_levels/L3/cpu6/ret/idle_enabled echo N > /sys/module/lpm_levels/L3/cpu7/ret/idle_enabled + echo N > /sys/module/lpm_levels/L3/l3-dyn-ret/idle_enabled # Turn on sleep modes. echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled echo 100 > /proc/sys/vm/swappiness + echo 120 > /proc/sys/vm/watermark_scale_factor + ;; +esac + +case "$target" in + "msmnile") + # Core control parameters for gold + echo 2 > /sys/devices/system/cpu/cpu4/core_ctl/min_cpus + echo 60 > /sys/devices/system/cpu/cpu4/core_ctl/busy_up_thres + echo 30 > /sys/devices/system/cpu/cpu4/core_ctl/busy_down_thres + echo 100 > /sys/devices/system/cpu/cpu4/core_ctl/offline_delay_ms + echo 3 > /sys/devices/system/cpu/cpu4/core_ctl/task_thres + + # Core control parameters for gold+ + echo 0 > /sys/devices/system/cpu/cpu7/core_ctl/min_cpus + echo 60 > /sys/devices/system/cpu/cpu7/core_ctl/busy_up_thres + echo 30 > /sys/devices/system/cpu/cpu7/core_ctl/busy_down_thres + echo 100 > /sys/devices/system/cpu/cpu7/core_ctl/offline_delay_ms + echo 1 > /sys/devices/system/cpu/cpu7/core_ctl/task_thres + # Controls how many more tasks should be eligible to run on gold CPUs + # w.r.t number of gold CPUs available to trigger assist (max number of + # tasks eligible to run on previous cluster minus number of CPUs in + # the previous cluster). + # + # Setting to 3 by default which means there should be at least + # 6 tasks eligible to run on gold cluster (tasks running on gold cores + # plus misfit tasks on silver cores) to trigger assitance from gold+. + echo 3 > /sys/devices/system/cpu/cpu7/core_ctl/nr_prev_assist_thresh + + # Disable Core control on silver + echo 0 > /sys/devices/system/cpu/cpu0/core_ctl/enable + + # Setting b.L scheduler parameters + echo 95 95 > /proc/sys/kernel/sched_upmigrate + echo 85 85 > /proc/sys/kernel/sched_downmigrate + echo 100 > /proc/sys/kernel/sched_group_upmigrate + echo 95 > /proc/sys/kernel/sched_group_downmigrate + echo 1 > /proc/sys/kernel/sched_walt_rotate_big_tasks + + # cpuset parameters + echo 0-3 > /dev/cpuset/background/cpus + echo 0-3 > /dev/cpuset/system-background/cpus + + # Turn off scheduler boost at the end + echo 0 > /proc/sys/kernel/sched_boost + + # configure governor settings for silver cluster + echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor + echo 0 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/rate_limit_us + echo 1075200 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/hispeed_freq + echo 576000 > /sys/devices/system/cpu/cpufreq/policy0/scaling_min_freq + echo 1 > /sys/devices/system/cpu/cpufreq/policy0/schedutil/pl + + # configure governor settings for gold cluster + echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy4/scaling_governor + echo 0 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/rate_limit_us + echo 1248000 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/hispeed_freq + echo 1 > /sys/devices/system/cpu/cpufreq/policy4/schedutil/pl + + # configure governor settings for gold+ cluster + echo "schedutil" > /sys/devices/system/cpu/cpufreq/policy7/scaling_governor + echo 0 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/rate_limit_us + echo 1286400 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/hispeed_freq + echo 1 > /sys/devices/system/cpu/cpufreq/policy7/schedutil/pl + + # configure input boost settings + echo "0:1324800" > /sys/module/cpu_boost/parameters/input_boost_freq + echo 120 > /sys/module/cpu_boost/parameters/input_boost_ms + + echo 120 > /proc/sys/vm/watermark_scale_factor + + echo 0-3 > /dev/cpuset/background/cpus + echo 0-3 > /dev/cpuset/system-background/cpus + + # Enable oom_reaper + if [ -f /sys/module/lowmemorykiller/parameters/oom_reaper ]; then + echo 1 > /sys/module/lowmemorykiller/parameters/oom_reaper + else + echo 1 > /proc/sys/vm/reap_mem_on_sigkill + fi + + # Enable bus-dcvs + for device in /sys/devices/platform/soc + do + for cpubw in $device/*cpu-cpu-llcc-bw/devfreq/*cpu-cpu-llcc-bw + do + echo "bw_hwmon" > $cpubw/governor + echo 40 > $cpubw/polling_interval + echo "2288 3051 6149 8132 10162 11856" > $cpubw/bw_hwmon/mbps_zones + echo 4 > $cpubw/bw_hwmon/sample_ms + echo 50 > $cpubw/bw_hwmon/io_percent + echo 20 > $cpubw/bw_hwmon/hist_memory + echo 10 > $cpubw/bw_hwmon/hyst_length + echo 30 > $cpubw/bw_hwmon/down_thres + echo 0 > $cpubw/bw_hwmon/guard_band_mbps + echo 250 > $cpubw/bw_hwmon/up_scale + echo 1600 > $cpubw/bw_hwmon/idle_mbps + done + + for llccbw in $device/*cpu-llcc-ddr-bw/devfreq/*cpu-llcc-ddr-bw + do + echo "bw_hwmon" > $llccbw/governor + echo 40 > $llccbw/polling_interval + echo "1720 2929 4943 5931 6881 7980" > $llccbw/bw_hwmon/mbps_zones + echo 4 > $llccbw/bw_hwmon/sample_ms + echo 80 > $llccbw/bw_hwmon/io_percent + echo 20 > $llccbw/bw_hwmon/hist_memory + echo 10 > $llccbw/bw_hwmon/hyst_length + echo 30 > $llccbw/bw_hwmon/down_thres + echo 0 > $llccbw/bw_hwmon/guard_band_mbps + echo 250 > $llccbw/bw_hwmon/up_scale + echo 1600 > $llccbw/bw_hwmon/idle_mbps + done + + for npubw in $device/*npu-npu-ddr-bw/devfreq/*npu-npu-ddr-bw + do + echo 1 > /sys/devices/virtual/npu/msm_npu/pwr + echo "bw_hwmon" > $npubw/governor + echo 40 > $npubw/polling_interval + echo "1720 2929 4943 5931 6881 7980" > $npubw/bw_hwmon/mbps_zones + echo 4 > $npubw/bw_hwmon/sample_ms + echo 80 > $npubw/bw_hwmon/io_percent + echo 20 > $npubw/bw_hwmon/hist_memory + echo 10 > $npubw/bw_hwmon/hyst_length + echo 30 > $npubw/bw_hwmon/down_thres + echo 0 > $npubw/bw_hwmon/guard_band_mbps + echo 250 > $npubw/bw_hwmon/up_scale + echo 1600 > $npubw/bw_hwmon/idle_mbps + echo 0 > /sys/devices/virtual/npu/msm_npu/pwr + done + + #Enable mem_latency governor for L3, LLCC, and DDR scaling + for memlat in $device/*cpu*-lat/devfreq/*cpu*-lat + do + echo "mem_latency" > $memlat/governor + echo 10 > $memlat/polling_interval + echo 400 > $memlat/mem_latency/ratio_ceil + done + + #Enable userspace governor for L3 cdsp nodes + for l3cdsp in $device/*cdsp-cdsp-l3-lat/devfreq/*cdsp-cdsp-l3-lat + do + echo "cdspl3" > $l3cdsp/governor + done + + #Enable compute governor for gold latfloor + for latfloor in $device/*cpu-ddr-latfloor*/devfreq/*cpu-ddr-latfloor* + do + echo "compute" > $latfloor/governor + echo 10 > $latfloor/polling_interval + done + + #Gold L3 ratio ceil + for l3gold in $device/*cpu4-cpu-l3-lat/devfreq/*cpu4-cpu-l3-lat + do + echo 4000 > $l3gold/mem_latency/ratio_ceil + done + done + + if [ -f /sys/devices/soc0/hw_platform ]; then + hw_platform=`cat /sys/devices/soc0/hw_platform` + else + hw_platform=`cat /sys/devices/system/soc/soc0/hw_platform` + fi + + if [ -f /sys/devices/soc0/platform_subtype_id ]; then + platform_subtype_id=`cat /sys/devices/soc0/platform_subtype_id` + fi + + case "$hw_platform" in + "MTP" | "Surf" | "RCM" ) + # Start Host based Touch processing + case "$platform_subtype_id" in + "0" | "1") + start_hbtp + ;; + esac + ;; + esac + + echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled + configure_memory_parameters ;; esac @@ -2890,6 +3941,9 @@ case "$target" in echo 0-3 > /dev/cpuset/background/cpus echo 0-3 > /dev/cpuset/system-background/cpus echo 0 > /proc/sys/kernel/sched_boost + + # Set Memory parameters + configure_memory_parameters ;; esac @@ -2949,15 +4003,6 @@ case "$target" in echo 1 > /sys/devices/system/cpu/cpu3/online echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled - # Tune core control - echo 2 > /sys/devices/system/cpu/cpu0/core_ctl/min_cpus - max_freq=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq` - min_freq=800000 - echo $((min_freq*100 / max_freq)) $((min_freq*100 / max_freq)) $((66*1000000 / max_freq)) \ - $((55*1000000 / max_freq)) > /sys/devices/system/cpu/cpu0/core_ctl/busy_up_thres - echo $((33*1000000 / max_freq)) > /sys/devices/system/cpu/cpu0/core_ctl/busy_down_thres - echo 100 > /sys/devices/system/cpu/cpu0/core_ctl/offline_delay_ms - for devfreq_gov in /sys/class/devfreq/*qcom,cpubw*/governor do echo "bw_hwmon" > $devfreq_gov @@ -2986,6 +4031,7 @@ case "$target" in # Set Memory parameters configure_memory_parameters + restorecon -R /sys/devices/system/cpu ;; esac @@ -3011,7 +4057,7 @@ chown -h system /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate chown -h system /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor chown -h system /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy -emmc_boot=`getprop ro.boot.emmc` +emmc_boot=`getprop vendor.boot.emmc` case "$emmc_boot" in "true") chown -h system /sys/devices/platform/rs300000a7.65536/force_sync @@ -3036,7 +4082,7 @@ case "$target" in start mpdecision ;; "msm8916") - setprop sys.post_boot.parsed 1 + setprop vendor.post_boot.parsed 1 if [ -f /sys/devices/soc0/soc_id ]; then soc_id=`cat /sys/devices/soc0/soc_id` @@ -3045,38 +4091,22 @@ case "$target" in fi case $soc_id in "239" | "241" | "263" | "268" | "269" | "270" | "271") - setprop ro.min_freq_0 960000 - setprop ro.min_freq_4 800000 + setprop vendor.min_freq_0 960000 + setprop vendor.min_freq_4 800000 ;; "206" | "247" | "248" | "249" | "250" | "233" | "240" | "242") - setprop ro.min_freq_0 800000 + setprop vendor.min_freq_0 800000 ;; esac ;; "msm8909") - echo 128 > /sys/block/mmcblk0/bdi/read_ahead_kb - echo 128 > /sys/block/mmcblk0/queue/read_ahead_kb - echo 128 > /sys/block/mmcblk0rpmb/bdi/read_ahead_kb - echo 128 > /sys/block/mmcblk0rpmb/queue/read_ahead_kb - setprop sys.post_boot.parsed 1 + setprop vendor.post_boot.parsed 1 ;; "msm8952") - echo 128 > /sys/block/mmcblk0/bdi/read_ahead_kb - echo 128 > /sys/block/mmcblk0/queue/read_ahead_kb - echo 128 > /sys/block/dm-0/queue/read_ahead_kb - echo 128 > /sys/block/dm-1/queue/read_ahead_kb - echo 128 > /sys/block/mmcblk0rpmb/bdi/read_ahead_kb - echo 128 > /sys/block/mmcblk0rpmb/queue/read_ahead_kb - setprop sys.post_boot.parsed 1 + setprop vendor.post_boot.parsed 1 ;; "msm8937" | "msm8953") - echo 128 > /sys/block/mmcblk0/bdi/read_ahead_kb - echo 128 > /sys/block/mmcblk0/queue/read_ahead_kb - echo 128 > /sys/block/dm-0/queue/read_ahead_kb - echo 128 > /sys/block/dm-1/queue/read_ahead_kb - echo 128 > /sys/block/mmcblk0rpmb/bdi/read_ahead_kb - echo 128 > /sys/block/mmcblk0rpmb/queue/read_ahead_kb - setprop sys.post_boot.parsed 1 + setprop vendor.post_boot.parsed 1 low_ram_enable=`getprop ro.config.low_ram` @@ -3088,8 +4118,8 @@ case "$target" in start mpdecision echo 512 > /sys/block/mmcblk0/bdi/read_ahead_kb ;; - "msm8994" | "msm8992" | "msm8996" | "msm8998" | "sdm660" | "apq8098_latv" | "sdm845") - setprop sys.post_boot.parsed 1 + "msm8994" | "msm8992" | "msm8996" | "msm8998" | "sdm660" | "apq8098_latv" | "sdm845" | "sdm710" | "msmnile" | "msmsteppe") + setprop vendor.post_boot.parsed 1 ;; "apq8084") rm /data/system/perfd/default_values @@ -3197,4 +4227,3 @@ esac misc_link=$(ls -l /dev/block/bootdevice/by-name/misc) real_path=${misc_link##*>} setprop persist.vendor.mmi.misc_dev_path $real_path - diff --git a/rootdir/bin/init.crda.sh b/rootdir/bin/init.qcom.sensors.sh index 4264789..d2eb8e1 100755 --- a/rootdir/bin/init.crda.sh +++ b/rootdir/bin/init.qcom.sensors.sh @@ -1,6 +1,5 @@ -#! /vendor/bin/sh - -# Copyright (c) 2012, The Linux Foundation. All rights reserved. +#!/vendor/bin/sh +# Copyright (c) 2015, The Linux Foundation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -27,9 +26,19 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -country=`getprop wlan.crda.country` -# crda takes input in COUNTRY environment variable -if [ $country != "" ] -then -COUNTRY="$country" /system/bin/crda -fi +# +# Function to start sensors for SSC enabled platforms +# +start_sensors() +{ + chmod -h 664 /persist/sensors/sensors_settings + chown -h -R system.system /persist/sensors + start vendor.sensors.qti + + # Only for SLPI + if [ -c /dev/msm_dsps -o -c /dev/sensors ]; then + start vendor.sensors + fi +} + +start_sensors diff --git a/rootdir/bin/init.qcom.sh b/rootdir/bin/init.qcom.sh index fc1f560..fbf8c82 100755 --- a/rootdir/bin/init.qcom.sh +++ b/rootdir/bin/init.qcom.sh @@ -28,6 +28,7 @@ # target=`getprop ro.board.platform` +low_ram=`getprop ro.config.low_ram` if [ -f /sys/devices/soc0/soc_id ]; then platformid=`cat /sys/devices/soc0/soc_id` else @@ -81,55 +82,28 @@ start_vm_bms() start_msm_irqbalance_8939() { - if [ -f /system/vendor/bin/msm_irqbalance ]; then + if [ -f /vendor/bin/msm_irqbalance ]; then case "$platformid" in - "239" | "293" | "294" | "295" | "304" | "313") + "239" | "293" | "294" | "295" | "304" | "313" |"353") start vendor.msm_irqbalance;; + "349" | "350" ) + start vendor.msm_irqbal_lb;; esac fi } -start_msm_irqbalance_8952() -{ - if [ -f /system/vendor/bin/msm_irqbalance ]; then - case "$platformid" in - "241" | "263" | "264" | "268" | "269" | "270" | "271") - start vendor.msm_irqbalance;; - esac - case "$platformid" in - "266" | "274" | "277" | "278") - start vendor.msm_irqbal_lb;; - esac - fi -} - -start_msm_irqbalance660() +start_msm_irqbalance() { if [ -f /vendor/bin/msm_irqbalance ]; then case "$platformid" in "317" | "324" | "325" | "326" | "345" | "346") start vendor.msm_irqbalance;; - "318" | "327") + "318" | "327" | "385") start vendor.msm_irqbl_sdm630;; esac fi } -start_msm_irqbalance() -{ - if [ -f /vendor/bin/msm_irqbalance ]; then - start vendor.msm_irqbalance - fi -} - -start_copying_prebuilt_qcril_db() -{ - if [ -f /vendor/radio/qcril_database/qcril.db -a ! -f /data/vendor/radio/qcril.db ]; then - cp /vendor/radio/qcril_database/qcril.db /data/vendor/radio/qcril.db - chown -h radio.radio /data/vendor/radio/qcril.db - fi -} - baseband=`getprop ro.baseband` echo 1 > /proc/sys/net/ipv6/conf/default/accept_ra_defrtr @@ -226,7 +200,7 @@ case "$target" in esac ;; esac - start_msm_irqbalance660 + start_msm_irqbalance ;; "apq8084") platformvalue=`cat /sys/devices/soc0/hw_platform` @@ -279,7 +253,7 @@ case "$target" in ;; esac ;; - "msm8994" | "msm8992" | "msm8998" | "apq8098_latv" | "sdm845") + "msm8994" | "msm8992" | "msm8998" | "apq8098_latv" | "sdm845" | "sdm710" | "qcs605" | "msmnile" | "talos") start_msm_irqbalance ;; "msm8996") @@ -306,60 +280,6 @@ case "$target" in "msm8909") start_vm_bms ;; - "msm8952") - start_msm_irqbalance_8952 - if [ -f /sys/devices/soc0/soc_id ]; then - soc_id=`cat /sys/devices/soc0/soc_id` - else - soc_id=`cat /sys/devices/system/soc/soc0/id` - fi - - if [ -f /sys/devices/soc0/platform_subtype_id ]; then - platform_subtype_id=`cat /sys/devices/soc0/platform_subtype_id` - fi - if [ -f /sys/devices/soc0/hw_platform ]; then - hw_platform=`cat /sys/devices/soc0/hw_platform` - fi - case "$soc_id" in - "264") - case "$hw_platform" in - "Surf") - case "$platform_subtype_id" in - "1" | "2") - setprop qemu.hw.mainkeys 0 - ;; - esac - ;; - "MTP") - case "$platform_subtype_id" in - "3") - setprop qemu.hw.mainkeys 0 - ;; - esac - ;; - "QRD") - case "$platform_subtype_id" in - "0") - setprop qemu.hw.mainkeys 0 - ;; - esac - ;; - esac - ;; - "266" | "274" | "277" | "278") - case "$hw_platform" in - "Surf" | "RCM") - if [ $panel_xres -eq 1440 ]; then - setprop qemu.hw.mainkeys 0 - fi - ;; - "MTP" | "QRD") - setprop qemu.hw.mainkeys 0 - ;; - esac - ;; - esac - ;; "msm8937") start_msm_irqbalance_8939 if [ -f /sys/devices/soc0/soc_id ]; then @@ -373,8 +293,42 @@ case "$target" in else hw_platform=`cat /sys/devices/system/soc/soc0/hw_platform` fi + if [ "$low_ram" != "true" ]; then + case "$soc_id" in + "294" | "295" | "303" | "307" | "308" | "309" | "313" | "320" | "353" | "354" | "363" | "364") + case "$hw_platform" in + "Surf") + setprop qemu.hw.mainkeys 0 + ;; + "MTP") + setprop qemu.hw.mainkeys 0 + ;; + "RCM") + setprop qemu.hw.mainkeys 0 + ;; + "QRD") + setprop qemu.hw.mainkeys 0 + ;; + esac + ;; + esac + fi + ;; + "msm8953") + start_msm_irqbalance_8939 + if [ -f /sys/devices/soc0/soc_id ]; then + soc_id=`cat /sys/devices/soc0/soc_id` + else + soc_id=`cat /sys/devices/system/soc/soc0/id` + fi + + if [ -f /sys/devices/soc0/hw_platform ]; then + hw_platform=`cat /sys/devices/soc0/hw_platform` + else + hw_platform=`cat /sys/devices/system/soc/soc0/hw_platform` + fi case "$soc_id" in - "294" | "295" | "303" | "307" | "308" | "309" | "313" | "320") + "293" | "304" | "338" | "351" | "349" | "350" ) case "$hw_platform" in "Surf") setprop qemu.hw.mainkeys 0 @@ -392,8 +346,7 @@ case "$target" in ;; esac ;; - "msm8953") - start_msm_irqbalance_8939 + "sdm710") if [ -f /sys/devices/soc0/soc_id ]; then soc_id=`cat /sys/devices/soc0/soc_id` else @@ -406,7 +359,7 @@ case "$target" in hw_platform=`cat /sys/devices/system/soc/soc0/hw_platform` fi case "$soc_id" in - "293" | "304" | "338" | "351" ) + "336" | "337" | "347" | "360" ) case "$hw_platform" in "Surf") setprop qemu.hw.mainkeys 0 @@ -427,33 +380,28 @@ case "$target" in esac # -# Copy qcril.db if needed for RIL -# -start_copying_prebuilt_qcril_db -echo 1 > /data/vendor/radio/db_check_done - -# # Make modem config folder and copy firmware config to that folder for RIL # -if [ -f /data/vendor/radio/ver_info.txt ]; then - prev_version_info=`cat /data/vendor/radio/ver_info.txt` +if [ -f /data/vendor/modem_config/ver_info.txt ]; then + prev_version_info=`cat /data/vendor/modem_config/ver_info.txt` else prev_version_info="" fi -cur_version_info=`cat /firmware/verinfo/ver_info.txt` -if [ ! -f /firmware/verinfo/ver_info.txt -o "$prev_version_info" != "$cur_version_info" ]; then - rm -rf /data/vendor/radio/modem_config - mkdir /data/vendor/radio/modem_config - chmod 770 /data/vendor/radio/modem_config - cp -r /firmware/image/modem_pr/mcfg/configs/* /data/vendor/radio/modem_config - chown -hR radio.radio /data/vendor/radio/modem_config - cp /firmware/verinfo/ver_info.txt /data/vendor/radio/ver_info.txt - chown radio.radio /data/vendor/radio/ver_info.txt +cur_version_info=`cat /vendor/firmware_mnt/verinfo/ver_info.txt` +if [ ! -f /vendor/firmware_mnt/verinfo/ver_info.txt -o "$prev_version_info" != "$cur_version_info" ]; then + # add W for group recursively before delete + chmod g+w -R /data/vendor/modem_config/* + rm -rf /data/vendor/modem_config/* + # preserve the read only mode for all subdir and files + cp --preserve=m -dr /vendor/firmware_mnt/image/modem_pr/mcfg/configs/* /data/vendor/modem_config + cp --preserve=m -d /vendor/firmware_mnt/verinfo/ver_info.txt /data/vendor/modem_config/ + cp --preserve=m -d /vendor/firmware_mnt/image/modem_pr/mbn_ota.txt /data/vendor/modem_config/ + # the group must be root, otherwise this script could not add "W" for group recursively + chown -hR radio.root /data/vendor/modem_config/* fi -cp /firmware/image/modem_pr/mbn_ota.txt /data/vendor/radio/modem_config -chown radio.radio /data/vendor/radio/modem_config/mbn_ota.txt -echo 1 > /data/vendor/radio/copy_complete +chmod g-w /data/vendor/modem_config +setprop ro.vendor.ril.mbn_copy_completed 1 #check build variant for printk logging #current default minimum boot-time-default diff --git a/rootdir/bin/init.qcom.usb.sh b/rootdir/bin/init.qcom.usb.sh index 9bd8ca2..4a18c40 100755 --- a/rootdir/bin/init.qcom.usb.sh +++ b/rootdir/bin/init.qcom.usb.sh @@ -1,5 +1,5 @@ #!/vendor/bin/sh -# Copyright (c) 2012-2017, The Linux Foundation. All rights reserved. +# Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -27,8 +27,6 @@ # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # -chown -h root.system /sys/devices/platform/msm_hsusb/gadget/wakeup -chmod -h 220 /sys/devices/platform/msm_hsusb/gadget/wakeup # Set platform variables if [ -f /sys/devices/soc0/hw_platform ]; then @@ -43,44 +41,6 @@ else soc_machine=`cat /sys/devices/system/soc/soc0/machine` 2> /dev/null fi -# Get hardware revision -if [ -f /sys/devices/soc0/revision ]; then - soc_revision=`cat /sys/devices/soc0/revision` 2> /dev/null -else - soc_revision=`cat /sys/devices/system/soc/soc0/revision` 2> /dev/null -fi - -# -# Allow persistent usb charging disabling -# User needs to set usb charging disabled in persist.usb.chgdisabled -# -target=`getprop ro.board.platform` -usbchgdisabled=`getprop persist.usb.chgdisabled` -case "$usbchgdisabled" in - "") ;; #Do nothing here - * ) - case $target in - "msm8660") - echo "$usbchgdisabled" > /sys/module/pmic8058_charger/parameters/disabled - echo "$usbchgdisabled" > /sys/module/smb137b/parameters/disabled - ;; - "msm8960") - echo "$usbchgdisabled" > /sys/module/pm8921_charger/parameters/disabled - ;; - esac -esac - -usbcurrentlimit=`getprop persist.usb.currentlimit` -case "$usbcurrentlimit" in - "") ;; #Do nothing here - * ) - case $target in - "msm8960") - echo "$usbcurrentlimit" > /sys/module/pm8921_charger/parameters/usb_max_current - ;; - esac -esac - # # Check ESOC for external MDM # @@ -89,7 +49,7 @@ esac if [ -d /sys/bus/esoc/devices ]; then for f in /sys/bus/esoc/devices/*; do if [ -d $f ]; then - if [ `grep "^MDM" $f/esoc_name` ]; then + if [ `grep -e "^MDM" -e "^SDX" $f/esoc_name` ]; then esoc_link=`cat $f/esoc_link` break fi @@ -106,44 +66,141 @@ else soc_id=`cat /sys/devices/system/soc/soc0/id` fi +if [ -f /sys/class/android_usb/f_mass_storage/lun/nofua ]; then + echo 1 > /sys/class/android_usb/f_mass_storage/lun/nofua +fi + # -# Allow USB enumeration with default PID/VID +# Override USB default composition # -baseband=`getprop ro.baseband` +# If USB persist config not set, set default configuration +miui_release=`getprop ro.fota.oem` +miui_debuggable=`getprop ro.debuggable` +if [ "$(getprop persist.vendor.usb.config)" == "" -a \ + "$(getprop init.svc.vendor.usb-gadget-hal-1-0)" != "running" ]; then + if [ "$esoc_link" != "" ]; then + setprop persist.vendor.usb.config diag,diag_mdm,qdss,qdss_mdm,serial_cdev,dpl,rmnet,adb + else + case "$(getprop ro.baseband)" in + "apq") + setprop persist.vendor.usb.config diag,adb + ;; + *) + case "$soc_hwplatform" in + "Dragon" | "SBC") + setprop persist.vendor.usb.config diag,adb + ;; + *) + soc_machine=${soc_machine:0:3} + case "$soc_machine" in + "SDA") + setprop persist.vendor.usb.config diag,adb + ;; + *) + case "$target" in + "msm8996") + setprop persist.vendor.usb.config diag,serial_cdev,serial_tty,rmnet_ipa,mass_storage,adb + ;; + "msm8909") + setprop persist.vendor.usb.config diag,serial_smd,rmnet_qti_bam,adb + ;; + "msm8937") + if [ -d /config/usb_gadget ]; then + setprop persist.vendor.usb.config diag,serial_cdev,rmnet,dpl,adb + else + case "$soc_id" in + "313" | "320") + echo BAM2BAM_IPA > /sys/class/android_usb/android0/f_rndis_qc/rndis_transports + setprop persist.vendor.usb.config diag,serial_smd,rmnet_ipa,adb + ;; + *) + setprop persist.vendor.usb.config diag,serial_smd,rmnet_qti_bam,adb + ;; + esac + fi + ;; + "msm8953") + if [ -d /config/usb_gadget ]; then + setprop persist.vendor.usb.config diag,serial_cdev,rmnet,dpl,adb + else + setprop persist.vendor.usb.config diag,serial_smd,rmnet_ipa,adb + fi + ;; + "msm8998" | "sdm660" | "sdm636"| "apq8098_latv") + case "$miui_release" in + "") + case "$miui_debuggable" in + "1") + setprop persist.vendor.usb.config diag,serial_cdev,rmnet,adb + ;; + *) + setprop persist.vendor.usb.config diag,serial_cdev,rmnet + ;; + esac + ;; + *) + case "$miui_debuggable" in + "1") + setprop persist.vendor.usb.config adb + ;; + *) + setprop persist.vendor.usb.config none + ;; + esac + ;; + esac + ;; + "sdm845" | "sdm710") + setprop persist.vendor.usb.config diag,serial_cdev,rmnet,dpl,adb + ;; + "msmnile" | "talos") + setprop persist.vendor.usb.config diag,serial_cdev,rmnet,dpl,qdss,adb + ;; + *) + setprop persist.vendor.usb.config diag,adb + ;; + esac + ;; + esac + ;; + esac + ;; + esac + fi +fi + +# set rndis transport to BAM2BAM_IPA for 8920 and 8940 +if [ "$target" == "msm8937" ]; then + if [ ! -d /config/usb_gadget ]; then + case "$soc_id" in + "313" | "320") + echo BAM2BAM_IPA > /sys/class/android_usb/android0/f_rndis_qc/rndis_transports + ;; + *) + ;; + esac + fi +fi -echo 1 > /sys/class/android_usb/f_mass_storage/lun/nofua +# set device mode notification to USB driver for SA8150 Auto ADP +product=`getprop ro.build.product` -# set USB controller's device node -case "$target" in - "msm8996") - setprop sys.usb.controller "6a00000.dwc3" - setprop sys.usb.rndis.func.name "rndis_bam" - setprop sys.usb.rmnet.func.name "rmnet_bam" - ;; - "msm8998" | "apq8098_latv") - setprop sys.usb.controller "a800000.dwc3" - setprop sys.usb.rndis.func.name "gsi" - setprop sys.usb.rmnet.func.name "gsi" - ;; - "sdm660") - setprop sys.usb.controller "a800000.dwc3" - setprop sys.usb.rndis.func.name "rndis_bam" - setprop sys.usb.rmnet.func.name "rmnet_bam" - echo 15916 > /sys/module/usb_f_qcrndis/parameters/rndis_dl_max_xfer_size - ;; - "sdm845") - setprop sys.usb.controller "a600000.dwc3" - setprop sys.usb.rndis.func.name "gsi" - setprop sys.usb.rmnet.func.name "gsi" - ;; - *) +case "$product" in + "msmnile_au") + echo peripheral > /sys/bus/platform/devices/a600000.ssusb/mode + ;; + *) ;; esac # check configfs is mounted or not if [ -d /config/usb_gadget ]; then + # Chip-serial is used for unique MSM identification in Product string msm_serial=`cat /sys/devices/soc0/serial_number`; msm_serial_hex=`printf %08X $msm_serial` + machine_type=`cat /sys/devices/soc0/machine` + product_string="$machine_type-$soc_hwplatform _SN:$msm_serial_hex" + echo "$product_string" > /config/usb_gadget/g1/strings/0x409/product # ADB requires valid iSerialNumber; if ro.serialno is missing, use dummy serialnumber=`cat /config/usb_gadget/g1/strings/0x409/serialnumber` 2> /dev/null @@ -151,141 +208,76 @@ if [ -d /config/usb_gadget ]; then serialno=1234567 echo $serialno > /config/usb_gadget/g1/strings/0x409/serialnumber fi - - persist_comp=`getprop persist.sys.usb.config` - comp=`getprop sys.usb.config` - echo $persist_comp - echo $comp - if [ "$comp" != "$persist_comp" ]; then - echo "setting sys.usb.config" - setprop sys.usb.config $persist_comp - fi - - setprop sys.usb.configfs 1 -else - persist_comp=`getprop persist.sys.usb.config` - comp=`getprop sys.usb.config` - echo $persist_comp - echo $comp - if [ "$comp" != "$persist_comp" ]; then - echo "setting sys.usb.config" - setprop sys.usb.config $persist_comp - fi fi # -# Do target specific things -# -case "$target" in - "msm8974") -# Select USB BAM - 2.0 or 3.0 - echo ssusb > /sys/bus/platform/devices/usb_bam/enable - ;; - "apq8084") - if [ "$baseband" == "apq" ]; then - echo "msm_hsic_host" > /sys/bus/platform/drivers/xhci_msm_hsic/unbind - fi - ;; - "msm8226") - if [ -e /sys/bus/platform/drivers/msm_hsic_host ]; then - if [ ! -L /sys/bus/usb/devices/1-1 ]; then - echo msm_hsic_host > /sys/bus/platform/drivers/msm_hsic_host/unbind - fi - fi - ;; - "msm8994" | "msm8992" | "msm8996" | "msm8953") - echo BAM2BAM_IPA > /sys/class/android_usb/android0/f_rndis_qc/rndis_transports - echo 131072 > /sys/module/g_android/parameters/mtp_tx_req_len - echo 131072 > /sys/module/g_android/parameters/mtp_rx_req_len - ;; - "msm8937") - case "$soc_id" in - "313" | "320") - echo BAM2BAM_IPA > /sys/class/android_usb/android0/f_rndis_qc/rndis_transports - ;; - esac - ;; -esac - -# -# set module params for embedded rmnet devices -# -rmnetmux=`getprop persist.rmnet.mux` -case "$baseband" in - "mdm" | "dsda" | "sglte2") - case "$rmnetmux" in - "enabled") - echo 1 > /sys/module/rmnet_usb/parameters/mux_enabled - echo 8 > /sys/module/rmnet_usb/parameters/no_fwd_rmnet_links - echo 17 > /sys/module/rmnet_usb/parameters/no_rmnet_insts_per_dev - ;; - esac - echo 1 > /sys/module/rmnet_usb/parameters/rmnet_data_init - # Allow QMUX daemon to assign port open wait time - chown -h radio.radio /sys/devices/virtual/hsicctl/hsicctl0/modem_wait - ;; - "dsda2") - echo 2 > /sys/module/rmnet_usb/parameters/no_rmnet_devs - echo hsicctl,hsusbctl > /sys/module/rmnet_usb/parameters/rmnet_dev_names - case "$rmnetmux" in - "enabled") #mux is neabled on both mdms - echo 3 > /sys/module/rmnet_usb/parameters/mux_enabled - echo 8 > /sys/module/rmnet_usb/parameters/no_fwd_rmnet_links - echo 17 > write /sys/module/rmnet_usb/parameters/no_rmnet_insts_per_dev - ;; - "enabled_hsic") #mux is enabled on hsic mdm - echo 1 > /sys/module/rmnet_usb/parameters/mux_enabled - echo 8 > /sys/module/rmnet_usb/parameters/no_fwd_rmnet_links - echo 17 > /sys/module/rmnet_usb/parameters/no_rmnet_insts_per_dev - ;; - "enabled_hsusb") #mux is enabled on hsusb mdm - echo 2 > /sys/module/rmnet_usb/parameters/mux_enabled - echo 8 > /sys/module/rmnet_usb/parameters/no_fwd_rmnet_links - echo 17 > /sys/module/rmnet_usb/parameters/no_rmnet_insts_per_dev - ;; - esac - echo 1 > /sys/module/rmnet_usb/parameters/rmnet_data_init - # Allow QMUX daemon to assign port open wait time - chown -h radio.radio /sys/devices/virtual/hsicctl/hsicctl0/modem_wait - ;; -esac - -# -# Add support for exposing lun0 as cdrom in mass-storage -# -cdromname="/system/etc/cdrom_install.iso" -platformver=`cat /sys/devices/soc0/hw_platform` -case "$target" in - "msm8226" | "msm8610" | "msm8916") - case $platformver in - "QRD") - echo "mounting usbcdrom lun" - echo $cdromname > /sys/class/android_usb/android0/f_mass_storage/rom/file - chmod 0444 /sys/class/android_usb/android0/f_mass_storage/rom/file - ;; - esac - ;; -esac - -# # Initialize RNDIS Diag option. If unset, set it to 'none'. # -diag_extra=`getprop persist.sys.usb.config.extra` +diag_extra=`getprop persist.vendor.usb.config.extra` if [ "$diag_extra" == "" ]; then - setprop persist.sys.usb.config.extra none -fi - -# soc_ids for 8937 -if [ -f /sys/devices/soc0/soc_id ]; then - soc_id=`cat /sys/devices/soc0/soc_id` -else - soc_id=`cat /sys/devices/system/soc/soc0/id` + setprop persist.vendor.usb.config.extra none fi # enable rps cpus on msm8937 target -setprop sys.usb.rps_mask 0 +setprop vendor.usb.rps_mask 0 case "$soc_id" in - "294" | "295") - setprop sys.usb.rps_mask 40 + "294" | "295" | "353" | "354") + setprop vendor.usb.rps_mask 40 ;; esac + +# +# Initialize UVC conifguration. +# +if [ -d /config/usb_gadget/g1/functions/uvc.0 ]; then + cd /config/usb_gadget/g1/functions/uvc.0 + + echo 3072 > streaming_maxpacket + echo 1 > streaming_maxburst + mkdir control/header/h + ln -s control/header/h control/class/fs/ + ln -s control/header/h control/class/ss + + mkdir -p streaming/uncompressed/u/360p + echo "666666\n1000000\n5000000\n" > streaming/uncompressed/u/360p/dwFrameInterval + + mkdir -p streaming/uncompressed/u/720p + echo 1280 > streaming/uncompressed/u/720p/wWidth + echo 720 > streaming/uncompressed/u/720p/wWidth + echo 29491200 > streaming/uncompressed/u/720p/dwMinBitRate + echo 29491200 > streaming/uncompressed/u/720p/dwMaxBitRate + echo 1843200 > streaming/uncompressed/u/720p/dwMaxVideoFrameBufferSize + echo 5000000 > streaming/uncompressed/u/720p/dwDefaultFrameInterval + echo "5000000\n" > streaming/uncompressed/u/720p/dwFrameInterval + + mkdir -p streaming/mjpeg/m/360p + echo "666666\n1000000\n5000000\n" > streaming/mjpeg/m/360p/dwFrameInterval + + mkdir -p streaming/mjpeg/m/720p + echo 1280 > streaming/mjpeg/m/720p/wWidth + echo 720 > streaming/mjpeg/m/720p/wWidth + echo 29491200 > streaming/mjpeg/m/720p/dwMinBitRate + echo 29491200 > streaming/mjpeg/m/720p/dwMaxBitRate + echo 1843200 > streaming/mjpeg/m/720p/dwMaxVideoFrameBufferSize + echo 5000000 > streaming/mjpeg/m/720p/dwDefaultFrameInterval + echo "5000000\n" > streaming/mjpeg/m/720p/dwFrameInterval + + echo 0x04 > /config/usb_gadget/g1/functions/uvc.0/streaming/mjpeg/m/bmaControls + + mkdir -p streaming/h264/h/960p + echo 1920 > streaming/h264/h/960p/wWidth + echo 960 > streaming/h264/h/960p/wWidth + echo 40 > streaming/h264/h/960p/bLevelIDC + echo "333667\n" > streaming/h264/h/960p/dwFrameInterval + + mkdir -p streaming/h264/h/1920p + echo "333667\n" > streaming/h264/h/1920p/dwFrameInterval + + mkdir streaming/header/h + ln -s streaming/uncompressed/u streaming/header/h + ln -s streaming/mjpeg/m streaming/header/h + ln -s streaming/h264/h streaming/header/h + ln -s streaming/header/h streaming/class/fs/ + ln -s streaming/header/h streaming/class/hs/ + ln -s streaming/header/h streaming/class/ss/ +fi diff --git a/rootdir/bin/init.qti.qseecomd.sh b/rootdir/bin/init.qti.qseecomd.sh index f1c725c..3b027f2 100755 --- a/rootdir/bin/init.qti.qseecomd.sh +++ b/rootdir/bin/init.qti.qseecomd.sh @@ -31,5 +31,5 @@ while [ "$registered" != "true" ] do sleep 0.1 - registered="`getprop sys.listeners.registered`" + registered="`getprop vendor.sys.listeners.registered`" done diff --git a/rootdir/etc/init.msm.usb.configfs.rc b/rootdir/etc/init.msm.usb.configfs.rc index b7f5b1b..7ad3db6 100755 --- a/rootdir/etc/init.msm.usb.configfs.rc +++ b/rootdir/etc/init.msm.usb.configfs.rc @@ -1,4 +1,4 @@ -# Copyright (c) 2016-2017, The Linux Foundation. All rights reserved. +# Copyright (c) 2016-2018, The Linux Foundation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -25,11 +25,19 @@ # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -# MIUI ADD -on property:vold.decrypt=trigger_restart_framework - setprop sys.usb.config ${persist.sys.usb.config} # USB compositions +on property:sys.usb.config=none && property:sys.usb.configfs=1 + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + rm /config/usb_gadget/g1/configs/b.1/f6 + rm /config/usb_gadget/g1/configs/b.1/f7 + rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 + on property:sys.usb.config=mass_storage && property:sys.usb.configfs=1 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "msc" rm /config/usb_gadget/g1/configs/b.1/f1 @@ -40,6 +48,7 @@ on property:sys.usb.config=mass_storage && property:sys.usb.configfs=1 rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0xF000 symlink /config/usb_gadget/g1/functions/mass_storage.0 /config/usb_gadget/g1/configs/b.1/f1 @@ -59,6 +68,7 @@ on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mass_storage,adb && p rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x9015 symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1 @@ -79,6 +89,7 @@ on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,adb && property: rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x901D symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 @@ -96,6 +107,7 @@ on property:sys.usb.config=diag && property:sys.usb.configfs=1 rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x900E symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 @@ -115,11 +127,12 @@ on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,serial_cdev,rmne rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x9091 symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2 - symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.rmnet /config/usb_gadget/g1/configs/b.1/f3 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.rmnet.inst.name} /config/usb_gadget/g1/configs/b.1/f3 symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f4 write /config/usb_gadget/g1/UDC ${sys.usb.controller} setprop sys.usb.state ${sys.usb.config} @@ -134,42 +147,20 @@ on property:sys.usb.config=diag,serial_cdev,rmnet && property:sys.usb.configfs=1 rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x9092 symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2 - symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.rmnet /config/usb_gadget/g1/configs/b.1/f3 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.rmnet.inst.name} /config/usb_gadget/g1/configs/b.1/f3 write /config/usb_gadget/g1/UDC ${sys.usb.controller} setprop sys.usb.state ${sys.usb.config} -on property:sys.usb.config=diag,adb,serial_cdev,serial_nmea,rmnet && property:sys.usb.configfs=1 - start adbd - -on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,adb,serial_cdev,serial_nmea,rmnet && property:sys.usb.configfs=1 - write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_adb_dun_nmea_rmnet" - rm /config/usb_gadget/g1/configs/b.1/f1 - rm /config/usb_gadget/g1/configs/b.1/f2 - rm /config/usb_gadget/g1/configs/b.1/f3 - rm /config/usb_gadget/g1/configs/b.1/f4 - rm /config/usb_gadget/g1/configs/b.1/f5 - rm /config/usb_gadget/g1/configs/b.1/f6 - rm /config/usb_gadget/g1/configs/b.1/f7 - rm /config/usb_gadget/g1/configs/b.1/f8 - write /config/usb_gadget/g1/idVendor 0x05C6 - write /config/usb_gadget/g1/idProduct 0x9025 - symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 - symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 - symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f3 - symlink /config/usb_gadget/g1/functions/cser.nmea.1 /config/usb_gadget/g1/configs/b.1/f4 - symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.rmnet /config/usb_gadget/g1/configs/b.1/f5 - write /config/usb_gadget/g1/UDC ${sys.usb.controller} - setprop sys.usb.state ${sys.usb.config} - -on property:sys.usb.tethering=true - write /sys/class/net/rndis0/queues/rx-0/rps_cpus ${sys.usb.rps_mask} +on property:vendor.usb.tethering=true + write /sys/class/net/rndis0/queues/rx-0/rps_cpus ${vendor.usb.rps_mask} on property:sys.usb.config=rndis - setprop sys.usb.config rndis,${persist.sys.usb.config.extra} + setprop sys.usb.config rndis,${persist.vendor.usb.config.extra} on property:sys.usb.config=rndis,none && property:sys.usb.configfs=1 write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis" @@ -181,15 +172,24 @@ on property:sys.usb.config=rndis,none && property:sys.usb.configfs=1 rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x2717 write /config/usb_gadget/g1/idProduct 0xFF80 - symlink /config/usb_gadget/g1/functions/${sys.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1 write /config/usb_gadget/g1/UDC ${sys.usb.controller} write /config/usb_gadget/g1/configs/b.1/f1/wceis 1 setprop sys.usb.state rndis +on property:sys.usb.config=rndis,sec && property:sys.usb.configfs=1 + write /config/usb_gadget/g2/configs/b.1/strings/0x409/configuration "rndis" + rm /config/usb_gadget/g2/configs/b.1/f1 + write /config/usb_gadget/g2/idVendor 0x05C6 + write /config/usb_gadget/g2/idProduct 0xF00E + symlink /config/usb_gadget/g2/functions/${vendor.usb.rndis.func.name}.rndis /config/usb_gadget/g2/configs/b.1/f1 + write /config/usb_gadget/g2/UDC ${persist.vendor.usb.controller.secondary} + setprop sys.usb.state rndis on property:sys.usb.config=rndis,adb - setprop sys.usb.config rndis,${persist.sys.usb.config.extra},adb + setprop sys.usb.config rndis,${persist.vendor.usb.config.extra},adb on property:sys.usb.config=rndis,none,adb && property:sys.usb.configfs=1 start adbd @@ -204,9 +204,10 @@ on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,none,adb && pro rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x2717 write /config/usb_gadget/g1/idProduct 0xFF88 - symlink /config/usb_gadget/g1/functions/${sys.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1 symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 write /config/usb_gadget/g1/UDC ${sys.usb.controller} write /config/usb_gadget/g1/configs/b.1/f1/wceis 1 @@ -222,9 +223,10 @@ on property:sys.usb.config=rndis,diag && property:sys.usb.configfs=1 rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x902C - symlink /config/usb_gadget/g1/functions/${sys.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1 symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2 write /config/usb_gadget/g1/UDC ${sys.usb.controller} setprop sys.usb.state rndis @@ -242,9 +244,10 @@ on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,diag,adb && pro rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x902D - symlink /config/usb_gadget/g1/functions/${sys.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1 symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2 symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f3 write /config/usb_gadget/g1/UDC ${sys.usb.controller} @@ -260,9 +263,10 @@ on property:sys.usb.config=rndis,serial_cdev && property:sys.usb.configfs=1 rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x90B3 - symlink /config/usb_gadget/g1/functions/${sys.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1 symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2 write /config/usb_gadget/g1/UDC ${sys.usb.controller} setprop sys.usb.state rndis @@ -280,9 +284,10 @@ on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,serial_cdev,adb rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x90B4 - symlink /config/usb_gadget/g1/functions/${sys.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1 symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2 symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f3 write /config/usb_gadget/g1/UDC ${sys.usb.controller} @@ -298,9 +303,10 @@ on property:sys.usb.config=rndis,serial_cdev,diag && property:sys.usb.configfs=1 rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x90B5 - symlink /config/usb_gadget/g1/functions/${sys.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1 symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2 symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f3 write /config/usb_gadget/g1/UDC ${sys.usb.controller} @@ -319,9 +325,10 @@ on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,serial_cdev,dia rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x90B6 - symlink /config/usb_gadget/g1/functions/${sys.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1 symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2 symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f3 symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f4 @@ -338,6 +345,7 @@ on property:sys.usb.config=mtp,diag && property:sys.usb.configfs=1 rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x901B symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1 @@ -358,6 +366,7 @@ on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mtp,diag,adb && prope rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x903A symlink /config/usb_gadget/g1/functions/mtp.gs0 /config/usb_gadget/g1/configs/b.1/f1 @@ -376,6 +385,7 @@ on property:sys.usb.config=diag,qdss && property:sys.usb.configfs=1 rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x904A write /config/usb_gadget/g1/functions/qdss.qdss/enable_debug_inface 1 @@ -397,6 +407,7 @@ on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,qdss,adb && prop rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x9060 write /config/usb_gadget/g1/functions/qdss.qdss/enable_debug_inface 1 @@ -416,12 +427,13 @@ on property:sys.usb.config=diag,qdss,rmnet && property:sys.usb.configfs=1 rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x9083 write /config/usb_gadget/g1/functions/qdss.qdss/enable_debug_inface 1 symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f2 - symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.rmnet /config/usb_gadget/g1/configs/b.1/f3 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.rmnet.inst.name} /config/usb_gadget/g1/configs/b.1/f3 write /config/usb_gadget/g1/UDC ${sys.usb.controller} setprop sys.usb.state ${sys.usb.config} @@ -438,13 +450,14 @@ on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,qdss,rmnet,adb & rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x9084 write /config/usb_gadget/g1/functions/qdss.qdss/enable_debug_inface 1 symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f2 symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f3 - symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.rmnet /config/usb_gadget/g1/configs/b.1/f4 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.rmnet.inst.name} /config/usb_gadget/g1/configs/b.1/f4 write /config/usb_gadget/g1/UDC ${sys.usb.controller} setprop sys.usb.state ${sys.usb.config} @@ -458,10 +471,11 @@ on property:sys.usb.config=rndis,diag,qdss && property:sys.usb.configfs=1 rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x9081 write /config/usb_gadget/g1/functions/qdss.qdss/enable_debug_inface 1 - symlink /config/usb_gadget/g1/functions/${sys.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1 symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2 symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f3 write /config/usb_gadget/g1/UDC ${sys.usb.controller} @@ -480,10 +494,11 @@ on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,diag,qdss,adb & rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x9082 write /config/usb_gadget/g1/functions/qdss.qdss/enable_debug_inface 1 - symlink /config/usb_gadget/g1/functions/${sys.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1 symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2 symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f3 symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f4 @@ -500,6 +515,7 @@ on property:sys.usb.config=ncm && property:sys.usb.configfs=1 rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0xA4A1 symlink /config/usb_gadget/g1/functions/ncm.0 /config/usb_gadget/g1/configs/b.1/f1 @@ -519,6 +535,7 @@ on property:sys.usb.ffs.ready=1 && property:sys.usb.config=ncm,adb && property:s rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x908C symlink /config/usb_gadget/g1/functions/ncm.0 /config/usb_gadget/g1/configs/b.1/f1 @@ -536,6 +553,7 @@ on property:sys.usb.config=diag,serial_cdev && property:sys.usb.configfs=1 rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x9004 symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 @@ -556,6 +574,7 @@ on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,adb,serial_cdev rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x901f symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 @@ -574,12 +593,13 @@ on property:sys.usb.config=diag,serial_cdev,rmnet,dpl && property:sys.usb.config rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x90b7 symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2 - symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.rmnet /config/usb_gadget/g1/configs/b.1/f3 - symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.dpl /config/usb_gadget/g1/configs/b.1/f4 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.rmnet.inst.name} /config/usb_gadget/g1/configs/b.1/f3 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.dpl.inst.name} /config/usb_gadget/g1/configs/b.1/f4 write /config/usb_gadget/g1/UDC ${sys.usb.controller} setprop sys.usb.state ${sys.usb.config} @@ -596,12 +616,13 @@ on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,serial_cdev,rmne rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x90b8 symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2 - symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.rmnet /config/usb_gadget/g1/configs/b.1/f3 - symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.dpl /config/usb_gadget/g1/configs/b.1/f4 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.rmnet.inst.name} /config/usb_gadget/g1/configs/b.1/f3 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.dpl.inst.name} /config/usb_gadget/g1/configs/b.1/f4 symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f5 write /config/usb_gadget/g1/UDC ${sys.usb.controller} setprop sys.usb.state ${sys.usb.config} @@ -616,11 +637,12 @@ on property:sys.usb.config=rndis,diag,dpl && property:sys.usb.configfs=1 rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x90bf - symlink /config/usb_gadget/g1/functions/gsi.rndis /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1 symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2 - symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.dpl /config/usb_gadget/g1/configs/b.1/f3 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.dpl.inst.name} /config/usb_gadget/g1/configs/b.1/f3 write /config/usb_gadget/g1/UDC ${sys.usb.controller} setprop sys.usb.state rndis @@ -637,11 +659,12 @@ on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,diag,dpl,adb && rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x90c0 - symlink /config/usb_gadget/g1/functions/gsi.rndis /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1 symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2 - symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.dpl /config/usb_gadget/g1/configs/b.1/f3 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.dpl.inst.name} /config/usb_gadget/g1/configs/b.1/f3 symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f4 write /config/usb_gadget/g1/UDC ${sys.usb.controller} setprop sys.usb.state rndis,adb @@ -656,6 +679,7 @@ on property:sys.usb.config=ccid && property:sys.usb.configfs=1 rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x90CE symlink /config/usb_gadget/g1/functions/ccid.ccid /config/usb_gadget/g1/configs/b.1/f1 @@ -675,6 +699,7 @@ on property:sys.usb.ffs.ready=1 && property:sys.usb.config=ccid,adb && property: rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x90CF symlink /config/usb_gadget/g1/functions/ccid.ccid /config/usb_gadget/g1/configs/b.1/f1 @@ -692,6 +717,7 @@ on property:sys.usb.config=ccid,diag && property:sys.usb.configfs=1 rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x90D0 symlink /config/usb_gadget/g1/functions/ccid.ccid /config/usb_gadget/g1/configs/b.1/f1 @@ -712,6 +738,7 @@ on property:sys.usb.ffs.ready=1 && property:sys.usb.config=ccid,diag,adb && prop rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x90D1 symlink /config/usb_gadget/g1/functions/ccid.ccid /config/usb_gadget/g1/configs/b.1/f1 @@ -730,11 +757,12 @@ on property:sys.usb.config=diag,serial_cdev,rmnet,ccid && property:sys.usb.confi rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x90D2 symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2 - symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.rmnet /config/usb_gadget/g1/configs/b.1/f3 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.rmnet.inst.name} /config/usb_gadget/g1/configs/b.1/f3 symlink /config/usb_gadget/g1/functions/ccid.ccid /config/usb_gadget/g1/configs/b.1/f4 write /config/usb_gadget/g1/UDC ${sys.usb.controller} setprop sys.usb.state ${sys.usb.config} @@ -752,11 +780,12 @@ on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,serial_cdev,rmne rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x90D3 symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2 - symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.rmnet /config/usb_gadget/g1/configs/b.1/f3 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.rmnet.inst.name} /config/usb_gadget/g1/configs/b.1/f3 symlink /config/usb_gadget/g1/functions/ccid.ccid /config/usb_gadget/g1/configs/b.1/f4 symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f5 write /config/usb_gadget/g1/UDC ${sys.usb.controller} @@ -772,6 +801,7 @@ on property:sys.usb.config=diag,diag_mdm,qdss,qdss_mdm,serial_cdev,serial_cdev_m rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x90D7 symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 @@ -780,7 +810,7 @@ on property:sys.usb.config=diag,diag_mdm,qdss,qdss_mdm,serial_cdev,serial_cdev_m symlink /config/usb_gadget/g1/functions/qdss.qdss_mdm /config/usb_gadget/g1/configs/b.1/f4 symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f5 symlink /config/usb_gadget/g1/functions/cser.dun.2 /config/usb_gadget/g1/configs/b.1/f6 - symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.rmnet /config/usb_gadget/g1/configs/b.1/f7 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.rmnet.inst.name} /config/usb_gadget/g1/configs/b.1/f7 write /config/usb_gadget/g1/UDC ${sys.usb.controller} setprop sys.usb.state ${sys.usb.config} @@ -797,6 +827,7 @@ on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,diag_mdm,qdss,qd rm /config/usb_gadget/g1/configs/b.1/f6 rm /config/usb_gadget/g1/configs/b.1/f7 rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 write /config/usb_gadget/g1/idVendor 0x05C6 write /config/usb_gadget/g1/idProduct 0x90D8 symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 @@ -805,11 +836,331 @@ on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,diag_mdm,qdss,qd symlink /config/usb_gadget/g1/functions/qdss.qdss_mdm /config/usb_gadget/g1/configs/b.1/f4 symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f5 symlink /config/usb_gadget/g1/functions/cser.dun.2 /config/usb_gadget/g1/configs/b.1/f6 - symlink /config/usb_gadget/g1/functions/${sys.usb.rmnet.func.name}.rmnet /config/usb_gadget/g1/configs/b.1/f7 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.rmnet.inst.name} /config/usb_gadget/g1/configs/b.1/f7 + symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f8 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,diag_mdm,qdss,qdss_mdm,serial_cdev,serial_cdev_mdm,dpl,rmnet && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_diag_mdm,qdss_qdss_mdm_dun_dun_mdm_dpl_rmnet" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + rm /config/usb_gadget/g1/configs/b.1/f6 + rm /config/usb_gadget/g1/configs/b.1/f7 + rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x90DD + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/diag.diag_mdm /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f3 + symlink /config/usb_gadget/g1/functions/qdss.qdss_mdm /config/usb_gadget/g1/configs/b.1/f4 + symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f5 + symlink /config/usb_gadget/g1/functions/cser.dun.2 /config/usb_gadget/g1/configs/b.1/f6 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.dpl.inst.name} /config/usb_gadget/g1/configs/b.1/f7 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.rmnet.inst.name} /config/usb_gadget/g1/configs/b.1/f8 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,diag_mdm,qdss,qdss_mdm,serial_cdev,serial_cdev_mdm,dpl,rmnet,adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,diag_mdm,qdss,qdss_mdm,serial_cdev,serial_cdev_mdm,dpl,rmnet,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_diag_mdm,qdss_qdss_mdm_dun_dun_mdm_dpl_rmnet_adb" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + rm /config/usb_gadget/g1/configs/b.1/f6 + rm /config/usb_gadget/g1/configs/b.1/f7 + rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x90DE + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/diag.diag_mdm /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f3 + symlink /config/usb_gadget/g1/functions/qdss.qdss_mdm /config/usb_gadget/g1/configs/b.1/f4 + symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f5 + symlink /config/usb_gadget/g1/functions/cser.dun.2 /config/usb_gadget/g1/configs/b.1/f6 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.dpl.inst.name} /config/usb_gadget/g1/configs/b.1/f7 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.rmnet.inst.name} /config/usb_gadget/g1/configs/b.1/f8 + symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f9 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,serial_cdev,rmnet,dpl,qdss && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_dun_rmnet_dpl_qdss" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + rm /config/usb_gadget/g1/configs/b.1/f6 + rm /config/usb_gadget/g1/configs/b.1/f7 + rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x90DC + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.rmnet.inst.name} /config/usb_gadget/g1/configs/b.1/f3 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.dpl.inst.name} /config/usb_gadget/g1/configs/b.1/f4 + symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f5 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,serial_cdev,rmnet,dpl,qdss,adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,serial_cdev,rmnet,dpl,qdss,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_dun_rmnet_dpl_qdss_adb" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + rm /config/usb_gadget/g1/configs/b.1/f6 + rm /config/usb_gadget/g1/configs/b.1/f7 + rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x90DB + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.rmnet.inst.name} /config/usb_gadget/g1/configs/b.1/f3 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.dpl.inst.name} /config/usb_gadget/g1/configs/b.1/f4 + symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f5 + symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f6 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,uac2,adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,uac2,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_uac2_adb" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + rm /config/usb_gadget/g1/configs/b.1/f6 + rm /config/usb_gadget/g1/configs/b.1/f7 + rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x90CA + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/uac2.0 /config/usb_gadget/g1/configs/b.1/f3 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,uac2 && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_uac2" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + rm /config/usb_gadget/g1/configs/b.1/f6 + rm /config/usb_gadget/g1/configs/b.1/f7 + rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x901C + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/uac2.0 /config/usb_gadget/g1/configs/b.1/f2 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,uvc,adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,uvc,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_uvc_adb" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + rm /config/usb_gadget/g1/configs/b.1/f6 + rm /config/usb_gadget/g1/configs/b.1/f7 + rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x90CB + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/uvc.0 /config/usb_gadget/g1/configs/b.1/f3 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,uvc && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_uvc" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + rm /config/usb_gadget/g1/configs/b.1/f6 + rm /config/usb_gadget/g1/configs/b.1/f7 + rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x90DF + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/uvc.0 /config/usb_gadget/g1/configs/b.1/f2 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,uac2,uvc,adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,uac2,uvc,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_uac2_uvc_adb" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + rm /config/usb_gadget/g1/configs/b.1/f6 + rm /config/usb_gadget/g1/configs/b.1/f7 + rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x90CC + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/uac2.0 /config/usb_gadget/g1/configs/b.1/f3 + symlink /config/usb_gadget/g1/functions/uvc.0 /config/usb_gadget/g1/configs/b.1/f4 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,uac2,uvc && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_uac2_uvc" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + rm /config/usb_gadget/g1/configs/b.1/f6 + rm /config/usb_gadget/g1/configs/b.1/f7 + rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x90E0 + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/uac2.0 /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/uvc.0 /config/usb_gadget/g1/configs/b.1/f3 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,diag_mdm,qdss,qdss_mdm,serial_cdev,dpl,rmnet && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_diag_mdm_qdss_qdss_mdm_dun_dpl_rmnet" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + rm /config/usb_gadget/g1/configs/b.1/f6 + rm /config/usb_gadget/g1/configs/b.1/f7 + rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x90E4 + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/diag.diag_mdm /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f3 + symlink /config/usb_gadget/g1/functions/qdss.qdss_mdm /config/usb_gadget/g1/configs/b.1/f4 + symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f5 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.dpl.inst.name} /config/usb_gadget/g1/configs/b.1/f6 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.rmnet.inst.name} /config/usb_gadget/g1/configs/b.1/f7 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state ${sys.usb.config} + +on property:sys.usb.config=diag,diag_mdm,qdss,qdss_mdm,serial_cdev,dpl,rmnet,adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,diag_mdm,qdss,qdss_mdm,serial_cdev,dpl,rmnet,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_diag_mdm_qdss_qdss_mdm_dun_dpl_rmnet_adb" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + rm /config/usb_gadget/g1/configs/b.1/f6 + rm /config/usb_gadget/g1/configs/b.1/f7 + rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x90E5 + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/diag.diag_mdm /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f3 + symlink /config/usb_gadget/g1/functions/qdss.qdss_mdm /config/usb_gadget/g1/configs/b.1/f4 + symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f5 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.dpl.inst.name} /config/usb_gadget/g1/configs/b.1/f6 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.rmnet.inst.name} /config/usb_gadget/g1/configs/b.1/f7 symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f8 write /config/usb_gadget/g1/UDC ${sys.usb.controller} setprop sys.usb.state ${sys.usb.config} +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,diag,diag_mdm,qdss,qdss_mdm,serial_cdev,dpl && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_diag_diag_mdm_qdss_qdss_mdm_dun_dpl" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + rm /config/usb_gadget/g1/configs/b.1/f6 + rm /config/usb_gadget/g1/configs/b.1/f7 + rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x90E6 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/diag.diag_mdm /config/usb_gadget/g1/configs/b.1/f3 + symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f4 + symlink /config/usb_gadget/g1/functions/qdss.qdss_mdm /config/usb_gadget/g1/configs/b.1/f5 + symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f6 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.dpl.inst.name} /config/usb_gadget/g1/configs/b.1/f7 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state rndis + +on property:sys.usb.config=rndis,diag,diag_mdm,qdss,qdss_mdm,serial_cdev,dpl,adb && property:sys.usb.configfs=1 + start adbd + +on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,diag,diag_mdm,qdss,qdss_mdm,serial_cdev,dpl,adb && property:sys.usb.configfs=1 + write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_diag_diag_mdm_qdss_qdss_mdm_dun_dpl_adb" + rm /config/usb_gadget/g1/configs/b.1/f1 + rm /config/usb_gadget/g1/configs/b.1/f2 + rm /config/usb_gadget/g1/configs/b.1/f3 + rm /config/usb_gadget/g1/configs/b.1/f4 + rm /config/usb_gadget/g1/configs/b.1/f5 + rm /config/usb_gadget/g1/configs/b.1/f6 + rm /config/usb_gadget/g1/configs/b.1/f7 + rm /config/usb_gadget/g1/configs/b.1/f8 + rm /config/usb_gadget/g1/configs/b.1/f9 + write /config/usb_gadget/g1/idVendor 0x05C6 + write /config/usb_gadget/g1/idProduct 0x90E7 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rndis.func.name}.rndis /config/usb_gadget/g1/configs/b.1/f1 + symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f2 + symlink /config/usb_gadget/g1/functions/diag.diag_mdm /config/usb_gadget/g1/configs/b.1/f3 + symlink /config/usb_gadget/g1/functions/qdss.qdss /config/usb_gadget/g1/configs/b.1/f4 + symlink /config/usb_gadget/g1/functions/qdss.qdss_mdm /config/usb_gadget/g1/configs/b.1/f5 + symlink /config/usb_gadget/g1/functions/cser.dun.0 /config/usb_gadget/g1/configs/b.1/f6 + symlink /config/usb_gadget/g1/functions/${vendor.usb.rmnet.func.name}.${vendor.usb.dpl.inst.name} /config/usb_gadget/g1/configs/b.1/f7 + symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f8 + write /config/usb_gadget/g1/UDC ${sys.usb.controller} + setprop sys.usb.state rndis,adb + on property:sys.usb.config=adb && property:sys.usb.configfs=1 write /config/usb_gadget/g1/idVendor 0x2717 write /config/usb_gadget/g1/idProduct 0xFF08 @@ -861,3 +1212,15 @@ on property:sys.usb.config=midi && property:sys.usb.configfs=1 on property:sys.usb.config=midi,adb && property:sys.usb.configfs=1 write /config/usb_gadget/g1/idVendor 0x18d1 write /config/usb_gadget/g1/idProduct 0x4ee9 + +on property:vendor.usb.eud=1 + write /config/usb_gadget/g1/configs/b.1/MaxPower 1 + write /sys/module/eud/parameters/enable 1 + write /sys/kernel/debug/pmic-votable/USB_ICL/force_active 1 + write /sys/kernel/debug/pmic-votable/USB_ICL/force_val 500 + +on property:vendor.usb.eud=0 + write /sys/kernel/debug/pmic-votable/USB_ICL/force_active 0 + write /sys/kernel/debug/pmic-votable/USB_ICL/force_val 0 + write /config/usb_gadget/g1/configs/b.1/MaxPower 0 + write /sys/module/eud/parameters/enable 0 diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc index a6949dd..6fe45f6 100755 --- a/rootdir/etc/init.qcom.rc +++ b/rootdir/etc/init.qcom.rc @@ -32,8 +32,22 @@ import /vendor/etc/init/hw/init.target.rc on early-init mount debugfs debugfs /sys/kernel/debug chmod 0755 /sys/kernel/debug + + # create symlink for vendor mount points + symlink /vendor/firmware_mnt /firmware + symlink /vendor/bt_firmware /bt_firmware + symlink /vendor/dsp /dsp + + # Change ownership of hw_recovery related nodes + chown system graphics /sys/kernel/debug/dri/0/debug/dump + chown system graphics /sys/kernel/debug/dri/0/debug/recovery_reg + chown system graphics /sys/kernel/debug/dri/0/debug/recovery_dbgbus + chown system graphics /sys/kernel/debug/dri/0/debug/recovery_vbif_dbgbus + chown root system /dev/kmsg chmod 0620 /dev/kmsg + # Load WIGIG platform driver + exec u:r:vendor_modprobe:s0 -- /vendor/bin/modprobe -a -d /vendor/lib/modules msm_11ad_proxy on init @@ -50,7 +64,6 @@ on init on post-fs chmod 0755 /sys/kernel/debug/tracing - on early-boot # set RLIMIT_MEMLOCK to 64MB setrlimit 8 67108864 67108864 @@ -59,7 +72,25 @@ on early-boot write /sys/kernel/boot_cdsp/boot 1 write /sys/kernel/boot_slpi/boot 1 exec u:r:qti_init_shell:s0 -- /vendor/bin/init.qcom.early_boot.sh - chown root audio /sys/kernel/boot_adsp/boot + + # for backward compatibility + chown system system /persist/sensors + chown system system /persist/sensors/registry + chown system system /persist/sensors/registry/registry + chown system system /persist/sensors/registry/registry/sensors_registry + chown system system /persist/sensors/sensors_settings + chown system system /persist/sensors/registry/config + chmod 0664 /persist/sensors/sensors_settings + + chown system system /mnt/vendor/persist/sensors + chown system system /mnt/vendor/persist/sensors/sns.reg + chown system system /mnt/vendor/persist/sensors/registry + chown system system /mnt/vendor/persist/sensors/registry/registry + chown system system /mnt/vendor/persist/sensors/registry/registry/sensors_registry + chown system system /mnt/vendor/persist/sensors/sensors_settings + chown system system /mnt/vendor/persist/sensors/registry/sns_reg_config + chown system system /mnt/vendor/persist/sensors/registry/config + chmod 0664 /mnt/vendor/persist/sensors/sensors_settings on boot chown bluetooth bluetooth /sys/module/bluetooth_power/parameters/power @@ -104,12 +135,42 @@ on boot mkdir /dev/socket/qmux_gps 0770 gps gps chmod 2770 /dev/socket/qmux_gps - mkdir /vendor/mnt/persist/drm 0770 system system - mkdir /vendor/mnt/persist/bluetooth 0770 bluetooth bluetooth - mkdir /vendor/mnt/persist/misc 0770 system system - mkdir /vendor/mnt/persist/alarm 0770 system system - mkdir /vendor/mnt/persist/time 0770 system system - mkdir /vendor/mnt/persist/secnvm 0770 system system + + #define back flash and front flash + chmod 0660 /sys/android_camera/sensor + chmod 0660 /sys/class/leds/led:flash_0/brightness + chmod 0660 /sys/class/leds/led:flash_1/brightness + chmod 0660 /sys/class/leds/led:flash_2/brightness + chmod 0660 /sys/class/leds/led:torch_0/brightness + chmod 0660 /sys/class/leds/led:torch_1/brightness + chmod 0660 /sys/class/leds/led:torch_2/brightness + chmod 0660 /sys/class/leds/led:switch_0/brightness + chmod 0660 /sys/class/leds/led:switch_1/brightness + chmod 0660 /sys/class/leds/flashlight/brightness + chown system system /sys/android_camera/sensor + chown system system /sys/class/leds/led:flash_0/brightness + chown system system /sys/class/leds/led:flash_1/brightness + chown system system /sys/class/leds/led:flash_2/brightness + chown system system /sys/class/leds/led:torch_0/brightness + chown system system /sys/class/leds/led:torch_1/brightness + chown system system /sys/class/leds/led:torch_2/brightness + chown system system /sys/class/leds/led:switch_0/brightness + chown system system /sys/class/leds/led:switch_1/brightness + chown system system /sys/class/leds/flashlight/brightness + chmod 0660 /sys/class/power_supply/battery/input_suspend + chmod 0660 /sys/class/power_supply/battery/charging_enabled + chown system system /sys/class/power_supply/battery/input_suspend + chown system system /sys/class/power_supply/battery/charging_enabled + + chmod 0770 /sys/class/power_supply/battery/device/thermalcall + chown system system /sys/class/power_supply/battery/device/thermalcall + + mkdir /persist/drm 0770 system system + mkdir /persist/bluetooth 0770 bluetooth bluetooth + mkdir /persist/misc 0770 system system + mkdir /mnt/vendor/persist/alarm 0770 system system + mkdir /persist/time 0770 system system + mkdir /mnt/vendor/persist/secnvm 0770 system system #Create NETMGR daemon socket area mkdir /dev/socket/netmgr 0750 radio radio @@ -126,6 +187,10 @@ on boot #enable camera read sensors data setprop persist.camera.gyro.disable 0 + #Remove SUID bit for iproute2 ip tool + chmod 0755 /system/bin/ip + + chmod 0444 /sys/devices/platform/msm_hsusb/gadget/usb_state # Define TCP buffer sizes for various networks @@ -156,6 +221,9 @@ on boot # an ack packet comes out of order write /proc/sys/net/netfilter/nf_conntrack_tcp_be_liberal 1 + #Make MTU adjusting for sometimes cannot access to internet + write /proc/sys/net/ipv4/tcp_mtu_probing 1 + # Set the console loglevel to < KERN_INFO # Set the default message loglevel to KERN_INFO write /proc/sys/kernel/printk "6 6 1 7" @@ -188,28 +256,19 @@ on boot chown system system /sys/class/sensors/apds9930-light/poll_delay chown system system /sys/class/sensors/apds9930-proximity/enable chown system system /sys/class/sensors/apds9930-proximity/poll_delay - chown system system /sys/class/sensors/compass/enable - chown system system /sys/class/sensors/compass/poll_delay - chown system system /sys/class/sensors/bma2x2-accel/enable - chown system system /sys/class/sensors/bma2x2-accel/poll_delay - chown system system /sys/class/sensors/ltr553-light/enable - chown system system /sys/class/sensors/ltr553-light/poll_delay - chown system system /sys/class/sensors/ltr553-proximity/enable - chown system system /sys/class/sensors/ltr553-proximity/poll_delay - chown system system /sys/class/sensors/ap3426-light/enable - chown system system /sys/class/sensors/ap3426-light/poll_delay - chown system system /sys/class/sensors/ap3426-proximity/enable - chown system system /sys/class/sensors/ap3426-proximity/poll_delay # Create directory used for display - mkdir /vendor/mnt/persist/display 0770 system graphics + mkdir /persist/display 0770 system graphics # Create vpp directory - mkdir /vendor/mnt/persist/vpp 0770 media media + mkdir /mnt/vendor/persist/vpp 0770 media media - # load WIGIG platform driver - insmod /vendor/lib/modules/msm_11ad_proxy.ko + # Create hvdcp_opti directory + mkdir /mnt/vendor/persist/hvdcp_opti 0770 root system + # Create pa-cal driver directory lct-20180914 + mkdir /mnt/vendor/persist/audio 0770 root root + # msm specific files that need to be created on /data on post-fs-data mkdir /data/vendor/misc 01771 system system @@ -226,27 +285,23 @@ on post-fs-data # Create directory used by media clients mkdir /data/vendor/media 0770 mediacodec media - #Create directories for Fingerprint - mkdir /data/vendor/misc/qti_fp 0770 system system - mkdir /data/vendor/misc/qti_fp/bg_estimation 0770 system system - mkdir /data/vendor/misc/qti_fp/calib_test 0770 system system - mkdir /data/vendor/misc/qti_fp/database 0770 system system - # create QDMA dropbox mkdir /data/vendor/qdmastats 0700 system system mkdir /data/vendor/qdma 0770 system system + mkdir /dev/socket/qdma 0770 system system + chmod 2770 /dev/socket/qdma - # Create directory for TZ Apps - mkdir /data/misc/qsee 0770 system system + # Create /data/vendor/tzstorage directory for SFS listener + mkdir /data/vendor/tzstorage 0770 system system # Create directory for apps access via QTEEConnector mkdir /data/vendor/qtee 0770 system system - # Create directory for voiceprint - mkdir /data/misc/qvop 0771 system system + #Create folder of camera + mkdir /data/vendor/camera 0770 camera camera - #Create folder for mm-qcamera-daemon - mkdir /data/misc/camera 0770 camera camera + mkdir /data/media 0770 media_rw media_rw + chown media_rw media_rw /data/media #Create directory for tftp mkdir /data/vendor/tombstones 0771 system system @@ -260,15 +315,10 @@ on post-fs-data mkdir /data/vendor/wifi/sockets 0770 wifi wifi mkdir /data/vendor/wifi/hostapd 0770 wifi wifi mkdir /data/vendor/wifi/hostapd/ctrl 0770 wifi wifi - mkdir /data/vendor/wifi/wpa 0770 wifi wifi - mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi mkdir /data/vendor/wifi/wpa_supplicant 0770 wifi wifi mkdir /data/vendor/wifi/wigig_hostapd 0770 wifi wifi - mkdir /data/misc/wifi 0770 wifi wifi - mkdir /data/misc/wifi/sockets 0770 wifi wifi - mkdir /data/misc/wifi/wpa_supplicant 0770 wifi wifi - mkdir /data/misc/dhcp 0777 dhcp dhcp - chown dhcp dhcp /data/misc/dhcp + mkdir /data/vendor/wifi/wpa 0770 wifi wifi + mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi #create port-bridge log dir mkdir /data/vendor/port_bridge 0770 radio radio @@ -282,39 +332,32 @@ on post-fs-data mkdir /data/vendor/ipa 0770 radio radio chmod 0770 /data/vendor/ipa + #Create QTI dir for logs + mkdir /data/vendor/dataqti 0770 radio radio + chmod 0770 /data/vendor/dataqti + # Create the directories used by CnE subsystem mkdir /data/vendor/connectivity 0771 radio radio chown radio radio /data/vendor/connectivity - # Create the directories used by DPM subsystem - mkdir /data/dpm 0771 system system - chown system system /data/dpm - - # Create the directories used by LctDiagSendData - mkdir /data/lct_diag 0771 system system - chown system system /data/lct_diag - - mkdir /data/dpm/nsrm 0771 system system - chown system system /data/dpm/nsrm - # Create directory used by audio subsystem - mkdir /data/vendor/misc/audio 0770 audio audio + mkdir /data/vendor/audio 0770 audio audio # Create directory for audio delta files - mkdir /data/vendor/misc/audio/acdbdata 0770 media audio - mkdir /data/vendor/misc/audio/acdbdata/delta 0770 media audio - - # Create directory used by the DASH client - mkdir /data/misc/dash 0770 media audio + mkdir /data/vendor/audio/acdbdata 0770 media audio + mkdir /data/vendor/audio/acdbdata/delta 0770 media audio # Create directory for radio mkdir /data/vendor/radio 0770 system radio + # Create directory for modem_config + mkdir /data/vendor/modem_config 0570 radio root + # Mounting of persist is moved to 'on emmc-fs' and 'on fs' sections - # We chown/chmod /vendor/mnt/persist again so because mount is run as root + defaults - chown root system /vendor/mnt/persist - chmod 0771 /vendor/mnt/persist - chown system system /vendor/mnt/persist/WCNSS_qcom_wlan_nv.bin + # We chown/chmod /persist again so because mount is run as root + defaults + chown root system /persist + chmod 0771 /persist + chown system system /persist/WCNSS_qcom_wlan_nv.bin chmod 0664 /sys/devices/platform/msm_sdcc.1/polling chmod 0664 /sys/devices/platform/msm_sdcc.2/polling chmod 0664 /sys/devices/platform/msm_sdcc.3/polling @@ -346,30 +389,19 @@ on post-fs-data mkdir /data/fota 0771 chown system system /data/fota - # SSC/SLPI sensors - mkdir /vendor/mnt/persist/sensors 0775 sensors sensors - write /vendor/mnt/persist/sensors/sensors_settings 1 - chown system root /vendor/mnt/persist/sensors/sensors_settings - chmod 0664 /vendor/mnt/persist/sensors/sensors_settings - chown system system /vendor/mnt/persist/PRSensorData.txt - chmod 0600 /vendor/mnt/persist/PRSensorData.txt - #Create directory for hostapd mkdir /data/hostapd 0770 system wifi # Create /data/time folder for time-services - mkdir /data/time/ 0700 system system - - mkdir /data/vendor/audio/ 0770 media audio + mkdir /data/vendor/time/ 0700 system system - # Create a folder for audio delta files - mkdir /data/vendor/audio/acdbdata 0770 media audio - mkdir /data/vendor/audio/acdbdata/delta 0770 media audio + # Create /data/vendor/diag_logs folder for on-device-logging + #mkdir /data/vendor/diag_logs 0770 system system setprop vold.post_fs_data_done 1 #Create a folder for SRS to be able to create a usercfg file - mkdir /data/data/media 0770 media media + #mkdir /data/data/media 0770 media media #Create FM dir for patchdownloader mkdir /data/vendor/fm 0770 system system @@ -400,6 +432,8 @@ on post-fs-data chown radio radio /data/vendor/radio/db_check_done chmod 0660 /data/vendor/radio/db_check_done + copy /vendor/etc/ad_calib.cfg /data/vendor/display/ad_calib.cfg + chmod 0644 /data/vendor/display/ad_calib.cfg # qti-logkit data mkdir /data/vendor/qti-logkit/ 0771 system system mkdir /data/vendor/qti-logkit/shared-privileged/ 2770 system system @@ -422,10 +456,59 @@ on post-fs-data #Create FTM_AP dir for factory test mkdir /data/FTM_AP 0775 system system + #Create dir for TUI + mkdir /data/vendor/tui 0600 system drmrpc + + #Start move time data to /data/vendor once post-fs-data done + start vendor.move_time_data + +service nqnfcinfo /system/vendor/bin/nqnfcinfo + class late_start + group nfc + user system + oneshot + +service iop /system/vendor/bin/iop + class main + user root + group root + disabled + socket iop seqpacket 0666 root system + +service qcomsysd /system/vendor/bin/qcom-system-daemon + class main + user root + group root diag oem_2901 + disabled + +on property:persist.vendor.qcomsysd.enabled=1 + enable qcomsysd + +on property:persist.vendor.qcomsysd.enabled=0 + stop qcomsysd + service vendor.ssr_setup /system/vendor/bin/ssr_setup oneshot disabled +service vendor.ss_ramdump /system/vendor/bin/subsystem_ramdump + class main + user system + group system + disabled + +on property:ro.vendor.iocgrp.config=1 + mkdir /dev/blkio + mount cgroup none /dev/blkio blkio + chown system system /dev/blkio + chown system system /dev/blkio/tasks + chmod 0664 /dev/blkio/tasks + mkdir /dev/blkio/bg 0755 system system + chown system system /dev/blkio/bg/tasks + chmod 0664 /dev/blkio/bg/tasks + write /dev/blkio/blkio.weight 1000 + write /dev/blkio/bg/blkio.weight 100 + on property:persist.sys.ssr.enable_debug=* write /sys/module/subsystem_restart/parameters/enable_debug ${persist.sys.ssr.enable_debug} @@ -438,14 +521,15 @@ on property:persist.sys.modem_auth_timeout=* on property:persist.sys.pil_proxy_timeout=* write /sys/module/peripheral_loader/parameters/proxy_timeout_ms ${persist.sys.pil_proxy_timeout} -on property:persist.sys.ssr.restart_level=* +on property:persist.vendor.ssr.restart_level=* start vendor.ssr_setup -on property:persist.sys.ssr.enable_ramdumps=1 +on property:persist.vendor.ssr.enable_ramdumps=1 write /sys/module/subsystem_restart/parameters/enable_ramdumps 1 - mkdir /data/ramdump 770 system system + mkdir /data/vendor/ramdump_ssr 770 system system + start vendor.ss_ramdump -on property:persist.sys.ssr.enable_ramdumps=0 +on property:persist.vendor.ssr.enable_ramdumps=0 write /sys/module/subsystem_restart/parameters/enable_ramdumps 0 on property:sys.boot_completed=1 @@ -456,30 +540,54 @@ on property:sys.boot_completed=1 #WDSP FW boot sysfs node used by STHAL chown media audio /sys/kernel/wdsp0/boot chown media audio /sys/kernel/wcd_cpe0/fw_name - restorecon /sys/tp_selftest/syn_selftest_result - chown system system /sys/tp_selftest/syn_selftest_result - chmod 0777 /sys/tp_selftest/syn_selftest_result - chown system system /sys/class/ant_class/ant_state - chmod 0644 /sys/class/ant_class/ant_state + +on property:persist.vendor.radio.atfwd.start=false + stop vendor.atfwd + +on property:vendor.radio.atfwd.start=false + stop vendor.atfwd # corefile limit on property:persist.debug.trace=1 mkdir /data/core 0777 root root write /proc/sys/kernel/core_pattern "/data/core/%E.%p.%e" -on property:sys.ftmd=1 - start vendor.ftmd +on property:init.svc.wpa_supplicant=stopped + stop dhcpcd + +on property:vendor.bluetooth.dun.status=running + start vendor.bt-dun + +on property:vendor.bluetooth.dun.status=stopped + stop vendor.bt-dun on property:ro.bluetooth.ftm_enabled=true - start vendor.ftmd + start ftmd + +on property:vendor.bluetooth.startbtsnoop=true + start vendor.btsnoop + +on property:vendor.bluetooth.startbtsnoop=false + stop vendor.btsnoop + +on property:vendor.bluetooth.startbtlogger=true + start vendor.bt_logger + +on property:vendor.bluetooth.startbtlogger=false + stop vendor.bt_logger + +service qcom-c_core-sh /vendor/bin/init.qcom.class_core.sh + class core + user root + oneshot -service vendor.qcom-c_main-sh /vendor/bin/init.class_main.sh +service qcom-c_main-sh /vendor/bin/init.class_main.sh class main user root oneshot on property:vold.decrypt=trigger_restart_framework - start vendor.qcom-c_main-sh + start qcom-c_main-sh start config_bt_addr start wcnss-service @@ -491,12 +599,18 @@ service vendor.cnd /system/vendor/bin/cnd user system group system wifi inet radio wakelock net_admin -service vendor.dpmQmiMgr /system/vendor/bin/dpmQmiMgr +service dpmQmiMgr /system/vendor/bin/dpmQmiMgr class main user system group system -service vendor.irsc_util /vendor/bin/irsc_util "/vendor/etc/sec_config" +service vendor.qrtr-ns /vendor/bin/qrtr-ns -f -i 1 + class core + user system + group system net_admin + capabilities NET_BIND_SERVICE NET_ADMIN + +service irsc_util /vendor/bin/irsc_util "/vendor/etc/sec_config" class core user root oneshot @@ -511,20 +625,67 @@ service vendor.tftp_server /vendor/bin/tftp_server class core user root -service vendor.ftmd /system/bin/logwrapper /system/vendor/bin/ftmdaemon +on property:vendor.wc_transport.start_hci=true + start vendor.start_hci_filter + +on property:vendor.wc_transport.start_hci=false + stop vendor.start_hci_filter + +service vendor.start_hci_filter /system/vendor/bin/wcnss_filter + class late_start + user bluetooth + group bluetooth diag system wakelock + seclabel u:r:bluetooth:s0 + disabled + +service vendor.bt-dun /system/bin/dun-server /dev/smd7 /dev/rfcomm0 + class late_start + user bluetooth + group bluetooth net_bt_admin inet + disabled + oneshot + +service vendor.btsnoop /system/bin/btsnoop + user bluetooth + group bluetooth net_bt_admin sdcard_rw sdcard_r media_rw + class late_start + disabled + oneshot + +service vendor.bt_logger /system/bin/bt_logger + user bluetooth + group bluetooth net_bt_admin sdcard_rw sdcard_r media_rw + class late_start + disabled + oneshot + +service ftmd /system/bin/logwrapper /system/bin/ftmdaemon class late_start user root - group bluetooth net_bt_admin misc diag net_bt + group bluetooth net_bt_admin misc net_bt_stack diag net_bt disabled oneshot service vendor.port-bridge /system/vendor/bin/port-bridge class main - user radio system + user radio group radio system inet disabled oneshot +service qmiproxy /system/bin/qmiproxy + class main + user radio + group radio diag + disabled + +# QMUX must be in multiple groups to support external process connections +service vendor.qmuxd /system/vendor/bin/qmuxd + class main + user root + group radio audio bluetooth gps nfc diag + disabled + service vendor.netmgrd /system/vendor/bin/netmgrd class main disabled @@ -548,12 +709,25 @@ service vendor.dataqti /system/vendor/bin/qti group radio oem_2901 diag usb net_admin disabled -service vendor.sensors /vendor/bin/sensors.qcom +service vendor.dataadpl /system/vendor/bin/adpl + class main + user radio + group radio oem_2901 diag usb net_admin + disabled + +service vendor.sensors /vendor/bin/sscrpcd class core - user root - group root + user system + group system + disabled + +service vendor.sensors.qti /vendor/bin/sensors.qti + class core + user system + group system + disabled -on property:ro.use_data_netmgrd=false +on property:ro.vendor.use_data_netmgrd=false # netmgr not supported on specific target stop vendor.netmgrd @@ -567,7 +741,7 @@ on property:sys.sysctl.tcp_adv_win_scale=* service wpa_supplicant /vendor/bin/hw/wpa_supplicant \ -O/data/vendor/wifi/wpa/sockets -puse_p2p_group_interface=1 -dd \ - -eg@android:wpa_wlan0 + -g@android:vendor_wpa_wlan0 # we will start as root and wpa_supplicant will switch to user wifi # after setting up the capabilities required for WEXT # user wifi @@ -575,7 +749,7 @@ service wpa_supplicant /vendor/bin/hw/wpa_supplicant \ interface android.hardware.wifi.supplicant@1.0::ISupplicant default interface android.hardware.wifi.supplicant@1.1::ISupplicant default class main - socket wpa_wlan0 dgram 660 wifi wifi + socket vendor_wpa_wlan0 dgram 660 wifi wifi disabled oneshot @@ -595,40 +769,194 @@ service vendor.wigig_supplicant /vendor/bin/hw/wpa_supplicant \ oneshot # FST Manager with hostapd (softap) - all settings inside ini file -service vendor.fstman /vendor/bin/fstman -B -ddd -c /data/vendor/wifi/fstman.ini +service fstman /vendor/bin/fstman -B -ddd -c /data/vendor/wifi/fstman.ini -a 1 user wifi - group wifi net_admin net_raw + group wifi + capabilities NET_ADMIN NET_RAW class main disabled oneshot # FST Manager with supplicant - connect to supplicant socket -service vendor.fstman_wlan0 /vendor/bin/fstman -B -ddd -c /data/vendor/wifi/fstman.ini @android:wpa_wlan0 +service fstman_wlan0 /vendor/bin/fstman -B -ddd -c /data/vendor/wifi/fstman.ini \ + -a 0 @android:vendor_wpa_wlan0 user wifi - group wifi net_admin net_raw + group wifi + capabilities NET_ADMIN NET_RAW + class main + disabled + oneshot + +service wigighalsvc /vendor/bin/wigighalsvc + interface vendor.qti.hardware.wigig.supptunnel@1.0::ISuppTunnelProvider default + class hal + user system + group wifi + # needed for on-demand insmod/rmmod of wigig module + capabilities SYS_MODULE + disabled + +service wigignpt /vendor/bin/wigignpt + interface vendor.qti.hardware.wigig.netperftuner@1.0::INetPerfTuner default + class hal + socket wigignpt stream 660 system wifi + user system + group wifi + capabilities NET_ADMIN + disabled + +service dhcpcd_wlan0 /system/bin/dhcpcd -ABKLG + class late_start + disabled + oneshot + +service dhcpcd_bond0 /system/bin/dhcpcd -ABKLG + class late_start + disabled + oneshot + +service dhcpcd_p2p /system/bin/dhcpcd -ABKLG + class late_start + disabled + oneshot + +service dhcpcd_wigig0 /system/bin/dhcpcd -ABKLG + class late_start + disabled + oneshot + +service iprenew_wlan0 /system/bin/dhcpcd -n + class late_start + disabled + oneshot + +service iprenew_bond0 /system/bin/dhcpcd -n + class late_start + disabled + oneshot + +service iprenew_p2p /system/bin/dhcpcd -n + class late_start + disabled + oneshot + +service iprenew_wigig0 /system/bin/dhcpcd -n + class late_start + disabled + oneshot + +service ptt_socket_app /system/vendor/bin/ptt_socket_app -d class main + user root + group root disabled oneshot -on property:netd.fstman.start=true - start vendor.fstman +service ptt_ffbm /system/vendor/bin/ptt_socket_app -f -d + user root + group root + disabled + oneshot -on property:netd.fstman.start=false - stop vendor.fstman +service wifi_ftmd /system/vendor/bin/wifi_ftmd + user system + group system inet net_admin + socket wififtmd_server dgram 0660 system system + disabled + oneshot -on property:persist.vendor.wigig.enable=1 - insmod /vendor/lib/modules/wil6210.ko alt_ifname=1 +on property:vendor.wifi.ftmd.load=true + insmod /system/lib/modules/pronto/pronto_wlan.ko con_mode=5 -service vendor.cnss-daemon /system/vendor/bin/cnss-daemon -n -l +service vendor.cnss_diag /system/vendor/bin/cnss_diag -q -f + class late_start + user system + group system wifi inet net_admin sdcard_rw media_rw diag + disabled + oneshot + +service vendor.tcpdump /vendor/bin/tcpdump -i any -W 2 -C 2 -s 134 -w /data/vendor/wlan_logs/tcpdump.pcap + class main + user root + group root wifi + disabled + oneshot + +service sniffer /vendor/bin/tcpdump -i wlan0 -w /sdcard/wlan_logs/sniffer.pcap + class main + user root + group root + disabled + oneshot + +on property:sys.user.0.ce_available=true + start vendor.cnss_diag + start vendor.tcpdump + +service startpktlog /system/bin/iwpriv wlan0 pktlog 1 + class main + user root + group root + disabled + oneshot + +service stoppktlog /system/bin/iwpriv wlan0 pktlog 0 + class main + user root + group root + disabled + oneshot + +on property:persist.vendor.data.shs_ko_load=1 + exec u:r:vendor_modprobe:s0 -- /vendor/bin/modprobe -a -d /vendor/lib/modules rmnet_shs + +on property:persist.vendor.data.shs_ko_load=0 + exec u:r:vendor_modprobe:s0 -- /vendor/bin/modprobe -r -d /vendor/lib/modules rmnet_shs + +on property:persist.vendor.data.perf_ko_load=1 + exec u:r:vendor_modprobe:s0 -- /vendor/bin/modprobe -a -d /vendor/lib/modules rmnet_perf + +on property:persist.vendor.data.perf_ko_load=0 + exec u:r:vendor_modprobe:s0 -- /vendor/bin/modprobe -r -d /vendor/lib/modules rmnet_perf + +service cnss-daemon /system/vendor/bin/cnss-daemon -n -l class late_start user system group system inet net_admin wifi capabilities NET_ADMIN on property:sys.shutdown.requested=* - stop vendor.cnss-daemon + stop cnss-daemon + +service dhcpcd_bt-pan /system/bin/dhcpcd -BKLG + class late_start + disabled + oneshot + +service iprenew_bt-pan /system/bin/dhcpcd -n + class late_start + disabled + oneshot -service vendor.loc_launcher /system/vendor/bin/loc_launcher +service ssgqmigd /vendor/bin/ssgqmigd + class late_start + user radio + group radio gps system + socket ssgqmig seqpacket 0660 radio inet + +service ssgtzd /vendor/bin/ssgtzd + class late_start + user system + group system + socket ssgtzd stream 0660 system inet + +service mlid /vendor/bin/mlid + class late_start + user gps + group gps + socket mlid stream 0666 gps gps + +service loc_launcher /system/vendor/bin/loc_launcher class late_start user gps group gps @@ -637,22 +965,68 @@ on property:crypto.driver.load=1 insmod /system/lib/modules/qce.ko insmod /system/lib/modules/qcedev.ko -service vendor.qcom-sh /vendor/bin/init.qcom.sh +service drmdiag /system/vendor/bin/drmdiagapp + class late_start + user root + disabled + oneshot + +on property:drmdiag.load=1 + start drmdiag + +on property:drmdiag.load=0 + stop drmdiag + +service qcom-sh /vendor/bin/init.qcom.sh class late_start user root group root system radio oneshot -service vendor.qcom-post-boot /vendor/bin/init.qcom.post_boot.sh +service vendor-sensor-sh /vendor/bin/init.qcom.sensors.sh + class core + user root + oneshot + +service crashdata-sh /vendor/bin/init.qcom.crashdata.sh class late_start user root + oneshot + +service qcom-post-boot /vendor/bin/init.qcom.post_boot.sh + class late_start + user root + group root system wakelock graphics disabled oneshot +service qti-testscripts /system/bin/sh /system/etc/init.qcom.testscripts.sh + class late_start + user root + disabled + oneshot + seclabel u:r:qti-testscripts:s0 + +service wifi-sdio-on /vendor/bin/init.qcom.sdio.sh + class late_start + group wifi inet + disabled + oneshot + +service wifi-crda /vendor/bin/init.crda.sh + class late_start + user root + disabled + oneshot + on property:sys.boot_completed=1 - start vendor.qcom-post-boot + start qcom-post-boot + start qti-testscripts + +on property:ro.vendor.ril.mbn_copy_completed=1 + write /data/vendor/radio/copy_complete 1 -service vendor.qvop-daemon /vendor/bin/qvop-daemon +service qvop-daemon /vendor/bin/qvop-daemon class late_start user system group system drmrpc @@ -661,47 +1035,61 @@ service vendor.atfwd /vendor/bin/ATFWD-daemon class late_start user system group system radio - disabled -on property:persist.radio.atfwd.start=true - start vendor.atfwd +service hostapd_fst /vendor/bin/hw/hostapd -dd -g /data/vendor/wifi/hostapd/global + interface android.hardware.wifi.hostapd@1.0::IHostapd default + class main + capabilities NET_ADMIN NET_RAW + user wifi + group wifi + disabled + oneshot -service hostapd_fst /vendor/bin/hostapd -dd -g /data/vendor/wifi/hostapd/global /data/misc/wifi/hostapd.conf +service vendor.wigig_hostapd /vendor/bin/hw/hostapd -dd -j wigighostapd /data/vendor/wifi/hostapd/wigig_hostapd.conf class late_start + capabilities NET_ADMIN NET_RAW user wifi - group wifi inet keystore net_admin net_raw + group wifi inet keystore oneshot disabled -service vendor.wigig_hostapd /vendor/bin/hostapd -dd /data/vendor/wifi/wigig_hostapd.conf +service ims_regmanager /system/vendor/bin/exe-ims-regmanagerprocessnative class late_start - user wifi - group wifi inet keystore net_admin net_raw - oneshot + group net_bt_admin inet radio wifi disabled +on property:persist.ims.regmanager.mode=1 + start ims_regmanager + on property:ro.data.large_tcp_window_size=true # Adjust socket buffer to enlarge TCP receive window for high bandwidth (e.g. DO-RevB) write /proc/sys/net/ipv4/tcp_adv_win_scale 2 +service battery_monitor /system/bin/battery_monitor + user system + group system + disabled + service vendor.ril-daemon2 /vendor/bin/hw/rild -c 2 class main - socket rild2 stream 660 root radio - socket rild-debug2 stream 660 radio system user radio disabled - group radio cache inet misc audio sdcard_r sdcard_rw diag log + group radio cache inet misc audio sdcard_r sdcard_rw diag oem_2901 log capabilities BLOCK_SUSPEND NET_ADMIN NET_RAW service vendor.ril-daemon3 /vendor/bin/hw/rild -c 3 class main - socket rild3 stream 660 root radio - socket rild-debug3 stream 660 radio system user radio disabled group radio cache inet misc audio sdcard_r sdcard_rw diag oem_2901 log capabilities BLOCK_SUSPEND NET_ADMIN NET_RAW +service profiler_daemon /system/bin/profiler_daemon + class late_start + user root + group root + disabled + service charger /charger class charger group system graphics @@ -713,6 +1101,22 @@ service vendor.ssr_diag /system/vendor/bin/ssr_diag group system disabled +service hvdcp /system/bin/hvdcp + class core + user root + disabled + +on property:persist.usb.hvdcp.detect=true + start hvdcp + +on property:persist.usb.hvdcp.detect=false + stop hvdcp + +service charger_monitor /system/bin/charger_monitor + user root + group root + disabled + service qbcharger /charger -m 1 disabled oneshot @@ -721,26 +1125,27 @@ on property:sys.qbcharger.enable=true start qbcharger on property:sys.qbcharger.enable=false - stop vendor.qbcharger + stop qbcharger -service vendor.diag_mdlog_start /system/vendor/bin/diag_mdlog - class late_start - user shell - group system diag oem_2901 sdcard_rw sdcard_r media_rw - disabled - oneshot -service vendor.diag_mdlog_stop /system/vendor/bin/diag_mdlog -k - class late_start - user shell - group system diag oem_2901 sdcard_rw sdcard_r media_rw +on property:persist.vendor.mdlog.enable=true + start diag_mdlog_start +on property:persist.vendor.mdlog.enable=false + start diag_mdlog_stop + +service qlogd /system/xbin/qlogd + socket qlogd stream 0662 system system + class main disabled - oneshot +on property:persist.vendor.qlogd=1 + start qlogd +on property:persist.vendor.qlogd=0 + stop qlogd -on property:persist.sys.mdlog.enable=true - start vendor.diag_mdlog_start -on property:persist.sys.mdlog.enable=false - start vendor.diag_mdlog_stop +service vm_bms /vendor/bin/vm_bms + user root + group root + disabled service vendor.msm_irqbalance /vendor/bin/msm_irqbalance -f /system/vendor/etc/msm_irqbalance.conf class core @@ -760,35 +1165,150 @@ service vendor.msm_irqbl_sdm630 /vendor/bin/msm_irqbalance -f /system/vendor/etc group root disabled +# service for USERDEBUG +service vendor.LKCore-dbg /vendor/bin/LKCore + class late_start + oneshot + disabled + user root + group root system log diag net_raw +service sdlog /system/bin/sdlog + class late_start + user root + disabled + oneshot + +on property:sys.logd_t2.enable=1 + start sdlog + +on property:sys.logd.enable=1 + start sdlog + +on property:persist.vendor.logd.enable=1 + start sdlog +on property:persist.vendor.logd.enable=0 + setprop vendor.sdlog.run 0 + stop sdlog + +# service for USER +service vendor.LKCore-rel /vendor/bin/LKCore + class late_start + oneshot + disabled + user system + group system log diag + +service qseeproxydaemon /system/vendor/bin/qseeproxydaemon + class late_start + user system + group system + +service esepmdaemon /system/vendor/bin/esepmdaemon + class core + user system + group nfc + on charger setprop persist.sys.usb.config mass_storage load_system_props - start vendor.qcom-post-boot + start qcom-post-boot + +#add poweroffhandler +service poweroffhandler /system/vendor/bin/poweroffhandler + class core + user media + group graphics audio + disabled + oneshot on property:init.svc.surfaceflinger=restarting - stop vendor.hwcomposer-2-1 + stop vendor.hwcomposer-2-1 start vendor.hwcomposer-2-1 +on property:vendor.display.lcd_density=* + setprop ro.sf.lcd_density ${vendor.display.lcd_density} + +# Logcat dump daemon, dumps logs to logdump partition +service logdumpd /system/bin/logcat -b all -v threadtime -D -w /dev/block/bootdevice/by-name/logdump + class core + writepid /dev/cpuset/system-background/tasks + seclabel u:r:logdumpd:s0 + disabled + +# Logdumpd is enabled only for userdebug non-perf build +on property:ro.logdumpd.enabled=1 + start logdumpd + +service time_daemon /system/vendor/bin/time_daemon + class main + user root + group root + +service vendor.qdmastatsd /system/vendor/bin/qdmastatsd + class late_start + user system + group readproc system net_bw_stats radio vendor_rfs_shared + +service vendor.vppservice /vendor/bin/vppservice + class main + user media + group camera + # Set vendor-ril lib path based on Meta version on property:vendor.rild.libpath=* setprop rild.libpath ${vendor.rild.libpath} -#lct add runin -on property:persist.sys.runin=enable - write /sys/class/power_supply/battery/device/BatteryTestStatus 1 +on property:ro.vendor.radio.noril=* + setprop ro.radio.noril ${ro.vendor.radio.noril} -on property:persist.sys.runin=disable - write /sys/class/power_supply/battery/device/BatteryTestStatus 0 +service seemp_healthd /vendor/bin/seemp_healthd + class late_start + user system + group system -#lct add phone call status -on property:sys.thermal.isincall=1 - write /sys/class/power_supply/battery/device/thermalcall 1 +#ant check change permission + chown system system /sys/class/ant_class/ant_state + chmod 0644 /sys/class/ant_class/ant_state -on property:sys.thermal.isincall=0 - write /sys/class/power_supply/battery/device/thermalcall 0 +service power_off_alarm /vendor/bin/power_off_alarm + class core + group system + disabled + oneshot + +service vendor.move_time_data /system/bin/move_time_data.sh + class main + user system + group system + disabled + oneshot + +service vendor.hbtp /vendor/bin/hbtp_daemon + class main + user system + group system + capabilities SYS_NICE + disabled + +service chre /vendor/bin/chre + class late_start + user system + group system + socket chre seqpacket 0660 root system + shutdown critical service config_bt_addr /vendor/bin/btnvtool -O class core user bluetooth group bluetooth radio oneshot + +service bugreport /system/bin/dumpstate -d -p -B -z -o /data/user_de/0/com.android.shell/files/bugreports/bugreport + class main + disabled + oneshot + keycodes 114 115 116 + +#workaround for camera HAL can not read sys property +on property:sys.camera.face.unlock=* + setprop vendor.camera.face.unlock ${sys.camera.face.unlock} diff --git a/rootdir/etc/init.qcom.usb.rc b/rootdir/etc/init.qcom.usb.rc index 2355ce8..7737741 100755 --- a/rootdir/etc/init.qcom.usb.rc +++ b/rootdir/etc/init.qcom.usb.rc @@ -1,4 +1,4 @@ -# Copyright (c) 2011-2016, The Linux Foundation. All rights reserved. +# Copyright (c) 2011-2016, 2018 The Linux Foundation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -41,32 +41,29 @@ on charger mkdir /config/usb_gadget/g1/configs/b.1 0770 shell shell mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell write /config/usb_gadget/g1/os_desc/b_vendor_code 0x1 - write /config/usb_gadget/g1/os_desc/qw_sign "MSFT100" symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1 - write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "msc" - write /config/usb_gadget/g1/idVendor 0x05C6 - write /config/usb_gadget/g1/idProduct 0xF000 - symlink /config/usb_gadget/g1/functions/mass_storage.0 /config/usb_gadget/g1/configs/b.1/f1 - setprop sys.usb.controller "a800000.dwc3" - write /config/usb_gadget/g1/UDC ${sys.usb.controller} - setprop sys.usb.state ${sys.usb.config} mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000 write /sys/class/android_usb/android0/f_ffs/aliases adb - enable qcom-usb-sh - start qcom-usb-sh + enable vendor.qcom-usb-sh + start vendor.qcom-usb-sh + setprop sys.usb.config mass_storage on boot write /sys/class/android_usb/android0/iSerial ${ro.serialno} - mkdir /dev/usb-ffs 0770 shell shell - mkdir /dev/usb-ffs/adb 0770 shell shell mount configfs none /config - mkdir /config/usb_gadget/g1 0770 shell shell - mkdir /config/usb_gadget/g1/strings/0x409 0770 shell shell + mkdir /config/usb_gadget/g1 0770 + mkdir /config/usb_gadget/g2 0770 + mkdir /config/usb_gadget/g1/strings/0x409 0770 + mkdir /config/usb_gadget/g2/strings/0x409 0770 write /config/usb_gadget/g1/bcdUSB 0x0200 + write /config/usb_gadget/g2/bcdUSB 0x0200 write /config/usb_gadget/g1/os_desc/use 1 write /config/usb_gadget/g1/strings/0x409/serialnumber ${ro.serialno} + write /config/usb_gadget/g2/strings/0x409/serialnumber ${ro.serialno} write /config/usb_gadget/g1/strings/0x409/manufacturer ${ro.product.manufacturer} + write /config/usb_gadget/g2/strings/0x409/manufacturer ${ro.product.manufacturer} write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model} + write /config/usb_gadget/g2/strings/0x409/product ${ro.product.model} mkdir /config/usb_gadget/g1/functions/mass_storage.0 mkdir /config/usb_gadget/g1/functions/mtp.gs0 mkdir /config/usb_gadget/g1/functions/ptp.gs1 @@ -85,25 +82,43 @@ on boot mkdir /config/usb_gadget/g1/functions/qdss.qdss mkdir /config/usb_gadget/g1/functions/qdss.qdss_mdm mkdir /config/usb_gadget/g1/functions/rndis_bam.rndis + mkdir /config/usb_gadget/g1/functions/rndis.rndis mkdir /config/usb_gadget/g1/functions/rmnet_bam.rmnet mkdir /config/usb_gadget/g1/functions/rmnet_bam.dpl + mkdir /config/usb_gadget/g1/functions/rmnet_bam.rmnet_bam_dmux + mkdir /config/usb_gadget/g1/functions/rmnet_bam.dpl_bam_dmux mkdir /config/usb_gadget/g1/functions/ncm.0 mkdir /config/usb_gadget/g1/functions/ccid.ccid - mkdir /config/usb_gadget/g1/configs/b.1 0770 shell shell - mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 shell shell + mkdir /config/usb_gadget/g1/functions/uac2.0 + mkdir /config/usb_gadget/g1/functions/uvc.0 + mkdir /config/usb_gadget/g1/configs/b.1 0770 + mkdir /config/usb_gadget/g2/configs/b.1 0770 + mkdir /config/usb_gadget/g1/configs/b.1/strings/0x409 0770 + mkdir /config/usb_gadget/g2/configs/b.1/strings/0x409 0770 write /config/usb_gadget/g1/os_desc/b_vendor_code 0x1 write /config/usb_gadget/g1/os_desc/qw_sign "MSFT100" symlink /config/usb_gadget/g1/configs/b.1 /config/usb_gadget/g1/os_desc/b.1 - mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000 + mkdir /dev/usb-ffs 0775 shell system + mkdir /dev/usb-ffs/adb 0770 shell system + mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=1000,rmode=0770,fmode=0660 write /sys/class/android_usb/android0/f_ffs/aliases adb - enable qcom-usb-sh + setprop vendor.usb.controller ${sys.usb.controller} + +on load_persist_props_action + enable vendor.qcom-usb-sh -service qcom-usb-sh /vendor/bin/init.qcom.usb.sh +service vendor.qcom-usb-sh /vendor/bin/init.qcom.usb.sh class core user root oneshot disabled +on property:persist.vendor.usb.config=* + setprop persist.sys.usb.config ${persist.vendor.usb.config} + +on boot && property:ro.boot.usbconfigfs=true + setprop sys.usb.configfs 1 + # Following are the parameters required for usb functionality. They provide configurable options like # product_id/vendor id and allows specifying required functions: # @@ -424,7 +439,7 @@ on property:sys.usb.config=diag,serial_tty,serial_tty,rmnet_smd,mass_storage,adb write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet_smd,mass_storage write /sys/class/android_usb/android0/enable 1 start adbd - start port-bridge + start vendor.port-bridge setprop sys.usb.state ${sys.usb.config} on property:sys.usb.config=diag,acm_tty,acm_tty,rmnet_smd,mass_storage,adb && property:sys.usb.configfs=0 @@ -437,7 +452,7 @@ on property:sys.usb.config=diag,acm_tty,acm_tty,rmnet_smd,mass_storage,adb && pr write /sys/class/android_usb/android0/functions diag,adb,acm,rmnet_smd,mass_storage write /sys/class/android_usb/android0/enable 1 start adbd - start port-bridge + start vendor.port-bridge setprop sys.usb.state ${sys.usb.config} on property:sys.usb.config=diag,serial_tty,serial_tty,rmnet_smd,mass_storage && property:sys.usb.configfs=0 @@ -449,7 +464,7 @@ on property:sys.usb.config=diag,serial_tty,serial_tty,rmnet_smd,mass_storage && write /sys/class/android_usb/android0/f_serial/transports tty,tty write /sys/class/android_usb/android0/functions diag,serial,rmnet_smd,mass_storage write /sys/class/android_usb/android0/enable 1 - start port-bridge + start vendor.port-bridge setprop sys.usb.state ${sys.usb.config} on property:sys.usb.config=diag,acm_tty,acm_tty,rmnet_smd,mass_storage && property:sys.usb.configfs=0 @@ -485,7 +500,7 @@ on property:sys.usb.config=diag,acm_smd,acm_tty,rmnet_smd,mass_storage,adb && pr write /sys/class/android_usb/android0/functions diag,adb,acm,rmnet_smd,mass_storage write /sys/class/android_usb/android0/enable 1 start adbd - start port-bridge + start vendor.port-bridge setprop sys.usb.state ${sys.usb.config} on property:sys.usb.config=diag,serial_smd,serial_tty,rmnet_smd,mass_storage && property:sys.usb.configfs=0 @@ -812,30 +827,30 @@ on property:sys.usb.config=diag,diag_qsc,serial_smd,serial_tty,serial_hsuart,rmn write /sys/class/android_usb/android0/enable 1 setprop sys.usb.state ${sys.usb.config} -on property:sys.usb.tethering=true - write /sys/class/net/rndis0/queues/rx-0/rps_cpus ${sys.usb.rps_mask} +on property:vendor.usb.tethering=true + write /sys/class/net/rndis0/queues/rx-0/rps_cpus ${vendor.usb.rps_mask} on property:sys.usb.config=rndis - setprop sys.usb.config rndis,${persist.sys.usb.config.extra} + setprop sys.usb.config rndis,${persist.vendor.usb.config.extra} on property:sys.usb.config=rndis,none && property:sys.usb.configfs=0 write /sys/class/android_usb/android0/enable 0 write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 2717 - write /sys/class/android_usb/android0/idProduct FF80 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct F00E write /sys/class/android_usb/android0/f_rndis/wceis 1 write /sys/class/android_usb/android0/functions rndis write /sys/class/android_usb/android0/enable 1 setprop sys.usb.state rndis on property:sys.usb.config=rndis,adb && property:sys.usb.configfs=0 - setprop sys.usb.config rndis,${persist.sys.usb.config.extra},adb + setprop sys.usb.config rndis,${persist.vendor.usb.config.extra},adb on property:sys.usb.config=rndis,none,adb && property:sys.usb.configfs=0 write /sys/class/android_usb/android0/enable 0 write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 2717 - write /sys/class/android_usb/android0/idProduct FF88 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9024 write /sys/class/android_usb/android0/f_rndis/wceis 1 write /sys/class/android_usb/android0/functions rndis,adb write /sys/class/android_usb/android0/enable 1 @@ -1018,8 +1033,8 @@ on property:sys.usb.config=rndis,diag,diag_mdm,diag_qsc,adb && property:sys.usb. on property:sys.usb.config=ptp && property:sys.usb.configfs=0 write /sys/class/android_usb/android0/enable 0 write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 2717 - write /sys/class/android_usb/android0/idProduct FF10 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 904D write /sys/class/android_usb/android0/functions ptp write /sys/class/android_usb/android0/enable 1 setprop sys.usb.state ${sys.usb.config} @@ -1027,8 +1042,8 @@ on property:sys.usb.config=ptp && property:sys.usb.configfs=0 on property:sys.usb.config=ptp,adb && property:sys.usb.configfs=0 write /sys/class/android_usb/android0/enable 0 write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 2717 - write /sys/class/android_usb/android0/idProduct FF18 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 904E write /sys/class/android_usb/android0/functions ptp,adb write /sys/class/android_usb/android0/enable 1 start adbd @@ -1037,8 +1052,8 @@ on property:sys.usb.config=ptp,adb && property:sys.usb.configfs=0 on property:sys.usb.config=mtp && property:sys.usb.configfs=0 write /sys/class/android_usb/android0/enable 0 write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 2717 - write /sys/class/android_usb/android0/idProduct FF40 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct F003 write /sys/class/android_usb/android0/functions mtp write /sys/class/android_usb/android0/enable 1 setprop sys.usb.state ${sys.usb.config} @@ -1046,8 +1061,8 @@ on property:sys.usb.config=mtp && property:sys.usb.configfs=0 on property:sys.usb.config=mtp,adb && property:sys.usb.configfs=0 write /sys/class/android_usb/android0/enable 0 write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 2717 - write /sys/class/android_usb/android0/idProduct FF48 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct 9039 write /sys/class/android_usb/android0/functions mtp,adb write /sys/class/android_usb/android0/enable 1 start adbd @@ -1345,20 +1360,6 @@ on property:sys.usb.config=diag,diag_mdm,qdss_apq,qdss_mdm,rmnet_hsic && propert write /sys/class/android_usb/android0/enable 1 setprop sys.usb.state ${sys.usb.config} -on property:sys.usb.config=diag,diag_mdm,qdss_apq,qdss_mdm,rmnet && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90A3 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/f_rmnet/transports qti,ether - write /sys/class/android_usb/android0/f_qdss/debug_intf 0 - write /sys/class/android_usb/android0/f_qdss/transports none,bam,none,pcie - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam,qdss_pcie - write /sys/class/android_usb/android0/functions diag,qdss,rmnet - write /sys/class/android_usb/android0/enable 1 - setprop sys.usb.state ${sys.usb.config} - on property:sys.usb.config=diag,diag_mdm,qdss_apq,qdss_mdm,rmnet_hsic,adb && property:sys.usb.configfs=0 write /sys/class/android_usb/android0/enable 0 write /sys/class/android_usb/android0/iSerial ${ro.serialno} @@ -1375,22 +1376,6 @@ on property:sys.usb.config=diag,diag_mdm,qdss_apq,qdss_mdm,rmnet_hsic,adb && pro start adbd setprop sys.usb.state ${sys.usb.config} -on property:sys.usb.config=diag,diag_mdm,qdss_apq,qdss_mdm,rmnet,adb && property:sys.usb.configfs=0 - write /sys/class/android_usb/android0/enable 0 - write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 05C6 - write /sys/class/android_usb/android0/idProduct 90A2 - write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm - write /sys/class/android_usb/android0/f_rmnet/transports qti,ether - write /sys/class/android_usb/android0/f_qdss/debug_intf 0 - write /sys/class/android_usb/android0/f_qdss/transports none,bam,none,pcie - write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam,qdss_pcie - write /sys/class/android_usb/android0/functions diag,qdss,adb,rmnet - write /sys/module/dwc3/parameters/tx_fifo_resize_enable 1 - write /sys/class/android_usb/android0/enable 1 - start adbd - setprop sys.usb.state ${sys.usb.config} - on property:sys.usb.config=rndis,diag,qdss && property:sys.usb.configfs=0 write /sys/class/android_usb/android0/enable 0 write /sys/class/android_usb/android0/iSerial ${ro.serialno} @@ -1511,8 +1496,8 @@ on property:sys.usb.config=ncm,adb && property:sys.usb.configfs=0 on property:sys.usb.config=charging && property:sys.usb.configfs=0 write /sys/class/android_usb/android0/enable 0 write /sys/class/android_usb/android0/iSerial ${ro.serialno} - write /sys/class/android_usb/android0/idVendor 2717 - write /sys/class/android_usb/android0/idProduct FF00 + write /sys/class/android_usb/android0/idVendor 05C6 + write /sys/class/android_usb/android0/idProduct F006 write /sys/class/android_usb/android0/functions charging write /sys/class/android_usb/android0/enable 1 setprop sys.usb.state ${sys.usb.config} diff --git a/rootdir/etc/init.target.rc b/rootdir/etc/init.target.rc index 0602e4e..36c88d0 100755 --- a/rootdir/etc/init.target.rc +++ b/rootdir/etc/init.target.rc @@ -1,4 +1,4 @@ -# Copyright (c) 2013-2017, The Linux Foundation. All rights reserved. +# Copyright (c) 2013-2018, The Linux Foundation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are @@ -40,38 +40,17 @@ on init write /dev/stune/system-background/schedtune.colocate 0 write /dev/stune/foreground/schedtune.colocate 0 write /dev/stune/top-app/schedtune.colocate 1 - chown media media /dev/dbmdx-1 - chmod 0770 /dev/dbmdx-1 on fs wait /dev/block/platform/soc/${ro.boot.bootdevice} symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice mount_all /vendor/etc/fstab.qcom swapon_all /vendor/etc/fstab.qcom - - # Set permissions for persist partition chown root system /mnt/vendor/persist chmod 0771 /mnt/vendor/persist - mkdir /mnt/vendor/persist/bms 0700 root system mkdir /mnt/vendor/persist/data 0700 system system - mkdir /mnt/vendor/persist/hvdcp_opti 0770 root system + mkdir /mnt/vendor/persist/bms 0700 root system restorecon_recursive /mnt/vendor/persist - - # Keeping following partitions outside fstab file. As user may not have - # these partition flashed on the device. Failure to mount any partition in fstab file - # results in failure to launch late-start class. - - mkdir /vendor/mnt/persist/data 0700 system system - mkdir /vendor/mnt/persist/bms 0700 root system - restorecon_recursive /vendor/mnt/persist - mkdir /vendor/mnt/persist/wlan_bt 0777 root system - #add by Quanyu.Lee for MI-feature - #only needed on Factory version,DO NOT push to MIUI! - chmod 0644 /vendor/mnt/persist/wlan_bt/bt.mac - chmod 0644 /vendor/mnt/persist/wlan_bt/wlan.mac - chown system system /vendor/mnt/persist/wlan_bt/bt.mac - chown system system /vendor/mnt/persist/wlan_bt/wlan.mac - write /sys/kernel/boot_adsp/boot 1 chmod 0664 /sys/class/thermal/thermal_message/sconfig @@ -80,6 +59,7 @@ on fs on post-fs start vendor.qseecomd exec - system system -- /vendor/bin/init.qti.qseecomd.sh + write /dev/ipa 1 on init write /sys/module/qpnp_rtc/parameters/poweron_alarm 1 @@ -89,43 +69,34 @@ on post-fs-data mkdir /data/tombstones/lpass 0771 system system mkdir /data/tombstones/wcnss 0771 system system mkdir /data/tombstones/dsps 0771 system system - mkdir /vendor/mnt/persist/qti_fp 0700 system system +#D2SP has no hbtp feature +# mkdir /data/vendor/hbtp 0750 system system +#end mkdir /data/misc/seemp 0700 system system - mkdir /data/misc/tloc 0700 system drmrpc - mkdir /data/thermal 0771 system system - mkdir /data/thermal/config 0771 system system + mkdir /data/vendor/tloc 0700 system drmrpc on boot - start vendor.rmt_storage + start rmt_storage + start rfs_access write /dev/cpuset/top-app/cpus 0-7 write /dev/cpuset/foreground/cpus 0-7 write /dev/cpuset/foreground/boost/cpus 0-7 write /dev/cpuset/background/cpus 0-7 write /dev/cpuset/system-background/cpus 0-7 - write /dev/cpuset/restricted/cpus 0-7 - ####Regionalization config and prop files#### - chmod 0644 /vendor/mnt/persist/speccfg/spec - chmod 0644 /vendor/mnt/persist/speccfg/devicetype - chmod 0644 /vendor/mnt/persist/speccfg/mbnversion - chmod 0644 /vendor/mnt/persist/speccfg/.not_triggered - chmod 0644 /vendor/mnt/persist/speccfg/vendor_ro.prop - chmod 0644 /vendor/mnt/persist/speccfg/vendor_persist.prop - chmod 0644 /vendor/mnt/persist/speccfg/submask - chmod 0644 /vendor/mnt/persist/speccfg/partition - chown system system /vendor/mnt/persist/speccfg/spec - chown system system /vendor/mnt/persist/speccfg/devicetype - chown system system /vendor/mnt/persist/speccfg/mbnversion - chown system system /vendor/mnt/persist/speccfg/.not_triggered - chown system system /vendor/mnt/persist/speccfg/vendor_ro.prop - chown system system /vendor/mnt/persist/speccfg/vendor_persist.prop - chown system system /vendor/mnt/persist/speccfg/submask - chown system system /vendor/mnt/persist/speccfg/partition - - chmod 0660 /proc/nvt_wake_gesture - chown system system /proc/nvt_wake_gesture - - # Wifi firmware reload path - chown wifi wifi /sys/module/wlan/parameters/fwpath + chown system system /mnt/vendor/persist/sensors/sns.reg +#spk pa-cal lct-20180914 + chmod 0664 /dev/tiload_node + +#Create folder dump yuv images while debugging + mkdir /data/vendor/camera 0770 camera camera + +#USB controller configuration + setprop vendor.usb.rndis.func.name "rndis_bam" + setprop vendor.usb.rmnet.func.name "rmnet_bam" + setprop vendor.usb.rmnet.inst.name "rmnet" + setprop vendor.usb.dpl.inst.name "dpl" + write /sys/module/usb_f_qcrndis/parameters/rndis_dl_max_xfer_size 15916 + setprop sys.usb.configfs 1 #Peripheral manager service vendor.per_mgr /system/vendor/bin/pm-service @@ -140,18 +111,60 @@ service vendor.per_proxy /system/vendor/bin/pm-proxy group system disabled -on property:init.svc.per_mgr=running +on property:init.svc.vendor.per_mgr=running start vendor.per_proxy on property:sys.shutdown.requested=* stop vendor.per_proxy +#start camera server as daemon +#service qcamerasvr /system/bin/mm-qcamera-daemon +# class late_start +# user camera +# group camera system inet input graphics + +## import cne init file +#on post-fs +# export LD_PRELOAD /vendor/lib/libNimsWrap.so +# +## Allow usb charging to be disabled peristently +#on property:persist.usb.chgdisabled=1 +# write /sys/class/power_supply/battery/charging_enabled 0 +# +#on property:persist.usb.chgdisabled=0 +# write /sys/class/power_supply/battery/charging_enabled 1 +# +#service qrngd /system/bin/qrngd -f +# class main +# user root +# group root +# +#service qrngp /system/bin/qrngp +# class main +# user root +# group root +# oneshot +# disabled +# +#on property:sys.boot_completed=1 +# start qrngp +# + service vendor.qseecomd /vendor/bin/qseecomd class core user root group root -service vendor.thermal-engine /system/vendor/bin/thermal-engine +#service mpdecision /system/vendor/bin/mpdecision --avg_comp +# user root +# disabled +# +#service qosmgrd /system/bin/qosmgr /system/etc/qosmgr_rules.xml +# user system +# group system +# disabled +# +service thermal-engine /system/vendor/bin/thermal-engine class main user root socket thermal-send-client stream 0666 system system @@ -160,41 +173,206 @@ service vendor.thermal-engine /system/vendor/bin/thermal-engine socket thermal-send-rule stream 0660 system system group root -service vendor.time_daemon /system/vendor/bin/time_daemon +#service security-check1 /sbin/security_boot_check system +# class core +# oneshot +# +#service security-check2 /sbin/security_boot_check recovery +# class core +# oneshot +# +service time_daemon /system/vendor/bin/time_daemon class late_start user root group root -service vendor.adsprpcd /system/vendor/bin/adsprpcd audiopd +service adsprpcd_root /vendor/bin/adsprpcd class main user media group media +service adsprpcd /vendor/bin/adsprpcd audiopd + class main + user media + group media + +#D2SP has no hbtp feature +#service hbtp /system/vendor/bin/hbtp_daemon +# class main +# user system +# group system +# disabled +#end + +service audiod /system/vendor/bin/audiod + class late_start + user system + group system + +service vendor.cdsprpcd /vendor/bin/cdsprpcd + class main + user system + group system + disabled + +# +#service usf_tester /system/vendor/bin/usf_tester +# user system +# group system inet +# disabled +# +#service usf_epos /system/vendor/bin/usf_epos +# user system +# group system inet +# disabled +# +#service usf_gesture /system/vendor/bin/usf_gesture +# user system +# group system inet +# disabled +# + +#service usf_sync_gesture /system/vendor/bin/usf_sync_gesture +# user system +# group system inet +# disabled +# + +#service usf_p2p /system/vendor/bin/usf_p2p +# user system +# group system inet +# disabled +# +#service usf_hovering /system/vendor/bin/usf_hovering +# user system +# group system inet +# disabled +# +#service usf_proximity /system/vendor/bin/usf_proximity +# user system +# group system inet +# disabled +# +#service usf-post-boot /system/vendor/bin/sh /system/etc/usf_post_boot.sh +# class late_start +# user root +# disabled +# oneshot +# +#on property:init.svc.bootanim=stopped +# start usf-post-boot +# +# +#on boot +# insmod /system/lib/modules/adsprpc.ko +# insmod /system/lib/modules/mhi.ko +## access permission for secure touch +# chmod 0660 /sys/devices/f9966000.i2c/i2c-1/1-004a/secure_touch_enable +# chmod 0440 /sys/devices/f9966000.i2c/i2c-1/1-004a/secure_touch +# chmod 0660 /sys/devices/f9966000.i2c/i2c-1/1-0020/secure_touch_enable +# chmod 0440 /sys/devices/f9966000.i2c/i2c-1/1-0020/secure_touch +# chown system drmrpc /sys/devices/f9966000.i2c/i2c-1/1-004a/secure_touch_enable +# chown system drmrpc /sys/devices/f9966000.i2c/i2c-1/1-004a/secure_touch +# chown system drmrpc /sys/devices/f9966000.i2c/i2c-1/1-0020/secure_touch_enable +# chown system drmrpc /sys/devices/f9966000.i2c/i2c-1/1-0020/secure_touch +# +# +# +## imsdatadaemon starts with root and UID will be downgraded to SYSTEM. service vendor.imsqmidaemon /system/vendor/bin/imsqmidaemon class main user system socket ims_qmid stream 0660 system radio group radio log diag +# imsdatadaemon starts with root and UID will be downgraded to SYSTEM. service vendor.imsdatadaemon /system/vendor/bin/imsdatadaemon class main user system socket ims_datad stream 0660 system radio group system wifi radio inet log diag disabled +# +#service mdm_helper /system/bin/mdm_helper +# class core +# onrestart setprop ro.service.mdm_helper_restarted "true" +# disabled +# +#service mdm_helper_proxy /system/bin/mdm_helper_proxy +# class core +# disabled +# +#service mdm_launcher /system/bin/sh /init.mdm.sh +# class main +# oneshot +# +#service qcamerasvr /system/bin/mm-qcamera-daemon +# class late_start +# user camera +# group camera system inet input graphics +# +# Stop mdm_helper_proxy in case of shutdown +#on property:sys.shutdown.requested=* +# stop mdm_helper_proxy +# +# Stop mdm_helper_proxy on APQ target +#on property:ro.radio.noril=yes +# stop mdm_helper_proxy +# +#on property:persist.airplane.mode.pwr.svg=enabled +# setprop ro.mdm_helper_proxy_req false +# +#on property:init.svc.ril-daemon=running +# setprop ro.mdm_helper_proxy_req true +# +## Start mdm_helper_proxy +#on property:ro.mdm_helper_proxy_req=true +# start mdm_helper_proxy +# +## QCA1530 SoC core detect +#service gnss-detect /system/vendor/bin/gnss.qca1530.sh detect +# class core +# oneshot -service vendor.energy-awareness /system/vendor/bin/energy-awareness +service energy-awareness /system/vendor/bin/energy-awareness class main user system group system oneshot +service mdtpd /system/vendor/bin/mdtpd + class late_start + user root + group system radio drmrpc + service vendor.pd_mapper /system/vendor/bin/pd-mapper class core +# +## QCA1530 SoC late_start group trigger +#service gnss-init /system/vendor/bin/gnss.qca1530.sh init +# class late_start +# oneshot +# +## QCA1530 SoC Service Daemon +#service gnss-svcd /system/vendor/bin/gnss.qca1530.sh start +# class late_start +# user root +# group gps system qcom_diag diag log inet net_raw +# disabled + on property:vendor.ims.QMI_DAEMON_STATUS=1 start vendor.imsdatadaemon +#on property:vold.decrypt=trigger_restart_framework +# start cnss_diag + +service cnss_diag /system/vendor/bin/cnss_diag -q -f -t HELIUM + class main + user system + group system wifi inet sdcard_rw media_rw diag + disabled + service vendor.ims_rtp_daemon /system/vendor/bin/ims_rtp_daemon class main user system @@ -203,15 +381,13 @@ service vendor.ims_rtp_daemon /system/vendor/bin/ims_rtp_daemon service vendor.imsrcsservice /system/vendor/bin/imsrcsd class main user system - group radio diag inet log + group radio diag inet log wakelock -# add for HMI_L8866_A01-502: begin on property:vendor.ims.DATA_DAEMON_STATUS=1 restart vendor.ims_rtp_daemon - setprop persist.rcs.supported 0 -# add for HMI_L8866_A01-502: end -service vendor.ppd /system/vendor/bin/mm-pp-dpps + +service ppd /system/vendor/bin/mm-pp-dpps class late_start user system group system graphics @@ -219,91 +395,72 @@ service vendor.ppd /system/vendor/bin/mm-pp-dpps disabled on property:init.svc.surfaceflinger=stopped - stop vendor.ppd + stop ppd on property:init.svc.surfaceflinger=running - start vendor.ppd + start ppd on property:init.svc.surfaceflinger=restarting - stop vendor.ppd + stop ppd on property:init.svc.zygote=stopped - stop vendor.ppd + stop ppd on property:init.svc.zygote=running - start vendor.ppd + start ppd on property:init.svc.zygote=restarting - stop vendor.ppd + stop ppd on charger load_system_props - start vendor.qcom-post-boot + start qcom-post-boot start vendor.hvdcp_opti setprop sys.usb.configfs 1 + start power_off_alarm -service vendor.qfp-daemon /vendor/bin/qfp-daemon +# +#service nqs /system/bin/nqs +# class late_start +# socket nqs_qsb_comm stream 660 system system +# user system +# group drmrpc +# +#service adsprpcd /system/vendor/bin/adsprpcd +# class main +# user media +# group media +# +##Start picture quality tuning service +#service vqttoolservice /system/bin/vqttoolservice +# class late_start +# socket vqtss stream 0660 system system +# user system +# group system + +service seempd /system/bin/seempd class late_start user system - group system drmrpc diag input + group system sdcard_rw + socket seempdw dgram 0666 system system + +service vendor.tlocd /vendor/bin/tloc_daemon + class late_start + user system + group drmrpc gps net_raw service vendor.hvdcp_opti /system/vendor/bin/hvdcp_opti class main user root group system wakelock - + +service smcinvoked /system/bin/smcinvoked + class main + user system + group system + on property:persist.sys.display_srgb=1 - write /sys/class/graphics/fb0/msm_fb_srgb 1 + write /sys/class/graphics/fb0/msm_fb_srgb 1 on property:persist.sys.display_srgb=2 write /sys/class/graphics/fb0/msm_fb_srgb 2 - -on property:sys.dynamic_debug=1 - write /sys/kernel/debug/dynamic_debug/control "file q6afe.c +p" - write /sys/kernel/debug/dynamic_debug/control "file q6adm.c +p" - write /sys/kernel/debug/dynamic_debug/control "file msm-pcm-routing-v2.c +p" - write /sys/kernel/debug/dynamic_debug/control "file msm-dai-q6-v2.c +p" - write /sys/kernel/debug/dynamic_debug/control "file soc-core.c +p" - write /sys/kernel/debug/dynamic_debug/control "file soc-dapm.c +p" - write /sys/kernel/debug/dynamic_debug/control "file sdm660-internal.c +p" - write /sys/kernel/debug/dynamic_debug/control "file sdm660-common.c +p" - write /sys/kernel/debug/dynamic_debug/control "file msm-analog-cdc.c +p" - write /sys/kernel/debug/dynamic_debug/control "file msm-digital-cdc.c +p" - write /sys/kernel/debug/dynamic_debug/control "file wcd-mbhc-v2.c +p" - -on property:sys.dynamic_debug=0 - write /sys/kernel/debug/dynamic_debug/control "file q6afe.c -p" - write /sys/kernel/debug/dynamic_debug/control "file q6adm.c -p" - write /sys/kernel/debug/dynamic_debug/control "file msm-pcm-routing-v2.c -p" - write /sys/kernel/debug/dynamic_debug/control "file msm-dai-q6-v2.c -p" - write /sys/kernel/debug/dynamic_debug/control "file soc-core.c -p" - write /sys/kernel/debug/dynamic_debug/control "file soc-dapm.c -p" - write /sys/kernel/debug/dynamic_debug/control "file sdm660-internal.c -p" - write /sys/kernel/debug/dynamic_debug/control "file sdm660-common.c -p" - write /sys/kernel/debug/dynamic_debug/control "file msm-analog-cdc.c -p" - write /sys/kernel/debug/dynamic_debug/control "file msm-digital-cdc.c -p" - write /sys/kernel/debug/dynamic_debug/control "file wcd-mbhc-v2.c -p" - -on property:persist.sys.display_ce=4 - write /sys/class/graphics/fb0/msm_fb_ce 1 - -on property:persist.sys.display_ce=0 - write /sys/class/graphics/fb0/msm_fb_ce 2 - -on property:persist.sys.display_cabc=1 - write /sys/class/graphics/fb0/msm_fb_cabc 1 - -on property:persist.sys.display_cabc=2 - write /sys/class/graphics/fb0/msm_fb_cabc 2 - -on property:persist.sys.display_gamma=1 - write /sys/class/graphics/fb0/msm_fb_gamma 1 - -on property:persist.sys.display_gamma=2 - write /sys/class/graphics/fb0/msm_fb_gamma 2 - -on property:sys.antgpio=0 - write /sys/class/ant_class/ant_state 0 - -on property:sys.antgpio=1 - write /sys/class/ant_class/ant_state 1 diff --git a/rootdir/etc/ueventd.qcom.rc b/rootdir/etc/ueventd.qcom.rc index 5247114..dde621b 100644 --- a/rootdir/etc/ueventd.qcom.rc +++ b/rootdir/etc/ueventd.qcom.rc @@ -1,4 +1,4 @@ -# Copyright (c) 2012-2015, 2017, The Linux Foundation. All rights reserved. +# Copyright (c) 2012-2015, 2017-2018, The Linux Foundation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -25,6 +25,11 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # +# Firmware directory Path +# Below macro will be read by uevent and path will +# be added to search path for firmware loading +firmware_directories /vendor/firmware_mnt/image/ + # the DIAG device node is not world writable/readable. /dev/diag 0660 system oem_2901 @@ -48,10 +53,9 @@ /dev/ipaNatTable 0660 radio radio /dev/rmnet_ctrl 0660 usb usb /dev/dpl_ctrl 0660 usb usb -/dev/spidev7.1 0660 system system /dev/ipa_odl_ctl 0660 radio radio /dev/ipa_adpl 0660 system oem_2905 - +/dev/spidev7.1 0660 system system #permissions for CSVT /dev/smd11 0660 radio radio @@ -112,17 +116,17 @@ /dev/hsicctl14 0640 radio radio /dev/hsicctl15 0640 radio radio /dev/hsicctl16 0640 radio radio -/dev/mhi_pipe_14 0640 radio radio -/dev/mhi_pipe_16 0640 radio radio -/dev/mhi_pipe_32 0640 radio radio +/dev/mhi_*_pipe_14 0640 radio radio +/dev/mhi_*_pipe_16 0640 radio radio +/dev/mhi_*_pipe_32 0640 radio radio /dev/at_usb0 0640 radio radio /dev/at_mdm0 0640 radio radio /dev/video* 0660 system camera /dev/media* 0660 system camera /dev/v4l-subdev* 0660 system camera /dev/qseecom 0660 system drmrpc -/dev/smcinvoke 0660 system system /dev/qce 0660 system drmrpc +/dev/smcinvoke 0660 system system /dev/qsee_ipc_irq_spss 0660 system drmrpc /dev/seemplog 0660 system system /dev/pft 0660 system drmrpc @@ -130,18 +134,36 @@ /dev/sp_kernel 0660 system system /dev/sp_ssr 0660 system system /dev/sp_keymaster 0660 system system +/dev/sec_nvm_* 0660 system system /dev/cryptoapp 0660 system system +/dev/spdaemon_ssr 0660 system system /dev/gemini0 0660 system camera /dev/jpeg0 0660 system camera /dev/jpeg1 0660 system camera /dev/jpeg2 0660 system camera /dev/jpeg3 0660 system camera /dev/adsprpc-smd 0664 system system +/dev/adsprpc-smd-secure 0644 system system /dev/system_health_monitor 0644 radio system /dev/mdss_rotator 0664 system system -# QDSS +#QDSS /dev/byte-cntr 0660 system oem_2902 +# fpc fingerprint +/sys/devices/soc/soc:fpc1020* hw_reset 0660 system system +/sys/devices/soc/soc:fpc1020* irq 0660 system system +/sys/devices/soc/soc:fpc1020* wakeup_enable 0660 system system +/sys/devices/soc/soc:fpc1020* fingerdown_wait 0220 system system + +/sys/class/leds/red delay_on 0640 system system +/sys/class/leds/red delay_off 0640 system system +/sys/class/leds/red breath 0640 system system +/sys/class/leds/green delay_on 0640 system system +/sys/class/leds/green delay_off 0640 system system +/sys/class/leds/green breath 0640 system system +/sys/class/leds/blue delay_on 0640 system system +/sys/class/leds/blue delay_off 0640 system system +/sys/class/leds/blue breath 0640 system system # wlan /dev/wcnss_wlan 0660 system system @@ -157,6 +179,7 @@ /dev/msm_vidc_dec_sec 0660 system audio /dev/msm_vidc_enc 0660 system audio /dev/msm_rotator 0660 system system +/dev/hw_random 0600 root root /dev/sdsprpc-smd 0660 system system #permissions for audio @@ -210,6 +233,7 @@ /dev/tsc_ci0 0660 media media # sensors +/dev/sensors 0660 system system /sys/devices/i2c-12/12-* pollrate_ms 0664 system system /sys/devices/f9925000.i2c/i2c-0/0-* enable 0660 input system /sys/devices/f9925000.i2c/i2c-0/0-* poll_delay 0660 input system @@ -239,6 +263,10 @@ /sys/devices/soc/78b7000.i2c/i2c-3/3-004b/input/input* secure_touch_enable 0660 system drmrpc /sys/devices/soc/c179000.i2c/i2c-5/5-0020/input/input* secure_touch 0440 system drmrpc /sys/devices/soc/c179000.i2c/i2c-5/5-0020/input/input* secure_touch_enable 0660 system drmrpc +/sys/devices/platform/soc/a98000.i2c/i2c-2/2-0020/input/input* secure_touch 0440 system drmrpc +/sys/devices/platform/soc/a98000.i2c/i2c-2/2-0020/input/input* secure_touch_enable 0660 system drmrpc +/sys/devices/platform/soc/a84000.i2c/i2c-2/2-0020/input/input* secure_touch 0440 system drmrpc +/sys/devices/platform/soc/a84000.i2c/i2c-2/2-0020/input/input* secure_touch_enable 0660 system drmrpc # laser sensor access /sys/devices/virtual/input/input* enable_ps_sensor 0660 system input @@ -296,6 +324,29 @@ /dev/block/platform/soc/1da4000.ufshc/by-name/frp 0600 system system /dev/block/platform/soc/c0c4000.sdhci/by-name/frp 0600 system system /dev/block/platform/soc/1d84000.ufshc/by-name/frp 0600 system system +/dev/block/platform/soc/7c4000.sdhci/by-name/frp 0600 system system + +# This is temporary while using SD card for initial bring-up +/dev/block/platform/soc/8804000.sdhci/by-name/frp 0600 system system # Kmsg device /dev/kmsg 0620 root system + +# LED class devices +/sys/class/leds/red delay_on 0640 system system +/sys/class/leds/red delay_off 0640 system system +/sys/class/leds/red breath 0640 system system +/sys/class/leds/green delay_on 0640 system system +/sys/class/leds/green delay_off 0640 system system +/sys/class/leds/green breath 0640 system system +/sys/class/leds/blue delay_on 0640 system system +/sys/class/leds/blue delay_off 0640 system system +/sys/class/leds/blue breath 0640 system system + +# NPU device +/dev/msm_npu 0644 system system + +# USB role switch +/sys/class/dual_role_usb/* data_role 0660 system system +/sys/class/dual_role_usb/* power_role 0660 system system +/sys/class/dual_role_usb/* mode 0660 system system |