summaryrefslogtreecommitdiff
path: root/rootdir
diff options
context:
space:
mode:
authorIsaac Chen <isaacchen@isaacchen.cn>2018-07-13 10:11:03 +0800
committerIsaac Chen <isaacchen@isaacchen.cn>2018-07-13 00:01:25 +0000
commit71ad0c9e5399aba0ac3cd20f1df41c9757cd6ca5 (patch)
treef9bd698e30cdb1e8a15fbebdd48e43b8f93272d0 /rootdir
parent103f8c68ff04e04a8b6de1c97dfb520f9286b692 (diff)
wayne: Initial bringup
Change-Id: I211da5781d8c7a16199fd8a18e1b00cfc9e01944 Signed-off-by: Isaac Chen <isaacchen@isaacchen.cn>
Diffstat (limited to 'rootdir')
-rw-r--r--[-rwxr-xr-x]rootdir/Android.mk174
-rwxr-xr-xrootdir/bin/init.class_main.sh102
-rwxr-xr-xrootdir/bin/init.crda.sh35
-rwxr-xr-xrootdir/bin/init.mdm.sh34
-rwxr-xr-xrootdir/bin/init.qcom.class_core.sh216
-rwxr-xr-xrootdir/bin/init.qcom.coex.sh115
-rwxr-xr-xrootdir/bin/init.qcom.crashdata.sh48
-rwxr-xr-xrootdir/bin/init.qcom.early_boot.sh530
-rwxr-xr-xrootdir/bin/init.qcom.efs.sync.sh35
-rwxr-xr-xrootdir/bin/init.qcom.post_boot.sh3200
-rwxr-xr-xrootdir/bin/init.qcom.sdio.sh78
-rwxr-xr-xrootdir/bin/init.qcom.sensors.sh43
-rwxr-xr-xrootdir/bin/init.qcom.sh470
-rwxr-xr-xrootdir/bin/init.qcom.syspart_fixup.sh80
-rwxr-xr-xrootdir/bin/init.qcom.usb.sh291
-rwxr-xr-xrootdir/bin/init.qcom.wifi.sh505
-rwxr-xr-xrootdir/bin/init.qti.ims.sh57
-rwxr-xr-xrootdir/bin/qca6234-service.sh87
-rw-r--r--[-rwxr-xr-x]rootdir/etc/fstab.qcom9
-rwxr-xr-xrootdir/etc/init.msm.usb.configfs.rc863
-rwxr-xr-xrootdir/etc/init.qcom.rc1299
-rwxr-xr-xrootdir/etc/init.qcom.usb.rc1682
-rwxr-xr-x[-rw-r--r--]rootdir/etc/init.target.rc237
-rw-r--r--rootdir/etc/recovery.fstab42
-rw-r--r--rootdir/etc/ueventd.qcom.rc302
25 files changed, 10486 insertions, 48 deletions
diff --git a/rootdir/Android.mk b/rootdir/Android.mk
index 8b2d12a..1a5cb84 100755..100644
--- a/rootdir/Android.mk
+++ b/rootdir/Android.mk
@@ -4,17 +4,171 @@ include $(CLEAR_VARS)
# files that live under device/qcom/common/rootdir/etc/
include $(CLEAR_VARS)
-LOCAL_MODULE := init.target.rc
-LOCAL_MODULE_TAGS := optional eng
-LOCAL_MODULE_CLASS := ETC
-LOCAL_SRC_FILES := etc/init.target.rc
-LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw
+LOCAL_MODULE := init.qcom.early_boot.sh
+LOCAL_MODULE_TAGS := optional eng
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES := bin/init.qcom.early_boot.sh
+LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
include $(BUILD_PREBUILT)
include $(CLEAR_VARS)
-LOCAL_MODULE := fstab.qcom
-LOCAL_MODULE_TAGS := optional eng
-LOCAL_MODULE_CLASS := ETC
-LOCAL_SRC_FILES := etc/fstab.qcom
-LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)
+LOCAL_MODULE := init.qcom.class_core.sh
+LOCAL_MODULE_TAGS := optional eng
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES := bin/init.qcom.class_core.sh
+LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := init.qcom.coex.sh
+LOCAL_MODULE_TAGS := optional eng
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES := bin/init.qcom.coex.sh
+LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := init.qcom.crashdata.sh
+LOCAL_MODULE_TAGS := optional eng
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES := bin/init.qcom.crashdata.sh
+LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := init.qcom.efs.sync.sh
+LOCAL_MODULE_TAGS := optional eng
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES := bin/init.qcom.efs.sync.sh
+LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := init.qcom.sdio.sh
+LOCAL_MODULE_TAGS := optional eng
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES := bin/init.qcom.sdio.sh
+LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
+include $(BUILD_PREBUILT)
+
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := init.qcom.syspart_fixup.sh
+LOCAL_MODULE_TAGS := optional eng
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES := bin/init.qcom.syspart_fixup.sh
+LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := init.qcom.wifi.sh
+LOCAL_MODULE_TAGS := optional eng
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES := bin/init.qcom.wifi.sh
+LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := qca6234-service.sh
+LOCAL_MODULE_TAGS := optional eng
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES := bin/qca6234-service.sh
+LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := init.qcom.post_boot.sh
+LOCAL_MODULE_TAGS := optional eng
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES := bin/init.qcom.post_boot.sh
+LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := init.qti.ims.sh
+LOCAL_MODULE_TAGS := optional eng
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES := bin/init.qti.ims.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
+LOCAL_SRC_FILES := etc/init.qcom.rc
+LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := init.qcom.sh
+LOCAL_MODULE_TAGS := optional eng
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES := bin/init.qcom.sh
+LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := init.class_main.sh
+LOCAL_MODULE_TAGS := optional eng
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES := bin/init.class_main.sh
+LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := init.qcom.usb.rc
+LOCAL_MODULE_TAGS := optional eng
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES := etc/init.qcom.usb.rc
+LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := init.msm.usb.configfs.rc
+LOCAL_MODULE_TAGS := optional eng
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES := etc/init.msm.usb.configfs.rc
+LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := init.qcom.usb.sh
+LOCAL_MODULE_TAGS := optional eng
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES := bin/init.qcom.usb.sh
+LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES)
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := ueventd.qcom.rc
+LOCAL_MODULE_STEM := ueventd.rc
+LOCAL_MODULE_TAGS := optional eng
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES := etc/ueventd.qcom.rc
+LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)
+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.target.rc
+LOCAL_MODULE_TAGS := optional eng
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES := etc/init.target.rc
+LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)/init/hw
+include $(BUILD_PREBUILT)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := fstab.qcom
+LOCAL_MODULE_TAGS := optional eng
+LOCAL_MODULE_CLASS := ETC
+LOCAL_SRC_FILES := etc/fstab.qcom
+LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_ETC)
include $(BUILD_PREBUILT)
diff --git a/rootdir/bin/init.class_main.sh b/rootdir/bin/init.class_main.sh
new file mode 100755
index 0000000..9fce445
--- /dev/null
+++ b/rootdir/bin/init.class_main.sh
@@ -0,0 +1,102 @@
+#! /vendor/bin/sh
+
+# Copyright (c) 2013-2014, 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 The 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.
+#
+
+#
+# start ril-daemon only for targets on which radio is present
+#
+baseband=`getprop ro.baseband`
+sgltecsfb=`getprop persist.vendor.radio.sglte_csfb`
+datamode=`getprop persist.data.mode`
+
+case "$baseband" in
+ "apq" | "sda" )
+ setprop ro.radio.noril yes
+ stop ril-daemon
+esac
+
+case "$baseband" in
+ "msm" | "csfb" | "svlte2a" | "mdm" | "mdm2" | "sglte" | "sglte2" | "dsda2" | "unknown" | "dsda3")
+ start qmuxd
+esac
+
+case "$baseband" in
+ "msm" | "csfb" | "svlte2a" | "mdm" | "mdm2" | "sglte" | "sglte2" | "dsda2" | "unknown" | "dsda3" | "sdm" | "sdx")
+ start ipacm-diag
+ start ipacm
+ case "$baseband" in
+ "svlte2a" | "csfb")
+ start qmiproxy
+ ;;
+ "sglte" | "sglte2" )
+ if [ "x$sgltecsfb" != "xtrue" ]; then
+ start qmiproxy
+ else
+ 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 ril-daemon2
+ elif [ "$multisim" = "tsts" ]; then
+ start ril-daemon2
+ start ril-daemon3
+ fi
+
+ case "$datamode" in
+ "tethered")
+ start qti
+ start port-bridge
+ ;;
+ "concurrent")
+ start qti
+ start netmgrd
+ start port-bridge
+ ;;
+ *)
+ start netmgrd
+ ;;
+ esac
+esac
+
+#
+# Allow persistent faking of bms
+# User needs to set fake bms charge in persist.bms.fake_batt_capacity
+#
+fake_batt_capacity=`getprop persist.bms.fake_batt_capacity`
+case "$fake_batt_capacity" in
+ "") ;; #Do nothing here
+ * )
+ echo "$fake_batt_capacity" > /sys/class/power_supply/battery/capacity
+ ;;
+esac
diff --git a/rootdir/bin/init.crda.sh b/rootdir/bin/init.crda.sh
new file mode 100755
index 0000000..4264789
--- /dev/null
+++ b/rootdir/bin/init.crda.sh
@@ -0,0 +1,35 @@
+#! /vendor/bin/sh
+
+# Copyright (c) 2012, 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 The 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.
+#
+
+country=`getprop wlan.crda.country`
+# crda takes input in COUNTRY environment variable
+if [ $country != "" ]
+then
+COUNTRY="$country" /system/bin/crda
+fi
diff --git a/rootdir/bin/init.mdm.sh b/rootdir/bin/init.mdm.sh
new file mode 100755
index 0000000..840c8cd
--- /dev/null
+++ b/rootdir/bin/init.mdm.sh
@@ -0,0 +1,34 @@
+#! /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.class_core.sh b/rootdir/bin/init.qcom.class_core.sh
new file mode 100755
index 0000000..8f8265d
--- /dev/null
+++ b/rootdir/bin/init.qcom.class_core.sh
@@ -0,0 +1,216 @@
+#!/vendor/bin/sh
+
+# Copyright (c) 2012-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 The 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.
+#
+
+# Set platform variables
+target=`getprop ro.board.platform`
+if [ -f /sys/devices/soc0/hw_platform ]; then
+ soc_hwplatform=`cat /sys/devices/soc0/hw_platform` 2> /dev/null
+else
+ soc_hwplatform=`cat /sys/devices/system/soc/soc0/hw_platform` 2> /dev/null
+fi
+if [ -f /sys/devices/soc0/soc_id ]; then
+ soc_hwid=`cat /sys/devices/soc0/soc_id` 2> /dev/null
+else
+ soc_hwid=`cat /sys/devices/system/soc/soc0/id` 2> /dev/null
+fi
+if [ -f /sys/devices/soc0/platform_version ]; then
+ soc_hwver=`cat /sys/devices/soc0/platform_version` 2> /dev/null
+else
+ soc_hwver=`cat /sys/devices/system/soc/soc0/platform_version` 2> /dev/null
+fi
+
+
+# Dynamic Memory Managment (DMM) provides a sys file system to the userspace
+# that can be used to plug in/out memory that has been configured as unstable.
+# This unstable memory can be in Active or In-Active State.
+# Each of which the userspace can request by writing to a sys file.
+#
+# ro.dev.dmm = 1; Indicates that DMM is enabled in the Android User Space. This
+# property is set in the Android system properties file.
+#
+# If ro.dev.dmm.dpd.start_address is set here then the target has a memory
+# configuration that supports DynamicMemoryManagement.
+init_DMM()
+{
+ block=-1
+
+ case "$target" in
+ "msm7630_surf" | "msm7630_1x" | "msm7630_fusion" | "msm8960")
+ ;;
+ *)
+ return
+ ;;
+ esac
+
+ mem="/sys/devices/system/memory"
+ op=`cat $mem/movable_start_bytes`
+ case "$op" in
+ "0")
+ log -p i -t DMM DMM Disabled. movable_start_bytes not set: $op
+ ;;
+
+ "$mem/movable_start_bytes: No such file or directory ")
+ log -p i -t DMM DMM Disabled. movable_start_bytes does not exist: $op
+ ;;
+
+ *)
+ log -p i -t DMM DMM available. movable_start_bytes at $op
+ movable_start_bytes=0x`cat $mem/movable_start_bytes`
+ block_size_bytes=0x`cat $mem/block_size_bytes`
+ block=$((#${movable_start_bytes}/${block_size_bytes}))
+
+ chown -h system.system $mem/memory$block/state
+ chown -h system.system $mem/probe
+ chown -h system.system $mem/active
+ chown -h system.system $mem/remove
+
+ case "$target" in
+ "msm7630_surf" | "msm7630_1x" | "msm7630_fusion")
+ echo $movable_start_bytes > $mem/probe
+ case "$?" in
+ "0")
+ log -p i -t DMM $movable_start_bytes to physical hotplug succeeded.
+ ;;
+ *)
+ log -p e -t DMM $movable_start_bytes to physical hotplug failed.
+ return
+ ;;
+ esac
+
+ echo online > $mem/memory$block/state
+ case "$?" in
+ "0")
+ log -p i -t DMM \'echo online\' to logical hotplug succeeded.
+ ;;
+ *)
+ log -p e -t DMM \'echo online\' to logical hotplug failed.
+ return
+ ;;
+ esac
+ ;;
+ esac
+
+ setprop ro.dev.dmm.dpd.start_address $movable_start_bytes
+ setprop ro.dev.dmm.dpd.block $block
+ ;;
+ esac
+
+ case "$target" in
+ "msm8960")
+ return
+ ;;
+ esac
+
+ # For 7X30 targets:
+ # ro.dev.dmm.dpd.start_address is set when the target has a 2x256Mb memory
+ # configuration. This is also used to indicate that the target is capable of
+ # setting EBI-1 to Deep Power Down or Self Refresh.
+ op=`cat $mem/low_power_memory_start_bytes`
+ case "$op" in
+ "0")
+ log -p i -t DMM Self-Refresh-Only Disabled. low_power_memory_start_bytes not set:$op
+ ;;
+ "$mem/low_power_memory_start_bytes No such file or directory ")
+ log -p i -t DMM Self-Refresh-Only Disabled. low_power_memory_start_bytes does not exist:$op
+ ;;
+ *)
+ log -p i -t DMM Self-Refresh-Only available. low_power_memory_start_bytes at $op
+ ;;
+ esac
+}
+
+#
+# For controlling console and shell on console on 8960 - perist.serial.enable 8960
+# On other target use default ro.debuggable property.
+#
+serial=`getprop persist.serial.enable`
+dserial=`getprop ro.debuggable`
+case "$target" in
+ "msm8960")
+ case "$serial" in
+ "0")
+ echo 0 > /sys/devices/platform/msm_serial_hsl.0/console
+ ;;
+ "1")
+ echo 1 > /sys/devices/platform/msm_serial_hsl.0/console
+ start console
+ ;;
+ *)
+ case "$dserial" in
+ "1")
+ start console
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+
+ "msm8610" | "msm8974" | "msm8226")
+ case "$serial" in
+ "0")
+ echo 0 > /sys/devices/f991f000.serial/console
+ ;;
+ "1")
+ echo 1 > /sys/devices/f991f000.serial/console
+ start console
+ ;;
+ *)
+ case "$dserial" in
+ "1")
+ start console
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ *)
+ case "$dserial" in
+ "1")
+ start console
+ ;;
+ esac
+ ;;
+esac
+
+case "$target" in
+ "msm7630_surf" | "msm7630_1x" | "msm7630_fusion")
+ insmod /system/lib/modules/ss_mfcinit.ko
+ insmod /system/lib/modules/ss_vencoder.ko
+ insmod /system/lib/modules/ss_vdecoder.ko
+ chmod -h 0666 /dev/ss_mfc_reg
+ chmod -h 0666 /dev/ss_vdec
+ chmod -h 0666 /dev/ss_venc
+
+ init_DMM
+ ;;
+
+ "msm8960")
+ init_DMM
+ ;;
+esac
diff --git a/rootdir/bin/init.qcom.coex.sh b/rootdir/bin/init.qcom.coex.sh
new file mode 100755
index 0000000..a9a22f1
--- /dev/null
+++ b/rootdir/bin/init.qcom.coex.sh
@@ -0,0 +1,115 @@
+#! /vendor/bin/sh
+
+# Copyright (c) 2009-2010, 2012, 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 The 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.
+
+LOG_TAG="qcom-bt-wlan-coex"
+LOG_NAME="${0}:"
+
+coex_pid=""
+ath_wlan_supported=`getprop wlan.driver.ath`
+
+loge ()
+{
+ /system/bin/log -t $LOG_TAG -p e "$LOG_NAME $@"
+}
+
+logi ()
+{
+ /system/bin/log -t $LOG_TAG -p i "$LOG_NAME $@"
+}
+
+failed ()
+{
+ loge "$1: exit code $2"
+ exit $2
+}
+
+start_coex ()
+{
+ case "$ath_wlan_supported" in
+ "2")
+ echo "ATH WLAN Chip ID AR6004 is enabled"
+ /system/bin/abtfilt -d -z -n -m -a -w wlan0 &
+ ;;
+ "1")
+ echo "ATH WLAN Chip ID is enabled"
+ # Must have -d -z -n -v -s -w wlan0 parameters for atheros btfilter.
+ /system/bin/abtfilt -d -z -n -v -q -s -w wlan0 &
+ ;;
+ "0")
+ echo "WCN WLAN Chip ID is enabled"
+ # Must have -o turned on to avoid daemon (otherwise we cannot get pid)
+ /system/bin/btwlancoex -o $opt_flags &
+ ;;
+ *)
+ echo "NO WLAN Chip ID is enabled, so enabling ATH as default"
+ # Must have -d -z -n -v -s -w wlan0 parameters for atheros btfilter.
+ /system/bin/abtfilt -d -z -n -v -q -s -w wlan0 &
+ ;;
+ esac
+ coex_pid=$!
+ logi "start_coex: pid = $coex_pid"
+}
+
+kill_coex ()
+{
+ logi "kill_coex: pid = $coex_pid"
+ kill -TERM $coex_pid
+ # this shell doesn't exit now -- wait returns for normal exit
+}
+
+# mimic coex options parsing -- maybe a waste of effort
+USAGE="${0} [-o] [-c] [-r] [-i] [-h]"
+
+while getopts "ocrih" f
+do
+ case $f in
+ o | c | r | i | h) opt_flags="$opt_flags -$f" ;;
+ \?) echo $USAGE; exit 1;;
+ esac
+done
+
+# init does SIGTERM on ctl.stop for service
+trap "kill_coex" TERM INT
+
+#Selectively start coex module
+target=`getprop ro.board.platform`
+
+if [ "$target" == "msm8960" ] && [ "$ath_wlan_supported" != "2" ]; then
+ logi "btwlancoex/abtfilt is not needed"
+else
+ # Build settings may not produce the coex executable
+ if ls /system/bin/btwlancoex || ls /system/bin/abtfilt
+ then
+ start_coex
+ wait $coex_pid
+ logi "Coex stopped"
+ else
+ logi "btwlancoex/abtfilt not available"
+ fi
+fi
+exit 0
diff --git a/rootdir/bin/init.qcom.crashdata.sh b/rootdir/bin/init.qcom.crashdata.sh
new file mode 100755
index 0000000..59cf68d
--- /dev/null
+++ b/rootdir/bin/init.qcom.crashdata.sh
@@ -0,0 +1,48 @@
+#!/vendor/bin/sh
+# Copyright (c) 2017, 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 The 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 "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.
+#
+
+abnormalcnt="persist.vendor.crash.cnt"
+
+abnormal_cnt=`getprop $abnormalcnt`
+crash_detect=`getprop persist.vendor.crash.detect`
+
+if [ "$abnormal_cnt" = "" ]
+then
+setprop $abnormalcnt 0
+fi
+
+if [ "$crash_detect" = "true" ]
+then
+abnormal_cnt=`expr $abnormal_cnt + 1`
+setprop $abnormalcnt $abnormal_cnt
+elif [ "$crash_detect" = "false" ];then
+setprop persist.vendor.crash.detect true
+else
+setprop persist.vendor.crash.detect true
+fi
diff --git a/rootdir/bin/init.qcom.early_boot.sh b/rootdir/bin/init.qcom.early_boot.sh
new file mode 100755
index 0000000..b037c8d
--- /dev/null
+++ b/rootdir/bin/init.qcom.early_boot.sh
@@ -0,0 +1,530 @@
+#! /vendor/bin/sh
+
+# Copyright (c) 2012-2013,2016 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 The 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.
+#
+
+export PATH=/vendor/bin
+
+# Set platform variables
+if [ -f /sys/devices/soc0/hw_platform ]; then
+ soc_hwplatform=`cat /sys/devices/soc0/hw_platform` 2> /dev/null
+else
+ soc_hwplatform=`cat /sys/devices/system/soc/soc0/hw_platform` 2> /dev/null
+fi
+if [ -f /sys/devices/soc0/soc_id ]; then
+ soc_hwid=`cat /sys/devices/soc0/soc_id` 2> /dev/null
+else
+ soc_hwid=`cat /sys/devices/system/soc/soc0/id` 2> /dev/null
+fi
+if [ -f /sys/devices/soc0/platform_version ]; then
+ soc_hwver=`cat /sys/devices/soc0/platform_version` 2> /dev/null
+else
+ soc_hwver=`cat /sys/devices/system/soc/soc0/platform_version` 2> /dev/null
+fi
+
+if [ -f /sys/class/graphics/fb0/virtual_size ]; then
+ res=`cat /sys/class/graphics/fb0/virtual_size` 2> /dev/null
+ fb_width=${res%,*}
+fi
+
+log -t BOOT -p i "MSM target '$1', SoC '$soc_hwplatform', HwID '$soc_hwid', SoC ver '$soc_hwver'"
+
+#For drm based display driver
+vbfile=/sys/module/drm/parameters/vblankoffdelay
+if [ -w $vbfile ]; then
+ echo -1 > $vbfile
+else
+ log -t DRM_BOOT -p w "file: '$vbfile' or perms doesn't exist"
+fi
+
+function set_density_by_fb() {
+ #put default density based on width
+ if [ -z $fb_width ]; then
+ setprop ro.sf.lcd_density 320
+ else
+ if [ $fb_width -ge 1440 ]; then
+ setprop ro.sf.lcd_density 560
+ elif [ $fb_width -ge 1080 ]; then
+ setprop ro.sf.lcd_density 480
+ elif [ $fb_width -ge 720 ]; then
+ setprop ro.sf.lcd_density 320 #for 720X1280 resolution
+ elif [ $fb_width -ge 480 ]; then
+ setprop ro.sf.lcd_density 240 #for 480X854 QRD resolution
+ else
+ setprop ro.sf.lcd_density 160
+ fi
+ fi
+}
+target=`getprop ro.board.platform`
+case "$target" in
+ "msm7630_surf" | "msm7630_1x" | "msm7630_fusion")
+ case "$soc_hwplatform" in
+ "FFA" | "SVLTE_FFA")
+ # linking to surf_keypad_qwerty.kcm.bin instead of surf_keypad_numeric.kcm.bin so that
+ # the UI keyboard works fine.
+ 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 qcom.bt.dev_power_class 2
+ ;;
+ *)
+ ln -s /system/usr/keychars/surf_keypad_qwerty.kcm.bin /system/usr/keychars/surf_keypad.kcm.bin
+ ;;
+ esac
+ ;;
+
+ "msm8660")
+ case "$soc_hwplatform" in
+ "Fluid")
+ setprop ro.sf.lcd_density 240
+ ;;
+ "Dragon")
+ setprop ro.sound.alsa "WM8903"
+ ;;
+ esac
+ ;;
+
+ "msm8960")
+ # lcd density is write-once. Hence the separate switch case
+ case "$soc_hwplatform" in
+ "Liquid")
+ if [ "$soc_hwver" == "196608" ]; then # version 0x30000 is 3D sku
+ setprop ro.sf.hwrotation 90
+ fi
+
+ setprop ro.sf.lcd_density 160
+ ;;
+ "MTP")
+ setprop ro.sf.lcd_density 240
+ ;;
+ *)
+ case "$soc_hwid" in
+ "109")
+ setprop ro.sf.lcd_density 160
+ ;;
+ *)
+ setprop ro.sf.lcd_density 240
+ ;;
+ esac
+ ;;
+ esac
+
+ #Set up composition type based on the target
+ case "$soc_hwid" in
+ 87)
+ #8960
+ setprop debug.composition.type dyn
+ ;;
+ 153|154|155|156|157|138)
+ #8064 V2 PRIME | 8930AB | 8630AB | 8230AB | 8030AB | 8960AB
+ setprop debug.composition.type c2d
+ ;;
+ *)
+ esac
+ ;;
+
+ "msm8974")
+ case "$soc_hwplatform" in
+ "Liquid")
+ setprop ro.sf.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 ro.sf.lcd_density 320
+ ;;
+ esac
+ ;;
+
+ "msm8226")
+ case "$soc_hwplatform" in
+ *)
+ setprop ro.sf.lcd_density 320
+ ;;
+ esac
+ ;;
+
+ "msm8610" | "apq8084" | "mpq8092")
+ case "$soc_hwplatform" in
+ *)
+ setprop ro.sf.lcd_density 240
+ ;;
+ esac
+ ;;
+ "apq8084")
+ case "$soc_hwplatform" in
+ "Liquid")
+ setprop ro.sf.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
+ # SBC do not have hardware navigation keys, so enable
+ # Android sw navigation bar
+ setprop qemu.hw.mainkeys 0
+ ;;
+ *)
+ setprop ro.sf.lcd_density 480
+ ;;
+ esac
+ ;;
+ "msm8996")
+ case "$soc_hwplatform" in
+ "Dragon")
+ setprop ro.sf.lcd_density 240
+ setprop qemu.hw.mainkeys 0
+ ;;
+ "ADP")
+ setprop ro.sf.lcd_density 160
+ setprop qemu.hw.mainkeys 0
+ ;;
+ "SBC")
+ setprop ro.sf.lcd_density 240
+ setprop qemu.hw.mainkeys 0
+ ;;
+ *)
+ setprop ro.sf.lcd_density 560
+ ;;
+ esac
+ ;;
+ "msm8937" | "msm8940")
+ # Set ro.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
+ ;;
+ 303|307|308|309|320)
+ # Vulkan is not supported for 8917 variants
+ setprop ro.opengles.version 196608
+ setprop persist.graphics.vulkan.disable true
+ ;;
+ *)
+ setprop ro.opengles.version 196608
+ ;;
+ esac
+ ;;
+ "msm8909")
+ case "$soc_hwplatform" in
+ *)
+ setprop persist.graphics.vulkan.disable true
+ ;;
+ esac
+ ;;
+ "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
+ else
+ setprop persist.sys.force_sw_gles 0
+ fi
+ ;;
+ esac
+ case "$soc_hwid" in
+ "319") #apq8098_latv
+ echo "\n==Loading ALX module==\n"
+ insmod /system/lib/modules/alx.ko
+ ;;
+ esac
+ ;;
+ "sdm845")
+ 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
+ else
+ setprop persist.sys.force_sw_gles 0
+ 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
+ ;;
+ "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.radio.atfwd.start true;;
+esac
+
+#set default lcd density
+#Since lcd density has read only
+#property, it will not overwrite previous set
+#property if any target is setting forcefully.
+set_density_by_fb
+
+# Setup display nodes & permissions
+# HDMI can be fb1 or fb2
+# Loop through the sysfs nodes and determine
+# the HDMI(dtv panel)
+
+function set_perms() {
+ #Usage set_perms <filename> <ownership> <permission>
+ chown -h $2 $1
+ chmod $3 $1
+}
+
+function setHDMIPermission() {
+ file=/sys/class/graphics/fb$1
+ dev_file=/dev/graphics/fb$1
+ dev_gfx_hdmi=/devices/virtual/switch/hdmi
+
+ set_perms $file/hpd system.graphics 0664
+ set_perms $file/res_info system.graphics 0664
+ set_perms $file/vendor_name system.graphics 0664
+ set_perms $file/product_description system.graphics 0664
+ set_perms $file/video_mode system.graphics 0664
+ set_perms $file/format_3d system.graphics 0664
+ set_perms $file/s3d_mode system.graphics 0664
+ set_perms $file/dynamic_fps system.graphics 0664
+ set_perms $file/msm_fb_dfps_mode system.graphics 0664
+ set_perms $file/hdr_stream system.graphics 0664
+ set_perms $file/cec/enable system.graphics 0664
+ set_perms $file/cec/logical_addr system.graphics 0664
+ set_perms $file/cec/rd_msg system.graphics 0664
+ 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/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
+}
+
+# check for the type of driver FB or DRM
+fb_driver=/sys/class/graphics/fb0
+if [ -e "$fb_driver" ]
+then
+ # check for HDMI connection
+ for fb_cnt in 0 1 2 3
+ do
+ file=/sys/class/graphics/fb$fb_cnt/msm_fb_panel_info
+ if [ -f "$file" ]
+ then
+ cat $file | while read line; do
+ case "$line" in
+ *"is_pluggable"*)
+ case "$line" in
+ *"1"*)
+ setHDMIPermission $fb_cnt
+ esac
+ esac
+ done
+ fi
+ done
+
+ # check for mdp caps
+ file=/sys/class/graphics/fb0/mdp/caps
+ if [ -f "$file" ]
+ then
+ setprop debug.gralloc.gfx_ubwc_disable 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
+ esac
+ done
+ fi
+
+ file=/sys/class/graphics/fb0
+ if [ -d "$file" ]
+ then
+ set_perms $file/idle_time system.graphics 0664
+ set_perms $file/dynamic_fps system.graphics 0664
+ set_perms $file/dyn_pu system.graphics 0664
+ set_perms $file/modes system.graphics 0664
+ set_perms $file/mode system.graphics 0664
+ set_perms $file/msm_cmd_autorefresh_en system.graphics 0664
+ fi
+
+ # set lineptr permissions for all displays
+ for fb_cnt in 0 1 2 3
+ do
+ file=/sys/class/graphics/fb$fb_cnt
+ if [ -f "$file/lineptr_value" ]; then
+ set_perms $file/lineptr_value system.graphics 0664
+ fi
+ if [ -f "$file/msm_fb_persist_mode" ]; then
+ set_perms $file/msm_fb_persist_mode system.graphics 0664
+ fi
+ done
+fi
+
+boot_reason=`cat /proc/sys/kernel/boot_reason`
+reboot_reason=`getprop ro.boot.alarmboot`
+power_off_alarm_file=`cat /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
+else
+ setprop ro.alarm_boot false
+fi
+
+# copy GPU frequencies to system 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"
+fi
diff --git a/rootdir/bin/init.qcom.efs.sync.sh b/rootdir/bin/init.qcom.efs.sync.sh
new file mode 100755
index 0000000..5e7bfa1
--- /dev/null
+++ b/rootdir/bin/init.qcom.efs.sync.sh
@@ -0,0 +1,35 @@
+#! /vendor/bin/sh
+
+# Copyright (c) 2012, 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 The 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 "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.
+#
+#
+
+PATH=/system/bin:$PATH
+export PATH
+cat /sys/devices/platform/rs300000a7.65536/force_sync
+cat /sys/devices/platform/rs300100a7.65536/force_sync
diff --git a/rootdir/bin/init.qcom.post_boot.sh b/rootdir/bin/init.qcom.post_boot.sh
new file mode 100755
index 0000000..1d6b55a
--- /dev/null
+++ b/rootdir/bin/init.qcom.post_boot.sh
@@ -0,0 +1,3200 @@
+#! /vendor/bin/sh
+
+# Copyright (c) 2012-2013, 2016-2017, 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 The 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.
+#
+
+target=`getprop ro.board.platform`
+
+function configure_zram_parameters() {
+ MemTotalStr=`cat /proc/meminfo | grep MemTotal`
+ MemTotal=${MemTotalStr:16:8}
+
+ 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
+ echo 402653184 > /sys/block/zram0/disksize
+ elif [ $MemTotal -le 1048576 ] && [ "$low_ram" == "true" ]; then
+ echo lz4 > /sys/block/zram0/comp_algorithm
+ echo 805306368 > /sys/block/zram0/disksize
+ else
+ echo 536870912 > /sys/block/zram0/disksize
+ fi
+ mkswap /dev/block/zram0
+ swapon /dev/block/zram0 -p 32758
+ fi
+}
+
+function configure_memory_parameters() {
+ # Set Memory paremeters.
+ #
+ # 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
+ #
+ # 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
+ #
+ # Set ALMK parameters (usually above the highest minfree values)
+ # 32 bit will have 53K & 64 bit will have 81K
+ #
+
+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
+
+ configure_zram_parameters
+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
+ 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
+ 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
+ fi
+ fi
+
+ configure_zram_parameters
+
+ SWAP_ENABLE_THRESHOLD=1048576
+ swap_enable=`getprop ro.vendor.qti.config.swap`
+
+ 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
+
+ # 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/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
+fi
+}
+
+function enable_memory_features()
+{
+ MemTotalStr=`cat /proc/meminfo | grep MemTotal`
+ MemTotal=${MemTotalStr:16:8}
+
+ if [ $MemTotal -le 2097152 ]; then
+ #Enable B service adj transition for 2GB or less memory
+ setprop ro.vendor.qti.sys.fw.bservice_enable true
+ setprop ro.vendor.qti.sys.fw.bservice_limit 5
+ setprop ro.vendor.qti.sys.fw.bservice_age 5000
+
+ #Enable Delay Service Restart
+ setprop ro.vendor.qti.am.reschedule_service true
+ fi
+}
+
+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
+ fi
+}
+
+case "$target" in
+ "msm7201a_ffa" | "msm7201a_surf" | "msm7627_ffa" | "msm7627_6x" | "msm7627a" | "msm7627_surf" | \
+ "qsd8250_surf" | "qsd8250_ffa" | "msm7630_surf" | "msm7630_1x" | "msm7630_fusion" | "qsd8650a_st1x")
+ echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
+ echo 90 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
+ ;;
+esac
+
+case "$target" in
+ "msm7201a_ffa" | "msm7201a_surf")
+ echo 500000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
+ ;;
+esac
+
+case "$target" in
+ "msm7630_surf" | "msm7630_1x" | "msm7630_fusion")
+ echo 75000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
+ echo 1 > /sys/module/pm2/parameters/idle_sleep_mode
+ ;;
+esac
+
+case "$target" in
+ "msm7201a_ffa" | "msm7201a_surf" | "msm7627_ffa" | "msm7627_6x" | "msm7627_surf" | "msm7630_surf" | "msm7630_1x" | "msm7630_fusion" | "msm7627a" )
+ echo 245760 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
+ ;;
+esac
+
+case "$target" in
+ "msm8660")
+ echo 1 > /sys/module/rpm_resources/enable_low_power/L2_cache
+ echo 1 > /sys/module/rpm_resources/enable_low_power/pxo
+ echo 2 > /sys/module/rpm_resources/enable_low_power/vdd_dig
+ echo 2 > /sys/module/rpm_resources/enable_low_power/vdd_mem
+ echo 1 > /sys/module/rpm_resources/enable_low_power/rpm_cpu
+ echo 1 > /sys/module/msm_pm/modes/cpu0/power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu0/power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/idle_enabled
+ echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
+ echo "ondemand" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
+ echo 50000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
+ echo 90 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
+ echo 1 > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
+ echo 4 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
+ echo 384000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
+ echo 384000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
+ 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 system /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
+ chown -h system /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
+ chown -h root.system /sys/devices/system/cpu/mfreq
+ chmod -h 220 /sys/devices/system/cpu/mfreq
+ chown -h root.system /sys/devices/system/cpu/cpu1/online
+ chmod -h 664 /sys/devices/system/cpu/cpu1/online
+ ;;
+esac
+
+case "$target" in
+ "msm8960")
+ echo 1 > /sys/module/rpm_resources/enable_low_power/L2_cache
+ echo 1 > /sys/module/rpm_resources/enable_low_power/pxo
+ echo 1 > /sys/module/rpm_resources/enable_low_power/vdd_dig
+ echo 1 > /sys/module/rpm_resources/enable_low_power/vdd_mem
+ echo 1 > /sys/module/msm_pm/modes/cpu0/retention/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu0/power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu2/power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu3/power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu0/power_collapse/idle_enabled
+ echo 0 > /sys/module/msm_thermal/core_control/enabled
+ 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 "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
+ echo "ondemand" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
+ echo "ondemand" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
+ echo "ondemand" > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
+ echo 50000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
+ echo 90 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
+ echo 1 > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
+ echo 4 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
+ echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/down_differential
+ echo 70 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
+ echo 3 > /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
+ echo 918000 > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
+ echo 1026000 > /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
+ echo 80 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
+ 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
+ echo 384000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
+ echo 384000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
+ echo 384000 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq
+ echo 384000 > /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq
+ 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 system /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
+ chown -h system /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
+ chown -h system /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
+ chown -h system /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq
+ chown -h system /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq
+ chown -h system /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq
+ echo 1 > /sys/module/msm_thermal/core_control/enabled
+ chown -h root.system /sys/devices/system/cpu/mfreq
+ chmod -h 220 /sys/devices/system/cpu/mfreq
+ chown -h root.system /sys/devices/system/cpu/cpu1/online
+ chown -h root.system /sys/devices/system/cpu/cpu2/online
+ chown -h root.system /sys/devices/system/cpu/cpu3/online
+ chmod -h 664 /sys/devices/system/cpu/cpu1/online
+ chmod -h 664 /sys/devices/system/cpu/cpu2/online
+ chmod -h 664 /sys/devices/system/cpu/cpu3/online
+ # set DCVS parameters for CPU
+ echo 40000 > /sys/module/msm_dcvs/cores/cpu0/slack_time_max_us
+ echo 40000 > /sys/module/msm_dcvs/cores/cpu0/slack_time_min_us
+ echo 100000 > /sys/module/msm_dcvs/cores/cpu0/em_win_size_min_us
+ echo 500000 > /sys/module/msm_dcvs/cores/cpu0/em_win_size_max_us
+ echo 0 > /sys/module/msm_dcvs/cores/cpu0/slack_mode_dynamic
+ echo 1000000 > /sys/module/msm_dcvs/cores/cpu0/disable_pc_threshold
+ echo 25000 > /sys/module/msm_dcvs/cores/cpu1/slack_time_max_us
+ echo 25000 > /sys/module/msm_dcvs/cores/cpu1/slack_time_min_us
+ echo 100000 > /sys/module/msm_dcvs/cores/cpu1/em_win_size_min_us
+ echo 500000 > /sys/module/msm_dcvs/cores/cpu1/em_win_size_max_us
+ echo 0 > /sys/module/msm_dcvs/cores/cpu1/slack_mode_dynamic
+ echo 1000000 > /sys/module/msm_dcvs/cores/cpu1/disable_pc_threshold
+ echo 25000 > /sys/module/msm_dcvs/cores/cpu2/slack_time_max_us
+ echo 25000 > /sys/module/msm_dcvs/cores/cpu2/slack_time_min_us
+ echo 100000 > /sys/module/msm_dcvs/cores/cpu2/em_win_size_min_us
+ echo 500000 > /sys/module/msm_dcvs/cores/cpu2/em_win_size_max_us
+ echo 0 > /sys/module/msm_dcvs/cores/cpu2/slack_mode_dynamic
+ echo 1000000 > /sys/module/msm_dcvs/cores/cpu2/disable_pc_threshold
+ echo 25000 > /sys/module/msm_dcvs/cores/cpu3/slack_time_max_us
+ echo 25000 > /sys/module/msm_dcvs/cores/cpu3/slack_time_min_us
+ echo 100000 > /sys/module/msm_dcvs/cores/cpu3/em_win_size_min_us
+ echo 500000 > /sys/module/msm_dcvs/cores/cpu3/em_win_size_max_us
+ echo 0 > /sys/module/msm_dcvs/cores/cpu3/slack_mode_dynamic
+ echo 1000000 > /sys/module/msm_dcvs/cores/cpu3/disable_pc_threshold
+ # set DCVS parameters for GPU
+ echo 20000 > /sys/module/msm_dcvs/cores/gpu0/slack_time_max_us
+ echo 20000 > /sys/module/msm_dcvs/cores/gpu0/slack_time_min_us
+ echo 0 > /sys/module/msm_dcvs/cores/gpu0/slack_mode_dynamic
+ # set msm_mpdecision parameters
+ echo 45000 > /sys/module/msm_mpdecision/slack_time_max_us
+ echo 15000 > /sys/module/msm_mpdecision/slack_time_min_us
+ echo 100000 > /sys/module/msm_mpdecision/em_win_size_min_us
+ echo 1000000 > /sys/module/msm_mpdecision/em_win_size_max_us
+ echo 3 > /sys/module/msm_mpdecision/online_util_pct_min
+ echo 25 > /sys/module/msm_mpdecision/online_util_pct_max
+ echo 97 > /sys/module/msm_mpdecision/em_max_util_pct
+ echo 2 > /sys/module/msm_mpdecision/rq_avg_poll_ms
+ echo 10 > /sys/module/msm_mpdecision/mp_em_rounding_point_min
+ echo 85 > /sys/module/msm_mpdecision/mp_em_rounding_point_max
+ echo 50 > /sys/module/msm_mpdecision/iowait_threshold_pct
+ #set permissions for the nodes needed by display on/off hook
+ chown -h system /sys/module/msm_dcvs/cores/cpu0/slack_time_max_us
+ chown -h system /sys/module/msm_dcvs/cores/cpu0/slack_time_min_us
+ chown -h system /sys/module/msm_mpdecision/slack_time_max_us
+ chown -h system /sys/module/msm_mpdecision/slack_time_min_us
+ chmod -h 664 /sys/module/msm_dcvs/cores/cpu0/slack_time_max_us
+ chmod -h 664 /sys/module/msm_dcvs/cores/cpu0/slack_time_min_us
+ chmod -h 664 /sys/module/msm_mpdecision/slack_time_max_us
+ chmod -h 664 /sys/module/msm_mpdecision/slack_time_min_us
+ 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
+ "130")
+ echo 230 > /sys/class/gpio/export
+ echo 228 > /sys/class/gpio/export
+ echo 229 > /sys/class/gpio/export
+ echo "in" > /sys/class/gpio/gpio230/direction
+ echo "rising" > /sys/class/gpio/gpio230/edge
+ echo "in" > /sys/class/gpio/gpio228/direction
+ echo "rising" > /sys/class/gpio/gpio228/edge
+ echo "in" > /sys/class/gpio/gpio229/direction
+ echo "rising" > /sys/class/gpio/gpio229/edge
+ echo 253 > /sys/class/gpio/export
+ echo 254 > /sys/class/gpio/export
+ echo 257 > /sys/class/gpio/export
+ echo 258 > /sys/class/gpio/export
+ echo 259 > /sys/class/gpio/export
+ echo "out" > /sys/class/gpio/gpio253/direction
+ echo "out" > /sys/class/gpio/gpio254/direction
+ echo "out" > /sys/class/gpio/gpio257/direction
+ echo "out" > /sys/class/gpio/gpio258/direction
+ echo "out" > /sys/class/gpio/gpio259/direction
+ chown -h media /sys/class/gpio/gpio253/value
+ chown -h media /sys/class/gpio/gpio254/value
+ chown -h media /sys/class/gpio/gpio257/value
+ chown -h media /sys/class/gpio/gpio258/value
+ chown -h media /sys/class/gpio/gpio259/value
+ chown -h media /sys/class/gpio/gpio253/direction
+ chown -h media /sys/class/gpio/gpio254/direction
+ chown -h media /sys/class/gpio/gpio257/direction
+ chown -h media /sys/class/gpio/gpio258/direction
+ chown -h media /sys/class/gpio/gpio259/direction
+ echo 0 > /sys/module/rpm_resources/enable_low_power/vdd_dig
+ echo 0 > /sys/module/rpm_resources/enable_low_power/vdd_mem
+ ;;
+ esac
+ ;;
+esac
+
+case "$target" in
+ "msm8974")
+ echo 4 > /sys/module/lpm_levels/enable_low_power/l2
+ echo 1 > /sys/module/msm_pm/modes/cpu0/power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu2/power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu3/power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu0/power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu2/power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu3/power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu0/retention/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/retention/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu2/retention/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu3/retention/idle_enabled
+ echo 0 > /sys/module/msm_thermal/core_control/enabled
+ echo 1 > /sys/devices/system/cpu/cpu1/online
+ echo 1 > /sys/devices/system/cpu/cpu2/online
+ echo 1 > /sys/devices/system/cpu/cpu3/online
+ 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
+ "208" | "211" | "214" | "217" | "209" | "212" | "215" | "218" | "194" | "210" | "213" | "216")
+ for devfreq_gov in /sys/class/devfreq/qcom,cpubw*/governor
+ do
+ echo "cpubw_hwmon" > $devfreq_gov
+ done
+ echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
+ echo "interactive" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
+ echo "interactive" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
+ echo "interactive" > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
+ echo "20000 1400000:40000 1700000:20000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
+ echo 90 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
+ echo 1190400 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
+ echo 1 > /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
+ echo "85 1500000:90 1800000:70" > /sys/devices/system/cpu/cpufreq/interactive/target_loads
+ echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
+ echo 20 > /sys/module/cpu_boost/parameters/boost_ms
+ echo 1728000 > /sys/module/cpu_boost/parameters/sync_threshold
+ 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
+ ;;
+ *)
+ echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
+ echo "ondemand" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
+ echo "ondemand" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
+ echo "ondemand" > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
+ echo 50000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
+ echo 90 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
+ echo 1 > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
+ echo 2 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
+ echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/down_differential
+ echo 70 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
+ echo 3 > /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
+ echo 960000 > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
+ echo 960000 > /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
+ echo 1190400 > /sys/devices/system/cpu/cpufreq/ondemand/input_boost
+ echo 80 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
+ ;;
+ esac
+ echo 300000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
+ echo 300000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
+ echo 300000 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq
+ echo 300000 > /sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq
+ chown -h system /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
+ chown -h system /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
+ echo 1 > /sys/module/msm_thermal/core_control/enabled
+ chown -h root.system /sys/devices/system/cpu/mfreq
+ chmod -h 220 /sys/devices/system/cpu/mfreq
+ chown -h root.system /sys/devices/system/cpu/cpu1/online
+ chown -h root.system /sys/devices/system/cpu/cpu2/online
+ chown -h root.system /sys/devices/system/cpu/cpu3/online
+ chmod -h 664 /sys/devices/system/cpu/cpu1/online
+ chmod -h 664 /sys/devices/system/cpu/cpu2/online
+ chmod -h 664 /sys/devices/system/cpu/cpu3/online
+ echo 1 > /dev/cpuctl/apps/cpu.notify_on_migrate
+ ;;
+esac
+
+case "$target" in
+ "msm8916")
+ 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
+ "206")
+ echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled
+ 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 2 > /sys/class/net/rmnet0/queues/rx-0/rps_cpus
+ ;;
+ "247" | "248" | "249" | "250")
+ echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled
+ echo 1 > /sys/devices/system/cpu/cpu1/online
+ echo 1 > /sys/devices/system/cpu/cpu2/online
+ echo 1 > /sys/devices/system/cpu/cpu3/online
+ ;;
+ "239" | "241" | "263")
+ if [ -f /sys/devices/soc0/revision ]; then
+ revision=`cat /sys/devices/soc0/revision`
+ else
+ revision=`cat /sys/devices/system/soc/soc0/revision`
+ fi
+ echo 10 > /sys/class/net/rmnet0/queues/rx-0/rps_cpus
+ 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
+ "239")
+ case "$hw_platform" in
+ "Surf")
+ case "$platform_subtype_id" in
+ "1" | "2")
+ start_hbtp
+ ;;
+ esac
+ ;;
+ "MTP")
+ case "$platform_subtype_id" in
+ "3")
+ start_hbtp
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ "268" | "269" | "270" | "271")
+ echo 10 > /sys/class/net/rmnet0/queues/rx-0/rps_cpus
+ ;;
+ "233" | "240" | "242")
+ 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
+ ;;
+esac
+
+case "$target" in
+ "msm8226")
+ echo 4 > /sys/module/lpm_levels/enable_low_power/l2
+ echo 1 > /sys/module/msm_pm/modes/cpu0/power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu2/power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu3/power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu0/power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu2/power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu3/power_collapse/idle_enabled
+ 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 "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
+ echo 50000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
+ echo 90 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
+ echo 1 > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
+ echo 2 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
+ echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/down_differential
+ echo 70 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
+ echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
+ echo 787200 > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
+ echo 300000 > /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
+ echo 80 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
+ echo 300000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
+ 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/cpu1/online
+ chown -h root.system /sys/devices/system/cpu/cpu2/online
+ chown -h root.system /sys/devices/system/cpu/cpu3/online
+ chmod -h 664 /sys/devices/system/cpu/cpu1/online
+ chmod -h 664 /sys/devices/system/cpu/cpu2/online
+ chmod -h 664 /sys/devices/system/cpu/cpu3/online
+ ;;
+esac
+
+case "$target" in
+ "msm8610")
+ echo 4 > /sys/module/lpm_levels/enable_low_power/l2
+ echo 1 > /sys/module/msm_pm/modes/cpu0/power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu2/power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu3/power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu0/power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu2/power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu3/power_collapse/idle_enabled
+ 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 "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
+ echo 50000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
+ echo 90 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
+ echo 1 > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
+ echo 2 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
+ echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/down_differential
+ echo 70 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_multi_core
+ echo 10 > /sys/devices/system/cpu/cpufreq/ondemand/down_differential_multi_core
+ echo 787200 > /sys/devices/system/cpu/cpufreq/ondemand/optimal_freq
+ echo 300000 > /sys/devices/system/cpu/cpufreq/ondemand/sync_freq
+ echo 80 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold_any_cpu_load
+ echo 300000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
+ setprop ro.qualcomm.perf.min_freq 7
+ echo 1 > /sys/kernel/mm/ksm/deferred_timer
+ 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/cpu1/online
+ chown -h root.system /sys/devices/system/cpu/cpu2/online
+ chown -h root.system /sys/devices/system/cpu/cpu3/online
+ chmod -h 664 /sys/devices/system/cpu/cpu1/online
+ chmod -h 664 /sys/devices/system/cpu/cpu2/online
+ chmod -h 664 /sys/devices/system/cpu/cpu3/online
+ ;;
+esac
+
+case "$target" in
+ "msm8916")
+
+ 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
+
+ # HMP scheduler settings for 8916, 8936, 8939, 8929
+ echo 3 > /proc/sys/kernel/sched_window_stats_policy
+ echo 3 > /proc/sys/kernel/sched_ravg_hist_size
+
+ # Apply governor settings for 8916
+ case "$soc_id" in
+ "206" | "247" | "248" | "249" | "250")
+
+ # HMP scheduler load tracking settings
+ echo 3 > /proc/sys/kernel/sched_ravg_hist_size
+
+ # HMP Task packing settings for 8916
+ echo 20 > /proc/sys/kernel/sched_small_task
+ echo 30 > /proc/sys/kernel/sched_mostly_idle_load
+ echo 3 > /proc/sys/kernel/sched_mostly_idle_nr_run
+
+ # disable thermal core_control to update scaling_min_freq
+ 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 800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
+ # enable thermal core_control now
+ echo 1 > /sys/module/msm_thermal/core_control/enabled
+
+ echo "25000 1094400:50000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
+ echo 90 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
+ echo 30000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
+ echo 998400 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
+ echo 0 > /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
+ echo "1 800000:85 998400:90 1094400:80" > /sys/devices/system/cpu/cpufreq/interactive/target_loads
+ echo 50000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
+ echo 50000 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
+
+ # 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
+ ;;
+ esac
+
+ # Apply governor settings for 8936
+ case "$soc_id" in
+ "233" | "240" | "242")
+
+ # HMP scheduler load tracking settings
+ echo 3 > /proc/sys/kernel/sched_ravg_hist_size
+
+ # HMP Task packing settings for 8936
+ echo 50 > /proc/sys/kernel/sched_small_task
+ echo 50 > /proc/sys/kernel/sched_mostly_idle_load
+ echo 10 > /proc/sys/kernel/sched_mostly_idle_nr_run
+
+ # disable thermal core_control to update scaling_min_freq, interactive gov
+ 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 800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
+ # enable thermal core_control now
+ echo 1 > /sys/module/msm_thermal/core_control/enabled
+
+ echo "25000 1113600:50000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
+ echo 90 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
+ echo 30000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
+ echo 960000 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
+ echo 0 > /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
+ echo "1 800000:85 1113600:90 1267200:80" > /sys/devices/system/cpu/cpufreq/interactive/target_loads
+ echo 50000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
+ echo 50000 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
+
+ # 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
+
+ # Enable low power modes
+ echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled
+
+ for gpu_bimc_io_percent in /sys/class/devfreq/*qcom,gpubw*/bw_hwmon/io_percent
+ do
+ echo 40 > $gpu_bimc_io_percent
+ done
+ ;;
+ esac
+
+ # Apply governor settings for 8939
+ case "$soc_id" in
+ "239" | "241" | "263" | "268" | "269" | "270" | "271")
+
+ if [ `cat /sys/devices/soc0/revision` != "3.0" ]; then
+ # Apply 1.0 and 2.0 specific Sched & Governor settings
+
+ # HMP scheduler load tracking settings
+ echo 5 > /proc/sys/kernel/sched_ravg_hist_size
+
+ # HMP Task packing settings for 8939, 8929
+ echo 20 > /proc/sys/kernel/sched_small_task
+
+ for devfreq_gov in /sys/class/devfreq/*qcom,mincpubw*/governor
+ do
+ echo "cpufreq" > $devfreq_gov
+ done
+
+ for devfreq_gov in /sys/class/devfreq/*qcom,cpubw*/governor
+ do
+ echo "bw_hwmon" > $devfreq_gov
+ for cpu_io_percent in /sys/class/devfreq/*qcom,cpubw*/bw_hwmon/io_percent
+ do
+ echo 20 > $cpu_io_percent
+ done
+ done
+
+ for gpu_bimc_io_percent in /sys/class/devfreq/*qcom,gpubw*/bw_hwmon/io_percent
+ do
+ echo 40 > $gpu_bimc_io_percent
+ done
+ # disable thermal core_control to update interactive gov 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 "20000 1113600:50000" > /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 1113600 > /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 1113600:90 1344000:80" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
+ echo 50000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time
+ echo 50000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/sampling_down_factor
+ 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 "25000 800000:50000" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay
+ echo 90 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/go_hispeed_load
+ echo 40000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_rate
+ echo 998400 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq
+ echo 0 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy
+ echo "1 800000: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 800000 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq
+
+ # enable thermal core_control now
+ echo 1 > /sys/module/msm_thermal/core_control/enabled
+
+ # 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
+
+ # HMP scheduler (big.Little cluster related) settings
+ echo 75 > /proc/sys/kernel/sched_upmigrate
+ echo 60 > /proc/sys/kernel/sched_downmigrate
+
+ # cpu idle load threshold
+ 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
+
+ # cpu idle nr run threshold
+ 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
+
+ else
+ # Apply 3.0 specific Sched & Governor settings
+ # HMP scheduler settings for 8939 V3.0
+ 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
+
+ # HMP Task packing settings for 8939 V3.0
+ echo 20 > /proc/sys/kernel/sched_small_task
+ echo 30 > /proc/sys/kernel/sched_mostly_idle_load
+ echo 3 > /proc/sys/kernel/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
+ done
+
+ for devfreq_gov in /sys/class/devfreq/*qcom,cpubw*/governor
+ do
+ echo "bw_hwmon" > $devfreq_gov
+ for cpu_io_percent in /sys/class/devfreq/*qcom,cpubw*/bw_hwmon/io_percent
+ do
+ echo 20 > $cpu_io_percent
+ done
+ done
+
+ for gpu_bimc_io_percent in /sys/class/devfreq/*qcom,gpubw*/bw_hwmon/io_percent
+ do
+ echo 40 > $gpu_bimc_io_percent
+ done
+ # disable thermal core_control to update interactive gov 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 1113600: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 1113600 > /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 1113600: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
+ 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 800000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq
+ echo 0 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy
+ echo "1 800000: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 800000 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq
+
+ # enable thermal core_control now
+ echo 1 > /sys/module/msm_thermal/core_control/enabled
+
+ # 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/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
+
+ # HMP scheduler (big.Little cluster related) settings
+ 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
+# insmod /system/lib/modules/core_ctl.ko
+ 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
+ case "$revision" in
+ "3.0")
+ # Enable dynamic clock gatin
+ echo 1 > /sys/module/lpm_levels/lpm_workarounds/dynamic_clock_gating
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ # Set Memory parameters
+ configure_memory_parameters
+ ;;
+esac
+
+case "$target" in
+ "msm8952")
+
+ 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
+ "264" | "289")
+ # Apply Scheduler and Governor settings for 8952
+
+ # 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
+
+ # 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
+
+ echo 0 > /proc/sys/kernel/sched_boost
+
+ for devfreq_gov in /sys/class/devfreq/*qcom,mincpubw*/governor
+ do
+ echo "cpufreq" > $devfreq_gov
+ done
+
+ for devfreq_gov in /sys/class/devfreq/*qcom,cpubw*/governor
+ do
+ echo "bw_hwmon" > $devfreq_gov
+ for cpu_io_percent in /sys/class/devfreq/*qcom,cpubw*/bw_hwmon/io_percent
+ do
+ echo 20 > $cpu_io_percent
+ done
+ for cpu_guard_band in /sys/class/devfreq/*qcom,cpubw*/bw_hwmon/guard_band_mbps
+ do
+ echo 30 > $cpu_guard_band
+ done
+ done
+
+ for gpu_bimc_io_percent in /sys/class/devfreq/qcom,gpubw*/bw_hwmon/io_percent
+ do
+ echo 40 > $gpu_bimc_io_percent
+ 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
+
+ # 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 1113600: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 1113600 > /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 1113600: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
+ 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 806400 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq
+ echo 0 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy
+ echo "1 806400: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 806400 > /sys/devices/system/cpu/cpu4/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
+
+ # HMP scheduler (big.Little cluster related) settings
+ 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
+ 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
+
+ # 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
+
+ # Enable dynamic clock gating
+ echo 1 > /sys/module/lpm_levels/lpm_workarounds/dynamic_clock_gating
+ # Enable timer migration to little cluster
+ echo 1 > /proc/sys/kernel/power_aware_timer_migration
+
+ # Set Memory parameters
+ configure_memory_parameters
+
+ ;;
+ *)
+ panel=`cat /sys/class/graphics/fb0/modes`
+ if [ "${panel:5:1}" == "x" ]; then
+ panel=${panel:2:3}
+ else
+ panel=${panel:2:4}
+ fi
+
+ # Apply Scheduler and Governor settings for 8976
+ # SoC IDs are 266, 274, 277, 278
+
+ # HMP scheduler (big.Little cluster related) settings
+ echo 95 > /proc/sys/kernel/sched_upmigrate
+ echo 85 > /proc/sys/kernel/sched_downmigrate
+
+ echo 2 > /proc/sys/kernel/sched_window_stats_policy
+ echo 5 > /proc/sys/kernel/sched_ravg_hist_size
+
+ 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
+
+ for devfreq_gov in /sys/class/devfreq/*qcom,mincpubw*/governor
+ do
+ echo "cpufreq" > $devfreq_gov
+ done
+
+ for devfreq_gov in /sys/class/devfreq/*qcom,cpubw*/governor
+ do
+ echo "bw_hwmon" > $devfreq_gov
+ for cpu_io_percent in /sys/class/devfreq/*qcom,cpubw*/bw_hwmon/io_percent
+ do
+ echo 20 > $cpu_io_percent
+ done
+ for cpu_guard_band in /sys/class/devfreq/*qcom,cpubw*/bw_hwmon/guard_band_mbps
+ do
+ echo 30 > $cpu_guard_band
+ done
+ done
+
+ for gpu_bimc_io_percent in /sys/class/devfreq/qcom,gpubw*/bw_hwmon/io_percent
+ do
+ echo 40 > $gpu_bimc_io_percent
+ 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
+
+ # enable governor for power cluster
+ echo 1 > /sys/devices/system/cpu/cpu0/online
+ echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
+ echo 80 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load
+ echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate
+ echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy
+ echo 40000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time
+ echo 691200 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
+
+ # enable governor for perf cluster
+ echo 1 > /sys/devices/system/cpu/cpu4/online
+ echo "interactive" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor
+ echo 85 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/go_hispeed_load
+ echo 20000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_rate
+ echo 0 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy
+ 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 883200 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq
+ echo 60000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/max_freq_hysteresis
+
+ if [ $panel -gt 1080 ]; then
+ #set texture cache size for resolution greater than 1080p
+ setprop ro.hwui.texture_cache_size 72
+ fi
+
+ echo 59000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay
+ echo 1305600 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq
+ echo "1 691200:80" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
+ echo 1382400 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq
+ echo "19000 1382400:39000" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay
+ echo "85 1382400:90 1747200:80" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads
+ # HMP Task packing settings for 8976
+ echo 30 > /proc/sys/kernel/sched_small_task
+ echo 20 > /sys/devices/system/cpu/cpu0/sched_mostly_idle_load
+ echo 20 > /sys/devices/system/cpu/cpu1/sched_mostly_idle_load
+ echo 20 > /sys/devices/system/cpu/cpu2/sched_mostly_idle_load
+ echo 20 > /sys/devices/system/cpu/cpu3/sched_mostly_idle_load
+ echo 20 > /sys/devices/system/cpu/cpu4/sched_mostly_idle_load
+ echo 20 > /sys/devices/system/cpu/cpu5/sched_mostly_idle_load
+ echo 20 > /sys/devices/system/cpu/cpu6/sched_mostly_idle_load
+ echo 20 > /sys/devices/system/cpu/cpu7/sched_mostly_idle_load
+
+ echo 0 > /proc/sys/kernel/sched_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
+ 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
+
+ #Disable CPU retention modes for 32bit builds
+ ProductName=`getprop ro.product.name`
+ if [ "$ProductName" == "msm8952_32" ] || [ "$ProductName" == "msm8952_32_LMT" ]; then
+ echo N > /sys/module/lpm_levels/system/a72/cpu4/retention/idle_enabled
+ echo N > /sys/module/lpm_levels/system/a72/cpu5/retention/idle_enabled
+ echo N > /sys/module/lpm_levels/system/a72/cpu6/retention/idle_enabled
+ echo N > /sys/module/lpm_levels/system/a72/cpu7/retention/idle_enabled
+ fi
+
+ if [ `cat /sys/devices/soc0/revision` == "1.0" ]; then
+ # Disable l2-pc and l2-gdhs low power modes
+ echo N > /sys/module/lpm_levels/system/a53/a53-l2-gdhs/idle_enabled
+ echo N > /sys/module/lpm_levels/system/a72/a72-l2-gdhs/idle_enabled
+ echo N > /sys/module/lpm_levels/system/a53/a53-l2-pc/idle_enabled
+ echo N > /sys/module/lpm_levels/system/a72/a72-l2-pc/idle_enabled
+ fi
+
+ # Enable LPM Prediction
+ echo 1 > /sys/module/lpm_levels/parameters/lpm_prediction
+
+ # Enable Low power modes
+ echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled
+ # Disable L2 GDHS on 8976
+ echo N > /sys/module/lpm_levels/system/a53/a53-l2-gdhs/idle_enabled
+ echo N > /sys/module/lpm_levels/system/a72/a72-l2-gdhs/idle_enabled
+
+ # 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
+ #for 8976
+ echo 2 > /sys/devices/system/cpu/cpu4/core_ctl/min_cpus
+ echo 4 > /sys/devices/system/cpu/cpu4/core_ctl/max_cpus
+ echo 68 > /sys/devices/system/cpu/cpu4/core_ctl/busy_up_thres
+ echo 40 > /sys/devices/system/cpu/cpu4/core_ctl/busy_down_thres
+ echo 100 > /sys/devices/system/cpu/cpu4/core_ctl/offline_delay_ms
+ echo 1 > /sys/devices/system/cpu/cpu4/core_ctl/is_big_cluster
+
+ # 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
+
+ # Enable timer migration to little cluster
+ echo 1 > /proc/sys/kernel/power_aware_timer_migration
+
+ case "$soc_id" in
+ "277" | "278")
+ # Start energy-awareness for 8976
+ start energy-awareness
+ ;;
+ esac
+
+ #enable sched colocation and colocation inheritance
+ echo 130 > /proc/sys/kernel/sched_grp_upmigrate
+ echo 110 > /proc/sys/kernel/sched_grp_downmigrate
+ echo 1 > /proc/sys/kernel/sched_enable_thread_grouping
+
+ # Set Memory parameters
+ configure_memory_parameters
+
+ ;;
+ esac
+ #Enable Memory Features
+ enable_memory_features
+ ;;
+esac
+
+case "$target" in
+ "msm8953")
+
+ 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
+ "293" | "304" | "338" | "351" )
+
+ # Start Host based Touch processing
+ case "$hw_platform" in
+ "MTP" | "Surf" | "RCM" )
+ #if this directory is present, it means that a
+ #1200p panel is connected to the device.
+ dir="/sys/bus/i2c/devices/3-0038"
+ if [ ! -d "$dir" ]; then
+ start_hbtp
+ fi
+ ;;
+ 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
+
+ #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
+ echo "cpufreq" > $devfreq_gov
+ done
+
+ for devfreq_gov in /sys/class/devfreq/soc:qcom,cpubw/governor
+ do
+ echo "bw_hwmon" > $devfreq_gov
+ for cpu_io_percent in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/io_percent
+ do
+ echo 34 > $cpu_io_percent
+ done
+ for cpu_guard_band in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/guard_band_mbps
+ do
+ echo 0 > $cpu_guard_band
+ done
+ for cpu_hist_memory in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/hist_memory
+ do
+ echo 20 > $cpu_hist_memory
+ done
+ for cpu_hyst_length in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/hyst_length
+ do
+ echo 10 > $cpu_hyst_length
+ done
+ for cpu_idle_mbps in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/idle_mbps
+ do
+ echo 1600 > $cpu_idle_mbps
+ done
+ for cpu_low_power_delay in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/low_power_delay
+ do
+ echo 20 > $cpu_low_power_delay
+ done
+ for cpu_low_power_io_percent in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/low_power_io_percent
+ do
+ echo 34 > $cpu_low_power_io_percent
+ done
+ for cpu_mbps_zones in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/mbps_zones
+ do
+ echo "1611 3221 5859 6445 7104" > $cpu_mbps_zones
+ done
+ for cpu_sample_ms in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/sample_ms
+ do
+ echo 4 > $cpu_sample_ms
+ done
+ for cpu_up_scale in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/up_scale
+ do
+ echo 250 > $cpu_up_scale
+ done
+ for cpu_min_freq in /sys/class/devfreq/soc:qcom,cpubw/min_freq
+ do
+ echo 1611 > $cpu_min_freq
+ done
+ 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
+
+ # 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
+
+ #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 652800 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
+
+ # 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
+
+ # 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 "$target" in
+ "msm8937")
+
+ 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
+ "303" | "307" | "308" | "309" | "320" )
+
+ # Start Host based Touch processing
+ case "$hw_platform" in
+ "MTP" )
+ start_hbtp
+ ;;
+ esac
+
+ case "$hw_platform" in
+ "Surf" | "RCM" )
+ if [ $platform_subtype_id -ne "4" ]; then
+ start_hbtp
+ fi
+ ;;
+ 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
+
+ for devfreq_gov in /sys/class/devfreq/qcom,mincpubw*/governor
+ do
+ echo "cpufreq" > $devfreq_gov
+ done
+
+ for devfreq_gov in /sys/class/devfreq/soc:qcom,cpubw/governor
+ do
+ echo "bw_hwmon" > $devfreq_gov
+ for cpu_io_percent in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/io_percent
+ do
+ echo 20 > $cpu_io_percent
+ done
+ for cpu_guard_band in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/guard_band_mbps
+ do
+ echo 30 > $cpu_guard_band
+ done
+ 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
+
+ # 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
+ 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
+
+ # Disable L2-GDHS low power modes
+ echo N > /sys/module/lpm_levels/perf/perf-l2-gdhs/idle_enabled
+ echo N > /sys/module/lpm_levels/perf/perf-l2-gdhs/suspend_enabled
+
+ # 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
+
+ # 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
+
+ # Enable dynamic clock gating
+ echo 1 > /sys/module/lpm_levels/lpm_workarounds/dynamic_clock_gating
+ # Enable timer migration to little cluster
+ echo 1 > /proc/sys/kernel/power_aware_timer_migration
+ # Set Memory parameters
+ configure_memory_parameters
+ ;;
+ *)
+ ;;
+ esac
+
+ case "$soc_id" in
+ "294" | "295" | "313" )
+
+ # Start Host based Touch processing
+ case "$hw_platform" in
+ "MTP" | "Surf" | "RCM" )
+ start_hbtp
+ ;;
+ esac
+
+ # Apply Scheduler and Governor settings for 8937/8940
+
+ # 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
+
+ #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
+ done
+
+ for devfreq_gov in /sys/class/devfreq/soc:qcom,cpubw/governor
+ do
+ echo "bw_hwmon" > $devfreq_gov
+ for cpu_io_percent in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/io_percent
+ do
+ echo 20 > $cpu_io_percent
+ done
+ for cpu_guard_band in /sys/class/devfreq/soc:qcom,cpubw/bw_hwmon/guard_band_mbps
+ do
+ echo 30 > $cpu_guard_band
+ done
+ 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
+
+ # 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
+ 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
+ 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
+
+ # 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
+
+ # HMP scheduler (big.Little cluster related) settings
+ 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
+ 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
+
+ # re-enable thermal core_control
+ echo 1 > /sys/module/msm_thermal/core_control/enabled
+
+ # Enable dynamic clock gating
+ echo 1 > /sys/module/lpm_levels/lpm_workarounds/dynamic_clock_gating
+ # Enable timer migration to little cluster
+ echo 1 > /proc/sys/kernel/power_aware_timer_migration
+ # Set Memory parameters
+ configure_memory_parameters
+ ;;
+ *)
+
+ ;;
+ esac
+ ;;
+esac
+
+case "$target" in
+ "sdm660")
+
+ # Set the default IRQ affinity to the primary cluster. When a
+ # CPU is isolated/hotplugged, the IRQ affinity is adjusted
+ # 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
+ 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
+
+ panel=`cat /sys/class/graphics/fb0/modes`
+ if [ "${panel:5:1}" == "x" ]; then
+ panel=${panel:2:3}
+ else
+ panel=${panel:2:4}
+ fi
+
+ if [ $panel -gt 1080 ]; then
+ echo 2 > /proc/sys/kernel/sched_window_stats_policy
+ echo 5 > /proc/sys/kernel/sched_ravg_hist_size
+ else
+ echo 3 > /proc/sys/kernel/sched_window_stats_policy
+ echo 3 > /proc/sys/kernel/sched_ravg_hist_size
+ fi
+ #Apply settings for sdm660, sdm636,sda636
+ case "$soc_id" in
+ "317" | "324" | "325" | "326" | "345" | "346" )
+
+ 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 1 > /sys/devices/system/cpu/cpu4/core_ctl/is_big_cluster
+ echo 4 > /sys/devices/system/cpu/cpu4/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 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 100000 > /proc/sys/kernel/sched_short_burst_ns
+ echo 1 > /proc/sys/kernel/sched_prefer_sync_wakee_to_waker
+
+ # cpuset settings
+ echo 0-7 > /dev/cpuset/top-app/cpus
+ echo 4-7 > /dev/cpuset/foreground/boost/cpus
+ echo 0-2,4-7 > /dev/cpuset/foreground/cpus
+ echo 0-1 > /dev/cpuset/background/cpus
+ echo 0-2 > /dev/cpuset/system-background/cpus
+
+ # disable thermal bcl hotplug to switch governor
+ echo 0 > /sys/module/msm_thermal/core_control/enabled
+
+ # online CPU0
+ echo 1 > /sys/devices/system/cpu/cpu0/online
+ # configure governor settings for little cluster
+ echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
+ 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 "19000 1401600:39000" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay
+ echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load
+ echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate
+ echo 1401600 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq
+ echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy
+ echo "85 1747200:95" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
+ echo 39000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time
+ echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/max_freq_hysteresis
+ echo 633600 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
+ echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/ignore_hispeed_on_notif
+ echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/fast_ramp_down
+ # online CPU4
+ echo 1 > /sys/devices/system/cpu/cpu4/online
+ # configure governor settings for big cluster
+ echo "interactive" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor
+ 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 "19000 1401600: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 1401600 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq
+ echo 0 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy
+ echo "85 1401600:90 2150400:95" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads
+ echo 39000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time
+ echo 59000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/max_freq_hysteresis
+ echo 1113600 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq
+ echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/ignore_hispeed_on_notif
+ echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/fast_ramp_down
+
+ # bring all cores online
+ echo 1 > /sys/devices/system/cpu/cpu0/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
+
+ # configure LPM
+ echo N > /sys/module/lpm_levels/system/pwr/cpu0/ret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/pwr/cpu1/ret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/pwr/cpu2/ret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/pwr/cpu3/ret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/perf/cpu4/ret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/perf/cpu5/ret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/perf/cpu6/ret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/perf/cpu7/ret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/pwr/pwr-l2-dynret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/perf/perf-l2-dynret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/pwr/pwr-l2-ret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/perf/perf-l2-ret/idle_enabled
+ # enable LPM
+ echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled
+
+ # 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
+ #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
+ # 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 762 > $cpubw/min_freq
+ echo "1525 3143 5859 7759 9887 10327 11863 13763" > $cpubw/bw_hwmon/mbps_zones
+ echo 4 > $cpubw/bw_hwmon/sample_ms
+ echo 85 > $cpubw/bw_hwmon/io_percent
+ echo 100 > $cpubw/bw_hwmon/decay_rate
+ echo 50 > $cpubw/bw_hwmon/bw_step
+ 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 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
+ done
+
+ 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
+ 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
+ ;;
+ esac
+ #Apply settings for sdm630
+ case "$soc_id" in
+ "318" | "327" )
+
+ # Start Host based Touch processing
+ #case "$hw_platform" in
+ # "MTP" | "Surf" | "RCM" | "QRD" )
+ # start_hbtp
+ # ;;
+ #esac
+
+ # Setting b.L scheduler parameters
+ echo 85 > /proc/sys/kernel/sched_upmigrate
+ echo 85 > /proc/sys/kernel/sched_downmigrate
+ echo 900 > /proc/sys/kernel/sched_group_upmigrate
+ echo 900 > /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 3 > /proc/sys/kernel/sched_spill_nr_run
+
+ #init task load, restrict wakeups to preferred cluster
+ echo 15 > /proc/sys/kernel/sched_init_task_load
+ echo 1 > /proc/sys/kernel/sched_restrict_cluster_spill
+ echo 50000 > /proc/sys/kernel/sched_short_burst_ns
+
+ # cpuset settings
+ echo 0-3 > /dev/cpuset/background/cpus
+ echo 0-3 > /dev/cpuset/system-background/cpus
+
+ # disable thermal bcl hotplug to switch governor
+ 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
+
+ # online CPU0
+ echo 1 > /sys/devices/system/cpu/cpu0/online
+ # configure governor settings for Big cluster(CPU0 to CPU3)
+ echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
+ 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 "19000 1344000: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 1344000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq
+ echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy
+ echo "85 1344000:80" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
+ echo 39000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time
+ echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/max_freq_hysteresis
+ echo 787200 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
+ echo 0 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/ignore_hispeed_on_notif
+
+ # online CPU4
+ echo 1 > /sys/devices/system/cpu/cpu4/online
+ # configure governor settings for Little cluster(CPU4 to CPU7)
+ echo "interactive" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor
+ 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 "19000 1094400:39000" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay
+ echo 85 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/go_hispeed_load
+ echo 20000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_rate
+ echo 1094400 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq
+ echo 0 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy
+ echo "85 1094400:80" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads
+ echo 39000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time
+ echo 0 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/max_freq_hysteresis
+ echo 614400 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq
+ echo 0 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/ignore_hispeed_on_notif
+
+ # bring all cores online
+ echo 1 > /sys/devices/system/cpu/cpu0/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
+
+ # configure LPM
+ echo N > /sys/module/lpm_levels/system/perf/cpu0/ret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/perf/cpu1/ret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/perf/cpu2/ret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/perf/cpu3/ret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/pwr/cpu4/ret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/pwr/cpu5/ret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/pwr/cpu6/ret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/pwr/cpu7/ret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/pwr/pwr-l2-dynret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/perf/perf-l2-dynret/idle_enabled
+ # enable LPM
+ echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled
+
+ # re-enable thermal and BCL hotplug
+ 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
+
+ # 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 762 > $cpubw/min_freq
+ echo "1525 3143 4173 5195 5859 7759 9887 10327" > $cpubw/bw_hwmon/mbps_zones
+ echo 4 > $cpubw/bw_hwmon/sample_ms
+ echo 85 > $cpubw/bw_hwmon/io_percent
+ echo 20 > $cpubw/bw_hwmon/hist_memory
+ echo 0 > $cpubw/bw_hwmon/hyst_length
+ echo 100 > $cpubw/bw_hwmon/decay_rate
+ echo 50 > $cpubw/bw_hwmon/bw_step
+ echo 80 > $cpubw/bw_hwmon/down_thres
+ echo 0 > $cpubw/bw_hwmon/low_power_ceil_mbps
+ echo 50 > $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
+
+ 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
+
+ echo "cpufreq" > /sys/class/devfreq/soc:qcom,mincpubw/governor
+ ;;
+ 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
+ echo 1 > /sys/module/msm_pm/modes/cpu1/power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu2/power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu3/power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu0/power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu2/power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu3/power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu0/retention/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/retention/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu2/retention/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu3/retention/idle_enabled
+ echo 0 > /sys/module/msm_thermal/core_control/enabled
+ echo 1 > /sys/devices/system/cpu/cpu1/online
+ echo 1 > /sys/devices/system/cpu/cpu2/online
+ echo 1 > /sys/devices/system/cpu/cpu3/online
+ for devfreq_gov in /sys/class/devfreq/qcom,cpubw*/governor
+ do
+ echo "cpubw_hwmon" > $devfreq_gov
+ done
+ echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
+ echo "interactive" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
+ echo "interactive" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
+ echo "interactive" > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
+ echo "20000 1400000:40000 1700000:20000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
+ echo 90 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
+ echo 1497600 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
+ echo "85 1500000:90 1800000:70" > /sys/devices/system/cpu/cpufreq/interactive/target_loads
+ echo 40000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
+ echo 20 > /sys/module/cpu_boost/parameters/boost_ms
+ echo 1728000 > /sys/module/cpu_boost/parameters/sync_threshold
+ 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
+ echo 1 > /dev/cpuctl/apps/cpu.notify_on_migrate
+ echo 300000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
+ echo 300000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
+ 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
+ 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
+ chmod -h 220 /sys/devices/system/cpu/mfreq
+ chown -h root.system /sys/devices/system/cpu/cpu1/online
+ chown -h root.system /sys/devices/system/cpu/cpu2/online
+ chown -h root.system /sys/devices/system/cpu/cpu3/online
+ chmod -h 664 /sys/devices/system/cpu/cpu1/online
+ chmod -h 664 /sys/devices/system/cpu/cpu2/online
+ chmod -h 664 /sys/devices/system/cpu/cpu3/online
+ ;;
+esac
+
+case "$target" in
+ "mpq8092")
+ echo 4 > /sys/module/lpm_levels/enable_low_power/l2
+ echo 1 > /sys/module/msm_pm/modes/cpu0/power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu2/power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu3/power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu0/power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu2/power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu3/power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/suspend_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu0/standalone_power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/standalone_power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu2/standalone_power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu3/standalone_power_collapse/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu0/retention/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu1/retention/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu2/retention/idle_enabled
+ echo 1 > /sys/module/msm_pm/modes/cpu3/retention/idle_enabled
+ echo 0 > /sys/module/msm_thermal/core_control/enabled
+ 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 "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
+ echo "ondemand" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
+ echo "ondemand" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
+ echo "ondemand" > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
+ echo 50000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
+ echo 90 > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
+ echo 1 > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy
+ echo 300000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
+ echo 300000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq
+ 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
+ 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
+ chmod -h 220 /sys/devices/system/cpu/mfreq
+ chown -h root.system /sys/devices/system/cpu/cpu1/online
+ chown -h root.system /sys/devices/system/cpu/cpu2/online
+ chown -h root.system /sys/devices/system/cpu/cpu3/online
+ chmod -h 664 /sys/devices/system/cpu/cpu1/online
+ chmod -h 664 /sys/devices/system/cpu/cpu2/online
+ chmod -h 664 /sys/devices/system/cpu/cpu3/online
+ ;;
+esac
+
+case "$target" in
+ "msm8992")
+ # disable thermal bcl hotplug to switch governor
+ echo 0 > /sys/module/msm_thermal/core_control/enabled
+ echo -n disable > /sys/devices/soc.*/qcom,bcl.*/mode
+ bcl_hotplug_mask=`cat /sys/devices/soc.*/qcom,bcl.*/hotplug_mask`
+ echo 0 > /sys/devices/soc.*/qcom,bcl.*/hotplug_mask
+ echo -n enable > /sys/devices/soc.*/qcom,bcl.*/mode
+ echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled
+ # configure governor settings for little cluster
+ echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
+ 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 19000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay
+ echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load
+ echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate
+ echo 960000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq
+ echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy
+ echo 80 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
+ echo 40000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time
+ echo 80000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/max_freq_hysteresis
+ echo 384000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
+ # online CPU4
+ echo 1 > /sys/devices/system/cpu/cpu4/online
+ # configure governor settings for big cluster
+ echo "interactive" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor
+ 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 19000 > /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 1536000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq
+ echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy
+ echo 85 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads
+ echo 40000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time
+ echo 80000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/max_freq_hysteresis
+ echo 384000 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq
+ # re-enable thermal and BCL hotplug
+ echo 1 > /sys/module/msm_thermal/core_control/enabled
+ echo -n disable > /sys/devices/soc.*/qcom,bcl.*/mode
+ echo $bcl_hotplug_mask > /sys/devices/soc.*/qcom,bcl.*/hotplug_mask
+ echo $bcl_soc_hotplug_mask > /sys/devices/soc.*/qcom,bcl.*/hotplug_soc_mask
+ echo -n enable > /sys/devices/soc.*/qcom,bcl.*/mode
+ # plugin remaining A57s
+ echo 1 > /sys/devices/system/cpu/cpu5/online
+ # input boost configuration
+ echo 0:1248000 > /sys/module/cpu_boost/parameters/input_boost_freq
+ echo 40 > /sys/module/cpu_boost/parameters/input_boost_ms
+ # Enable task migration fixups in the scheduler
+ echo 1 > /proc/sys/kernel/sched_migration_fixup
+ for devfreq_gov in /sys/class/devfreq/qcom,cpubw*/governor
+ do
+ echo "bw_hwmon" > $devfreq_gov
+ done
+ #enable rps static configuration
+ echo 8 > /sys/class/net/rmnet_ipa0/queues/rx-0/rps_cpus
+ echo 30 > /proc/sys/kernel/sched_small_task
+ ;;
+esac
+
+case "$target" in
+ "msm8994")
+ # ensure at most one A57 is online when thermal hotplug is disabled
+ echo 0 > /sys/devices/system/cpu/cpu5/online
+ echo 0 > /sys/devices/system/cpu/cpu6/online
+ echo 0 > /sys/devices/system/cpu/cpu7/online
+ # in case CPU4 is online, limit its frequency
+ echo 960000 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq
+ # Limit A57 max freq from msm_perf module in case CPU 4 is offline
+ echo "4:960000 5:960000 6:960000 7:960000" > /sys/module/msm_performance/parameters/cpu_max_freq
+ # disable thermal bcl hotplug to switch governor
+ 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 "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
+ 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 19000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay
+ echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load
+ echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate
+ echo 960000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq
+ echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy
+ echo 80 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
+ echo 40000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time
+ echo 80000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/max_freq_hysteresis
+ echo 384000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
+ # online CPU4
+ echo 1 > /sys/devices/system/cpu/cpu4/online
+ # Best effort limiting for first time boot if msm_performance module is absent
+ echo 960000 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq
+ # configure governor settings for big cluster
+ echo "interactive" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor
+ 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 "19000 1400000:39000 1700000:19000" > /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 1248000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq
+ echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy
+ echo "85 1500000:90 1800000:70" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads
+ echo 40000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time
+ echo 80000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/max_freq_hysteresis
+ echo 384000 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq
+ # restore A57's max
+ cat /sys/devices/system/cpu/cpu4/cpufreq/cpuinfo_max_freq > /sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq
+ # re-enable thermal and BCL hotplug
+ 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
+ # plugin remaining A57s
+ echo 1 > /sys/devices/system/cpu/cpu5/online
+ echo 1 > /sys/devices/system/cpu/cpu6/online
+ echo 1 > /sys/devices/system/cpu/cpu7/online
+ echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled
+ # Restore CPU 4 max freq from msm_performance
+ echo "4:4294967295 5:4294967295 6:4294967295 7:4294967295" > /sys/module/msm_performance/parameters/cpu_max_freq
+ # input boost configuration
+ echo 0:1344000 > /sys/module/cpu_boost/parameters/input_boost_freq
+ echo 40 > /sys/module/cpu_boost/parameters/input_boost_ms
+ # Setting b.L scheduler parameters
+ echo 1 > /proc/sys/kernel/sched_migration_fixup
+ echo 30 > /proc/sys/kernel/sched_small_task
+ echo 20 > /proc/sys/kernel/sched_mostly_idle_load
+ echo 3 > /proc/sys/kernel/sched_mostly_idle_nr_run
+ echo 99 > /proc/sys/kernel/sched_upmigrate
+ echo 85 > /proc/sys/kernel/sched_downmigrate
+ echo 400000 > /proc/sys/kernel/sched_freq_inc_notify
+ echo 400000 > /proc/sys/kernel/sched_freq_dec_notify
+ #enable rps static configuration
+ echo 8 > /sys/class/net/rmnet_ipa0/queues/rx-0/rps_cpus
+ for devfreq_gov in /sys/class/devfreq/qcom,cpubw*/governor
+ do
+ echo "bw_hwmon" > $devfreq_gov
+ done
+ ;;
+esac
+
+case "$target" in
+ "msm8996")
+ # disable thermal bcl hotplug to switch governor
+ echo 0 > /sys/module/msm_thermal/core_control/enabled
+ echo -n disable > /sys/devices/soc/soc:qcom,bcl/mode
+ bcl_hotplug_mask=`cat /sys/devices/soc/soc:qcom,bcl/hotplug_mask`
+ echo 0 > /sys/devices/soc/soc:qcom,bcl/hotplug_mask
+ bcl_soc_hotplug_mask=`cat /sys/devices/soc/soc:qcom,bcl/hotplug_soc_mask`
+ echo 0 > /sys/devices/soc/soc:qcom,bcl/hotplug_soc_mask
+ echo -n enable > /sys/devices/soc/soc:qcom,bcl/mode
+ # set sync wakee policy tunable
+ echo 1 > /proc/sys/kernel/sched_prefer_sync_wakee_to_waker
+ # configure governor settings for little cluster
+ echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
+ 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 19000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay
+ echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load
+ echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate
+ echo 960000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq
+ echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy
+ echo 80 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
+ echo 19000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time
+ echo 79000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/max_freq_hysteresis
+ echo 300000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
+ echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/ignore_hispeed_on_notif
+ # online CPU2
+ echo 1 > /sys/devices/system/cpu/cpu2/online
+ # configure governor settings for big cluster
+ echo "interactive" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
+ echo 1 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/use_sched_load
+ echo 1 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/use_migration_notif
+ echo "19000 1400000:39000 1700000:19000 2100000:79000" > /sys/devices/system/cpu/cpu2/cpufreq/interactive/above_hispeed_delay
+ echo 90 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/go_hispeed_load
+ echo 20000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/timer_rate
+ echo 1248000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/hispeed_freq
+ echo 1 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/io_is_busy
+ echo "85 1500000:90 1800000:70 2100000:95" > /sys/devices/system/cpu/cpu2/cpufreq/interactive/target_loads
+ echo 19000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/min_sample_time
+ echo 79000 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/max_freq_hysteresis
+ echo 300000 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq
+ echo 1 > /sys/devices/system/cpu/cpu2/cpufreq/interactive/ignore_hispeed_on_notif
+ # re-enable thermal and BCL hotplug
+ echo 1 > /sys/module/msm_thermal/core_control/enabled
+ echo -n disable > /sys/devices/soc/soc:qcom,bcl/mode
+ echo $bcl_hotplug_mask > /sys/devices/soc/soc:qcom,bcl/hotplug_mask
+ echo $bcl_soc_hotplug_mask > /sys/devices/soc/soc:qcom,bcl/hotplug_soc_mask
+ echo -n enable > /sys/devices/soc/soc:qcom,bcl/mode
+ # input boost configuration
+ echo "0:1324800 2:1324800" > /sys/module/cpu_boost/parameters/input_boost_freq
+ echo 40 > /sys/module/cpu_boost/parameters/input_boost_ms
+ # Setting b.L scheduler parameters
+ echo 0 > /proc/sys/kernel/sched_boost
+ echo 1 > /proc/sys/kernel/sched_migration_fixup
+ echo 45 > /proc/sys/kernel/sched_downmigrate
+ echo 45 > /proc/sys/kernel/sched_upmigrate
+ echo 400000 > /proc/sys/kernel/sched_freq_inc_notify
+ echo 400000 > /proc/sys/kernel/sched_freq_dec_notify
+ echo 3 > /proc/sys/kernel/sched_spill_nr_run
+ echo 100 > /proc/sys/kernel/sched_init_task_load
+ # Enable bus-dcvs
+ for cpubw in /sys/class/devfreq/*qcom,cpubw*
+ do
+ echo "bw_hwmon" > $cpubw/governor
+ echo 50 > $cpubw/polling_interval
+ echo 1525 > $cpubw/min_freq
+ echo "1525 5195 11863 13763" > $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 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
+ done
+
+ for memlat in /sys/class/devfreq/*qcom,memlat-cpu*
+ do
+ echo "mem_latency" > $memlat/governor
+ echo 10 > $memlat/polling_interval
+ done
+ echo "cpufreq" > /sys/class/devfreq/soc:qcom,mincpubw/governor
+
+ soc_revision=`cat /sys/devices/soc0/revision`
+ if [ "$soc_revision" == "2.0" ]; then
+ #Disable suspend for v2.0
+ echo pwr_dbg > /sys/power/wake_lock
+ elif [ "$soc_revision" == "2.1" ]; then
+ # Enable C4.D4.E4.M3 LPM modes
+ # Disable D3 state
+ echo 0 > /sys/module/lpm_levels/system/pwr/pwr-l2-gdhs/idle_enabled
+ echo 0 > /sys/module/lpm_levels/system/perf/perf-l2-gdhs/idle_enabled
+ # Disable DEF-FPC mode
+ echo N > /sys/module/lpm_levels/system/pwr/cpu0/fpc-def/idle_enabled
+ echo N > /sys/module/lpm_levels/system/pwr/cpu1/fpc-def/idle_enabled
+ echo N > /sys/module/lpm_levels/system/perf/cpu2/fpc-def/idle_enabled
+ echo N > /sys/module/lpm_levels/system/perf/cpu3/fpc-def/idle_enabled
+ else
+ # Enable all LPMs by default
+ # This will enable C4, D4, D3, E4 and M3 LPMs
+ echo N > /sys/module/lpm_levels/parameters/sleep_disabled
+ fi
+ echo N > /sys/module/lpm_levels/parameters/sleep_disabled
+ # Starting io prefetcher service
+ start iop
+
+ # Set Memory parameters
+ configure_memory_parameters
+ ;;
+esac
+
+case "$target" in
+ "sdm845")
+
+ # 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 f > /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
+ "321") #sdm845
+ start_hbtp
+ ;;
+ 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
+ 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 1 > /sys/devices/system/cpu/cpu4/core_ctl/is_big_cluster
+ echo 4 > /sys/devices/system/cpu/cpu4/core_ctl/task_thres
+
+ # Setting b.L scheduler parameters
+ echo 95 > /proc/sys/kernel/sched_upmigrate
+ 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
+
+ # 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
+
+ # 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 "0:1324800" > /sys/module/cpu_boost/parameters/input_boost_freq
+ echo 120 > /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 "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 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
+ done
+
+ for llccbw in /sys/class/devfreq/*qcom,llccbw*
+ do
+ echo "bw_hwmon" > $llccbw/governor
+ echo 50 > $llccbw/polling_interval
+ echo "1720 2929 4943 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 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
+ 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
+
+ #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
+
+ # 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
+ # 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
+ # Turn on sleep modes.
+ echo 0 > /sys/module/lpm_levels/parameters/sleep_disabled
+ echo 100 > /proc/sys/vm/swappiness
+ ;;
+esac
+
+case "$target" in
+ "msm8998" | "apq8098_latv")
+
+ 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 1 > /sys/devices/system/cpu/cpu4/core_ctl/is_big_cluster
+ echo 4 > /sys/devices/system/cpu/cpu4/core_ctl/task_thres
+
+ # Setting b.L scheduler parameters
+ echo 1 > /proc/sys/kernel/sched_migration_fixup
+ echo 95 > /proc/sys/kernel/sched_upmigrate
+ echo 90 > /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_prefer_sync_wakee_to_waker
+ start iop
+
+ # disable thermal bcl hotplug to switch governor
+ echo 0 > /sys/module/msm_thermal/core_control/enabled
+
+ # online CPU0
+ echo 1 > /sys/devices/system/cpu/cpu0/online
+ # configure governor settings for little cluster
+ echo "interactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
+ 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 19000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay
+ echo 90 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load
+ echo 20000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate
+ echo 1248000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq
+ echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy
+ echo "83 1804800:95" > /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads
+ echo 19000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time
+ echo 79000 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/max_freq_hysteresis
+ echo 518400 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
+ echo 1 > /sys/devices/system/cpu/cpu0/cpufreq/interactive/ignore_hispeed_on_notif
+ # online CPU4
+ echo 1 > /sys/devices/system/cpu/cpu4/online
+ # configure governor settings for big cluster
+ echo "interactive" > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor
+ 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 19000 > /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 1574400 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq
+ echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy
+ echo "83 1939200:90 2016000:95" > /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads
+ echo 19000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time
+ echo 79000 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/max_freq_hysteresis
+ echo 806400 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq
+ echo 1 > /sys/devices/system/cpu/cpu4/cpufreq/interactive/ignore_hispeed_on_notif
+
+ # re-enable thermal and BCL hotplug
+ echo 1 > /sys/module/msm_thermal/core_control/enabled
+
+ # Enable input boost configuration
+ echo "0:1324800" > /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 1525 > $cpubw/min_freq
+ echo "3143 5859 11863 13763" > $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 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
+ done
+
+ 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
+ echo "cpufreq" > /sys/class/devfreq/soc:qcom,mincpubw/governor
+ 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_version ]; then
+ platform_version=`cat /sys/devices/soc0/platform_version`
+ platform_major_version=$((10#${platform_version}>>16))
+ 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
+ "292") #msm8998 apq8098_latv
+ # Start Host based Touch processing
+ case "$hw_platform" in
+ "QRD")
+ case "$platform_subtype_id" in
+ "0")
+ start_hbtp
+ ;;
+ "16")
+ if [ $platform_major_version -lt 6 ]; then
+ start_hbtp
+ fi
+ ;;
+ esac
+
+ ;;
+ esac
+ ;;
+ esac
+
+ echo N > /sys/module/lpm_levels/system/pwr/cpu0/ret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/pwr/cpu1/ret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/pwr/cpu2/ret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/pwr/cpu3/ret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/perf/cpu4/ret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/perf/cpu5/ret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/perf/cpu6/ret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/perf/cpu7/ret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/pwr/pwr-l2-dynret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/pwr/pwr-l2-ret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/perf/perf-l2-dynret/idle_enabled
+ echo N > /sys/module/lpm_levels/system/perf/perf-l2-ret/idle_enabled
+ echo N > /sys/module/lpm_levels/parameters/sleep_disabled
+
+ echo 0-3 > /dev/cpuset/background/cpus
+ echo 0-3 > /dev/cpuset/system-background/cpus
+ echo 0 > /proc/sys/kernel/sched_boost
+ ;;
+esac
+
+case "$target" in
+ "msm8909")
+
+ 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
+
+ # HMP scheduler settings for 8909 similiar to 8917
+ 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
+
+ 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
+
+ # Apply governor settings for 8909
+
+ # disable thermal core_control to update scaling_min_freq
+ 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 800000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
+ # enable thermal core_control now
+ echo 1 > /sys/module/msm_thermal/core_control/enabled
+
+ echo "29000 1094400:49000" > /sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay
+ echo 90 > /sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load
+ echo 30000 > /sys/devices/system/cpu/cpufreq/interactive/timer_rate
+ echo 998400 > /sys/devices/system/cpu/cpufreq/interactive/hispeed_freq
+ echo 0 > /sys/devices/system/cpu/cpufreq/interactive/io_is_busy
+ echo "1 800000:85 998400:90 1094400:80" > /sys/devices/system/cpu/cpufreq/interactive/target_loads
+ echo 50000 > /sys/devices/system/cpu/cpufreq/interactive/min_sample_time
+ echo 50000 > /sys/devices/system/cpu/cpufreq/interactive/sampling_down_factor
+
+ # 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 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
+ for cpu_bimc_bw_step in /sys/class/devfreq/*qcom,cpubw*/bw_hwmon/bw_step
+ do
+ echo 60 > $cpu_bimc_bw_step
+ done
+ for cpu_guard_band_mbps in /sys/class/devfreq/*qcom,cpubw*/bw_hwmon/guard_band_mbps
+ do
+ echo 30 > $cpu_guard_band_mbps
+ done
+ done
+
+ for gpu_bimc_io_percent in /sys/class/devfreq/*qcom,gpubw*/bw_hwmon/io_percent
+ do
+ echo 40 > $gpu_bimc_io_percent
+ done
+ for gpu_bimc_bw_step in /sys/class/devfreq/*qcom,gpubw*/bw_hwmon/bw_step
+ do
+ echo 60 > $gpu_bimc_bw_step
+ done
+ for gpu_bimc_guard_band_mbps in /sys/class/devfreq/*qcom,gpubw*/bw_hwmon/guard_band_mbps
+ do
+ echo 30 > $gpu_bimc_guard_band_mbps
+ done
+
+ # Set Memory parameters
+ configure_memory_parameters
+ ;;
+esac
+
+case "$target" in
+ "msm7627_ffa" | "msm7627_surf" | "msm7627_6x")
+ echo 25000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
+ ;;
+esac
+
+case "$target" in
+ "qsd8250_surf" | "qsd8250_ffa" | "qsd8650a_st1x")
+ echo 50000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
+ ;;
+esac
+
+case "$target" in
+ "qsd8650a_st1x")
+ mount -t debugfs none /sys/kernel/debug
+ ;;
+esac
+
+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`
+case "$emmc_boot"
+ in "true")
+ chown -h system /sys/devices/platform/rs300000a7.65536/force_sync
+ chown -h system /sys/devices/platform/rs300000a7.65536/sync_sts
+ chown -h system /sys/devices/platform/rs300100a7.65536/force_sync
+ chown -h system /sys/devices/platform/rs300100a7.65536/sync_sts
+ ;;
+esac
+
+case "$target" in
+ "msm8960" | "msm8660" | "msm7630_surf")
+ echo 10 > /sys/devices/platform/msm_sdcc.3/idle_timeout
+ ;;
+ "msm7627a")
+ echo 10 > /sys/devices/platform/msm_sdcc.1/idle_timeout
+ ;;
+esac
+
+# Post-setup services
+case "$target" in
+ "msm8660" | "msm8960" | "msm8226" | "msm8610" | "mpq8092" )
+ start mpdecision
+ ;;
+ "msm8916")
+ setprop sys.post_boot.parsed 1
+
+ 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
+ "239" | "241" | "263" | "268" | "269" | "270" | "271")
+ setprop ro.min_freq_0 960000
+ setprop ro.min_freq_4 800000
+ ;;
+ "206" | "247" | "248" | "249" | "250" | "233" | "240" | "242")
+ setprop ro.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
+ ;;
+ "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
+ ;;
+ "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
+
+ low_ram_enable=`getprop ro.config.low_ram`
+
+ if [ "$low_ram_enable" != "true" ]; then
+ start gamed
+ fi
+ ;;
+ "msm8974")
+ 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
+ ;;
+ "apq8084")
+ rm /data/system/perfd/default_values
+ start mpdecision
+ echo 512 > /sys/block/mmcblk0/bdi/read_ahead_kb
+ echo 512 > /sys/block/sda/bdi/read_ahead_kb
+ echo 512 > /sys/block/sdb/bdi/read_ahead_kb
+ echo 512 > /sys/block/sdc/bdi/read_ahead_kb
+ echo 512 > /sys/block/sdd/bdi/read_ahead_kb
+ echo 512 > /sys/block/sde/bdi/read_ahead_kb
+ echo 512 > /sys/block/sdf/bdi/read_ahead_kb
+ echo 512 > /sys/block/sdg/bdi/read_ahead_kb
+ echo 512 > /sys/block/sdh/bdi/read_ahead_kb
+ ;;
+ "msm7627a")
+ 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
+ "127" | "128" | "129")
+ start mpdecision
+ ;;
+ esac
+ ;;
+esac
+
+# Enable Power modes and set the CPU Freq Sampling rates
+case "$target" in
+ "msm7627a")
+ start qosmgrd
+ echo 1 > /sys/module/pm2/modes/cpu0/standalone_power_collapse/idle_enabled
+ echo 1 > /sys/module/pm2/modes/cpu1/standalone_power_collapse/idle_enabled
+ echo 1 > /sys/module/pm2/modes/cpu0/standalone_power_collapse/suspend_enabled
+ echo 1 > /sys/module/pm2/modes/cpu1/standalone_power_collapse/suspend_enabled
+ #SuspendPC:
+ echo 1 > /sys/module/pm2/modes/cpu0/power_collapse/suspend_enabled
+ #IdlePC:
+ echo 1 > /sys/module/pm2/modes/cpu0/power_collapse/idle_enabled
+ echo 25000 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
+ ;;
+esac
+
+# Change adj level and min_free_kbytes setting for lowmemory killer to kick in
+case "$target" in
+ "msm7627a")
+ echo 0,1,2,4,9,12 > /sys/module/lowmemorykiller/parameters/adj
+ echo 5120 > /proc/sys/vm/min_free_kbytes
+ ;;
+esac
+
+# Install AdrenoTest.apk if not already installed
+if [ -f /data/prebuilt/AdrenoTest.apk ]; then
+ if [ ! -d /data/data/com.qualcomm.adrenotest ]; then
+ pm install /data/prebuilt/AdrenoTest.apk
+ fi
+fi
+
+# Install SWE_Browser.apk if not already installed
+if [ -f /data/prebuilt/SWE_AndroidBrowser.apk ]; then
+ if [ ! -d /data/data/com.android.swe.browser ]; then
+ pm install /data/prebuilt/SWE_AndroidBrowser.apk
+ fi
+fi
+
+# Change adj level and min_free_kbytes setting for lowmemory killer to kick in
+case "$target" in
+ "msm8660")
+ start qosmgrd
+ echo 0,1,2,4,9,12 > /sys/module/lowmemorykiller/parameters/adj
+ echo 5120 > /proc/sys/vm/min_free_kbytes
+ ;;
+esac
+
+# Let kernel know our image version/variant/crm_version
+if [ -f /sys/devices/soc0/select_image ]; then
+ image_version="10:"
+ image_version+=`getprop ro.build.id`
+ image_version+=":"
+ image_version+=`getprop ro.build.version.incremental`
+ image_variant=`getprop ro.product.name`
+ image_variant+="-"
+ image_variant+=`getprop ro.build.type`
+ oem_version=`getprop ro.build.version.codename`
+ echo 10 > /sys/devices/soc0/select_image
+ echo $image_version > /sys/devices/soc0/image_version
+ echo $image_variant > /sys/devices/soc0/image_variant
+ echo $oem_version > /sys/devices/soc0/image_crm_version
+fi
+
+# Change console log level as per console config property
+console_config=`getprop persist.console.silent.config`
+case "$console_config" in
+ "1")
+ echo "Enable console config to $console_config"
+ echo 0 > /proc/sys/kernel/printk
+ ;;
+ *)
+ echo "Enable console config to $console_config"
+ ;;
+esac
+
+# Parse misc partition path and set property
+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.qcom.sdio.sh b/rootdir/bin/init.qcom.sdio.sh
new file mode 100755
index 0000000..df77745
--- /dev/null
+++ b/rootdir/bin/init.qcom.sdio.sh
@@ -0,0 +1,78 @@
+#! /vendor/bin/sh
+
+# Copyright (c) 2010, 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 The 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 "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.
+#
+
+# For successful WLAN card detection, WLAN needs SDIO polling turned on.
+# This script can be used to turn on/off SDIO polling on appropriate
+# SDIO slot on the MSM target (e.g. slot 3 on 7x30 surf).
+
+arg=$1
+target=`getprop ro.board.platform`
+
+case "$target" in
+ "msm7627_6x")
+ echo 1 > /sys/devices/platform/msm_sdcc.1/polling
+ echo 1 > /sys/devices/platform/msm_sdcc.2/polling
+ ;;
+
+ "msm7627_ffa")
+ echo 1 > /sys/devices/platform/msm_sdcc.2/polling
+ ;;
+
+ "msm7627_surf")
+ echo 1 > /sys/devices/platform/msm_sdcc.1/polling
+ echo 1 > /sys/devices/platform/msm_sdcc.2/polling
+ ;;
+
+ "msm7627a")
+ echo 1 > /sys/devices/platform/msm_sdcc.2/polling
+ ;;
+
+ "msm7630_surf")
+ echo 1 > /sys/devices/platform/msm_sdcc.3/polling
+ ;;
+
+ "msm7630_1x")
+ echo 1 > /sys/devices/platform/msm_sdcc.3/polling
+ ;;
+
+ "msm7630_fusion")
+ echo 1 > /sys/devices/platform/msm_sdcc.3/polling
+ ;;
+
+ "msm8660")
+ echo 1 > /sys/devices/platform/msm_sdcc.4/polling
+ ;;
+
+ "msm8660_csfb")
+ echo 1 > /sys/devices/platform/msm_sdcc.4/polling
+ ;;
+esac
+
+exit 0
diff --git a/rootdir/bin/init.qcom.sensors.sh b/rootdir/bin/init.qcom.sensors.sh
new file mode 100755
index 0000000..fd193e2
--- /dev/null
+++ b/rootdir/bin/init.qcom.sensors.sh
@@ -0,0 +1,43 @@
+#!/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:
+# * 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 The 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.
+#
+
+#
+# Function to start sensors for SSC enabled platforms
+#
+start_sensors()
+{
+ if [ -c /dev/msm_dsps -o -c /dev/sensors ]; then
+ chmod -h 775 /persist/sensors
+ chmod -h 664 /persist/sensors/sensors_settings
+ mkdir -p /persist/sensors/registry/registry
+ chown -h system.root /persist/sensors/sensors_settings
+ start sensors
+ fi
+}
+
+start_sensors
diff --git a/rootdir/bin/init.qcom.sh b/rootdir/bin/init.qcom.sh
new file mode 100755
index 0000000..fc1f560
--- /dev/null
+++ b/rootdir/bin/init.qcom.sh
@@ -0,0 +1,470 @@
+#! /vendor/bin/sh
+
+# Copyright (c) 2009-2016, 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 The 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.
+#
+
+target=`getprop ro.board.platform`
+if [ -f /sys/devices/soc0/soc_id ]; then
+ platformid=`cat /sys/devices/soc0/soc_id`
+else
+ platformid=`cat /sys/devices/system/soc/soc0/id`
+fi
+
+start_battery_monitor()
+{
+ if ls /sys/bus/spmi/devices/qpnp-bms-*/fcc_data ; then
+ chown -h root.system /sys/module/pm8921_bms/parameters/*
+ chown -h root.system /sys/module/qpnp_bms/parameters/*
+ chown -h root.system /sys/bus/spmi/devices/qpnp-bms-*/fcc_data
+ chown -h root.system /sys/bus/spmi/devices/qpnp-bms-*/fcc_temp
+ chown -h root.system /sys/bus/spmi/devices/qpnp-bms-*/fcc_chgcyl
+ chmod 0660 /sys/module/qpnp_bms/parameters/*
+ chmod 0660 /sys/module/pm8921_bms/parameters/*
+ mkdir -p /data/bms
+ chown -h root.system /data/bms
+ chmod 0770 /data/bms
+ start battery_monitor
+ fi
+}
+
+start_charger_monitor()
+{
+ if ls /sys/module/qpnp_charger/parameters/charger_monitor; then
+ chown -h root.system /sys/module/qpnp_charger/parameters/*
+ chown -h root.system /sys/class/power_supply/battery/input_current_max
+ chown -h root.system /sys/class/power_supply/battery/input_current_trim
+ chown -h root.system /sys/class/power_supply/battery/input_current_settled
+ chown -h root.system /sys/class/power_supply/battery/voltage_min
+ chmod 0664 /sys/class/power_supply/battery/input_current_max
+ chmod 0664 /sys/class/power_supply/battery/input_current_trim
+ chmod 0664 /sys/class/power_supply/battery/input_current_settled
+ chmod 0664 /sys/class/power_supply/battery/voltage_min
+ chmod 0664 /sys/module/qpnp_charger/parameters/charger_monitor
+ start charger_monitor
+ fi
+}
+
+start_vm_bms()
+{
+ if [ -e /dev/vm_bms ]; then
+ chown -h root.system /sys/class/power_supply/bms/current_now
+ chown -h root.system /sys/class/power_supply/bms/voltage_ocv
+ chmod 0664 /sys/class/power_supply/bms/current_now
+ chmod 0664 /sys/class/power_supply/bms/voltage_ocv
+ start vm_bms
+ fi
+}
+
+start_msm_irqbalance_8939()
+{
+ if [ -f /system/vendor/bin/msm_irqbalance ]; then
+ case "$platformid" in
+ "239" | "293" | "294" | "295" | "304" | "313")
+ start vendor.msm_irqbalance;;
+ 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()
+{
+ if [ -f /vendor/bin/msm_irqbalance ]; then
+ case "$platformid" in
+ "317" | "324" | "325" | "326" | "345" | "346")
+ start vendor.msm_irqbalance;;
+ "318" | "327")
+ 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
+
+case "$baseband" in
+ "svlte2a")
+ start bridgemgrd
+ ;;
+esac
+
+case "$target" in
+ "msm7630_surf" | "msm7630_1x" | "msm7630_fusion")
+ if [ -f /sys/devices/soc0/hw_platform ]; then
+ value=`cat /sys/devices/soc0/hw_platform`
+ else
+ value=`cat /sys/devices/system/soc/soc0/hw_platform`
+ fi
+ case "$value" in
+ "Fluid")
+ start profiler_daemon;;
+ esac
+ ;;
+ "msm8660" )
+ if [ -f /sys/devices/soc0/hw_platform ]; then
+ platformvalue=`cat /sys/devices/soc0/hw_platform`
+ else
+ platformvalue=`cat /sys/devices/system/soc/soc0/hw_platform`
+ fi
+ case "$platformvalue" in
+ "Fluid")
+ start profiler_daemon;;
+ esac
+ ;;
+ "msm8960")
+ case "$baseband" in
+ "msm")
+ start_battery_monitor;;
+ esac
+
+ if [ -f /sys/devices/soc0/hw_platform ]; then
+ platformvalue=`cat /sys/devices/soc0/hw_platform`
+ else
+ platformvalue=`cat /sys/devices/system/soc/soc0/hw_platform`
+ fi
+ case "$platformvalue" in
+ "Fluid")
+ start profiler_daemon;;
+ "Liquid")
+ start profiler_daemon;;
+ esac
+ ;;
+ "msm8974")
+ platformvalue=`cat /sys/devices/soc0/hw_platform`
+ case "$platformvalue" in
+ "Fluid")
+ start profiler_daemon;;
+ "Liquid")
+ start profiler_daemon;;
+ esac
+ case "$baseband" in
+ "msm")
+ start_battery_monitor
+ ;;
+ esac
+ start_charger_monitor
+ ;;
+ "sdm660")
+ 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
+ "317" | "324" | "325" | "326" | "318" | "327" )
+ 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
+ start_msm_irqbalance660
+ ;;
+ "apq8084")
+ platformvalue=`cat /sys/devices/soc0/hw_platform`
+ case "$platformvalue" in
+ "Fluid")
+ start profiler_daemon;;
+ "Liquid")
+ start profiler_daemon;;
+ esac
+ ;;
+ "msm8226")
+ start_charger_monitor
+ ;;
+ "msm8610")
+ start_charger_monitor
+ ;;
+ "msm8916")
+ start_vm_bms
+ 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/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
+ "239")
+ case "$hw_platform" in
+ "Surf")
+ case "$platform_subtype_id" in
+ "1")
+ setprop qemu.hw.mainkeys 0
+ ;;
+ esac
+ ;;
+ "MTP")
+ case "$platform_subtype_id" in
+ "3")
+ setprop qemu.hw.mainkeys 0
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ ;;
+ "msm8994" | "msm8992" | "msm8998" | "apq8098_latv" | "sdm845")
+ start_msm_irqbalance
+ ;;
+ "msm8996")
+ if [ -f /sys/devices/soc0/hw_platform ]; then
+ hw_platform=`cat /sys/devices/soc0/hw_platform`
+ fi
+ case "$hw_platform" in
+ "MTP" | "CDP")
+ #Loop through the sysfs nodes and determine the correct sysfs to change the permission and ownership.
+ for count in 0 1 2 3 4 5 6 7 8 9 10
+ do
+ dir="/sys/devices/soc/75ba000.i2c/i2c-12/12-0020/input/input"$count
+ if [ -d "$dir" ]; then
+ chmod 0660 $dir/secure_touch_enable
+ chmod 0440 $dir/secure_touch
+ chown system.drmrpc $dir/secure_touch_enable
+ chown system.drmrpc $dir/secure_touch
+ break
+ fi
+ done
+ ;;
+ esac
+ ;;
+ "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
+ 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")
+ 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
+ ;;
+ "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
+ "293" | "304" | "338" | "351" )
+ 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
+ ;;
+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`
+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
+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
+
+#check build variant for printk logging
+#current default minimum boot-time-default
+buildvariant=`getprop ro.build.type`
+case "$buildvariant" in
+ "userdebug" | "eng")
+ #set default loglevel to KERN_INFO
+ echo "6 6 1 7" > /proc/sys/kernel/printk
+ ;;
+ *)
+ #set default loglevel to KERN_WARNING
+ echo "4 4 1 4" > /proc/sys/kernel/printk
+ ;;
+esac
diff --git a/rootdir/bin/init.qcom.syspart_fixup.sh b/rootdir/bin/init.qcom.syspart_fixup.sh
new file mode 100755
index 0000000..38d00f1
--- /dev/null
+++ b/rootdir/bin/init.qcom.syspart_fixup.sh
@@ -0,0 +1,80 @@
+#! /vendor/bin/sh
+
+# Copyright (c) 2012, 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 The 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.
+#
+
+target="$1"
+serial="$2"
+
+# No path is set up at this point so we have to do it here.
+PATH=/sbin:/system/sbin:/system/bin:/system/xbin
+export PATH
+
+mount_needed=false;
+
+if [ ! -f /system/etc/boot_fixup ];then
+# This should be the first command
+# remount system as read-write.
+ mount -o rw,remount,barrier=1 /system
+ mount_needed=true;
+fi
+
+# **** WARNING *****
+# This runs in a single-threaded, critical path portion
+# of the Android bootup sequence. This is to guarantee
+# all necessary system partition fixups are done before
+# the rest of the system starts up. Run any non-
+# timing critical tasks in a separate process to
+# prevent slowdown at boot.
+
+# Run modem link script
+if [ -f /system/etc/init.qcom.modem_links.sh ]; then
+ /system/vendor/bin/init.qcom.modem_links.sh
+fi
+
+# Run mdm link script
+if [ -f /system/etc/init.qcom.mdm_links.sh ]; then
+ /system/vendor/bin/init.qcom.mdm_links.sh
+fi
+
+# Run wifi script
+if [ -f /vendor/bin/init.qcom.wifi.sh ]; then
+ /vendor/bin/init.qcom.wifi.sh "$target" "$serial"
+fi
+
+# Run the sensor script
+if [ -f /system/etc/init.qcom.sensor.sh ]; then
+ /system/vendor/bin/init.qcom.sensor.sh
+fi
+
+touch /system/etc/boot_fixup
+
+if $mount_needed ;then
+# This should be the last command
+# remount system as read-only.
+ mount -o ro,remount,barrier=1 /system
+fi
diff --git a/rootdir/bin/init.qcom.usb.sh b/rootdir/bin/init.qcom.usb.sh
new file mode 100755
index 0000000..9bd8ca2
--- /dev/null
+++ b/rootdir/bin/init.qcom.usb.sh
@@ -0,0 +1,291 @@
+#!/vendor/bin/sh
+# Copyright (c) 2012-2017, 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 The 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 "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.
+#
+#
+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
+ soc_hwplatform=`cat /sys/devices/soc0/hw_platform` 2> /dev/null
+else
+ soc_hwplatform=`cat /sys/devices/system/soc/soc0/hw_platform` 2> /dev/null
+fi
+
+if [ -f /sys/devices/soc0/machine ]; then
+ soc_machine=`cat /sys/devices/soc0/machine` 2> /dev/null
+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
+#
+# Note: currently only a single MDM is supported
+#
+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
+ esoc_link=`cat $f/esoc_link`
+ break
+ fi
+ fi
+done
+fi
+
+target=`getprop ro.board.platform`
+
+# 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`
+fi
+
+#
+# Allow USB enumeration with default PID/VID
+#
+baseband=`getprop ro.baseband`
+
+echo 1 > /sys/class/android_usb/f_mass_storage/lun/nofua
+
+# 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"
+ ;;
+ *)
+ ;;
+esac
+
+# check configfs is mounted or not
+if [ -d /config/usb_gadget ]; then
+ msm_serial=`cat /sys/devices/soc0/serial_number`;
+ msm_serial_hex=`printf %08X $msm_serial`
+
+ # ADB requires valid iSerialNumber; if ro.serialno is missing, use dummy
+ serialnumber=`cat /config/usb_gadget/g1/strings/0x409/serialnumber` 2> /dev/null
+ if [ "$serialnumber" == "" ]; 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`
+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`
+fi
+
+# enable rps cpus on msm8937 target
+setprop sys.usb.rps_mask 0
+case "$soc_id" in
+ "294" | "295")
+ setprop sys.usb.rps_mask 40
+ ;;
+esac
diff --git a/rootdir/bin/init.qcom.wifi.sh b/rootdir/bin/init.qcom.wifi.sh
new file mode 100755
index 0000000..d8bb2d3
--- /dev/null
+++ b/rootdir/bin/init.qcom.wifi.sh
@@ -0,0 +1,505 @@
+#! /vendor/bin/sh
+
+# Copyright (c) 2010-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 The 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 "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.
+#
+# This script will load and unload the wifi driver to put the wifi in
+# in deep sleep mode so that there won't be voltage leakage.
+# Loading/Unloading the driver only incase if the Wifi GUI is not going
+# to Turn ON the Wifi. In the Script if the wlan driver status is
+# ok(GUI loaded the driver) or loading(GUI is loading the driver) then
+# the script won't do anything. Otherwise (GUI is not going to Turn On
+# the Wifi) the script will load/unload the driver
+# This script will get called after post bootup.
+
+target="$1"
+serialno="$2"
+
+btsoc=""
+
+# No path is set up at this point so we have to do it here.
+PATH=/sbin:/system/sbin:/system/bin:/system/xbin
+export PATH
+
+# Trigger WCNSS platform driver
+trigger_wcnss()
+{
+ # We need to trigger WCNSS platform driver, WCNSS driver
+ # will export a file which we must touch so that the
+ # driver knows that userspace is ready to handle firmware
+ # download requests.
+
+ # See if an appropriately named device file is present
+ wcnssnode=`ls /dev/wcnss*`
+ case "$wcnssnode" in
+ *wcnss*)
+ # Before triggering wcnss, let it know that
+ # caldata is available at userspace.
+ if [ -e /data/misc/wifi/WCNSS_qcom_wlan_cal.bin ]; then
+ calparm=`ls /sys/module/wcnsscore/parameters/has_calibrated_data`
+ if [ -e $calparm ] && [ ! -e /data/misc/wifi/WCN_FACTORY ]; then
+ echo 1 > $calparm
+ fi
+ fi
+ # There is a device file. Write to the file
+ # so that the driver knows userspace is
+ # available for firmware download requests
+ echo 1 > $wcnssnode
+ ;;
+
+ *)
+ # There is not a device file present, so
+ # the driver must not be available
+ echo "No WCNSS device node detected"
+ ;;
+ esac
+
+ # Plumb down the device serial number
+ if [ -f /sys/devices/*wcnss-wlan/serial_number ]; then
+ cd /sys/devices/*wcnss-wlan
+ echo $serialno > serial_number
+ cd /
+ elif [ -f /sys/devices/platform/wcnss_wlan.0/serial_number ]; then
+ echo $serialno > /sys/devices/platform/wcnss_wlan.0/serial_number
+ fi
+}
+
+
+case "$target" in
+ msm8974* | msm8226* | msm8610*)
+
+# Check whether device is plugged on the HSIC bus
+# Currently HSIC bus will be the first index
+
+ 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
+
+ chown -h system.system /sys/bus/platform/drivers/msm_hsic_host/bind
+ chown -h system.system /sys/bus/platform/drivers/msm_hsic_host/unbind
+ chmod -h 0200 /sys/bus/platform/drivers/msm_hsic_host/bind
+ chmod -h 0200 /sys/bus/platform/drivers/msm_hsic_host/unbind
+ fi
+
+ wlanchip=""
+
+# force ar6004 is ar6004_wlan.conf existed.
+ if [ -f /system/etc/firmware/ath6k/AR6004/ar6004_wlan.conf ]; then
+ wlanchip=`cat /system/etc/firmware/ath6k/AR6004/ar6004_wlan.conf`
+ fi
+
+# auto detect ar6004-sdio card
+# for ar6004-sdio card, the vendor id and device id is as the following
+# vendor id device id
+# 0x0271 0x0400
+# 0x0271 0x0401
+ if [ "$wlanchip" == "" ]; then
+ sdio_vendors=`echo \`cat /sys/bus/mmc/devices/*/*/vendor\``
+ sdio_devices=`echo \`cat /sys/bus/mmc/devices/*/*/device\``
+ ven_idx=0
+
+ for vendor in $sdio_vendors; do
+ case "$vendor" in
+ "0x0271")
+ dev_idx=0
+ for device in $sdio_devices; do
+ if [ $ven_idx -eq $dev_idx ]; then
+ case "$device" in
+ "0x0400" | "0x0401" | "0x0402")
+ wlanchip="AR6004-SDIO"
+ ;;
+ *)
+ ;;
+ esac
+ fi
+ dev_idx=$(( $dev_idx + 1))
+ done
+ ;;
+ *)
+ ;;
+ esac
+ ven_idx=$(( $ven_idx + 1))
+ done
+ # auto detect ar6004-sdio card end
+ fi
+
+# for ar6004-usb card, the vendor id and device id is as the following
+# vendor id product id
+# 0x0cf3 0x9374
+# 0x0cf3 0x9372
+ if [ "$wlanchip" == "" ]; then
+ usb_vendors=`echo \`cat /sys/bus/usb/devices/*/*/idVendor\``
+ usb_products=`echo \`cat /sys/bus/usb/devices/*/*/idProduct\``
+ ven_idx=0
+
+ for vendor in $usb_vendors; do
+ case "$vendor" in
+ "0cf3")
+ dev_idx=0
+ for product in $usb_products; do
+ if [ $ven_idx -eq $dev_idx ]; then
+ case "$product" in
+ "9374" | "9372")
+ wlanchip="AR6004-USB"
+ ;;
+ *)
+ ;;
+ esac
+ fi
+ dev_idx=$(( $dev_idx + 1))
+ done
+ ;;
+ *)
+ ;;
+ esac
+ ven_idx=$(( $ven_idx + 1))
+ done
+ # auto detect ar6004-usb card end
+ fi
+
+ echo "The WLAN Chip ID is $wlanchip"
+ case "$wlanchip" in
+ "AR6004-USB")
+ echo msm_hsic_host > /sys/bus/platform/drivers/msm_hsic_host/unbind
+ setprop wlan.driver.ath 2
+ setprop qcom.bluetooth.soc ath3k
+ btsoc="ath3k"
+ rm /system/lib/modules/wlan.ko
+ ln -s /system/lib/modules/ath6kl-3.5/ath6kl_usb.ko \
+ /system/lib/modules/wlan.ko
+ rm /system/etc/firmware/ath6k/AR6004/hw1.3/fw.ram.bin
+ rm /system/etc/firmware/ath6k/AR6004/hw1.3/bdata.bin
+ ln -s /system/etc/firmware/ath6k/AR6004/hw1.3/fw.ram.bin_usb \
+ /system/etc/firmware/ath6k/AR6004/hw1.3/fw.ram.bin
+ ln -s /system/etc/firmware/ath6k/AR6004/hw1.3/bdata.bin_usb \
+ /system/etc/firmware/ath6k/AR6004/hw1.3/bdata.bin
+ rm /system/etc/firmware/ath6k/AR6004/hw3.0/bdata.bin
+ ln -s /system/etc/firmware/ath6k/AR6004/hw3.0/bdata.bin_usb \
+ /system/etc/firmware/ath6k/AR6004/hw3.0/bdata.bin
+
+ # Use different wpa_supplicant.conf template between wcn driver
+ # and ath6kl driver
+ rm /system/etc/wifi/wpa_supplicant.conf
+ ln -s /system/etc/wifi/wpa_supplicant_ath6kl.conf \
+ /system/etc/wifi/wpa_supplicant.conf
+ ;;
+
+ "AR6004-SDIO")
+ setprop wlan.driver.ath 2
+ setprop qcom.bluetooth.soc ath3k
+ btsoc="ath3k"
+ # Chown polling nodes as needed from UI running on system server
+ chmod -h 0200 /sys/devices/msm_sdcc.1/polling
+ chmod -h 0200 /sys/devices/msm_sdcc.2/polling
+ chmod -h 0200 /sys/devices/msm_sdcc.3/polling
+ chmod -h 0200 /sys/devices/msm_sdcc.4/polling
+
+ chown -h system.system /sys/devices/msm_sdcc.1/polling
+ chown -h system.system /sys/devices/msm_sdcc.2/polling
+ chown -h system.system /sys/devices/msm_sdcc.3/polling
+ chown -h system.system /sys/devices/msm_sdcc.4/polling
+
+ rm /system/lib/modules/wlan.ko
+ ln -s /system/lib/modules/ath6kl-3.5/ath6kl_sdio.ko \
+ /system/lib/modules/wlan.ko
+ rm /system/etc/firmware/ath6k/AR6004/hw1.3/fw.ram.bin
+ rm /system/etc/firmware/ath6k/AR6004/hw1.3/bdata.bin
+ ln -s /system/etc/firmware/ath6k/AR6004/hw1.3/fw.ram.bin_sdio \
+ /system/etc/firmware/ath6k/AR6004/hw1.3/fw.ram.bin
+ ln -s /system/etc/firmware/ath6k/AR6004/hw1.3/bdata.bin_sdio \
+ /system/etc/firmware/ath6k/AR6004/hw1.3/bdata.bin
+ rm /system/etc/firmware/ath6k/AR6004/hw3.0/bdata.bin
+ ln -s /system/etc/firmware/ath6k/AR6004/hw3.0/bdata.bin_sdio \
+ /system/etc/firmware/ath6k/AR6004/hw3.0/bdata.bin
+
+ # Use different wpa_supplicant.conf template between wcn driver
+ # and ath6kl driver
+ rm /system/etc/wifi/wpa_supplicant.conf
+ ln -s /system/etc/wifi/wpa_supplicant_ath6kl.conf \
+ /system/etc/wifi/wpa_supplicant.conf
+ ;;
+
+ *)
+ echo "*** WI-FI chip ID is not specified in /persist/wlan_chip_id **"
+ echo "*** Use the default WCN driver. **"
+ setprop wlan.driver.ath 0
+ rm /system/lib/modules/wlan.ko
+ ln -s /system/lib/modules/pronto/pronto_wlan.ko \
+ /system/lib/modules/wlan.ko
+ # Populate the writable driver configuration file
+ if [ ! -s /data/misc/wifi/WCNSS_qcom_cfg.ini ]; then
+ cp /system/etc/wifi/WCNSS_qcom_cfg.ini \
+ /data/misc/wifi/WCNSS_qcom_cfg.ini
+ chown -h system:wifi /data/misc/wifi/WCNSS_qcom_cfg.ini
+ chmod -h 660 /data/misc/wifi/WCNSS_qcom_cfg.ini
+ fi
+
+ # The property below is used in Qcom SDK for softap to determine
+ # the wifi driver config file
+ setprop wlan.driver.config /data/misc/wifi/WCNSS_qcom_cfg.ini
+
+ # Use different wpa_supplicant.conf template between wcn driver
+ # and ath6kl driver
+ rm /system/etc/wifi/wpa_supplicant.conf
+ ln -s /system/etc/wifi/wpa_supplicant_wcn.conf \
+ /system/etc/wifi/wpa_supplicant.conf
+
+ # Trigger WCNSS platform driver
+ trigger_wcnss &
+ ;;
+ esac
+ ;;
+
+ apq8084*)
+ echo "*** Use the CNSS CLD driver.**"
+ setprop wlan.driver.ath 0
+
+ # Use different wpa_supplicant.conf template between wcn driver
+ # and ath6kl driver
+ rm /system/etc/wifi/wpa_supplicant.conf
+ ln -s /system/etc/wifi/wpa_supplicant_wcn.conf \
+ /system/etc/wifi/wpa_supplicant.conf
+ ;;
+
+ msm8960*)
+
+ # Move cfg80211.ko to prima directory, the default cfg80211.ko is
+ # for wcnss solution
+ if [ ! -L /system/lib/modules/cfg80211.ko ]; then
+ mv /system/lib/modules/cfg80211.ko /system/lib/modules/prima/
+ fi
+
+ wlanchip=""
+
+ if [ -f /system/etc/firmware/ath6k/AR6004/ar6004_wlan.conf ]; then
+ wlanchip=`cat /system/etc/firmware/ath6k/AR6004/ar6004_wlan.conf`
+ fi
+
+ if [ "$wlanchip" == "" ]; then
+ # auto detect ar6004-usb card
+ # for ar6004-usb card, the vendor id and device id is as the following
+ # vendor id product id
+ # 0x0cf3 0x9374
+ # 0x0cf3 0x9372
+ usb_vendors=`echo \`cat /sys/bus/usb/devices/*/*/idVendor\``
+ usb_products=`echo \`cat /sys/bus/usb/devices/*/*/idProduct\``
+ ven_idx=0
+
+ for vendor in $usb_vendors; do
+ case "$vendor" in
+ "0cf3")
+ dev_idx=0
+ for product in $usb_products; do
+ if [ $ven_idx -eq $dev_idx ]; then
+ case "$product" in
+ "9374" | "9372")
+ wlanchip="AR6004-USB"
+ ;;
+ *)
+ ;;
+ esac
+ fi
+ dev_idx=$(( $dev_idx + 1))
+ done
+ ;;
+ *)
+ ;;
+ esac
+ ven_idx=$(( $ven_idx + 1))
+ done
+ # auto detect ar6004-usb card end
+ fi
+
+ if [ "$wlanchip" == "" ]; then
+ # auto detect ar6004-sdio card
+ # for ar6004-sdio card, the vendor id and device id is
+ # as the following
+ # vendor id device id
+ # 0x0271 0x0400
+ # 0x0271 0x0401
+ sdio_vendors=`echo \`cat /sys/bus/mmc/devices/*/*/vendor\``
+ sdio_devices=`echo \`cat /sys/bus/mmc/devices/*/*/device\``
+ ven_idx=0
+
+ for vendor in $sdio_vendors; do
+ case "$vendor" in
+ "0x0271")
+ dev_idx=0
+ for device in $sdio_devices; do
+ if [ $ven_idx -eq $dev_idx ]; then
+ case "$device" in
+ "0x0400" | "0x0401")
+ wlanchip="AR6004-SDIO"
+ ;;
+ *)
+ ;;
+ esac
+ fi
+ dev_idx=$(( $dev_idx + 1))
+ done
+ ;;
+ *)
+ ;;
+ esac
+ ven_idx=$(( $ven_idx + 1))
+ done
+ # auto detect ar6004-sdio card end
+ fi
+
+ echo "The WLAN Chip ID is $wlanchip"
+ case "$wlanchip" in
+ "AR6004-USB")
+ setprop wlan.driver.ath 2
+ rm /system/lib/modules/wlan.ko
+ rm /system/lib/modules/cfg80211.ko
+ ln -s /system/lib/modules/ath6kl-3.5/ath6kl_usb.ko \
+ /system/lib/modules/wlan.ko
+ ln -s /system/lib/modules/ath6kl-3.5/cfg80211.ko \
+ /system/lib/modules/cfg80211.ko
+ rm /system/etc/firmware/ath6k/AR6004/hw1.3/fw.ram.bin
+ rm /system/etc/firmware/ath6k/AR6004/hw1.3/bdata.bin
+ ln -s /system/etc/firmware/ath6k/AR6004/hw1.3/fw.ram.bin_usb \
+ /system/etc/firmware/ath6k/AR6004/hw1.3/fw.ram.bin
+ ln -s /system/etc/firmware/ath6k/AR6004/hw1.3/bdata.bin_usb \
+ /system/etc/firmware/ath6k/AR6004/hw1.3/bdata.bin
+
+ # Use different wpa_supplicant.conf template between wcn driver
+ # and ath6kl driver
+ rm /system/etc/wifi/wpa_supplicant.conf
+ ln -s /system/etc/wifi/wpa_supplicant_ath6kl.conf \
+ /system/etc/wifi/wpa_supplicant.conf
+ ;;
+ "AR6004-SDIO")
+ setprop wlan.driver.ath 2
+ setprop qcom.bluetooth.soc ath3k
+ btsoc="ath3k"
+ rm /system/lib/modules/wlan.ko
+ rm /system/lib/modules/cfg80211.ko
+ ln -s /system/lib/modules/ath6kl-3.5/ath6kl_sdio.ko \
+ /system/lib/modules/wlan.ko
+ ln -s /system/lib/modules/ath6kl-3.5/cfg80211.ko \
+ /system/lib/modules/cfg80211.ko
+ rm /system/etc/firmware/ath6k/AR6004/hw1.3/fw.ram.bin
+ rm /system/etc/firmware/ath6k/AR6004/hw1.3/bdata.bin
+ ln -s /system/etc/firmware/ath6k/AR6004/hw1.3/fw.ram.bin_sdio \
+ /system/etc/firmware/ath6k/AR6004/hw1.3/fw.ram.bin
+ ln -s /system/etc/firmware/ath6k/AR6004/hw1.3/bdata.bin_sdio \
+ /system/etc/firmware/ath6k/AR6004/hw1.3/bdata.bin
+
+ # Use different wpa_supplicant.conf template between wcn driver
+ # and ath6kl driver
+ rm /system/etc/wifi/wpa_supplicant.conf
+ ln -s /system/etc/wifi/wpa_supplicant_ath6kl.conf \
+ /system/etc/wifi/wpa_supplicant.conf
+ ;;
+ *)
+ echo "*** WI-FI chip ID is not specified in /persist/wlan_chip_id **"
+ echo "*** Use the default WCN driver. **"
+ setprop wlan.driver.ath 0
+ rm /system/lib/modules/wlan.ko
+ rm /system/lib/modules/cfg80211.ko
+ ln -s /system/lib/modules/prima/prima_wlan.ko \
+ /system/lib/modules/wlan.ko
+ ln -s /system/lib/modules/prima/cfg80211.ko \
+ /system/lib/modules/cfg80211.ko
+
+ # The property below is used in Qcom SDK for softap to determine
+ # the wifi driver config file
+ setprop wlan.driver.config /data/misc/wifi/WCNSS_qcom_cfg.ini
+
+ # Use different wpa_supplicant.conf template between wcn driver
+ # and ath6kl driver
+ rm /system/etc/wifi/wpa_supplicant.conf
+ ln -s /system/etc/wifi/wpa_supplicant_wcn.conf \
+ /system/etc/wifi/wpa_supplicant.conf
+
+ # Trigger WCNSS platform driver
+ trigger_wcnss &
+ ;;
+ esac
+ ;;
+
+ msm7627a*)
+
+ # The default cfg80211 module is for volans
+ if [ ! -L /system/lib/modules/cfg80211.ko ]; then
+ mv /system/lib/modules/cfg80211.ko /system/lib/modules/volans/
+ fi
+
+ wlanchip=`cat /persist/wlan_chip_id`
+ echo "The WLAN Chip ID is $wlanchip"
+ case "$wlanchip" in
+ "ATH6KL")
+ setprop wlan.driver.ath 1
+ rm /system/lib/modules/wlan.ko
+ rm /system/lib/modules/cfg80211.ko
+ ln -s /system/lib/modules/ath6kl/ath6kl_sdio.ko \
+ /system/lib/modules/wlan.ko
+ ln -s /system/lib/modules/ath6kl/cfg80211.ko \
+ /system/lib/modules/cfg80211.ko
+ ;;
+ "WCN1314")
+ setprop wlan.driver.ath 0
+ rm /system/lib/modules/wlan.ko
+ rm /system/lib/modules/cfg80211.ko
+ ln -s /system/lib/modules/volans/WCN1314_rf.ko \
+ /system/lib/modules/wlan.ko
+ ln -s /system/lib/modules/volans/cfg80211.ko \
+ /system/lib/modules/cfg80211.ko
+ ;;
+ *)
+ setprop wlan.driver.ath 1
+ rm /system/lib/modules/wlan.ko
+ rm /system/lib/modules/cfg80211.ko
+ ln -s /system/lib/modules/ath6kl/ath6kl_sdio.ko \
+ /system/lib/modules/wlan.ko
+ ln -s /system/lib/modules/ath6kl/cfg80211.ko \
+ /system/lib/modules/cfg80211.ko
+ echo "************************************************************"
+ echo "*** Error:WI-FI chip ID is not specified in"
+ echo "/persist/wlan_chip_id"
+ echo "******* WI-FI may not work ***************************"
+ ;;
+ esac
+ ;;
+
+ msm7627*)
+ ln -s /data/hostapd/qcom_cfg.ini /etc/firmware/wlan/qcom_cfg.ini
+ ln -s /persist/qcom_wlan_nv.bin /etc/firmware/wlan/qcom_wlan_nv.bin
+ ;;
+
+ msm8660*)
+ ;;
+
+ msm7630*)
+ ;;
+
+ *)
+ ;;
+esac
+
diff --git a/rootdir/bin/init.qti.ims.sh b/rootdir/bin/init.qti.ims.sh
new file mode 100755
index 0000000..c2ac44e
--- /dev/null
+++ b/rootdir/bin/init.qti.ims.sh
@@ -0,0 +1,57 @@
+#! /vendor/bin/sh
+
+# Copyright (c) 2014, 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 The 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 "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.
+#
+#
+
+dir0=/data
+trigger_file=$dir0/ims_diabled
+ims_disabled=`getprop persist.ims.disabled`
+target=`getprop ro.build.product`
+
+#if [ ! -e $trigger_file ]; then
+# for future use in doing conditional debugging
+#else
+#
+#fi
+echo "$ims_disabled"
+echo "$target"
+
+if [ "$ims_disabled" = "0" ]; then
+ echo "ims will be enabled"
+ setprop service.qti.ims.enabled 1
+ exit
+fi
+
+if [ "$ims_disabled" = "1" ] || [ "$target" = "msm8909_512" ]; then
+ echo "ims is disabled"
+ setprop service.qti.ims.enabled 0
+else
+ echo "ims is enabled"
+ setprop service.qti.ims.enabled 1
+fi
diff --git a/rootdir/bin/qca6234-service.sh b/rootdir/bin/qca6234-service.sh
new file mode 100755
index 0000000..ee0f4dc
--- /dev/null
+++ b/rootdir/bin/qca6234-service.sh
@@ -0,0 +1,87 @@
+#! /vendor/bin/sh
+
+# Copyright (c) 2010-2014, 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 The 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 "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.
+
+# Check whether device is plugged on the HSIC bus
+# Currently HSIC bus will be the first index
+
+PATH=/sbin:/system/sbin:/system/bin:/system/xbin
+export PATH
+
+deviceprop=`getprop ro.baseband`
+boardprop=`getprop ro.board.platform`
+
+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
+
+ chown -h system.system /sys/bus/platform/drivers/msm_hsic_host/bind
+ chown -h system.system /sys/bus/platform/drivers/msm_hsic_host/unbind
+ chmod -h 0200 /sys/bus/platform/drivers/msm_hsic_host/bind
+ chmod -h 0200 /sys/bus/platform/drivers/msm_hsic_host/unbind
+fi
+
+wlanchip=""
+
+if [ "$deviceprop" == "apq" ] && [ "$boardprop" == "msm8974" ]; then
+ wlanchip="AR6004-USB"
+fi
+
+# force ar6004 is ar6004_wlan.conf existed.
+if [ -f /system/etc/firmware/ath6k/AR6004/ar6004_wlan.conf ]; then
+ wlanchip=`cat /system/etc/firmware/ath6k/AR6004/ar6004_wlan.conf`
+fi
+
+echo "The WLAN Chip ID is $wlanchip"
+if [ "$wlanchip" == "AR6004-USB" ]; then
+ echo msm_hsic_host > /sys/bus/platform/drivers/msm_hsic_host/unbind
+ setprop wlan.driver.ath 2
+ setprop qcom.bluetooth.soc ath3k
+ setprop wlan.driver.name /system/lib/modules/ath6kl-3.5/ath6kl_usb.ko
+ setprop wlan.supp.template /system/etc/wifi/wpa_supplicant_ath6kl.conf
+ btsoc="ath3k"
+elif [ "$wlanchip" == "AR6004-SDIO" ]; then
+ setprop wlan.driver.ath 2
+ setprop qcom.bluetooth.soc ath3k
+ setprop wlan.driver.name /system/lib/modules/ath6kl-3.5/ath6kl_sdio.ko
+ setprop wlan.supp.template /system/etc/wifi/wpa_supplicant_ath6kl.conf
+ btsoc="ath3k"
+
+ # Chown polling nodes as needed from UI running on system server
+ chmod -h 0200 /sys/devices/msm_sdcc.1/polling
+ chmod -h 0200 /sys/devices/msm_sdcc.2/polling
+ chmod -h 0200 /sys/devices/msm_sdcc.3/polling
+ chmod -h 0200 /sys/devices/msm_sdcc.4/polling
+
+ chown -h system.system /sys/devices/msm_sdcc.1/polling
+ chown -h system.system /sys/devices/msm_sdcc.2/polling
+ chown -h system.system /sys/devices/msm_sdcc.3/polling
+ chown -h system.system /sys/devices/msm_sdcc.4/polling
+fi
+
diff --git a/rootdir/etc/fstab.qcom b/rootdir/etc/fstab.qcom
index 0892afe..2c4f737 100755..100644
--- a/rootdir/etc/fstab.qcom
+++ b/rootdir/etc/fstab.qcom
@@ -7,12 +7,11 @@
# Non-A/B fstab.qcom variant
#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
-/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard,noatime,lazytime,errors=panic wait,resize,check,forceencrypt=footer,crashcheck,quota
-/dev/block/bootdevice/by-name/cust /cust ext4 ro,nosuid,nodev,barrier=1 wait,check
+/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,barrier=1,noauto_da_alloc,discard,noatime,lazytime,errors=panic wait,resize,check,encryptable=footer,crashcheck,quota
/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults
/dev/block/bootdevice/by-name/modem /firmware vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait
/dev/block/bootdevice/by-name/bluetooth /bt_firmware vfat ro,shortname=lower,uid=1002,gid=3002,dmask=227,fmask=337,context=u:object_r:bt_firmware_file:s0 wait
-/devices/soc/a800000.ssusb/a800000.dwc3/xhci-hcd.0.auto* /storage/usbotg vfat nosuid,nodev wait,voldmanaged=usbotg:auto
+/devices/soc/a800000.ssusb/a800000.dwc3/xhci-hcd.0.auto* /storage/usbotg vfat nosuid,nodev wait,voldmanaged=usbotg:auto
/dev/block/bootdevice/by-name/dsp /dsp ext4 ro,nosuid,nodev,barrier=1 wait
-/dev/block/bootdevice/by-name/cache /cache ext4 nosuid,nodev,noatime,barrier=1 wait
-/dev/block/bootdevice/by-name/persist /persist ext4 nosuid,nodev,barrier=1,noatime wait,check
+/dev/block/bootdevice/by-name/cache /cache ext4 nosuid,nodev,noatime,barrier=1 wait
+/dev/block/bootdevice/by-name/persist /persist ext4 nosuid,nodev,barrier=1,noatime wait,check
diff --git a/rootdir/etc/init.msm.usb.configfs.rc b/rootdir/etc/init.msm.usb.configfs.rc
new file mode 100755
index 0000000..b7f5b1b
--- /dev/null
+++ b/rootdir/etc/init.msm.usb.configfs.rc
@@ -0,0 +1,863 @@
+# Copyright (c) 2016-2017, 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 The 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 "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.
+#
+# MIUI ADD
+on property:vold.decrypt=trigger_restart_framework
+ setprop sys.usb.config ${persist.sys.usb.config}
+
+# USB compositions
+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
+ 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 0xF000
+ symlink /config/usb_gadget/g1/functions/mass_storage.0 /config/usb_gadget/g1/configs/b.1/f1
+ write /config/usb_gadget/g1/UDC ${sys.usb.controller}
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=mass_storage,adb && property:sys.usb.configfs=1
+ start adbd
+
+on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mass_storage,adb && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "adb_msc"
+ 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 0x9015
+ symlink /config/usb_gadget/g1/functions/ffs.adb /config/usb_gadget/g1/configs/b.1/f1
+ symlink /config/usb_gadget/g1/functions/mass_storage.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,adb && property:sys.usb.configfs=1
+ start adbd
+
+on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,adb && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_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
+ 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
+ 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}
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag"
+ 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 0x900E
+ symlink /config/usb_gadget/g1/functions/diag.diag /config/usb_gadget/g1/configs/b.1/f1
+ 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,adb && property:sys.usb.configfs=1
+ start adbd
+
+on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,serial_cdev,rmnet,adb && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "Default composition"
+ 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 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/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}
+
+on property:sys.usb.config=diag,serial_cdev,rmnet && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "Default comp without 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
+ 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
+ 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:sys.usb.config=rndis
+ setprop sys.usb.config rndis,${persist.sys.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"
+ 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 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
+ 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,adb
+ setprop sys.usb.config rndis,${persist.sys.usb.config.extra},adb
+
+on property:sys.usb.config=rndis,none,adb && property:sys.usb.configfs=1
+ start adbd
+
+on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,none,adb && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_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
+ 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/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
+ setprop sys.usb.state rndis,adb
+
+on property:sys.usb.config=rndis,diag && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_diag"
+ 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 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/diag.diag /config/usb_gadget/g1/configs/b.1/f2
+ write /config/usb_gadget/g1/UDC ${sys.usb.controller}
+ setprop sys.usb.state rndis
+
+on property:sys.usb.config=rndis,diag,adb && property:sys.usb.configfs=1
+ start adbd
+
+on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,diag,adb && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_diag_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
+ 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/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}
+ setprop sys.usb.state rndis,adb
+
+on property:sys.usb.config=rndis,serial_cdev && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_dun"
+ 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 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/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
+
+on property:sys.usb.config=rndis,serial_cdev,adb && property:sys.usb.configfs=1
+ start adbd
+
+on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,serial_cdev,adb && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_dun_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
+ 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/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}
+ setprop sys.usb.state rndis,adb
+
+on property:sys.usb.config=rndis,serial_cdev,diag && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_dun_diag"
+ 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 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/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}
+ setprop sys.usb.state rndis
+
+on property:sys.usb.config=rndis,serial_cdev,diag,adb && property:sys.usb.configfs=1
+ start adbd
+
+on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,serial_cdev,diag,adb && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_dun_diag"
+ 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 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/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
+ write /config/usb_gadget/g1/UDC ${sys.usb.controller}
+ setprop sys.usb.state rndis,adb
+
+on property:sys.usb.config=mtp,diag && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp_diag"
+ 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 0x901B
+ symlink /config/usb_gadget/g1/functions/mtp.gs0 /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 ${sys.usb.config}
+
+on property:sys.usb.config=mtp,diag,adb && property:sys.usb.configfs=1
+ start adbd
+
+on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mtp,diag,adb && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "mtp_diag_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
+ 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
+ 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}
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,qdss && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_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
+ 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
+ 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
+ write /config/usb_gadget/g1/UDC ${sys.usb.controller}
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,qdss,adb && property:sys.usb.configfs=1
+ start adbd
+
+on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,qdss,adb && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_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
+ 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
+ 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
+ write /config/usb_gadget/g1/UDC ${sys.usb.controller}
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,qdss,rmnet && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_qdss_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 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
+ write /config/usb_gadget/g1/UDC ${sys.usb.controller}
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,qdss,rmnet,adb && property:sys.usb.configfs=1
+ start adbd
+
+on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,qdss,rmnet,adb && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_qdss_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
+ 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
+ write /config/usb_gadget/g1/UDC ${sys.usb.controller}
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=rndis,diag,qdss && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_diag_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
+ 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/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}
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=rndis,diag,qdss,adb && property:sys.usb.configfs=1
+ start adbd
+
+on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,diag,qdss,adb && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_diag_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
+ 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/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
+ write /config/usb_gadget/g1/UDC ${sys.usb.controller}
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=ncm && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ncm"
+ 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 0xA4A1
+ symlink /config/usb_gadget/g1/functions/ncm.0 /config/usb_gadget/g1/configs/b.1/f1
+ write /config/usb_gadget/g1/UDC ${sys.usb.controller}
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=ncm,adb && property:sys.usb.configfs=1
+ start adbd
+
+on property:sys.usb.ffs.ready=1 && property:sys.usb.config=ncm,adb && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ncm_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
+ 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
+ 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}
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,serial_cdev && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_dun"
+ 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 0x9004
+ 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
+ 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 && property:sys.usb.configfs=1
+ start adbd
+
+on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,adb,serial_cdev && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_adb_dun"
+ 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 0x901f
+ 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
+ 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 && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_dun_rmnet_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
+ 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
+ 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,adb && property:sys.usb.configfs=1
+ start adbd
+
+on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,serial_cdev,rmnet,dpl,adb && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_dun_rmnet_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
+ 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/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}
+
+on property:sys.usb.config=rndis,diag,dpl && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_diag_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
+ 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/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
+ write /config/usb_gadget/g1/UDC ${sys.usb.controller}
+ setprop sys.usb.state rndis
+
+on property:sys.usb.config=rndis,diag,dpl,adb && property:sys.usb.configfs=1
+ start adbd
+
+on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,diag,dpl,adb && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "rndis_diag_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
+ 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/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/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
+
+on property:sys.usb.config=ccid && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ccid"
+ 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 0x90CE
+ symlink /config/usb_gadget/g1/functions/ccid.ccid /config/usb_gadget/g1/configs/b.1/f1
+ write /config/usb_gadget/g1/UDC ${sys.usb.controller}
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=ccid,adb && property:sys.usb.configfs=1
+ start adbd
+
+on property:sys.usb.ffs.ready=1 && property:sys.usb.config=ccid,adb && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ccid_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
+ 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
+ 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}
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=ccid,diag && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ccid_diag"
+ 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 0x90D0
+ symlink /config/usb_gadget/g1/functions/ccid.ccid /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 ${sys.usb.config}
+
+on property:sys.usb.config=ccid,diag,adb && property:sys.usb.configfs=1
+ start adbd
+
+on property:sys.usb.ffs.ready=1 && property:sys.usb.config=ccid,diag,adb && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "ccid_diag_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
+ 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
+ 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}
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,serial_cdev,rmnet,ccid && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_dun_rmnet_ccid"
+ 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 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/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}
+
+on property:sys.usb.config=diag,serial_cdev,rmnet,ccid,adb && property:sys.usb.configfs=1
+ start adbd
+
+on property:sys.usb.ffs.ready=1 && property:sys.usb.config=diag,serial_cdev,rmnet,ccid,adb && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/configs/b.1/strings/0x409/configuration "diag_dun_rmnet_ccid_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
+ 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/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}
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,diag_mdm,qdss,qdss_mdm,serial_cdev,serial_cdev_mdm,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_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 0x90D7
+ 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/${sys.usb.rmnet.func.name}.rmnet /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,serial_cdev_mdm,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,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_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
+ 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
+ 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/${sys.usb.rmnet.func.name}.rmnet /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=adb && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/idVendor 0x2717
+ write /config/usb_gadget/g1/idProduct 0xFF08
+
+on property:sys.usb.config=mtp && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/idVendor 0x2717
+ write /config/usb_gadget/g1/idProduct 0xFF40
+
+on property:sys.usb.config=mtp,adb && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/idVendor 0x2717
+ write /config/usb_gadget/g1/idProduct 0xFF48
+
+on property:sys.usb.config=ptp && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/idVendor 0x2717
+ write /config/usb_gadget/g1/idProduct 0xFF10
+
+on property:sys.usb.config=ptp,adb && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/idVendor 0x2717
+ write /config/usb_gadget/g1/idProduct 0xFF18
+
+on property:sys.usb.config=accessory && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/idVendor 0x18d1
+ write /config/usb_gadget/g1/idProduct 0x2d00
+
+on property:sys.usb.config=accessory,adb && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/idVendor 0x18d1
+ write /config/usb_gadget/g1/idProduct 0x2d01
+
+on property:sys.usb.config=audio_source && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/idVendor 0x18d1
+ write /config/usb_gadget/g1/idProduct 0x2d02
+
+on property:sys.usb.config=audio_source,adb && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/idVendor 0x18d1
+ write /config/usb_gadget/g1/idProduct 0x2d03
+
+on property:sys.usb.config=accessory,audio_source && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/idVendor 0x18d1
+ write /config/usb_gadget/g1/idProduct 0x2d04
+
+on property:sys.usb.config=accessory,audio_source,adb && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/idVendor 0x18d1
+ write /config/usb_gadget/g1/idProduct 0x2d05
+
+on property:sys.usb.config=midi && property:sys.usb.configfs=1
+ write /config/usb_gadget/g1/idVendor 0x18d1
+ write /config/usb_gadget/g1/idProduct 0x4ee8
+
+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
diff --git a/rootdir/etc/init.qcom.rc b/rootdir/etc/init.qcom.rc
new file mode 100755
index 0000000..357f276
--- /dev/null
+++ b/rootdir/etc/init.qcom.rc
@@ -0,0 +1,1299 @@
+# Copyright (c) 2009-2012, 2014-2017, 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 The 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.
+#
+
+import /vendor/etc/init/hw/init.qcom.usb.rc
+import /vendor/etc/init/hw/init.msm.usb.configfs.rc
+import /vendor/etc/init/hw/init.target.rc
+
+on early-init
+ mount debugfs debugfs /sys/kernel/debug
+ chmod 0755 /sys/kernel/debug
+ chown root system /dev/kmsg
+ chmod 0620 /dev/kmsg
+
+on init
+ # Set permissions for persist partition
+ mkdir /persist 0771 root system
+
+ # Support legacy paths
+ symlink /sdcard /mnt/sdcard
+ symlink /sdcard /storage/sdcard0
+
+ # Create cgroup mount point for memory
+ mkdir /sys/fs/cgroup/memory/bg 0750 root system
+ write /sys/fs/cgroup/memory/bg/memory.swappiness 140
+ write /sys/fs/cgroup/memory/bg/memory.move_charge_at_immigrate 1
+ chown root system /sys/fs/cgroup/memory/bg/tasks
+ chmod 0660 /sys/fs/cgroup/memory/bg/tasks
+
+on post-fs
+ chmod 0755 /sys/kernel/debug/tracing
+ insmod /system/lib/modules/exfat.ko
+
+on early-boot
+ # set RLIMIT_MEMLOCK to 64MB
+ setrlimit 8 67108864 67108864
+ # Allow subsystem (modem etc) debugging
+ write /sys/kernel/boot_adsp/boot 1
+ 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
+
+on boot
+ chown bluetooth bluetooth /sys/module/bluetooth_power/parameters/power
+ chown bluetooth net_bt /sys/class/rfkill/rfkill0/type
+ chown bluetooth net_bt /sys/class/rfkill/rfkill0/state
+ chown bluetooth bluetooth /proc/bluetooth/sleep/proto
+ chown bluetooth bluetooth /sys/module/hci_uart/parameters/ath_lpm
+ chown bluetooth bluetooth /sys/module/hci_uart/parameters/ath_btwrite
+ chown system system /sys/module/sco/parameters/disable_esco
+ chown bluetooth bluetooth /sys/module/hci_smd/parameters/hcismd_set
+ chown system system /sys/module/msm_core/parameters/polling_interval
+ chown system system /sys/module/msm_core/parameters/disabled
+ chown system system /sys/kernel/debug/msm_core/enable
+ chown system system /sys/kernel/debug/msm_core/ptable
+ chown system system /sys/kernel/boot_slpi/ssr
+ chown system system /sys/module/radio_iris_transport/parameters/fmsmd_set
+ chmod 0660 /sys/module/bluetooth_power/parameters/power
+ chmod 0660 /sys/module/hci_smd/parameters/hcismd_set
+ chmod 0660 /sys/module/radio_iris_transport/parameters/fmsmd_set
+ chmod 0660 /sys/class/rfkill/rfkill0/state
+ chmod 0660 /proc/bluetooth/sleep/proto
+ chown bluetooth net_bt /dev/ttyHS0
+ chmod 0660 /sys/module/hci_uart/parameters/ath_lpm
+ chmod 0660 /sys/module/hci_uart/parameters/ath_btwrite
+ chmod 0660 /dev/ttyHS0
+ chown bluetooth bluetooth /sys/devices/platform/msm_serial_hs.0/clock
+ chmod 0660 /sys/devices/platform/msm_serial_hs.0/clock
+
+ chmod 0660 /dev/ttyHS2
+ chown bluetooth bluetooth /dev/ttyHS2
+
+ chown bluetooth net_bt /sys/class/rfkill/rfkill0/device/extldo
+ chmod 0660 /sys/class/rfkill/rfkill0/device/extldo
+
+ #Create QMUX deamon socket area
+ mkdir /dev/socket/qmux_radio 0770 radio radio
+ chmod 2770 /dev/socket/qmux_radio
+ mkdir /dev/socket/qmux_audio 0770 media audio
+ chmod 2770 /dev/socket/qmux_audio
+ mkdir /dev/socket/qmux_bluetooth 0770 bluetooth bluetooth
+ chmod 2770 /dev/socket/qmux_bluetooth
+ mkdir /dev/socket/qmux_gps 0770 gps gps
+ chmod 2770 /dev/socket/qmux_gps
+
+ mkdir /persist/drm 0770 system system
+ mkdir /persist/bluetooth 0770 bluetooth bluetooth
+ mkdir /persist/misc 0770 system system
+ mkdir /persist/alarm 0770 system system
+ mkdir /persist/time 0770 system system
+ mkdir /persist/secnvm 0770 system system
+
+ #Create NETMGR daemon socket area
+ mkdir /dev/socket/netmgr 0750 radio radio
+
+ setprop wifi.interface wlan0
+
+# Define TCP buffer sizes for various networks
+# ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
+ setprop net.tcp.buffersize.wifi 524288,2097152,4194304,262144,524288,1048576
+
+
+ setprop ro.telephony.call_ring.multiple false
+
+ #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
+# ReadMin, ReadInitial, ReadMax, WriteMin, WriteInitial, WriteMax,
+ setprop net.tcp.buffersize.default 4096,87380,524288,4096,16384,110208
+ setprop net.tcp.buffersize.lte 2097152,4194304,8388608,262144,524288,1048576
+ setprop net.tcp.buffersize.umts 4094,87380,110208,4096,16384,110208
+ setprop net.tcp.buffersize.hspa 4094,87380,1220608,4096,16384,1220608
+ setprop net.tcp.buffersize.hsupa 4094,87380,1220608,4096,16384,1220608
+ setprop net.tcp.buffersize.hsdpa 4094,87380,1220608,4096,16384,1220608
+ setprop net.tcp.buffersize.hspap 4094,87380,1220608,4096,16384,1220608
+ setprop net.tcp.buffersize.edge 4093,26280,35040,4096,16384,35040
+ setprop net.tcp.buffersize.gprs 4092,8760,11680,4096,8760,11680
+ setprop net.tcp.buffersize.evdo 4094,87380,524288,4096,16384,262144
+
+ setprop net.tcp.2g_init_rwnd 10
+
+# Assign TCP buffer thresholds to be ceiling value of technology maximums
+# Increased technology maximums should be reflected here.
+ write /proc/sys/net/core/rmem_max 8388608
+ write /proc/sys/net/core/wmem_max 8388608
+
+ # To prevent out of order acknowledgements from making
+ # connection tracking to treat them as not belonging to
+ # the connection they belong to.
+ # Otherwise, a weird issue happens in which some long
+ # connections on high-throughput links get dropped when
+ # an ack packet comes out of order
+ write /proc/sys/net/netfilter/nf_conntrack_tcp_be_liberal 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"
+
+ # Allow access for CCID command/response timeout configuration
+ chown system system /sys/module/ccid_bridge/parameters/bulk_msg_timeout
+
+ # bond0 used by FST Manager
+ chown wifi wifi /sys/class/net/bond0/bonding/queue_id
+
+ # Allow access to emmc rawdump block partition and dload sysfs node
+ chown root system /dev/block/bootdevice/by-name/rawdump -p /dev/block/
+ chmod 0660 /dev/block/bootdevice/by-name/rawdump -p /dev/block/
+ chown root system /sys/kernel/dload/emmc_dload
+ chmod 0660 /sys/kernel/dload/emmc_dload
+ chown root system /dev/block/bootdevice/by-name/ramdump -p /dev/block/
+ chmod 0660 /dev/block/bootdevice/by-name/ramdump -p /dev/block/
+ chown root system /sys/kernel/dload/dload_mode
+ chmod 0660 /sys/kernel/dload/dload_mode
+
+ chown system system /sys/class/backlight/panel0-backlight/brightness
+ chown system system /sys/class/backlight/panel0-backlight/max_brightness
+
+ # Allow access to sensors device attributes
+ chown system system /sys/class/sensors/MPU6050-accel/enable
+ chown system system /sys/class/sensors/MPU6050-accel/poll_delay
+ chown system system /sys/class/sensors/MPU6050-gyro/enable
+ chown system system /sys/class/sensors/MPU6050-gyro/poll_delay
+ chown system system /sys/class/sensors/apds9930-light/enable
+ 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 /persist/display 0770 system graphics
+
+ # Create vpp directory
+ mkdir /persist/vpp 0770 media media
+
+ # load WIGIG platform driver
+ insmod /vendor/lib/modules/msm_11ad_proxy.ko
+
+# msm specific files that need to be created on /data
+on post-fs-data
+ mkdir /data/vendor/misc 01771 system system
+
+ # Create directory used by display clients
+ mkdir /data/vendor/display 0770 system graphics
+
+ # Change lm related dirs
+ mkdir /data/vendor/lm 0700 root root
+
+ # 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
+
+ # Create directory for TZ Apps
+ mkdir /data/misc/qsee 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 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
+
+ mkdir /data/vendor/ramdump 0771 root system
+ mkdir /data/vendor/bluetooth 0770 bluetooth bluetooth
+ mkdir /data/vendor/ramdump/bluetooth 0770 bluetooth bluetooth
+
+ # Create the directories used by the Wireless subsystem
+ mkdir /data/vendor/wifi 0770 wifi wifi
+ 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_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
+
+ #create port-bridge log dir
+ mkdir /data/vendor/port_bridge 0770 radio radio
+ chmod 0770 /data/vendor/port_bridge
+
+ #create netmgr log dir
+ mkdir /data/vendor/netmgr 0770 radio radio
+ chmod 0770 /data/vendor/netmgr
+
+ #create ipacm log dir
+ mkdir /data/vendor/ipa 0770 radio radio
+ chmod 0770 /data/vendor/ipa
+
+ # Create the directories used by CnE subsystem
+ mkdir /data/connectivity 0771 system system
+ chown system system /data/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
+
+ # 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
+
+ # Create directory for radio
+ mkdir /data/vendor/radio 0770 system radio
+
+ # Mounting of persist is moved to 'on emmc-fs' and 'on fs' sections
+ # 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
+ chmod 0664 /sys/devices/platform/msm_sdcc.4/polling
+
+ # Chown polling nodes as needed from UI running on system server
+ chown system system /sys/devices/platform/msm_sdcc.1/polling
+ chown system system /sys/devices/platform/msm_sdcc.2/polling
+ chown system system /sys/devices/platform/msm_sdcc.3/polling
+ chown system system /sys/devices/platform/msm_sdcc.4/polling
+
+ #Create the symlink to qcn wpa_supplicant folder for ar6000 wpa_supplicant
+ mkdir /data/system 0775 system system
+ #symlink /data/misc/wifi/wpa_supplicant /data/system/wpa_supplicant
+
+ #Create directories for Location services
+ mkdir /data/vendor/location 0770 gps gps
+ mkdir /data/vendor/location/mq 0770 gps gps
+ mkdir /data/vendor/location/xtwifi 0770 gps gps
+
+ #Create directory from IMS services
+ mkdir /data/shared 0755
+ chown system system /data/shared
+
+ #Create directory for FOTA
+ mkdir /data/fota 0771
+ chown system system /data/fota
+
+ #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
+
+ # Create a folder for audio delta files
+ mkdir /data/vendor/audio/acdbdata 0770 media audio
+ mkdir /data/vendor/audio/acdbdata/delta 0770 media audio
+
+ 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
+
+ #Create FM dir for patchdownloader
+ mkdir /data/misc/fm 0770 system system
+ chmod 0770 /data/misc/fm
+
+ #Create PERFD deamon related dirs
+ mkdir /data/vendor/perfd 0770 root system
+ chmod 2770 /data/vendor/perfd
+ rm /data/vendor/perfd/default_values
+
+ # NFC local data and nfcee xml storage
+ mkdir /data/nfc 0770 nfc nfc
+ mkdir /data/nfc/param 0770 nfc nfc
+
+ #Create IOP deamon related dirs
+ mkdir /data/vendor/iop 0770 root system
+
+ # Mark the copy complete flag to not completed
+ write /data/vendor/radio/copy_complete 0
+ chown radio radio /data/vendor/radio/copy_complete
+ chmod 0660 /data/vendor/radio/copy_complete
+
+ # copy prebuilt qcril.db files always
+ copy /vendor/radio/qcril_database/qcril.db /data/vendor/radio/qcril_prebuilt.db
+ chown radio radio /data/vendor/radio/qcril_prebuilt.db
+ chmod 0660 /data/vendor/radio/qcril_prebuilt.db
+ # File flags for prebuilt ril db file
+ write /data/vendor/radio/prebuilt_db_support 1
+ chown radio radio /data/vendor/radio/prebuilt_db_support
+ chmod 0400 /data/vendor/radio/prebuilt_db_support
+ write /data/vendor/radio/db_check_done 0
+ chown radio radio /data/vendor/radio/db_check_done
+ chmod 0660 /data/vendor/radio/db_check_done
+
+ # qti-logkit data
+ mkdir /data/vendor/qti-logkit/ 0771 system system
+ mkdir /data/vendor/qti-logkit/shared-privileged/ 2770 system system
+ mkdir /data/vendor/qti-logkit/shared-public/ 2770 system diag
+ mkdir /data/vendor/qti-logkit/socket-privileged/ 2770 system system
+ mkdir /data/vendor/qti-logkit/socket-public/ 2750 system diag
+ mkdir /data/vendor/qti-logkit/logdata/ 2750 system shell
+
+ #Create SWAP related dirs
+ mkdir /data/system/swap 0770 root system
+ chmod 2770 /data/system/swap
+
+ # set aggressive read ahead for dm-0 and dm-1 during boot up
+ write /sys/block/dm-0/queue/read_ahead_kb 2048
+ write /sys/block/dm-1/queue/read_ahead_kb 2048
+
+ # Create vpp directory
+ mkdir /data/vendor/vpp 0770 media media
+
+ #Create FTM_AP dir for factory test
+ mkdir /data/FTM_AP 0775 system system
+
+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
+ disabled
+
+on property:persist.vendor.qcomsysd.enabled=1
+ start qcomsysd
+
+service ssr_setup /system/vendor/bin/ssr_setup
+ oneshot
+ disabled
+
+service ss_ramdump /system/vendor/bin/subsystem_ramdump
+ class main
+ user system
+ group system
+ disabled
+
+on property:persist.sys.ssr.enable_debug=*
+ write /sys/module/subsystem_restart/parameters/enable_debug ${persist.sys.ssr.enable_debug}
+
+on property:persist.sys.mba_boot_timeout=*
+ write /sys/module/pil_msa/parameters/pbl_mba_boot_timeout_ms ${persist.sys.mba_boot_timeout}
+
+on property:persist.sys.modem_auth_timeout=*
+ write /sys/module/pil_msa/parameters/modem_auth_timeout_ms ${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=*
+ start ssr_setup
+
+on property:persist.sys.ssr.enable_ramdumps=1
+ write /sys/module/subsystem_restart/parameters/enable_ramdumps 1
+ mkdir /data/ramdump 770 system system
+ start ss_ramdump
+
+on property:persist.sys.ssr.enable_ramdumps=0
+ write /sys/module/subsystem_restart/parameters/enable_ramdumps 0
+
+on property:sys.boot_completed=1
+ write /dev/kmsg "Boot completed "
+ #Reset read ahead for dm-0 and dm-1 to 512kb
+ write /sys/block/dm-0/queue/read_ahead_kb 512
+ write /sys/block/dm-1/queue/read_ahead_kb 512
+ #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
+
+# 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"
+
+#zhuxiaomin @ 20170928
+service iwprivftm /system/bin/sh /system/etc/iwpriv.agent.sh
+ oneshot
+ disabled
+on property:persist.sys.iwpriv=1
+ start iwprivftm
+
+#++++>
+on property:sys.ptt_socket_app=1
+ start ptt_ffbm
+
+on property:sys.ftmd=1
+ start ftmd
+#<++++ zhuxiaomin @ 20170928 Add for WiFi & BT FFBM test.
+
+on property:init.svc.wpa_supplicant=stopped
+ stop dhcpcd
+
+on property:bluetooth.sap.status=running
+ start bt-sap
+
+on property:bluetooth.sap.status=stopped
+ stop bt-sap
+
+on property:bluetooth.dun.status=running
+ start bt-dun
+
+on property:bluetooth.dun.status=stopped
+ stop bt-dun
+
+on property:ro.bluetooth.ftm_enabled=true
+ start ftmd
+
+on property:bluetooth.startbtsnoop=true
+ start btsnoop
+
+on property:bluetooth.startbtsnoop=false
+ stop btsnoop
+
+on property:bluetooth.startbtlogger=true
+ start bt_logger
+
+on property:bluetooth.startbtlogger=false
+ stop bt_logger
+
+service qcom-c_core-sh /vendor/bin/init.qcom.class_core.sh
+ class core
+ user root
+ oneshot
+
+service qcom-c_main-sh /vendor/bin/init.class_main.sh
+ class main
+ user root
+ oneshot
+
+on property:vold.decrypt=trigger_restart_framework
+ start qcom-c_main-sh
+ start config_bt_addr
+ start wcnss-service
+
+on property:persist.env.fastdorm.enabled=true
+ setprop persist.radio.data_no_toggle 1
+
+service cnd /system/vendor/bin/cnd
+ class main
+ user system
+ group system wifi inet radio wakelock net_admin
+
+service dpmQmiMgr /system/vendor/bin/dpmQmiMgr
+ class main
+ user system
+ group system
+
+service irsc_util /vendor/bin/irsc_util "/vendor/etc/sec_config"
+ class core
+ user root
+ oneshot
+
+service rmt_storage /vendor/bin/rmt_storage
+ class core
+ user root
+ shutdown critical
+ ioprio rt 0
+
+service tftp_server /vendor/bin/tftp_server
+ class core
+ user root
+
+on property:wc_transport.start_hci=true
+ start start_hci_filter
+
+on property:wc_transport.start_hci=false
+ stop start_hci_filter
+
+service 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 bt-dun /system/bin/dun-server /dev/smd7 /dev/rfcomm0
+ class late_start
+ user bluetooth
+ group bluetooth net_bt_admin inet
+ disabled
+ oneshot
+
+service bt-sap /system/bin/sapd 15
+ user bluetooth
+ group bluetooth net_bt_admin
+ class late_start
+ disabled
+ oneshot
+
+service btsnoop /system/bin/btsnoop
+ user bluetooth
+ group bluetooth net_bt_admin sdcard_rw sdcard_r media_rw
+ class late_start
+ disabled
+ oneshot
+
+service 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/vendor/bin/ftmdaemon
+ class late_start
+ user root
+ group bluetooth net_bt_admin misc diag net_bt
+ disabled
+ oneshot
+
+service port-bridge /system/vendor/bin/port-bridge
+ class main
+ user radio system
+ 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 qmuxd /system/vendor/bin/qmuxd
+ class main
+ user root
+ group radio audio bluetooth gps nfc diag
+ disabled
+
+service netmgrd /system/vendor/bin/netmgrd
+ class main
+ disabled
+
+service ipacm-diag /system/vendor/bin/ipacm-diag
+ class main
+ user radio
+ socket ipacm_log_file dgram 660 radio radio
+ group radio diag oem_2901
+ disabled
+
+service ipacm /system/vendor/bin/ipacm
+ class main
+ user radio
+ group radio inet
+ disabled
+
+service qti /system/vendor/bin/qti
+ class main
+ user radio
+ group radio oem_2901 diag usb net_admin
+ disabled
+
+service sensors /vendor/bin/sensors.qcom
+ class core
+ user root
+ group root
+ disabled
+
+on property:ro.use_data_netmgrd=false
+ # netmgr not supported on specific target
+ stop netmgrd
+
+# Adjust socket buffer to enlarge TCP receive window for high bandwidth
+# but only if ro.data.large_tcp_window_size property is set.
+on property:ro.data.large_tcp_window_size=true
+ write /proc/sys/net/ipv4/tcp_adv_win_scale 2
+
+on property:sys.sysctl.tcp_adv_win_scale=*
+ write /proc/sys/net/ipv4/tcp_adv_win_scale ${sys.sysctl.tcp_adv_win_scale}
+
+service amp_init /system/vendor/bin/amploader -i
+ class late_start
+ user root
+ disabled
+ oneshot
+
+service amp_load /system/vendor/bin/amploader -l 7000
+ class late_start
+ user root
+ disabled
+ oneshot
+
+service amp_unload /system/vendor/bin/amploader -u
+ class late_start
+ user root
+ disabled
+ oneshot
+
+service wpa_supplicant /vendor/bin/hw/wpa_supplicant \
+ -ip2p0 -Dnl80211 -c/data/misc/wifi/p2p_supplicant.conf \
+ -I/vendor/etc/wifi/p2p_supplicant_overlay.conf -N \
+ -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
+ -I/vendor/etc/wifi/wpa_supplicant_overlay.conf \
+ -O/data/misc/wifi/sockets -puse_p2p_group_interface=1 -dd \
+ -e/data/misc/wifi/entropy.bin -g@android: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
+# group wifi inet keystore
+ class main
+ socket wpa_wlan0 dgram 660 wifi wifi
+ disabled
+ oneshot
+
+service vendor.wigig_supplicant /vendor/bin/hw/wpa_supplicant \
+ -iwigig0 -Dnl80211 -c/data/vendor/wifi/wigig_supplicant.conf \
+ -m/data/vendor/wifi/wigig_p2p_supplicant.conf \
+ -O/data/vendor/wifi/wigig_sockets -dd \
+ -e/data/vendor/wifi/wigig_entropy.bin -g@android:wpa_wigig0 \
+ -S wigigsvc
+ # we will start as root and wpa_supplicant will switch to user wifi
+ # after setting up the capabilities required for WEXT
+ # user wifi
+ # group wifi inet keystore
+ class main
+ socket wpa_wigig0 dgram 660 wifi wifi
+ disabled
+ oneshot
+
+# FST Manager with hostapd (softap) - all settings inside ini file
+service fstman /vendor/bin/fstman -B -ddd -c /data/vendor/wifi/fstman.ini
+ user wifi
+ group wifi net_admin net_raw
+ class main
+ disabled
+ oneshot
+
+# FST Manager with supplicant - connect to supplicant socket
+service fstman_wlan0 /vendor/bin/fstman -B -ddd -c /data/vendor/wifi/fstman.ini @android:wpa_wlan0
+ user wifi
+ group wifi net_admin net_raw
+ class main
+ disabled
+ oneshot
+
+on property:netd.fstman.start=true
+ start fstman
+
+on property:netd.fstman.start=false
+ stop fstman
+
+service wigighalsvc /vendor/bin/wigighalsvc
+ class main
+ user system
+ group wifi
+ disabled
+
+service wigignpt /vendor/bin/wigignpt
+ class main
+ socket wigignpt stream 660 system wifi
+ user system
+ group wifi net_admin
+ disabled
+
+on property:persist.vendor.wigig.enable=1
+ insmod /vendor/lib/modules/wil6210.ko alt_ifname=1
+ start wigighalsvc
+
+on property:persist.vendor.wigig.npt.enable=1
+ start wigignpt
+
+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
+
+service ptt_ffbm /system/vendor/bin/ptt_socket_app -f -d
+ user root
+ group root
+ disabled
+ oneshot
+
+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:wifi.ftmd.load=true
+ start openwifi
+on property:wifi.ftmd.load=false
+ stop openwifi
+
+
+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 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 dhcpcd_bnep0 /system/bin/dhcpcd -BKLG
+ disabled
+ oneshot
+
+service dhcpcd_bnep1 /system/bin/dhcpcd -BKLG
+ disabled
+ oneshot
+
+service dhcpcd_bnep2 /system/bin/dhcpcd -BKLG
+ disabled
+ oneshot
+
+service dhcpcd_bnep3 /system/bin/dhcpcd -BKLG
+ disabled
+ oneshot
+
+service dhcpcd_bnep4 /system/bin/dhcpcd -BKLG
+ disabled
+ oneshot
+
+service ssgqmigd /vendor/bin/ssgqmigd
+ class late_start
+ user radio
+ group radio
+ socket ssgqmig seqpacket 0660 radio 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
+ #loc_launcher will start as root and set its uid to gps
+ class late_start
+ group gps inet diag wifi
+
+on property:crypto.driver.load=1
+ insmod /system/lib/modules/qce.ko
+ insmod /system/lib/modules/qcedev.ko
+
+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
+ oneshot
+
+service 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
+ disabled
+ oneshot
+
+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 qcom-post-boot
+
+service qvop-daemon /vendor/bin/qvop-daemon
+ class late_start
+ user system
+ group system drmrpc
+
+service atfwd /vendor/bin/ATFWD-daemon
+ class late_start
+ user system
+ group system radio
+ disabled
+
+on property:persist.radio.atfwd.start=true
+ start atfwd
+
+service hostapd_fst /vendor/bin/hostapd -dd -g /data/vendor/wifi/hostapd/global /data/misc/wifi/hostapd.conf
+ class late_start
+ user wifi
+ group wifi inet keystore net_admin net_raw
+ oneshot
+ disabled
+
+service vendor.wigig_hostapd /vendor/bin/hostapd -dd /data/vendor/wifi/wigig_hostapd.conf
+ class late_start
+ user wifi
+ group wifi inet keystore net_admin net_raw
+ oneshot
+ disabled
+
+service ims_regmanager /system/vendor/bin/exe-ims-regmanagerprocessnative
+ class late_start
+ 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 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 oem_2901 log
+ capabilities BLOCK_SUSPEND NET_ADMIN NET_RAW
+
+service 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
+ seclabel u:r:healthd:s0
+
+service ssr_diag /system/vendor/bin/ssr_diag
+ class late_start
+ user system
+ 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
+
+on property:sys.qbcharger.enable=true
+ start qbcharger
+
+on property:sys.qbcharger.enable=false
+ stop qbcharger
+
+service 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 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
+ disabled
+ oneshot
+
+on property:persist.sys.mdlog.enable=true
+ start diag_mdlog_start
+on property:persist.sys.mdlog.enable=false
+ start diag_mdlog_stop
+
+service qlogd /system/xbin/qlogd
+ socket qlogd stream 0662 system system
+ class main
+ disabled
+on property:persist.sys.qlogd=1
+ start qlogd
+on property:persist.sys.qlogd=0
+ stop qlogd
+
+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
+ user root
+ group root
+ disabled
+
+service vendor.msm_irqbal_lb /vendor/bin/msm_irqbalance -f /system/vendor/etc/msm_irqbalance_little_big.conf
+ class core
+ user root
+ group root
+ disabled
+
+service vendor.msm_irqbl_sdm630 /vendor/bin/msm_irqbalance -f /system/vendor/etc/msm_irqbalance_sdm630.conf
+ class core
+ user root
+ 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.service.logd.enable=1
+ start sdlog
+on property:persist.service.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 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 hwcomposer-2-1
+ start hwcomposer-2-1
+
+# 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 qdmastatsd /system/vendor/bin/qdmastatsd
+ class late_start
+ user system
+ group readproc system net_bw_stats radio
+
+service 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}
+
+service seemp_healthd /vendor/bin/seemp_healthd
+ class late_start
+ user system
+ group system
+
+# blueduttest service for RF BT test.
+service blueduttest /vendor/bin/sh /vendor/bin/bluedut.sh
+ class late_start
+ user root
+ group root
+ disabled
+ oneshot
+
+# openwifi service for RF wifi test.
+service openwifi /system/bin/sh /vendor/bin/wifitest.sh
+ class late_start
+ user root
+ disabled
+ oneshot
+
+# closewifi service for RF wifi test.
+service closewifi /system/bin/sh /vendor/bin/wifitest_close.sh
+ class late_start
+ user root
+ disabled
+ oneshot
+
+#for wifi myftm test
+service myftmftm /vendor/bin/sh /vendor/bin/myftm.agent.sh
+ oneshot
+ disabled
+on property:persist.sys.myftm=1
+ start myftmftm
+
+#zhufanghua@longcheer.com
+service btclose /vendor/bin/sh /vendor/bin/bt_close.sh
+ user root
+ group root
+ oneshot
+ disabled
+on property:sys.closebt=1
+ start btclose
+
+service wdsdaemon /vendor/bin/wdsdaemon -su
+ user root
+ group root
+ oneshot
+ disabled
+
+on property:sys.start_wdsdaemon=1
+ start wdsdaemon
+
+on property:sys.start_wdsdaemon=0
+ stop wdsdaemon
+
+#lct add runin
+on property:persist.sys.runin=enable
+ write /sys/class/power_supply/battery/device/BatteryTestStatus 1
+
+on property:persist.sys.runin=disable
+ write /sys/class/power_supply/battery/device/BatteryTestStatus 0
+
+#lct add phone call status
+on property:sys.thermal.isincall=1
+ write /sys/class/power_supply/battery/device/thermalcall 1
+
+on property:sys.thermal.isincall=0
+ write /sys/class/power_supply/battery/device/thermalcall 0
+
+#Add command for PA test begin
+service LctDiagSendData /vendor/bin/LctDiagSendData
+ class core
+ user root
+ oneshot
+ disabled
+#on property:persist.sys.lctdiagsenddata=1
+# start LctDiagSendData
+#on property:persist.sys.lctdiagsenddata=0
+# stop LctDiagSendData
+on property:ro.runtime.firstboot=*
+ start LctDiagSendData
+#Add command for PA test end
+service power_off_alarm /vendor/bin/power_off_alarm
+ class core
+ group system
+ disabled
+ oneshot
+
+service config_bt_addr /vendor/bin/btnvtool -O
+ class core
+ user bluetooth
+ group bluetooth radio
+ oneshot
diff --git a/rootdir/etc/init.qcom.usb.rc b/rootdir/etc/init.qcom.usb.rc
new file mode 100755
index 0000000..2355ce8
--- /dev/null
+++ b/rootdir/etc/init.qcom.usb.rc
@@ -0,0 +1,1682 @@
+# Copyright (c) 2011-2016, 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 The 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.
+#
+
+on charger
+ 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
+ write /config/usb_gadget/g1/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/g1/strings/0x409/manufacturer ${ro.product.manufacturer}
+ write /config/usb_gadget/g1/strings/0x409/product ${ro.product.model}
+ mkdir /config/usb_gadget/g1/functions/mass_storage.0
+ mkdir /config/usb_gadget/g1/functions/ffs.adb
+ 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
+
+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
+ write /config/usb_gadget/g1/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/g1/strings/0x409/manufacturer ${ro.product.manufacturer}
+ write /config/usb_gadget/g1/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
+ mkdir /config/usb_gadget/g1/functions/accessory.gs2
+ mkdir /config/usb_gadget/g1/functions/audio_source.gs3
+ mkdir /config/usb_gadget/g1/functions/midi.gs5
+ mkdir /config/usb_gadget/g1/functions/ffs.adb
+ mkdir /config/usb_gadget/g1/functions/diag.diag
+ mkdir /config/usb_gadget/g1/functions/diag.diag_mdm
+ mkdir /config/usb_gadget/g1/functions/cser.dun.0
+ mkdir /config/usb_gadget/g1/functions/cser.nmea.1
+ mkdir /config/usb_gadget/g1/functions/cser.dun.2
+ mkdir /config/usb_gadget/g1/functions/gsi.rmnet
+ mkdir /config/usb_gadget/g1/functions/gsi.rndis
+ mkdir /config/usb_gadget/g1/functions/gsi.dpl
+ 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/rmnet_bam.rmnet
+ mkdir /config/usb_gadget/g1/functions/rmnet_bam.dpl
+ 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
+ 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
+ write /sys/class/android_usb/android0/f_ffs/aliases adb
+ enable qcom-usb-sh
+
+service qcom-usb-sh /vendor/bin/init.qcom.usb.sh
+ class core
+ user root
+ oneshot
+ disabled
+
+# Following are the parameters required for usb functionality. They provide configurable options like
+# product_id/vendor id and allows specifying required functions:
+#
+# Required parameters:
+#
+# /sys/class/android_usb/android0/enable: Enables/disables usb composition
+# Value: 0 (disable), 1 (enable)
+#
+# /sys/class/android_usb/android0/idVendor: Stores Vendor ID
+# Value: 05c6 (Vendor id for Qualcomm Inc)
+#
+# /sys/class/android_usb/android0/idProduct: Stores Product id corresponding to usb composition
+# Value: 0x9xxx for composite interface, 0xFxxx for single interface
+#
+# /sys/class/android_usb/android0/f_diag/clients: Stores name of clients representing a diag interface.
+# Value: Passed one per interface. e.g. diag[,diag_mdm, diag_qsc, diag_mdm2]
+#
+# /sys/class/android_usb/android0/functions: Stores name of the function drivers used in usb composition.
+# Value: Passed one per function driver. e.g. diag[,adb]
+#
+#Optional parameters:
+#
+# /sys/class/android_usb/android0/f_serial/transports: Stores type of underlying transports used to
+# communicate to serial interface.
+# Value: Passed one per interface. One value represents control and data transport together.
+# e.g. smd[,sdio,tty,hsic]
+# Only required if serial interface is present.
+#
+# /sys/class/android_usb/android0/f_serial/transport_names: Stores name of the underlying transports
+# used to communicate to serial interface. This is used to distinguish between more than one interface
+# using same transport type.
+# Value: Passed one per interface. One value represents control and data transport together.
+# e.g. serial_hsic[,serial_hsusb]
+# Only required for transport type hsic, optional for other transport types.
+#
+# /sys/class/android_usb/android0/f_rmnet/transports: Stores type of underlying transports used to
+# communicate to rmnet interface.
+# Value: Passed two per interface as control, data transport type pair.
+# e.g. smd,bam[,hsuart,hsuart]
+# Only required if rmnet interface is present.
+#
+# /sys/class/android_usb/android0/f_rmnet/transport_names: Stores name of the underlying transports
+# used to communicate to rmnet interface. This is used to distinguish between more than one interface
+# using same transport type.
+# Value: Passed one per interface. One value represents control and data transport together.
+# e.g. rmnet_hsic[,rmnet_hsusb]
+# Only required for transport type hsic, optional for other transport types.
+
+# USB compositions
+on property:sys.usb.config=diag,serial_tty,serial_smd && 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 9002
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports tty,smd
+ write /sys/class/android_usb/android0/functions diag,serial
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,serial_tty,serial_smd,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 9020
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports smd,tty
+ write /sys/class/android_usb/android0/functions diag,adb,serial
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,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 901D
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/functions diag,adb
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag && 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 900E
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/functions diag
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,serial_smd,rmnet_bam,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 9091
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports smd
+ write /sys/class/android_usb/android0/f_rmnet/transports smd,bam
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet,adb
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,serial_smd,rmnet_qti_bam,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 9091
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports smd
+ write /sys/class/android_usb/android0/f_rmnet/transports qti,bam
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet,adb
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,serial_smd,rmnet_bam && 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 9092
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports smd
+ write /sys/class/android_usb/android0/f_rmnet/transports smd,bam
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,serial_smd,rmnet_qti_bam && 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 9092
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports smd
+ write /sys/class/android_usb/android0/f_rmnet/transports qti,bam
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,serial_cdev,serial_tty,rmnet_ipa,mass_storage,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 9025
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports char_bridge,tty
+ write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa
+ write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,serial_cdev,serial_tty,rmnet_ipa,mass_storage && 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 9026
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports char_bridge,tty
+ write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,serial_smd,serial_tty,rmnet_bam,mass_storage,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 9025
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports smd,tty
+ write /sys/class/android_usb/android0/f_rmnet/transports smd,bam
+ write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,acm_smd,acm_tty,rmnet_bam,mass_storage,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 903D
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_acm/acm_transports smd,tty
+ write /sys/class/android_usb/android0/f_rmnet/transports smd,bam
+ write /sys/class/android_usb/android0/functions diag,adb,acm,rmnet,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,serial_smd,serial_tty,rmnet_bam,mass_storage && 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 9026
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports smd,tty
+ write /sys/class/android_usb/android0/f_rmnet/transports smd,bam
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,acm_smd,acm_tty,rmnet_bam,mass_storage && 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 903E
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_acm/acm_transports smd,tty
+ write /sys/class/android_usb/android0/f_rmnet/transports smd,bam
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,diag_mdm,serial_sdio,serial_smd,rmnet_smd_sdio,mass_storage,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 9037
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/f_serial/transports sdio,smd
+ write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet_smd_sdio,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,diag_mdm,acm_sdio,acm_smd,rmnet_smd_sdio,mass_storage,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 903B
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/f_acm/acm_transports sdio,smd
+ write /sys/class/android_usb/android0/functions diag,adb,acm,rmnet_smd_sdio,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,diag_mdm,serial_sdio,serial_smd,rmnet_smd_sdio,mass_storage && 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 9038
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/f_serial/transports sdio,smd
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet_smd_sdio,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,diag_mdm,acm_sdio,acm_smd,rmnet_smd_sdio,mass_storage && 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 903C
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/f_acm/acm_transports sdio,smd
+ write /sys/class/android_usb/android0/functions diag,acm,rmnet_smd_sdio,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,diag_mdm,serial_sdio,serial_tty,rmnet_sdio,mass_storage,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 9031
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/f_serial/transports sdio,tty
+ write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet_sdio,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,diag_mdm,acm_sdio,acm_tty,rmnet_sdio,mass_storage,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 903B
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/f_acm/acm_transports sdio,tty
+ write /sys/class/android_usb/android0/functions diag,adb,acm,rmnet_sdio,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,diag_mdm,serial_sdio,serial_tty,rmnet_sdio,mass_storage && 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 9032
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/f_serial/transports sdio,tty
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet_sdio,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,diag_mdm,acm_sdio,acm_tty,rmnet_sdio,mass_storage && 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 903C
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/f_acm/acm_transports sdio,tty
+ write /sys/class/android_usb/android0/functions diag,acm,rmnet_sdio,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,serial_tty,serial_tty,rmnet_smd,mass_storage,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 9025
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports tty,tty
+ 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
+ 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
+ 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 903D
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_acm/acm_transports tty,tty
+ 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
+ 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
+ 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 9026
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ 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
+ 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
+ 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 903E
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_acm/acm_transports tty,tty
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet_smd,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,serial_smd,serial_tty,rmnet_smd,mass_storage,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 9025
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports smd,tty
+ write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet_smd,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,acm_smd,acm_tty,rmnet_smd,mass_storage,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 903D
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_acm/acm_transports smd,tty
+ 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
+ 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
+ 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 9026
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports smd,tty
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet_smd,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,acm_smd,acm_tty,rmnet_smd,mass_storage && 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 903E
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_acm/acm_transports smd,tty
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet_smd,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+# RmNet using USB BAM to IPA BAM
+on property:sys.usb.config=diag,serial_smd,serial_tty,rmnet_ipa,mass_storage,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 9025
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports smd,tty
+ write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa
+ write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,serial_smd,serial_tty,rmnet_ipa,mass_storage && 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 9026
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports smd,tty
+ write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,serial_smd,rmnet_ipa,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 9091
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports smd
+ write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet,adb
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,serial_smd,rmnet_ipa && 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 9092
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports smd
+ write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+# Fusion 3 composition
+on property:sys.usb.config=diag,serial_hsic,serial_tty,rmnet_hsic,mass_storage,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 9025
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports hsic,tty
+ write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic
+ write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic
+ write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic
+ write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage
+ write /sys/module/mdm_bridge/parameters/rx_rmnet_buffer_size 16384
+ write /sys/module/mdm_bridge/parameters/max_rx_urbs 20
+ write /sys/module/g_android/parameters/ghsic_data_rx_req_size 16384
+ write /sys/module/g_android/parameters/ghsic_data_rmnet_rx_q_size 20
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+# Fusion 3 composition with diag_mdm and adb
+on property:sys.usb.config=diag,diag_mdm,serial_hsic,serial_tty,rmnet_hsic,mass_storage,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 9031
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/f_serial/transports hsic,tty
+ write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic
+ write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic
+ write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic
+ write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage
+ write /sys/module/mdm_bridge/parameters/rx_rmnet_buffer_size 16384
+ write /sys/module/mdm_bridge/parameters/max_rx_urbs 20
+ write /sys/module/g_android/parameters/ghsic_data_rx_req_size 16384
+ write /sys/module/g_android/parameters/ghsic_data_rmnet_rx_q_size 20
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+# Fusion 3 composition with diag_mdm
+on property:sys.usb.config=diag,diag_mdm,serial_hsic,serial_tty,rmnet_hsic,mass_storage && 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 9032
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/f_serial/transports hsic,tty
+ write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic
+ write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic
+ write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage
+ write /sys/module/mdm_bridge/parameters/rx_rmnet_buffer_size 16384
+ write /sys/module/mdm_bridge/parameters/max_rx_urbs 20
+ write /sys/module/g_android/parameters/ghsic_data_rx_req_size 16384
+ write /sys/module/g_android/parameters/ghsic_data_rmnet_rx_q_size 20
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+# Fusion 3 DSDA composition with adb
+on property:sys.usb.config=diag,diag_mdm,diag_qsc,serial_hsic,serial_hsuart,rmnet_hsic,rmnet_hsuart,mass_storage,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 9065
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm,diag_qsc
+ write /sys/class/android_usb/android0/f_serial/transports hsic,hsuart
+ write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic,serial_hsuart
+ write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic,hsuart,hsuart
+ write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic,rmnet_hsuart
+ write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage
+ write /sys/module/mdm_bridge/parameters/rx_rmnet_buffer_size 16384
+ write /sys/module/mdm_bridge/parameters/max_rx_urbs 20
+ write /sys/module/g_android/parameters/ghsic_data_rx_req_size 16384
+ write /sys/module/g_android/parameters/ghsic_data_rmnet_rx_q_size 20
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+# Fusion 3 DSDA composition without adb
+on property:sys.usb.config=diag,diag_mdm,diag_qsc,serial_hsic,serial_hsuart,rmnet_hsic,rmnet_hsuart,mass_storage && 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 9066
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm,diag_qsc
+ write /sys/class/android_usb/android0/f_serial/transports hsic,hsuart
+ write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic,serial_hsuart
+ write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic,hsuart,hsuart
+ write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic,rmnet_hsuart
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage
+ write /sys/module/mdm_bridge/parameters/rx_rmnet_buffer_size 16384
+ write /sys/module/mdm_bridge/parameters/max_rx_urbs 20
+ write /sys/module/g_android/parameters/ghsic_data_rx_req_size 16384
+ write /sys/module/g_android/parameters/ghsic_data_rmnet_rx_q_size 20
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+# Fusion 3 DSDA2 composition with adb
+on property:sys.usb.config=diag,diag_mdm,diag_mdm2,serial_hsic,serial_hsusb,rmnet_hsic,rmnet_hsusb,mass_storage,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 9065
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm,diag_mdm2
+ write /sys/class/android_usb/android0/f_serial/transports hsic,hsic
+ write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic,serial_hsusb
+ write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic,hsic,hsic
+ write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic,rmnet_hsusb
+ write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage
+ write /sys/module/mdm_bridge/parameters/rx_rmnet_buffer_size 16384
+ write /sys/module/mdm_bridge/parameters/max_rx_urbs 20
+ write /sys/module/g_android/parameters/ghsic_data_rx_req_size 16384
+ write /sys/module/g_android/parameters/ghsic_data_rmnet_rx_q_size 20
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+# Fusion 3 DSDA2 composition without adb
+on property:sys.usb.config=diag,diag_mdm,diag_mdm2,serial_hsic,serial_hsusb,rmnet_hsic,rmnet_hsusb,mass_storage && 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 9066
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm,diag_mdm2
+ write /sys/class/android_usb/android0/f_serial/transports hsic,hsic
+ write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic,serial_hsusb
+ write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic,hsic,hsic
+ write /sys/class/android_usb/android0/f_rmnet/transport_names rmnet_hsic,rmnet_hsusb
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage
+ write /sys/module/mdm_bridge/parameters/rx_rmnet_buffer_size 16384
+ write /sys/module/mdm_bridge/parameters/max_rx_urbs 20
+ write /sys/module/g_android/parameters/ghsic_data_rx_req_size 16384
+ write /sys/module/g_android/parameters/ghsic_data_rmnet_rx_q_size 20
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+# Fusion PCIe composition with diag_mdm and adb
+# Serial & RmNet bridged in userspace with tty and qti/ether
+on property:sys.usb.config=diag,diag_mdm,serial_tty,rmnet_qti_ether,mass_storage,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 9035
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/f_serial/transports tty
+ write /sys/class/android_usb/android0/f_rmnet/transports qti,ether
+ write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+# Fusion PCIe composition with diag_mdm
+# Serial & RmNet bridged in userspace with tty and qti/ether
+on property:sys.usb.config=diag,diag_mdm,serial_hsic,rmnet_hsic,mass_storage && 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 9036
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/f_serial/transports tty
+ write /sys/class/android_usb/android0/f_rmnet/transports qti,ether
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+# Fusion HSIC/PCIe Hybrid composition with diag_mdm and adb
+# RmNet is bridged over PCIe using qti,ether ctrl/data transports
+on property:sys.usb.config=diag,diag_mdm,serial_hsic,rmnet_qti_ether,mass_storage,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 9035
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/f_serial/transports hsic
+ write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic
+ write /sys/class/android_usb/android0/f_rmnet/transports qti,ether
+ write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+# Fusion HSIC/PCIe Hybrid composition with diag_mdm
+# RmNet is bridged over PCIe using qti,ether ctrl/data transports
+on property:sys.usb.config=diag,diag_mdm,serial_hsic,rmnet_hsic,mass_storage && 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 9036
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/f_serial/transports hsic
+ write /sys/class/android_usb/android0/f_serial/transport_names serial_hsic
+ write /sys/class/android_usb/android0/f_rmnet/transports qti,ether
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+# Fusion PCIe composition with diag_mdm
+# Serial & RmNet bridged in userspace with port bridge and qti/ether
+on property:sys.usb.config=diag,diag_mdm,serial_cdev,rmnet_qti_ether,mass_storage && 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 9036
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/f_serial/transports char_bridge
+ write /sys/class/android_usb/android0/f_rmnet/transports qti,ether
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,diag_mdm,serial_cdev,rmnet_qti_ether,mass_storage,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 9035
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/f_serial/transports char_bridge
+ write /sys/class/android_usb/android0/f_rmnet/transports qti,ether
+ write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+# Fusion 2.2 composition with diag_qsc and adb
+on property:sys.usb.config=diag,diag_qsc,serial_smd,serial_tty,serial_hsuart,rmnet_hsuart,mass_storage,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 9053
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_qsc
+ write /sys/class/android_usb/android0/f_serial/transports smd,tty,hsuart
+ write /sys/class/android_usb/android0/f_rmnet/transports smd,bam,hsuart,hsuart
+ write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+# Fusion 2.2 composition with diag_qsc
+on property:sys.usb.config=diag,diag_qsc,serial_smd,serial_tty,serial_hsuart,rmnet_hsuart,mass_storage && 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 9054
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_qsc
+ write /sys/class/android_usb/android0/f_serial/transports smd,tty,hsuart
+ write /sys/class/android_usb/android0/f_rmnet/transports smd,bam,hsuart,hsuart
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage
+ 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:sys.usb.config=rndis
+ setprop sys.usb.config rndis,${persist.sys.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/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
+
+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/f_rndis/wceis 1
+ write /sys/class/android_usb/android0/functions rndis,adb
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state rndis,adb
+
+on property:sys.usb.config=rndis,diag && 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 902C
+ write /sys/class/android_usb/android0/f_rndis/wceis 1
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/functions rndis,diag
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state rndis
+
+on property:sys.usb.config=rndis,diag,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 902D
+ write /sys/class/android_usb/android0/f_rndis/wceis 1
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/functions rndis,diag,adb
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state rndis,adb
+
+# DPL is implemented using QDSS
+on property:sys.usb.config=rndis,diag,dpl && 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 90BF
+ write /sys/class/android_usb/android0/f_rndis/wceis 1
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_qdss/debug_intf 0
+ write /sys/class/android_usb/android0/f_qdss/transports qti,bam2bam_ipa
+ write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam
+ write /sys/class/android_usb/android0/functions rndis,diag,qdss
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state rndis
+
+# DPL is implemented using QDSS
+on property:sys.usb.config=rndis,diag,dpl,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 90C0
+ write /sys/class/android_usb/android0/f_rndis/wceis 1
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_qdss/debug_intf 0
+ write /sys/class/android_usb/android0/f_qdss/transports qti,bam2bam_ipa
+ write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam
+ write /sys/class/android_usb/android0/functions rndis,diag,qdss,adb
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state rndis,adb
+
+on property:sys.usb.config=rndis,serial_smd && 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 90B3
+ write /sys/class/android_usb/android0/f_rndis/wceis 1
+ write /sys/class/android_usb/android0/f_serial/transports smd
+ write /sys/class/android_usb/android0/functions rndis,serial
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state rndis
+
+on property:sys.usb.config=rndis,serial_smd,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 90B4
+ write /sys/class/android_usb/android0/f_rndis/wceis 1
+ write /sys/class/android_usb/android0/f_serial/transports smd
+ write /sys/class/android_usb/android0/functions rndis,serial,adb
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state rndis,adb
+
+on property:sys.usb.config=rndis,serial_smd,diag && 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 90B5
+ write /sys/class/android_usb/android0/f_rndis/wceis 1
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports smd
+ write /sys/class/android_usb/android0/functions rndis,serial,diag
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state rndis
+
+on property:sys.usb.config=rndis,serial_smd,diag,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 90B6
+ write /sys/class/android_usb/android0/f_rndis/wceis 1
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports smd
+ write /sys/class/android_usb/android0/functions rndis,serial,diag,adb
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state rndis,adb
+
+on property:sys.usb.config=rndis,serial_cdev,diag && 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 90B5
+ write /sys/class/android_usb/android0/f_rndis/wceis 1
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports char_bridge
+ write /sys/class/android_usb/android0/functions rndis,serial,diag
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state rndis
+
+on property:sys.usb.config=rndis,serial_cdev,diag,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 90B6
+ write /sys/class/android_usb/android0/f_rndis/wceis 1
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports char_bridge
+ write /sys/class/android_usb/android0/functions rndis,serial,diag,adb
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state rndis,adb
+
+on property:sys.usb.config=rndis,diag,diag_mdm && 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 9041
+ write /sys/class/android_usb/android0/f_rndis/wceis 1
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/functions rndis,diag
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state rndis
+
+on property:sys.usb.config=rndis,diag,diag_mdm,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 9042
+ write /sys/class/android_usb/android0/f_rndis/wceis 1
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/functions rndis,diag,adb
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state rndis,adb
+
+on property:sys.usb.config=rndis,diag,diag_mdm,diag_qsc && 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 9086
+ write /sys/class/android_usb/android0/f_rndis/wceis 1
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm,diag_qsc
+ write /sys/class/android_usb/android0/functions rndis,diag
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state rndis
+
+on property:sys.usb.config=rndis,diag,diag_mdm,diag_qsc,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 9087
+ write /sys/class/android_usb/android0/f_rndis/wceis 1
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm,diag_qsc
+ write /sys/class/android_usb/android0/functions rndis,diag,adb
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state rndis,adb
+
+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/functions ptp
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+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/functions ptp,adb
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+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/functions mtp
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+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/functions mtp,adb
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=mtp,diag && 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 901B
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/functions mtp,diag
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=mtp,diag,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 903A
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/functions mtp,diag,adb
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=mtp,diag,diag_mdm && 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 9040
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/functions mtp,diag
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=mtp,diag,diag_mdm,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 903F
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/functions mtp,diag,adb
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=mtp,diag,diag_mdm,diag_qsc && 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 9088
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm,diag_qsc
+ write /sys/class/android_usb/android0/functions mtp,diag
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=mtp,diag,diag_mdm,diag_qsc,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 9089
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm,diag_qsc
+ write /sys/class/android_usb/android0/functions mtp,diag,adb
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,diag_mdm,ccid && 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 9045
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/functions diag,ccid
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,diag_mdm,ccid,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 9044
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/functions diag,adb,ccid
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=mass_storage,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 9015
+ write /sys/class/android_usb/android0/functions adb,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+#Mass-storage only composition
+on property:sys.usb.config=mass_storage && 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 F000
+ write /sys/class/android_usb/android0/functions mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,qdss && 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 904A
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_qdss/debug_intf 1
+ write /sys/class/android_usb/android0/f_qdss/transports bam
+ write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam
+ write /sys/class/android_usb/android0/functions diag,qdss
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,qdss,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 9060
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_qdss/debug_intf 1
+ write /sys/class/android_usb/android0/f_qdss/transports bam
+ write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam
+ write /sys/class/android_usb/android0/functions diag,qdss,adb
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,diag_mdm,qdss && 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 9099
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/f_qdss/debug_intf 1
+ write /sys/class/android_usb/android0/f_qdss/transports bam
+ write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam
+ write /sys/class/android_usb/android0/functions diag,qdss
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,diag_mdm,qdss,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 9098
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/f_qdss/debug_intf 1
+ write /sys/class/android_usb/android0/f_qdss/transports bam
+ write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam
+ write /sys/class/android_usb/android0/functions diag,qdss,adb
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,qdss,rmnet_bam && 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 9083
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_rmnet/transports smd,bam
+ write /sys/class/android_usb/android0/f_qdss/debug_intf 1
+ write /sys/class/android_usb/android0/f_qdss/transports bam
+ write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam
+ 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,qdss,rmnet_qti_bam && 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 9083
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_rmnet/transports qti,bam
+ write /sys/class/android_usb/android0/f_qdss/debug_intf 1
+ write /sys/class/android_usb/android0/f_qdss/transports bam
+ write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam
+ 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,qdss,rmnet_bam,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 9084
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_rmnet/transports smd,bam
+ write /sys/class/android_usb/android0/f_qdss/debug_intf 1
+ write /sys/class/android_usb/android0/f_qdss/transports bam
+ write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam
+ 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=diag,qdss,rmnet_qti_bam,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 9084
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_rmnet/transports qti,bam
+ write /sys/class/android_usb/android0/f_qdss/debug_intf 1
+ write /sys/class/android_usb/android0/f_qdss/transports bam
+ write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam
+ 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=diag,qdss,rmnet_ipa && 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 9083
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa
+ write /sys/class/android_usb/android0/f_qdss/debug_intf 1
+ write /sys/class/android_usb/android0/f_qdss/transports bam
+ write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam
+ 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,qdss,rmnet_ipa,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 9084
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa
+ write /sys/class/android_usb/android0/f_qdss/debug_intf 1
+ write /sys/class/android_usb/android0/f_qdss/transports bam
+ write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam
+ 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=diag,diag_mdm,qdss,rmnet_hsic && 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 909B
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic
+ write /sys/class/android_usb/android0/f_qdss/debug_intf 1
+ write /sys/class/android_usb/android0/f_qdss/transports bam
+ write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam
+ 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,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}
+ write /sys/class/android_usb/android0/idVendor 05C6
+ write /sys/class/android_usb/android0/idProduct 909A
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/f_rmnet/transports hsic,hsic
+ write /sys/class/android_usb/android0/f_qdss/debug_intf 1
+ write /sys/class/android_usb/android0/f_qdss/transports bam
+ write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam
+ 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=diag,diag_mdm,qdss_apq,qdss_mdm,rmnet_hsic && 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 hsic,hsic
+ write /sys/class/android_usb/android0/f_qdss/debug_intf 0
+ write /sys/class/android_usb/android0/f_qdss/transports bam,hsic
+ write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam,qdss_hsic
+ 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 && 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}
+ 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 hsic,hsic
+ write /sys/class/android_usb/android0/f_qdss/debug_intf 0
+ write /sys/class/android_usb/android0/f_qdss/transports bam,hsic
+ write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam,qdss_hsic
+ 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=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}
+ write /sys/class/android_usb/android0/idVendor 05C6
+ write /sys/class/android_usb/android0/idProduct 9081
+ write /sys/class/android_usb/android0/f_rndis/wceis 1
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_qdss/debug_intf 1
+ write /sys/class/android_usb/android0/f_qdss/transports bam
+ write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam
+ write /sys/class/android_usb/android0/functions rndis,diag,qdss
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=rndis,diag,qdss,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 9082
+ write /sys/class/android_usb/android0/f_rndis/wceis 1
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_qdss/debug_intf 1
+ write /sys/class/android_usb/android0/f_qdss/transports bam
+ write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam
+ write /sys/class/android_usb/android0/functions rndis,diag,qdss,adb
+ 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}
+
+# same as 9025, plus data packet logging (DPL) using QDSS
+on property:sys.usb.config=diag,serial_smd,serial_tty,rmnet_ipa,mass_storage,dpl,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 90AD
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports smd,tty
+# DPL is implemented using QDSS
+ write /sys/class/android_usb/android0/f_qdss/debug_intf 0
+ write /sys/class/android_usb/android0/f_qdss/transports qti,bam2bam_ipa
+ write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam
+ write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa
+ write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage,qdss
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+# same as 9026, plus data packet logging (DPL)
+on property:sys.usb.config=diag,serial_smd,serial_tty,rmnet_ipa,mass_storage,dpl && 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 90B0
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports smd,tty
+# DPL is implemented using QDSS
+ write /sys/class/android_usb/android0/f_qdss/debug_intf 0
+ write /sys/class/android_usb/android0/f_qdss/transports qti,bam2bam_ipa
+ write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam
+ write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage,qdss
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,serial_cdev,serial_tty,rmnet_ipa,mass_storage,dpl,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 90AD
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports char_bridge,tty
+# DPL is implemented using QDSS
+ write /sys/class/android_usb/android0/f_qdss/debug_intf 0
+ write /sys/class/android_usb/android0/f_qdss/transports qti,bam2bam_ipa
+ write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam
+ write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa
+ write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,mass_storage,qdss
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,serial_cdev,serial_tty,rmnet_ipa,mass_storage,dpl && 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 90B0
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports char_bridge,tty
+# DPL is implemented using QDSS
+ write /sys/class/android_usb/android0/f_qdss/debug_intf 0
+ write /sys/class/android_usb/android0/f_qdss/transports qti,bam2bam_ipa
+ write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam
+ write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet,mass_storage,qdss
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=ncm && 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 0525
+ write /sys/class/android_usb/android0/idProduct A4A1
+ write /sys/class/android_usb/android0/functions ncm
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=ncm,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 908C
+ write /sys/class/android_usb/android0/functions ncm,adb
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+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/functions charging
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,serial_smd,rmnet_qti_bam,dpl_qti_bam_dmux && 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 90B7
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports smd
+ write /sys/class/android_usb/android0/f_rmnet/transports qti,bam
+ write /sys/class/android_usb/android0/f_qdss/transports qti,bam_dmux
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet,qdss
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,serial_smd,rmnet_qti_bam,dpl_qti_bam_dmux,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 90B8
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports smd
+ write /sys/class/android_usb/android0/f_rmnet/transports qti,bam
+ write /sys/class/android_usb/android0/f_qdss/transports qti,bam_dmux
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet,qdss,adb
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,diag_cnss,serial_smd,serial_tty,rmnet_bam,mass_storage,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 90B2
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_cnss
+ write /sys/class/android_usb/android0/f_serial/transports smd,tty
+ write /sys/class/android_usb/android0/f_rmnet/transports smd,bam
+ write /sys/class/android_usb/android0/functions diag,diag_cnss,adb,serial,rmnet,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,diag_cnss,serial_smd,serial_tty,rmnet_bam,mass_storage && 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 90B3
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_cnss
+ write /sys/class/android_usb/android0/f_serial/transports smd,tty
+ write /sys/class/android_usb/android0/f_rmnet/transports smd,bam
+ write /sys/class/android_usb/android0/functions diag,diag_cnss,serial,rmnet,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=midi && 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 90BA
+ write /sys/class/android_usb/android0/functions midi
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=midi,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 90BB
+ write /sys/class/android_usb/android0/functions midi,adb
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,serial_smd,rmnet_ipa,dpl && 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 90B7
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports smd
+# DPL is implemented using QDSS
+ write /sys/class/android_usb/android0/f_qdss/debug_intf 0
+ write /sys/class/android_usb/android0/f_qdss/transports qti,bam2bam_ipa
+ write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam
+ write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet,qdss
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,serial_smd,rmnet_ipa,dpl,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 90B8
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/f_serial/transports smd
+# DPL is implemented using QDSS
+ write /sys/class/android_usb/android0/f_qdss/debug_intf 0
+ write /sys/class/android_usb/android0/f_qdss/transports qti,bam2bam_ipa
+ write /sys/class/android_usb/android0/f_qdss/transport_names qdss_bam
+ write /sys/class/android_usb/android0/f_rmnet/transports qti,bam2bam_ipa
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet,qdss,adb
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,diag_mdm,serial_tty,rmnet_qti_ether,dpl_ether,mass_storage,adb
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 05C6
+ write /sys/class/android_usb/android0/idProduct 90AE
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/f_serial/transports tty
+ 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 qti,ether
+ write /sys/class/android_usb/android0/f_qdss/transport_names qdss_dpl
+ write /sys/class/android_usb/android0/functions diag,adb,serial,rmnet,qdss,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,diag_mdm,serial_tty,rmnet_qti_ether,dpl_ether,mass_storage
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 05C6
+ write /sys/class/android_usb/android0/idProduct 90AF
+ write /sys/class/android_usb/android0/f_diag/clients diag,diag_mdm
+ write /sys/class/android_usb/android0/f_serial/transports tty
+ 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 qti,ether
+ write /sys/class/android_usb/android0/f_qdss/transport_names qdss_dpl
+ write /sys/class/android_usb/android0/functions diag,serial,rmnet,qdss,mass_storage
+ write /sys/class/android_usb/android0/enable 1
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,adb,uac2
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 05C6
+ write /sys/class/android_usb/android0/idProduct 90CA
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/functions diag,adb,uac2_func
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,adb,video && property:sys.usb.configfs=0
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 05C6
+ write /sys/class/android_usb/android0/idProduct 90CB
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/functions diag,adb,video
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
+on property:sys.usb.config=diag,adb,uac2,video && property:sys.usb.configfs=0
+ write /sys/class/android_usb/android0/enable 0
+ write /sys/class/android_usb/android0/idVendor 05C6
+ write /sys/class/android_usb/android0/idProduct 90CC
+ write /sys/class/android_usb/android0/f_diag/clients diag
+ write /sys/class/android_usb/android0/functions diag,adb,uac2_func,video
+ write /sys/class/android_usb/android0/enable 1
+ start adbd
+ setprop sys.usb.state ${sys.usb.config}
+
diff --git a/rootdir/etc/init.target.rc b/rootdir/etc/init.target.rc
index 2213bce..2f9f8b4 100644..100755
--- a/rootdir/etc/init.target.rc
+++ b/rootdir/etc/init.target.rc
@@ -40,6 +40,8 @@ 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}
@@ -51,12 +53,23 @@ on fs
# these partition flashed on the device. Failure to mount any partition in fstab file
# results in failure to launch late-start class.
- wait /dev/block/bootdevice/by-name/persist
- mount ext4 /dev/block/bootdevice/by-name/persist /persist nosuid nodev noatime barrier=1
mkdir /persist/data 0700 system system
mkdir /persist/bms 0700 root system
restorecon_recursive /persist
+ mkdir /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 /persist/wlan_bt/bt.mac
+ chmod 0644 /persist/wlan_bt/wlan.mac
+ chown system system /persist/wlan_bt/bt.mac
+ chown system system /persist/wlan_bt/wlan.mac
+
write /sys/kernel/boot_adsp/boot 1
+ chown system system /dev/goodix_fp
+ #chmod 0644 /dev/goodix_fp
+
+ chmod 0664 /sys/class/thermal/thermal_message/sconfig
+ chown system system /sys/class/thermal/thermal_message/sconfig
on post-fs
start qseecomd
@@ -75,6 +88,9 @@ on post-fs-data
mkdir /persist/qti_fp 0700 system system
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
+ start pa-cal-load
on boot
start rmt_storage
@@ -101,9 +117,9 @@ on boot
chown system system /persist/speccfg/vendor_persist.prop
chown system system /persist/speccfg/submask
chown system system /persist/speccfg/partition
-
#Load WLAN driver
- insmod /vendor/lib/modules/qca_cld3/qca_cld3_wlan.ko
+ insmod -f /vendor/lib/modules/qca_cld3/qca_cld3_wlan.ko
+ chown wifi wifi /sys/module/wlan/parameters/fwpath
setprop wlan.driver.status "ok"
#Peripheral manager
@@ -193,11 +209,6 @@ service time_daemon /system/vendor/bin/time_daemon
user root
group root
-service adsprpcd_root /system/bin/adsprpcd
- class main
- user media
- group media
-
service adsprpcd /system/vendor/bin/adsprpcd audiopd
class main
user media
@@ -371,10 +382,12 @@ service vendor.imsrcsservice /system/vendor/bin/imsrcsd
group radio diag inet log
disabled
+# add for HMI_L8866_A01-502: begin
on property:vendor.ims.DATA_DAEMON_STATUS=1
start ims_rtp_daemon
start vendor.imsrcsservice
-
+ setprop persist.rcs.supported 0
+# add for HMI_L8866_A01-502: end
service ppd /system/vendor/bin/mm-pp-dpps
class late_start
@@ -453,3 +466,207 @@ service smcinvoked /system/bin/smcinvoked
user system
group system
+# smart pa cal wangshiyou 11/09
+service smart-pa-tfa-cal /system/vendor/bin/smart-pa-tfa-cal
+ user root
+ group root
+ disabled
+ oneshot
+
+# smart pa cal tsx 08/26
+service pa-cal-load /system/vendor/bin/smart-pa-cal -load
+ user root
+ group root
+ disabled
+ oneshot
+
+# smart pa cal tsx 08/26
+service smart-pa-cal /system/vendor/bin/smart-pa-cal -t 25 -c /system/vendor/etc/speaker.ftcfg -v -u
+ user root
+ group root
+ disabled
+ oneshot
+
+on property:sys.pa-cal=0
+ stop smart-pa-cal
+
+on property:sys.pa-cal=1
+ start smart-pa-cal
+
+on property:sys.pa-tfa-cal=0
+ stop smart-pa-tfa-cal
+
+on property:sys.pa-tfa-cal=1
+ start smart-pa-tfa-cal
+
+# audio loopback test begin tsx 08/26
+service loopback_spk1 /system/vendor/bin/loopback.sh 1 1
+ user root
+ group root
+ disabled
+ oneshot
+
+service loopback_spk0 /system/vendor/bin/loopback.sh 1 0
+ user root
+ group root
+ disabled
+ oneshot
+
+service loopback_rec1 /system/vendor/bin/loopback.sh 2 1
+ user root
+ group root
+ disabled
+ oneshot
+
+service loopback_rec0 /system/vendor/bin/loopback.sh 2 0
+ user root
+ group root
+ disabled
+ oneshot
+
+service loopback_hand1 /system/vendor/bin/loopback.sh 3 1
+ user root
+ group root
+ disabled
+ oneshot
+
+service loopback_hand0 /system/vendor/bin/loopback.sh 3 0
+ user root
+ group root
+ disabled
+ oneshot
+
+service loopback_sec1 /system/vendor/bin/loopback.sh 4 1
+ user root
+ group root
+ disabled
+ oneshot
+
+service loopback_sec0 /system/vendor/bin/loopback.sh 4 0
+ user root
+ group root
+ disabled
+ oneshot
+
+service spk_playback1 /system/vendor/bin/loopback.sh 5 1
+ user root
+ group root
+ disabled
+ oneshot
+
+service spk_playback0 /system/vendor/bin/loopback.sh 5 0
+ user root
+ group root
+ disabled
+ oneshot
+
+on property:sys.loopback-spk=1
+ start loopback_spk1
+
+on property:sys.loopback-spk=0
+ start loopback_spk0
+
+on property:sys.loopback-rec=1
+ start loopback_rec1
+
+on property:sys.loopback-rec=0
+ start loopback_rec0
+
+on property:sys.loopback-mic1=1
+ start loopback_hand1
+
+on property:sys.loopback-mic1=0
+ start loopback_hand0
+
+on property:sys.loopback-mic2=1
+ start loopback_sec1
+
+on property:sys.loopback-mic2=0
+ start loopback_sec0
+
+on property:sys.spk-playback=1
+ start spk_playback1
+
+on property:sys.spk-playback=0
+ start spk_playback0
+
+service tinyhostless_spk /system/vendor/bin/tinyhostless -D 0 -P 35 -C 11 -p 8 -n 2 -c 1 -r 48000
+ user root
+ group root
+ disabled
+ oneshot
+
+service tinyhostless /system/vendor/bin/tinyhostless -D 0 -P 5 -C 11 -p 8 -n 2 -c 1 -r 48000
+ user root
+ group root
+ disabled
+ oneshot
+
+on property:sys.tinyhostless=0
+ stop tinyhostless
+
+on property:sys.tinyhostless=1
+ start tinyhostless
+
+on property:sys.tinyhostless-spk=0
+ stop tinyhostless_spk
+
+on property:sys.tinyhostless-spk=1
+ start tinyhostless_spk
+
+#audio loopback test end
+on property:persist.sys.display_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/recovery.fstab b/rootdir/etc/recovery.fstab
index e9a36ce..bcc6edf 100644
--- a/rootdir/etc/recovery.fstab
+++ b/rootdir/etc/recovery.fstab
@@ -2,27 +2,23 @@
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
-# mount point fstype device device2 flags
-/boot emmc /dev/block/bootdevice/by-name/boot
-/cache ext4 /dev/block/bootdevice/by-name/cache
-/data ext4 /dev/block/bootdevice/by-name/userdata flags=encryptable=footer
-/misc emmc /dev/block/bootdevice/by-name/misc
-/recovery emmc /dev/block/bootdevice/by-name/recovery flags=backup=1
-/system ext4 /dev/block/bootdevice/by-name/system
-/system_image emmc /dev/block/bootdevice/by-name/system
-/vendor ext4 /dev/block/bootdevice/by-name/vendor flags=display="vendor";backup=1;wipeingui
-/firmware vfat /dev/block/bootdevice/by-name/modem flags=display="Firmware";mounttodecrypt;fsflags=ro
-/cust ext4 /dev/block/bootdevice/by-name/cust
-/modem emmc /dev/block/bootdevice/by-name/modem flags=backup=1;display="Modem"
-/bluetooth emmc /dev/block/bootdevice/by-name/bluetooth flags=backup=1;subpartitionof=/modem
-/dsp emmc /dev/block/bootdevice/by-name/dsp flags=backup=1;subpartitionof=/modem
-/efs1 emmc /dev/block/bootdevice/by-name/modemst1 flags=backup=1;display=EFS
-/efs2 emmc /dev/block/bootdevice/by-name/modemst2 flags=backup=1;subpartitionof=/efs1
-/efsg emmc /dev/block/bootdevice/by-name/fsg flags=backup=1;subpartitionof=/efs1
-/efsc emmc /dev/block/bootdevice/by-name/fsc flags=backup=1;subpartitionof=/efs1
-
-# Removable storage
-/usb_otg vfat /dev/block/sda1 /dev/block/sda flags=fsflags=utf8;display="USB-OTG";storage;wipeingui;removable
-/external_sd vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1 flags=fsflags=utf8;display="SDcard";storage;wipeingui;removable
-
+#TODO: Add 'check' as fs_mgr_flags with data partition.
+# Currently we dont have e2fsck compiled. So fs check would failed.
+# Non-A/B fstab.qcom variant
+#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
+/dev/block/bootdevice/by-name/boot /boot emmc defaults defaults
+/dev/block/bootdevice/by-name/recovery /recovery emmc defaults defaults
+/dev/block/bootdevice/by-name/system /system ext4 ro wait
+/dev/block/bootdevice/by-name/vendor /vendor ext4 ro wait
+/dev/block/bootdevice/by-name/userdata /data ext4 nosuid,nodev,noauto_da_alloc,noatime,lazytime,errors=panic wait,resize,check,reservedsize=128M,encryptable=footer,quota,formattable
+/devices/soc/c084000.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,encryptable=footer
+/dev/block/bootdevice/by-name/cust /cust ext4 ro,nosuid,nodev wait,check
+/dev/block/bootdevice/by-name/misc /misc emmc defaults defaults
+/dev/block/bootdevice/by-name/modem /firmware vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait
+/dev/block/bootdevice/by-name/bluetooth /bt_firmware vfat ro,shortname=lower,uid=1002,gid=3002,dmask=227,fmask=337,context=u:object_r:bt_firmware_file:s0 wait
+/devices/soc/a800000.ssusb/a800000.dwc3/xhci-hcd.0.auto* /storage/usbotg vfat nosuid,nodev wait,voldmanaged=usbotg:auto
+/dev/block/bootdevice/by-name/dsp /dsp ext4 ro,nosuid,nodev wait
+/dev/block/bootdevice/by-name/cache /cache ext4 nosuid,nodev,noatime wait,check,formattable
+/dev/block/bootdevice/by-name/persist /persist ext4 nosuid,nodev,noatime wait,check
+/dev/block/bootdevice/by-name/persistbak /persistbak ext4 nosuid,nodev,noatime wait,check
diff --git a/rootdir/etc/ueventd.qcom.rc b/rootdir/etc/ueventd.qcom.rc
new file mode 100644
index 0000000..cdc46e7
--- /dev/null
+++ b/rootdir/etc/ueventd.qcom.rc
@@ -0,0 +1,302 @@
+# Copyright (c) 2012-2015, 2017, 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 The 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.
+#
+
+# the DIAG device node is not world writable/readable.
+/dev/diag 0660 system oem_2901
+
+/dev/genlock 0666 system system
+/dev/wlan 0660 wifi wifi
+/dev/kgsl 0666 system system
+/dev/kgsl-3d0 0666 system system
+/dev/kgsl-2d0 0666 root root
+/dev/kgsl-2d1 0666 root root
+/dev/ion 0664 system system
+/dev/rtc0 0660 system system
+/dev/smd0 0660 system system
+/dev/smd4 0660 system system
+/dev/smd_cxm_qmi 0640 radio radio
+/dev/smd5 0660 system system
+/dev/smd6 0660 system system
+/dev/smd7 0660 bluetooth bluetooth
+/dev/ccid_bridge 0660 system system
+/dev/ipa 0660 radio radio
+/dev/wwan_ioctl 0660 radio radio
+/dev/ipaNatTable 0660 radio radio
+/dev/rmnet_ctrl 0660 usb usb
+/dev/dpl_ctrl 0660 usb usb
+/dev/spidev7.1 0660 system system
+
+#permissions for CSVT
+/dev/smd11 0660 radio radio
+
+#permsissions for BT/FM
+/dev/smd2 0660 bluetooth bluetooth
+/dev/smd3 0660 bluetooth bluetooth
+/dev/btpower 0660 bluetooth system
+
+#permissions for pta
+/dev/pta 0660 system system
+
+/dev/radio0 0640 system system
+/dev/rfcomm0 0660 bluetooth bluetooth
+/dev/ttyUSB0 0660 bluetooth bluetooth
+/dev/smdcntl0 0640 radio radio
+/dev/smdcntl1 0640 radio radio
+/dev/smdcntl2 0640 radio radio
+/dev/smdcntl3 0640 radio radio
+/dev/smdcntl4 0640 radio radio
+/dev/smdcntl5 0640 radio radio
+/dev/smdcntl6 0640 radio radio
+/dev/smdcntl7 0640 radio radio
+/dev/smdcntl8 0640 radio radio
+/dev/smdcnt_rev0 0640 radio radio
+/dev/smdcnt_rev1 0640 radio radio
+/dev/smdcnt_rev2 0640 radio radio
+/dev/smdcnt_rev3 0640 radio radio
+/dev/smdcnt_rev4 0640 radio radio
+/dev/smdcnt_rev5 0640 radio radio
+/dev/smdcnt_rev6 0640 radio radio
+/dev/smdcnt_rev7 0640 radio radio
+/dev/smdcnt_rev8 0640 radio radio
+/dev/smuxctl32 0640 radio radio
+/dev/sdioctl0 0640 radio radio
+/dev/sdioctl1 0640 radio radio
+/dev/sdioctl2 0640 radio radio
+/dev/sdioctl3 0640 radio radio
+/dev/sdioctl4 0640 radio radio
+/dev/sdioctl5 0640 radio radio
+/dev/sdioctl6 0640 radio radio
+/dev/sdioctl7 0640 radio radio
+/dev/sdioctl8 0640 radio radio
+/dev/rmnet_mux_ctrl 0640 radio radio
+/dev/hsicctl0 0640 radio radio
+/dev/hsicctl1 0640 radio radio
+/dev/hsicctl2 0640 radio radio
+/dev/hsicctl3 0640 radio radio
+/dev/hsicctl4 0640 radio radio
+/dev/hsicctl5 0640 radio radio
+/dev/hsicctl6 0640 radio radio
+/dev/hsicctl7 0640 radio radio
+/dev/hsicctl8 0640 radio radio
+/dev/hsicctl9 0640 radio radio
+/dev/hsicctl10 0640 radio radio
+/dev/hsicctl11 0640 radio radio
+/dev/hsicctl12 0640 radio radio
+/dev/hsicctl13 0640 radio radio
+/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/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/qsee_ipc_irq_spss 0660 system drmrpc
+/dev/seemplog 0660 system system
+/dev/pft 0660 system drmrpc
+/dev/spcom 0660 system system
+/dev/sp_kernel 0660 system system
+/dev/sp_ssr 0660 system system
+/dev/sp_keymaster 0660 system system
+/dev/cryptoapp 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/system_health_monitor 0644 radio system
+/dev/mdss_rotator 0664 system system
+
+# 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
+
+# wlan
+/dev/wcnss_wlan 0660 system system
+/dev/wcnss_ctrl 0660 system system
+/sys/devices/soc/a000000.qcom,wcnss-wlan/net/wlan0/queues/rx-* rps_cpus 0660 system system
+/sys/devices/soc/a000000.qcom,wcnss-wlan/net/p2p0/queues/rx-* rps_cpus 0660 system system
+/dev/spidev0.0 0660 system audio
+/dev/msm_camera/* 0660 system camera
+/dev/gemini/ 0660 system camera
+/dev/mercury0 0660 system camera
+/dev/msm_vidc_reg 0660 system audio
+/dev/msm_vidc_dec 0660 system audio
+/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
+/dev/wcd_dsp0_control 0660 system audio
+/dev/wcd-dsp-glink 0660 system audio
+/dev/audio_slimslave 0660 system audio
+/dev/msm_qcelp 0660 system audio
+/dev/msm_evrc 0660 system audio
+/dev/msm_wma 0660 system audio
+/dev/msm_wmapro 0660 system audio
+/dev/msm_alac 0660 system audio
+/dev/msm_ape 0660 system audio
+/dev/msm_amrnb 0660 system audio
+/dev/msm_amrwb 0660 system audio
+/dev/msm_amrwbplus 0660 system audio
+/dev/msm_aac 0660 system audio
+/dev/msm_multi_aac 0660 system audio
+/dev/msm_aac_in 0660 system audio
+/dev/msm_qcelp_in 0660 system audio
+/dev/msm_evrc_in 0660 system audio
+/dev/msm_amrnb_in 0660 system audio
+/dev/msm_amrwb_in 0660 system audio
+/dev/msm_a2dp_in 0660 system audio
+/dev/msm_ac3 0660 system audio
+/dev/msm_audio_cal 0660 system audio
+/dev/msm_hweffects 0660 system audio
+/dev/msm_cad 0660 system audio
+/dev/msm_fm 0660 system audio
+/dev/msm_mvs 0660 system audio
+/dev/msm_pcm_lp_dec 0660 system audio
+/dev/msm_preproc_ctl 0660 system audio
+/dev/msm_rtac 0660 system audio
+/dev/msm_voicememo 0660 system audio
+/dev/ttyHSL1 0660 system system
+/dev/ttyHS1 0660 system system
+/dev/mdm 0660 system radio
+/sys/devices/virtual/smdpkt/smdcntl* open_timeout 0664 radio radio
+/dev/sdio_tty_ciq_00 0660 system system
+/dev/tty_sdio_00 0660 system system
+/dev/ttyGS0 0660 system system
+/dev/i2c-5 0660 media media
+/dev/avtimer 0660 system audio
+
+# DVB devices
+/dev/dvb/adapter0/demux* 0440 media media
+/dev/dvb/adapter0/dvr* 0660 media media
+/dev/dvb/adapter0/video* 0660 media media
+
+# Broadcast devices
+/dev/tsc_mux0 0660 media media
+/dev/tsc_ci0 0660 media media
+
+# sensors
+/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
+/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* enable 0660 input system
+/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* poll_delay 0660 input system
+/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* enable_wakeup 0660 input system
+/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* max_latency 0660 input system
+/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* flush 0660 input system
+/sys/devices/soc.0/78b6000.i2c/i2c-0/0-* calibrate 0660 input system
+/sys/devices/soc.0/78b5000.i2c/i2c-1/1-* enable 0660 input system
+/sys/devices/soc.0/78b5000.i2c/i2c-1/1-* poll_delay 0660 input system
+/sys/devices/soc.0/78b5000.i2c/i2c-1/1-* enable_wakeup 0660 input system
+/sys/devices/soc.0/78b5000.i2c/i2c-1/1-* max_latency 0660 input system
+/sys/devices/soc.0/78b5000.i2c/i2c-1/1-* flush 0660 input system
+/sys/devices/soc.0/78b5000.i2c/i2c-1/1-* calibrate 0660 input system
+/sys/devices/virtual/optical_sensors/proximity ps_adc 0660 input system
+/sys/devices/virtual/optical_sensors/proximity ps_poll_delay 0660 input system
+/sys/devices/virtual/optical_sensors/lightsensor ls_auto 0660 input system
+/sys/devices/virtual/optical_sensors/lightsensor ls_poll_delay 0660 input system
+/sys/devices/virtual/input/input* poll 0660 input system
+/sys/devices/virtual/input/input* pollrate_ms 0660 input system
+/sys/devices/soc/78b7000.i2c/i2c-3/3-0020/input/input* secure_touch 0440 system drmrpc
+/sys/devices/soc/78b7000.i2c/i2c-3/3-0020/input/input* secure_touch_enable 0660 system drmrpc
+/sys/devices/soc/78b7000.i2c/i2c-3/3-0038/input/input* secure_touch 0440 system drmrpc
+/sys/devices/soc/78b7000.i2c/i2c-3/3-0038/input/input* secure_touch_enable 0660 system drmrpc
+/sys/devices/soc/78b7000.i2c/i2c-3/3-004b/input/input* secure_touch 0440 system drmrpc
+/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
+
+# laser sensor access
+/sys/devices/virtual/input/input* enable_ps_sensor 0660 system input
+/sys/devices/virtual/input/input* set_delay_ms 0660 system input
+/sys/devices/virtual/input/input* do_flush 0660 system input
+
+# vm_bms
+/dev/vm_bms 0660 system system
+/dev/battery_data 0660 system system
+
+# wlan
+/dev/wcnss_wlan 0660 system system
+/dev/wcnss_ctrl 0660 system system
+/sys/devices/soc/600000.qcom,pcie/pci0000:00/0000:00:00.0/0000:01:00.0/net/wlan0/queues/rx-* rps_cpus 0660 system system
+/sys/devices/soc/600000.qcom,pcie/pci0000:00/0000:00:00.0/0000:01:00.0/net/p2p0/queues/rx-* rps_cpus 0660 system system
+
+# wigig
+/sys/bus/pci/drivers/wil6210* 0000:01:00.0/wil6210/fst_link_loss 0660 wifi wifi
+/sys/bus/pci/drivers/wil6210* 0000:01:00.0/wil6210/thermal_throttling 0660 system system
+/sys/bus/pci/drivers/wil6210* 0000:01:00.0/wil6210/snr_thresh 0660 wifi wifi
+/sys/bus/pci/drivers/wil6210* 0000:01:00.0/net/wigig0/queues/rx-0/rps_cpus 0660 system system
+/sys/bus/pci/drivers/wil6210* 0000:01:00.0/net/wigig0/gro_flush_timeout 0660 system system
+/sys/devices/virtual/net/bond0 queues/rx-0/rps_cpus 0660 system system
+
+#nfc permissions
+/dev/nfc-nci 0660 nfc nfc
+/dev/nq-nci 0660 nfc nfc
+/dev/assd 0660 nfc nfc
+
+# UIO devices
+/dev/uio0 0660 system system
+/dev/uio1 0660 system system
+/dev/uio2 0660 system system
+
+# SSR devices
+/dev/subsys_* 0640 system system
+
+# Ultrasound device
+/dev/usf1 0660 system system
+
+# Ramdump devices
+/dev/ramdump* 0640 system system
+
+# Fingerprint device
+/dev/qbt1000 0660 system system
+
+#ImproveTouch device
+/dev/hbtp_input 0660 system system
+/dev/hbtp_vm 0660 system system
+
+# Add device block for FRP
+/dev/block/platform/soc/7824900.sdhci/by-name/config 0600 system system
+/dev/block/platform/soc/7464900.sdhci/by-name/frp 0600 system system
+/dev/block/platform/soc/624000.ufshc/by-name/frp 0600 system system
+/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
+
+# Kmsg device
+/dev/kmsg 0620 root system