blob: c7fa7439d5b143aacb62cbf4a56a2ac7468763ee [file] [log] [blame]
Patrick Tjinea3b3cd2015-03-31 10:38:39 -07001#
2# Copyright 2015 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17import init.angler.usb.rc
18import init.angler.diag.rc
Patrick Tjind18dd242015-05-21 23:43:58 -070019import init.angler.sensorhub.rc
Patrick Tjinea3b3cd2015-03-31 10:38:39 -070020
21on early-init
22 mount debugfs debugfs /sys/kernel/debug
23 chown system system /sys/kernel/debug/kgsl/proc
24
25on init
26 # Set permissions for persist partition
27 mkdir /persist 0771 system system
28 mkdir /firmware 0771 system system
29
30 # Support legacy paths
31 symlink /sdcard /mnt/sdcard
32 symlink /sdcard /storage/sdcard0
33
34on fs
35 mount_all ./fstab.angler
36
Naveen Ramaraj87018982015-04-24 21:10:40 -070037 # Enable rmnet data and aggregation
38 setprop persist.rmnet.mux enabled
39 setprop persist.rmnet.data.enable true
40 setprop persist.data.wda.enable true
41 setprop persist.data.df.agg.dl_pkt 10
42 setprop persist.data.df.agg.dl_size 4096
43
Patrick Tjinea3b3cd2015-03-31 10:38:39 -070044on early-boot
45 # set RLIMIT_MEMLOCK to 64MB
46 setrlimit 8 67108864 67108864
47
48on boot
Zhihui Wu5a04a702015-05-22 14:27:54 -070049 # ensure at most one A57 is online when thermal hotplug is disabled
50 write /sys/devices/system/cpu/cpu5/online 0
51 write /sys/devices/system/cpu/cpu6/online 0
52 write /sys/devices/system/cpu/cpu7/online 0
53
54 # Limit A57 max freq from msm_perf module in case CPU 4 is offline
55 write /sys/module/msm_performance/parameters/cpu_max_freq "4:960000 5:960000 6:960000 7:960000"
56
57 # disable thermal bcl hotplug to switch governor
58 write /sys/module/msm_thermal/core_control/enabled 0
59
60 # configure governor settings for little cluster
61 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor "interactive"
62 write /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_sched_load 1
63 write /sys/devices/system/cpu/cpu0/cpufreq/interactive/use_migration_notif 1
64 write /sys/devices/system/cpu/cpu0/cpufreq/interactive/above_hispeed_delay 19000
65 write /sys/devices/system/cpu/cpu0/cpufreq/interactive/go_hispeed_load 90
66 write /sys/devices/system/cpu/cpu0/cpufreq/interactive/timer_rate 20000
67 write /sys/devices/system/cpu/cpu0/cpufreq/interactive/hispeed_freq 960000
68 write /sys/devices/system/cpu/cpu0/cpufreq/interactive/io_is_busy 1
69 write /sys/devices/system/cpu/cpu0/cpufreq/interactive/target_loads 80
70 write /sys/devices/system/cpu/cpu0/cpufreq/interactive/min_sample_time 40000
71 write /sys/devices/system/cpu/cpu0/cpufreq/interactive/max_freq_hysteresis 80000
72 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq 384000
73
74 # online CPU4
75 write /sys/devices/system/cpu/cpu4/online 1
76
77 # configure governor settings for big cluster
78 write /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor "interactive"
79 write /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_sched_load 1
80 write /sys/devices/system/cpu/cpu4/cpufreq/interactive/use_migration_notif 1
81 write /sys/devices/system/cpu/cpu4/cpufreq/interactive/above_hispeed_delay "19000 1400000:39000 1700000:19000"
82 write /sys/devices/system/cpu/cpu4/cpufreq/interactive/go_hispeed_load 90
83 write /sys/devices/system/cpu/cpu4/cpufreq/interactive/timer_rate 20000
84 write /sys/devices/system/cpu/cpu4/cpufreq/interactive/hispeed_freq 1248000
85 write /sys/devices/system/cpu/cpu4/cpufreq/interactive/io_is_busy 1
86 write /sys/devices/system/cpu/cpu4/cpufreq/interactive/target_loads "85 1500000:90 1800000:70"
87 write /sys/devices/system/cpu/cpu4/cpufreq/interactive/min_sample_time 40000
88 write /sys/devices/system/cpu/cpu4/cpufreq/interactive/max_freq_hysteresis 80000
89 write /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_frqe 384000
90
91 # re-enable thermal and BCL hotplug
92 write /sys/module/msm_thermal/core_control/enabled 1
93
94 # plugin remaining A57s
95 write /sys/devices/system/cpu/cpu5/online 1
96 write /sys/devices/system/cpu/cpu6/online 1
97 write /sys/devices/system/cpu/cpu7/online 1
98 write /sys/module/lpm_levels/parameters/sleep_disabled 0
99
100 # Restore CPU 4 max freq from msm_performance
101 write /sys/module/msm_performance/parameters/cpu_max_freq "4:4294967295 5:4294967295 6:4294967295 7:4294967295"
102
103 # input boost configuration
104 write /sys/module/cpu_boost/parameters/input_boost_freq "0:1344000"
105 write /sys/module/cpu_boost/parameters/input_boost_ms 40
106 # Setting b.L scheduler parameters
107 write /proc/sys/kernel/sched_migration_fixup 1
108 write /proc/sys/kernel/sched_small_task 30
109 write /proc/sys/kernel/sched_mostly_idle_load 20
110 write /proc/sys/kernel/sched_mostly_idle_nr_run 3
111 write /proc/sys/kernel/sched_upmigrate 99
112 write /proc/sys/kernel/sched_downmigrate 85
113 write /proc/sys/kernel/sched_freq_inc_notify 400000
114 write /proc/sys/kernel/sched_freq_dec_notify 400000
Zhihui Wu7d7b98c2015-04-24 00:40:19 -0700115
Patrick Tjinea3b3cd2015-03-31 10:38:39 -0700116 # Enable DEBUG_SUSPEND, DEBUG_EXIT_SUSPEND, and DEBUG_WAKEUP
117 write /sys/module/wakelock/parameters/debug_mask 7
118
119 # create symlink for fb1 as HDMI
120 symlink /dev/graphics/fb1 /dev/graphics/hdmi
Naveen Ramaraj87018982015-04-24 21:10:40 -0700121 symlink /dev/block/platform/soc.0/f9824900.sdhci /dev/block/bootdevice
Patrick Tjinea3b3cd2015-03-31 10:38:39 -0700122
123 # setup permissions for fb1 related nodes
124 chown system graphics /sys/class/graphics/fb1/hpd
125 chown system graphics /sys/class/graphics/fb1/vendor_name
126 chown system graphics /sys/class/graphics/fb1/product_description
127 chmod 0664 /sys/devices/virtual/graphics/fb1/hpd
128 chmod 0664 /sys/devices/virtual/graphics/fb1/vendor_name
129 chmod 0664 /sys/devices/virtual/graphics/fb1/product_description
130
Zhihui Wu9f08b862015-05-04 21:25:06 -0700131 #config fingerprint
132 chown system system /dev/fpc1020
133 chmod 0660 /dev/fpc1020
134 chown system system /sys/devices/platform/fingerprint/diag/result
135 chown system system /sys/devices/platform/fingerprint/diag/navigation_enable
136 chown system system /sys/devices/platform/fingerprint/diag/wakeup_enable
137 chown system system /sys/devices/platform/fingerprint/diag/chip_id
138 chown system system /sys/devices/platform/fingerprint/diag/selftest
139 chown system system /sys/devices/platform/fingerprint/diag/fingerdetect
140 chown system system /sys/devices/platform/fingerprint/diag/spi_ctl
141 chown system system /sys/devices/platform/fingerprint/setup/adc_gain
142 chown system system /sys/devices/platform/fingerprint/setup/adc_shift
143 chown system system /sys/devices/platform/fingerprint/setup/capture_mode
144 chown system system /sys/devices/platform/fingerprint/setup/capture_count
145 chown system system /sys/devices/platform/fingerprint/setup/capture_col_groups
146 chown system system /sys/devices/platform/fingerprint/setup/capture_col_start
147 chown system system /sys/devices/platform/fingerprint/setup/capture_row_count
148 chown system system /sys/devices/platform/fingerprint/setup/capture_row_start
149 chown system system /sys/devices/platform/fingerprint/setup/capture_settings_mux
150 chown system system /sys/devices/platform/fingerprint/setup/pxl_ctrl
151 chown system system /sys/devices/platform/fingerprint/fingerprint_chip_info
152
Zhihui Wu9c4decf2015-05-11 23:23:35 -0700153 #config sensor hub
154 chown system system /dev/spidev5.0
155 write /sys/class/gpio/export 94
156 write /sys/class/gpio/export 93
157 write /sys/class/gpio/export 41
158 write /sys/class/gpio/export 39
159 chown system system /sys/class/gpio/gpio94
160 chown system system /sys/class/gpio/gpio41
161 chown system system /sys/class/gpio/gpio39
162 chown system system /sys/class/gpio/gpio93
163 chown system system /sys/class/gpio/gpio94/value
164 chown system system /sys/class/gpio/gpio41/value
165 chown system system /sys/class/gpio/gpio39/value
166 chown system system /sys/class/gpio/gpio93/value
167 chown system system /sys/class/gpio/gpio94/direction
168 chown system system /sys/class/gpio/gpio41/direction
169 chown system system /sys/class/gpio/gpio39/direction
170 chown system system /sys/class/gpio/gpio93/direction
171
Naveen Ramaraj87018982015-04-24 21:10:40 -0700172 #Create QMUX deamon socket
173 mkdir /dev/socket/qmux_radio 0770 radio radio
174 chmod 2770 /dev/socket/qmux_radio
175 mkdir /dev/socket/qmux_audio 0770 media audio
176 chmod 2770 /dev/socket/qmux_audio
177 mkdir /dev/socket/qmux_gps 0770 gps gps
178 chmod 2770 /dev/socket/qmux_gps
179
wang pingd69321a2015-05-13 00:11:24 +0800180 setprop wifi.interface wlan0
181
Naveen Ramaraj87018982015-04-24 21:10:40 -0700182 write /sys/bus/platform/drivers/xhci_msm_hsic/unbind msm_hsic_host
183 write /sys/module/rmnet_usb/parameters/mux_enabled 1
184 write /sys/module/rmnet_usb/parameters/no_fwd_rmnet_links 8
185 write /sys/module/rmnet_usb/parameters/no_rmnet_insts_per_dev 17
186 write /sys/module/rmnet_usb/parameters/rmnet_data_init 1
187 chown radio radio /sys/devices/virtual/hsicctl/hsicctl0/modem_wait
188
189 # Create /data/time folder for time-services
190 mkdir /data/time/ 0700 system system
191 mkdir /data/audio/ 0770 media audio
192
193 start qmuxd
194 start netmgrd
Zhihui Wu384b2222015-05-19 13:42:18 -0700195 start qti
Naveen Ramaraj87018982015-04-24 21:10:40 -0700196
197
198on property:init.svc.per_mgr=running
199 start per_proxy
200
201on property:sys.shutdown.requested=*
202 stop per_proxy
203
Patrick Tjinea3b3cd2015-03-31 10:38:39 -0700204on post-fs-data
205 write /sys/kernel/boot_adsp/boot 1
206
207 # Ecc_Handler qcril.db
208 mkdir /data/misc/radio 0770 radio radio
209 symlink /system/etc/qcril.db /data/misc/radio/qcril.db
210
211 setprop vold.post_fs_data_done 1
212
Mekala Natarajaneb9c2a32015-04-27 11:01:22 -0700213 # Create directory for TZ Apps
214 mkdir /data/misc/qsee 0770 system system
215
Zhihui Wu7055b3e2015-05-13 18:14:46 -0700216 #Create folder for mm-qcamera-daemon
217 mkdir /data/misc/camera 0770 camera camera
218
Zhihui Wu5dd2b472015-05-20 16:31:35 -0700219 # Create the directories used by CnE subsystem
220 mkdir /data/connectivity 0771 system system
221 chown system system /data/connectivity
222
223 #Create directory from IMS services
224 mkdir /data/shared 0755
225 chown system system /data/shared
226
wang pingdc7ea962015-05-09 00:37:27 +0800227 # Configure bluetooth
228 chmod 0660 /proc/bluetooth/sleep/lpm
229 chmod 0660 /proc/bluetooth/sleep/btwrite
230 chmod 0660 /sys/class/rfkill/rfkill0/state
231 chmod 0660 /dev/ttyHS0
232 chown bluetooth net_bt_stack /proc/bluetooth/sleep/lpm
233 chown bluetooth net_bt_stack /proc/bluetooth/sleep/btwrite
234 chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/state
235 chown bluetooth net_bt_stack /dev/ttyHS0
236
Patrick Tjinea3b3cd2015-03-31 10:38:39 -0700237on charger
Zhihui Wu13d03c62015-04-23 22:06:27 -0700238 #low power governing
239 write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive
240 write /sys/devices/system/cpu/cpu1/online 0
241 write /sys/devices/system/cpu/cpu2/online 0
242 write /sys/devices/system/cpu/cpu3/online 0
243 write /sys/devices/system/cpu/cpu4/online 0
244 write /sys/devices/system/cpu/cpu5/online 0
245 write /sys/devices/system/cpu/cpu6/online 0
246 write /sys/devices/system/cpu/cpu7/online 0
247
248service charger /sbin/healthd -c
249 class charger
250 group log
251 seclabel u:r:healthd:s0
Patrick Tjinea3b3cd2015-03-31 10:38:39 -0700252
Naveen Ramaraj87018982015-04-24 21:10:40 -0700253service per_mgr /system/bin/pm-service
254 class core
255 user root
256 group system net_raw
257
258service per_proxy /system/bin/pm-proxy
259 class core
260 user root
261 group system net_raw
262 disabled
263
264service rmt_storage /system/bin/rmt_storage
265 class core
266 user root
267
Mekala Natarajaneb9c2a32015-04-27 11:01:22 -0700268service qseecomd /system/bin/qseecomd
269 class core
270 user root
271 group root
272
Naveen Ramaraj87018982015-04-24 21:10:40 -0700273service irsc_util /system/bin/irsc_util "/etc/sec_config"
274 class main
275 user root
276 oneshot
277
278service bridgemgrd /system/bin/bridgemgrd
279 class late_start
280 user radio
281 group radio
282
Naveen Ramaraj910680c2015-05-04 10:45:49 -0700283service thermal-engine /system/bin/thermal-engine
284 class main
285 user root
286 socket thermal-send-client stream 0660 system system
287 socket thermal-recv-client stream 0660 system system
288 socket thermal-recv-passive-client stream 0660 system system
289 group root
290
Naveen Ramaraj87018982015-04-24 21:10:40 -0700291# QMUX must be in multiple groups to support external process connections
292service qmuxd /system/bin/qmuxd
293 class main
294 user root
295 group root radio audio bluetooth gps
296 disabled
297
298service netmgrd /system/bin/netmgrd
299 class root
300 group radio
301 disabled
302
Zhihui Wu384b2222015-05-19 13:42:18 -0700303service qti /system/vendor/bin/qti
304 class main
305 user radio
306 group radio net_raw usb net_admin
307 disabled
308
Naveen Ramaraj87018982015-04-24 21:10:40 -0700309service time_daemon /system/bin/time_daemon
310 class late_start
311 user root
312 group root
313
Mekala Natarajan19925592015-05-04 10:19:48 -0700314service loc_launcher /system/bin/loc_launcher
315 class late_start
316 group gps inet net_raw net_admin wifi
317
Patrick Tjinea3b3cd2015-03-31 10:38:39 -0700318# bugreport is triggered by holding down volume down, volume up and power
319service bugreport /system/bin/dumpstate -d -p -B \
320 -o /data/data/com.android.shell/files/bugreports/bugreport
321 class main
322 disabled
323 oneshot
324 keycodes 114 115 116
Zhihui Wu7055b3e2015-05-13 18:14:46 -0700325
326# start camera server as daemon
327service qcamerasvr /system/bin/mm-qcamera-daemon
328 class late_start
329 user camera
330 group camera system inet input graphics
Vineeta Srivastavaf6ab59a2015-05-20 17:29:44 -0700331
332service fingerprintd /system/bin/fingerprintd
333 class late_start
334 user system
Vineeta Srivastavae954dcc2015-05-22 10:59:44 -0700335 disabled
wang pingd69321a2015-05-13 00:11:24 +0800336
337service p2p_supplicant /system/bin/wpa_supplicant \
338 -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
339 -I/system/etc/wifi/p2p_supplicant_overlay.conf \
340 -O/data/misc/wifi/sockets \
341 -m/data/misc/wifi/p2p_supplicant.conf \
342 -puse_p2p_group_interface=1p2p_device=1 \
343 -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
344 class main
345 socket wpa_wlan0 dgram 660 wifi wifi
346 disabled
347 oneshot
348
349service wpa_supplicant /system/bin/wpa_supplicant \
350 -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \
351 -I/system/etc/wifi/wpa_supplicant_overlay.conf \
352 -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0
353 class main
354 socket wpa_wlan0 dgram 660 wifi wifi
355 disabled
356 oneshot
357
358service dhcpcd_wlan0 /system/bin/dhcpcd -aABKL
359 class main
360 disabled
361 oneshot
362
363service dhcpcd_p2p /system/bin/dhcpcd -aABKL
364 class main
365 disabled
366 oneshot
367
368service iprenew_wlan0 /system/bin/dhcpcd -n
369 class main
370 disabled
371 oneshot
372
373service iprenew_p2p /system/bin/dhcpcd -n
374 class main
375 disabled
376 oneshot
Zhihui Wu5dd2b472015-05-20 16:31:35 -0700377
378service imsqmidaemon /system/bin/imsqmidaemon
379 class main
380 user system
381 socket ims_qmid stream 0660 system radio
382 group radio net_raw log diag
383
384service imsdatadaemon /system/bin/imsdatadaemon
385 class main
386 user system
387 socket ims_datad stream 0660 system radio
388 group system wifi radio inet net_raw log diag net_admin
389 disabled
390
391on property:sys.ims.QMI_DAEMON_STATUS=1
392 start imsdatadaemon
393
394service ims_rtp_daemon /system/bin/ims_rtp_daemon
395 class main
396 user system
397 socket ims_rtpd stream 0660 system radio
398 group radio net_raw diag diag log
399 disabled
400
401on property:sys.ims.DATA_DAEMON_STATUS=1
402 start ims_rtp_daemon
403
404service imscmservice /system/bin/imscmservice
405 class main
406 user system
407 group radio net_raw diag diag log
408
409service cnd /system/bin/cnd
410 class late_start
411 socket cnd stream 660 root inet