1import /vendor/etc/init/hw/init.gs101.usb.rc
2import android.hardware.drm@1.2-service.widevine.rc
3import init.exynos.sensorhub.rc
4import /vendor/etc/init/hw/init.aoc.rc
5
6on early-init
7    mount_all /vendor/etc/fstab.persist --early
8
9on init
10    # CPU0 cannot be offline
11    chmod 0444 /sys/devices/system/cpu/cpu0/online
12
13    # Set teo as cpu idle governor
14    write /sys/devices/system/cpu/cpuidle/current_governor teo
15    # Disable util-awareness
16    write /proc/vendor_sched/teo_util_threshold "1024 1024 1024"
17
18    # Boot time fs tuning
19    write /sys/block/sda/queue/scheduler bfq
20    write /sys/block/sda/queue/iosched/slice_idle 0
21
22    chown system system /proc/vendor_sched/groups/bg/set_task_group
23    chown system system /proc/vendor_sched/groups/cam/set_task_group
24    chown system system /proc/vendor_sched/groups/fg/set_task_group
25    chown system system /proc/vendor_sched/groups/nnapi/set_task_group
26    chown system system /proc/vendor_sched/groups/sys/set_task_group
27    chown system system /proc/vendor_sched/groups/sys_bg/set_task_group
28    chown system system /proc/vendor_sched/groups/ta/set_task_group
29    chown system system /proc/vendor_sched/groups/rt/set_task_group
30    chown system system /proc/vendor_sched/groups/sf/set_task_group
31    chown system system /proc/vendor_sched/groups/dex2oat/set_task_group
32    chown system system /proc/vendor_sched/groups/cam_power/set_task_group
33    chown system system /proc/vendor_sched/groups/ota/set_task_group
34    chown system system /proc/vendor_sched/groups/bg/set_proc_group
35    chown system system /proc/vendor_sched/groups/cam/set_proc_group
36    chown system system /proc/vendor_sched/groups/fg/set_proc_group
37    chown system system /proc/vendor_sched/groups/nnapi/set_proc_group
38    chown system system /proc/vendor_sched/groups/sys/set_proc_group
39    chown system system /proc/vendor_sched/groups/sys_bg/set_proc_group
40    chown system system /proc/vendor_sched/groups/ta/set_proc_group
41    chown system system /proc/vendor_sched/groups/rt/set_proc_group
42    chown system system /proc/vendor_sched/groups/sf/set_proc_group
43    chown system system /proc/vendor_sched/groups/dex2oat/set_proc_group
44    chown system system /proc/vendor_sched/groups/cam_power/set_proc_group
45    chown system system /proc/vendor_sched/groups/ota/set_proc_group
46    chown system system /proc/vendor_sched/prefer_idle_set
47    chown system system /proc/vendor_sched/prefer_idle_clear
48    chown system system /proc/vendor_sched/pmu_poll_enable
49    chown system system /proc/vendor_sched/pmu_poll_time
50    chown system system /sys/devices/system/cpu/cpufreq/policy0/sched_pixel/lcpi_threshold
51    chown system system /sys/devices/system/cpu/cpufreq/policy0/sched_pixel/spc_threshold
52    chown system system /sys/devices/system/cpu/cpufreq/policy0/sched_pixel/limit_frequency
53    chown system system /sys/devices/system/cpu/cpufreq/policy0/sched_pixel/pmu_limit_enable
54    chown system system /sys/devices/system/cpu/cpufreq/policy4/sched_pixel/lcpi_threshold
55    chown system system /sys/devices/system/cpu/cpufreq/policy4/sched_pixel/spc_threshold
56    chown system system /sys/devices/system/cpu/cpufreq/policy4/sched_pixel/limit_frequency
57    chown system system /sys/devices/system/cpu/cpufreq/policy4/sched_pixel/pmu_limit_enable
58    chown system system /sys/devices/system/cpu/cpufreq/policy6/sched_pixel/lcpi_threshold
59    chown system system /sys/devices/system/cpu/cpufreq/policy6/sched_pixel/spc_threshold
60    chown system system /sys/devices/system/cpu/cpufreq/policy6/sched_pixel/limit_frequency
61    chown system system /sys/devices/system/cpu/cpufreq/policy6/sched_pixel/pmu_limit_enable
62    chown system system /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu0_memlat@17000010/memlat_cpuidle_state_aware
63    chown system system /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu1_memlat@17000010/memlat_cpuidle_state_aware
64    chown system system /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu2_memlat@17000010/memlat_cpuidle_state_aware
65    chown system system /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu3_memlat@17000010/memlat_cpuidle_state_aware
66    chown system system /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu4_memlat@17000010/memlat_cpuidle_state_aware
67    chown system system /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu5_memlat@17000010/memlat_cpuidle_state_aware
68    chown system system /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu6_memlat@17000010/memlat_cpuidle_state_aware
69    chown system system /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu7_memlat@17000010/memlat_cpuidle_state_aware
70
71    chmod 0220 /proc/vendor_sched/groups/bg/set_task_group
72    chmod 0220 /proc/vendor_sched/groups/cam/set_task_group
73    chmod 0220 /proc/vendor_sched/groups/fg/set_task_group
74    chmod 0220 /proc/vendor_sched/groups/nnapi/set_task_group
75    chmod 0220 /proc/vendor_sched/groups/sys/set_task_group
76    chmod 0220 /proc/vendor_sched/groups/sys_bg/set_task_group
77    chmod 0220 /proc/vendor_sched/groups/ta/set_task_group
78    chmod 0220 /proc/vendor_sched/groups/rt/set_task_group
79    chmod 0220 /proc/vendor_sched/groups/sf/set_task_group
80    chmod 0220 /proc/vendor_sched/groups/dex2oat/set_task_group
81    chmod 0220 /proc/vendor_sched/groups/cam_power/set_task_group
82    chmod 0220 /proc/vendor_sched/groups/ota/set_task_group
83    chmod 0220 /proc/vendor_sched/groups/bg/set_proc_group
84    chmod 0220 /proc/vendor_sched/groups/cam/set_proc_group
85    chmod 0220 /proc/vendor_sched/groups/fg/set_proc_group
86    chmod 0220 /proc/vendor_sched/groups/nnapi/set_proc_group
87    chmod 0220 /proc/vendor_sched/groups/sys/set_proc_group
88    chmod 0220 /proc/vendor_sched/groups/sys_bg/set_proc_group
89    chmod 0220 /proc/vendor_sched/groups/ta/set_proc_group
90    chmod 0220 /proc/vendor_sched/groups/rt/set_proc_group
91    chmod 0220 /proc/vendor_sched/groups/sf/set_proc_group
92    chmod 0220 /proc/vendor_sched/groups/dex2oat/set_proc_group
93    chmod 0220 /proc/vendor_sched/groups/cam_power/set_proc_group
94    chmod 0220 /proc/vendor_sched/groups/ota/set_proc_group
95    chmod 0220 /proc/vendor_sched/prefer_idle_set
96    chmod 0220 /proc/vendor_sched/prefer_idle_clear
97    chmod 0220 /proc/vendor_sched/pmu_poll_enable
98    chmod 0220 /proc/vendor_sched/pmu_poll_time
99
100    start vendor.keymaster-3-0
101
102    # ZRAM setup
103    write /sys/block/zram0/comp_algorithm lz77eh
104    write /proc/sys/vm/page-cluster 0
105
106    # Some user code relies on ro.boot.hardware.revision
107    setprop ro.boot.hardware.revision ${ro.revision}
108
109    # Allow PAI targeting per hardware SKU
110    setprop ro.oem.key1 ${ro.boot.hardware.sku}
111
112    # Property used by vintf for sku specific manifests
113    # Property used by NFC for sku specific configurations
114    setprop ro.boot.product.hardware.sku ${ro.boot.hardware.sku}
115
116    # Support legacy paths
117    symlink /data/app /factory
118
119    # Apply network parameters for high data performance.
120    write /proc/sys/net/core/rmem_default 327680
121    write /proc/sys/net/core/rmem_max 8388608
122    write /proc/sys/net/core/wmem_default 327680
123    write /proc/sys/net/core/wmem_max 8388608
124    write /proc/sys/net/core/optmem_max 20480
125    write /proc/sys/net/core/netdev_max_backlog 10000
126    write /proc/sys/net/ipv4/tcp_rmem "2097152 4194304 8388608"
127    write /proc/sys/net/ipv4/tcp_wmem "262144 524288 8388608"
128    write /proc/sys/net/ipv4/tcp_mem "44259 59012 88518"
129    write /proc/sys/net/ipv4/udp_mem "88518 118025 177036"
130
131    write /sys/class/net/rmnet0/queues/rx-0/rps_cpus fe
132    write /sys/class/net/rmnet1/queues/rx-0/rps_cpus fe
133    write /sys/class/net/rmnet2/queues/rx-0/rps_cpus fe
134    write /sys/class/net/rmnet3/queues/rx-0/rps_cpus fe
135    write /sys/class/net/rmnet4/queues/rx-0/rps_cpus fe
136    write /sys/class/net/rmnet5/queues/rx-0/rps_cpus fe
137    write /sys/class/net/rmnet6/queues/rx-0/rps_cpus fe
138    write /sys/class/net/rmnet7/queues/rx-0/rps_cpus fe
139
140    # Create UDS structure for base VR services.
141    mkdir /dev/socket/pdx 0775 system system
142    mkdir /dev/socket/pdx/system 0775 system system
143    mkdir /dev/socket/pdx/system/buffer_hub 0775 system system
144    mkdir /dev/socket/pdx/system/performance 0775 system system
145    mkdir /dev/socket/pdx/system/vr 0775 system system
146    mkdir /dev/socket/pdx/system/vr/display 0775 system system
147    mkdir /dev/socket/pdx/system/vr/pose 0775 system system
148    mkdir /dev/socket/pdx/system/vr/sensors 0775 system system
149
150    # Boot time 183626384
151    write /proc/vendor_sched/groups/ta/uclamp_min 201
152    write /proc/vendor_sched/groups/ta/prefer_idle 1
153    write /proc/vendor_sched/groups/fg/uclamp_min 201
154    write /proc/vendor_sched/groups/fg/prefer_idle 1
155    write /proc/vendor_sched/groups/sys/uclamp_min 201
156    write /proc/vendor_sched/groups/sys/prefer_idle 1
157
158    # governor setting
159    write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor sched_pixel
160    write /sys/devices/system/cpu/cpu0/cpufreq/sched_pixel/up_rate_limit_us 500
161    write /sys/devices/system/cpu/cpu0/cpufreq/sched_pixel/down_rate_limit_us 5000
162    write /sys/devices/system/cpu/cpu0/cpufreq/sched_pixel/down_rate_limit_scale_pow 2
163    write /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor sched_pixel
164    write /sys/devices/system/cpu/cpu4/cpufreq/sched_pixel/up_rate_limit_us 500
165    write /sys/devices/system/cpu/cpu4/cpufreq/sched_pixel/down_rate_limit_us 20000
166    write /sys/devices/system/cpu/cpu6/cpufreq/scaling_governor sched_pixel
167    write /sys/devices/system/cpu/cpu6/cpufreq/sched_pixel/up_rate_limit_us 500
168    write /sys/devices/system/cpu/cpu6/cpufreq/sched_pixel/down_rate_limit_us 20000
169
170    # memlat cpuidle awareness setting
171    write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu0_memlat@17000010/memlat_cpuidle_state_aware 2
172    write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu1_memlat@17000010/memlat_cpuidle_state_aware 2
173    write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu2_memlat@17000010/memlat_cpuidle_state_aware 2
174    write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu3_memlat@17000010/memlat_cpuidle_state_aware 2
175    write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu4_memlat@17000010/memlat_cpuidle_state_aware 2
176    write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu5_memlat@17000010/memlat_cpuidle_state_aware 2
177    write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu6_memlat@17000010/memlat_cpuidle_state_aware 2
178    write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu7_memlat@17000010/memlat_cpuidle_state_aware 2
179
180    # RT uclamp setting
181    write /proc/sys/kernel/sched_util_clamp_min_rt_default 0
182
183    # change permissions and default values for camera-daemon cpu controller
184    chown system system /dev/cpuctl/camera-daemon/cpu.uclamp.min
185    chown system system /dev/cpuctl/camera-daemon/cpu.uclamp.max
186    chown root root /dev/cpuctl/camera-daemon/cpu.uclamp.latency_sensitive
187    chown system system /dev/cpuctl/camera-daemon/cgroup.procs
188
189    mkdir /dev/cpuset/camera-daemon-high-group
190    write /dev/cpuset/camera-daemon-high-group/cpus 0-7
191    write /dev/cpuset/camera-daemon-high-group/mems 0
192    chown system system /dev/cpuset/camera-daemon-high-group/tasks
193    chmod 0664 /dev/cpuset/camera-daemon-high-group/tasks
194
195    mkdir /dev/cpuset/camera-daemon-mid-group
196    write /dev/cpuset/camera-daemon-mid-group/cpus 0-7
197    write /dev/cpuset/camera-daemon-mid-group/mems 0
198    chown system system /dev/cpuset/camera-daemon-mid-group/tasks
199    chmod 0664 /dev/cpuset/camera-daemon-mid-group/tasks
200
201    mkdir /dev/cpuset/camera-daemon-mid-high-group
202    write /dev/cpuset/camera-daemon-mid-high-group/cpus 0-7
203    write /dev/cpuset/camera-daemon-mid-high-group/mems 0
204    chown system system /dev/cpuset/camera-daemon-mid-high-group/tasks
205    chmod 0664 /dev/cpuset/camera-daemon-mid-high-group/tasks
206
207    write /proc/vendor_sched/groups/cam/prefer_idle 1
208    write /proc/vendor_sched/groups/cam/uclamp_min 1
209
210    chown system system /dev/cpuset/cgroup.procs
211
212    # nanohub sensor
213    chmod 0664 /dev/nanohub
214    chmod 0664 /dev/nanohub_comms
215    chown system system /dev/nanohub
216    chown system system /dev/nanohub_comms
217
218    # logbuffer
219    chown system system /dev/logbuffer_maxfg
220    chown system system /dev/logbuffer_maxfg_base
221    chown system system /dev/logbuffer_maxfg_flip
222    chown system system /dev/logbuffer_maxfg_monitor
223    chown system system /dev/logbuffer_maxfg_base_monitor
224    chown system system /dev/logbuffer_maxfg_flip_monitor
225    chown system system /dev/logbuffer_maxq
226    chown system system /dev/logbuffer_google,cpm
227    chown system system /dev/logbuffer_rtx
228    chown system system /dev/logbuffer_ssoc
229    chown system system /dev/logbuffer_ttf
230    chown system system /dev/logbuffer_tcpm
231    chown system system /dev/logbuffer_usbpd
232    chown system system /dev/logbuffer_pogo_transport
233    chown system system /dev/logbuffer_wireless
234    chown system system /dev/logbuffer_pca9468
235    chown system system /dev/logbuffer_cpm
236    chown system system /dev/logbuffer_bd
237    chown system system /dev/logbuffer_cpif
238
239    # Dump maxfg
240    chown system system /sys/class/power_supply/maxfg/m5_model_state
241    chown system system /sys/class/power_supply/maxfg_base/m5_model_state
242
243    # Modem temperature driver
244    chown radio system /sys/devices/platform/cp-tm1/cp_temp
245
246    # insert display module
247    start init_display
248
249    # Charge stats (write 0)
250    chown system system /sys/class/power_supply/battery/charge_stats
251
252    # Pca Charge stats (write 0)
253    chown system system /sys/class/power_supply/pca9468-mains/device/chg_stats
254
255    # Wireless Charge stats (write 0)
256    chown system system /sys/class/power_supply/wireless/device/charge_stats
257
258    # Thermal Charge stats (write 0)
259    chown system system /sys/devices/platform/google,charger/thermal_stats
260
261    # Google Charger stats (write 0)
262    chown system system /sys/devices/platform/google,charger/charge_stats
263
264    # Permission for wireless charging fan
265    chown system system /sys/devices/platform/google,charger/thermal_dc_fan_alarm
266    chown system system /sys/devices/platform/google,cpm/thermal_mdis_fan_alarm
267
268    # Permission for wireless charging
269    chown system system /sys/class/power_supply/wireless/capacity
270    chown system system /sys/class/power_supply/wireless/device/rtx
271    chown system system /sys/class/power_supply/wireless/device/rxdata
272    chown system system /sys/class/power_supply/wireless/device/txdata
273    chown system system /sys/class/power_supply/wireless/device/rxlen
274    chown system system /sys/class/power_supply/wireless/device/txlen
275    chown system system /sys/class/power_supply/wireless/device/ccreset
276    chown system system /sys/class/power_supply/wireless/device/status
277    chown system system /sys/class/power_supply/wireless/device/version
278    chown system system /sys/class/power_supply/wireless/device/features
279    chown system system /sys/class/power_supply/wireless/device/authtype
280
281    # Adaptive charge
282    chown system system /sys/class/power_supply/battery/charge_deadline
283
284    # Charging policy
285    chown system system /sys/class/power_supply/battery/charging_policy
286
287    # BatteryHealthData
288    chown system system /sys/class/power_supply/battery/first_usage_date
289    chown system system /sys/class/power_supply/battery/swelling_data
290
291    # Battery Defender
292    chown system system /sys/devices/platform/google,battery/power_supply/battery/bd_trickle_cnt
293    chown system system /sys/devices/platform/google,battery/power_supply/battery/bd_trickle_dry_run
294    chown system system /sys/devices/platform/google,battery/power_supply/battery/bd_trickle_enable
295    chown system system /sys/devices/platform/google,battery/power_supply/battery/bd_trickle_recharge_soc
296    chown system system /sys/devices/platform/google,battery/power_supply/battery/bd_trickle_reset_sec
297    chown system system /sys/devices/platform/google,battery/power_supply/battery/bd_clear
298    chown system system /sys/devices/platform/google,battery/power_supply/battery/health_safety_margin
299    chown system system /sys/devices/platform/google,battery/power_supply/battery/aacr_state
300    chown system system /sys/devices/platform/google,battery/power_supply/battery/aacr_cycle_max
301    chown system system /sys/devices/platform/google,battery/power_supply/battery/aacr_cycle_grace
302    chown system system /sys/devices/platform/google,charger/bd_drainto_soc
303    chown system system /sys/devices/platform/google,charger/bd_recharge_soc
304    chown system system /sys/devices/platform/google,charger/bd_recharge_voltage
305    chown system system /sys/devices/platform/google,charger/bd_resume_abs_temp
306    chown system system /sys/devices/platform/google,charger/bd_resume_soc
307    chown system system /sys/devices/platform/google,charger/bd_resume_temp
308    chown system system /sys/devices/platform/google,charger/bd_resume_time
309    chown system system /sys/devices/platform/google,charger/bd_temp_dry_run
310    chown system system /sys/devices/platform/google,charger/bd_temp_enable
311    chown system system /sys/devices/platform/google,charger/bd_trigger_temp
312    chown system system /sys/devices/platform/google,charger/bd_trigger_time
313    chown system system /sys/devices/platform/google,charger/bd_trigger_voltage
314    chown system system /sys/devices/platform/google,charger/bd_clear
315    chown system system /sys/devices/platform/google,charger/bd_state
316    chown system system /sys/devices/platform/google,charger/charge_start_level
317    chown system system /sys/devices/platform/google,charger/charge_stop_level
318    chown system system /sys/devices/platform/google,cpm/dc_ctl
319    # Important to include dd_state as it's used in battery defender in charger mode
320    chown system system /sys/devices/platform/google,charger/dd_state
321    chown system system /sys/devices/platform/google,charger/dd_settings
322
323    # Power Stats HAL
324    chown system system /dev/bbd_pwrstat
325
326    # Add a boost for NNAPI HAL
327    write /proc/vendor_sched/groups/nnapi/prefer_idle 0
328    write /proc/vendor_sched/groups/nnapi/uclamp_min 512
329
330    # Add memlat governor settings
331    write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu0_memlat@17000010/polling_interval 10
332    write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu1_memlat@17000010/polling_interval 10
333    write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu2_memlat@17000010/polling_interval 10
334    write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu3_memlat@17000010/polling_interval 10
335    write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu4_memlat@17000010/polling_interval 10
336    write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu5_memlat@17000010/polling_interval 10
337    write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu6_memlat@17000010/polling_interval 10
338    write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu7_memlat@17000010/polling_interval 10
339    write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu0_memlat@17000010/mem_latency/ratio_ceil 400
340    write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu1_memlat@17000010/mem_latency/ratio_ceil 400
341    write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu2_memlat@17000010/mem_latency/ratio_ceil 400
342    write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu3_memlat@17000010/mem_latency/ratio_ceil 400
343    write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu4_memlat@17000010/mem_latency/ratio_ceil 2700
344    write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu5_memlat@17000010/mem_latency/ratio_ceil 2700
345    write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu6_memlat@17000010/mem_latency/ratio_ceil 3200
346    write /sys/class/devfreq/gs_memlat_devfreq:devfreq_mif_cpu7_memlat@17000010/mem_latency/ratio_ceil 3200
347
348    # Set boost_adpf_prio, -1 by default
349    write /proc/vendor_sched/boost_adpf_prio ${persist.device_config.vendor_system_native_boot.boost_adpf_prio:--1}
350
351on init && property:ro.boot.hw.soc.rev=0
352    setprop vendor.powerhal.config powerhint_a0.json
353
354on init && property:ro.boot.hw.soc.rev=1
355    setprop vendor.powerhal.config powerhint_a1.json
356
357on init && property:ro.boot.hw.soc.rev=0
358    # STOPSHIP b/177967147 disable SICD
359    write /sys/devices/platform/cpupm/cpupm/sicd 0
360
361on init && property:ro.boot.hw.soc.rev=1
362    # STOPSHIP b/177967147 disable SICD
363    write /sys/devices/platform/cpupm/cpupm/sicd 0
364
365on late-fs
366    # Start bootanimation class before mount
367    start bootanim
368    class_start animation
369
370    # Mount RW partitions which need run fsck
371    mount_all --late
372
373on post-fs-data
374    # Log data folder
375    mkdir /data/vendor 0771 radio system
376    mkdir /data/vendor/log 0771 radio system
377    mkdir /data/vendor/log/cbd 0771 radio system
378    mkdir /data/vendor/log/rfsd 0771 radio system
379
380    mkdir /data/exynos/log 0771 radio system
381    mkdir /data/vendor/rild 0771 radio system
382    mkdir /data/vendor/dump 0771 radio system
383    mkdir /data/vendor/slog 0771 system system
384
385    # PixelLogger log paths.
386    mkdir /data/vendor/radio 773 system radio
387    mkdir /data/vendor/radio/logs 773 system radio
388    mkdir /data/vendor/radio/logs/always-on 777 system radio
389
390    # Modem extended log folder
391    mkdir /data/vendor/radio/extended_logs 0770 radio system
392
393    # Modem MDS log folder
394    mkdir /data/vendor/radio/mds 0771 radio system
395
396    # Unzipped modem images folder
397    mkdir /data/vendor/radio/image 0771 radio system
398
399    # Modem stat folder
400    mkdir /data/vendor/modem_stat 0771 radio system
401    write /data/vendor/modem_stat/debug.txt ""
402    chown radio system /data/vendor/modem_stat/debug.txt
403    chmod 0664 /data/vendor/modem_stat/debug.txt
404
405    # Modem replay folder
406    mkdir /mnt/vendor/modem_userdata/replay 0775 radio system
407
408    # Write display MIPI frequency from Modem
409    chown system system /sys/devices/platform/1c2c0000.drmdsim/hs_clock
410    chown system system /sys/devices/platform/1c2d0000.drmdsim/hs_clock
411    chmod 0664 /sys/devices/platform/1c2c0000.drmdsim/hs_clock
412    chmod 0664 /sys/devices/platform/1c2d0000.drmdsim/hs_clock
413
414    setprop wifi.direct.interface p2p-dev-wlan0
415    setprop wifi.aware.interface aware_nmi0
416
417# IPSEC PIDDIR for VoWiFi
418    mkdir /data/vendor/misc 0771 root system
419    mkdir /data/vendor/misc/vpn 0771 root system
420
421# Permissions Camera
422    mkdir /data/vendor/camera 0770 system camera
423    mkdir /data/vendor/camera/catpipe 0770 system camera
424    chmod 0755 /sys/kernel/debug/tracing
425    restorecon /sys/kernel/debug/tracing/trace_marker
426
427    # ranging sensor
428    chown system system /dev/stmvl53l1_ranging
429    chmod 0660 /dev/stmvl53l1_ranging
430
431    # Factory calibration files
432    chmod 0771 /mnt/vendor/persist/camera
433    chmod 0771 /mnt/vendor/persist/camera/OTP_calibration
434    chmod 0771 /mnt/vendor/persist/camera/pdaf_calibration_data
435    chmod 0771 /mnt/vendor/persist/camera/rear
436
437# Audio dump and debug
438    mkdir /data/vendor/audio 0770 audio audio
439
440# Create the directories for Darwinn HAL.
441    mkdir /data/vendor/hal_neuralnetworks_darwinn 0770 system system
442    mkdir /data/vendor/hal_neuralnetworks_darwinn/checksum_cache 0770 system system
443    mkdir /data/vendor/edgetpu 0770 system system
444    mkdir /data/vendor/edgetpu/cache 0770 system system
445
446# Compatibility path for TPU
447    symlink /dev/abrolhos /dev/edgetpu
448
449on zygote-start
450    # For PixelLogger configuration file.
451    chmod 0771 /data/vendor/wifi
452    write /proc/vendor_sched/groups/sys/uclamp_min 0
453
454on post-fs-data
455    # Create the directories used by the Wireless subsystem
456    mkdir /data/vendor/wifi 0771 wifi wifi
457    mkdir /data/vendor/wifi/wpa 0770 wifi wifi
458    mkdir /data/vendor/wifi/wpa/sockets 0770 wifi wifi
459
460# Gatekeeper data
461    mkdir /data/vendor/gk 0771 system system
462
463# HWC data
464    mkdir /data/vendor/log/hwc 0771 system graphics
465
466# Video data
467    mkdir /data/vendor/media 0700 mediacodec mediacodec
468
469on post-fs-data
470    # GPS
471    mkdir /data/vendor/gps 0771 system system
472    chown system system /data/vendor/gps
473    rm /data/vendor/gps/gps_started
474    rm /data/vendor/gps/glonass_started
475    rm /data/vendor/gps/beidou_started
476    rm /data/vendor/gps/smd_started
477    rm /data/vendor/gps/sv_cno.info
478
479    chown gps system /sys/devices/platform/10940000.spi/spi_master/spi5/spi5.0/nstandby
480    chmod 0664 /dev/ttyBCM
481    chown gps system /dev/ttyBCM
482    chmod 0664 /dev/bbd_control
483    chown gps system /dev/bbd_control
484    chmod 0664 /dev/bbd_patch
485    chown gps system /dev/bbd_patch
486    chmod 0664 /dev/bbd_sensor
487    chown gps system /dev/bbd_sensor
488
489on early-boot
490    # Wait for insmod_sh to finish all common modules
491    wait_for_prop vendor.common.modules.ready 1
492
493on boot
494
495    # Allow to access debugfs for system:system
496    chmod 0755 /sys/kernel/debug
497    chown system system /sys/kernel/debug
498
499    #setprop ro.radio.noril no
500
501    # default country code
502    setprop ro.boot.wificountrycode 00
503
504    # Set up kernel tracing, but disable it by default
505    chmod 0222 /sys/kernel/debug/tracing/trace_marker
506    write /sys/kernel/debug/tracing/tracing_on 0
507
508    # Change permission for A-Box firmware logs file & GPR dump
509    chown audioserver system /sys/devices/platform/17c50000.abox/reset
510    chown audioserver system /sys/devices/platform/17c50000.abox/service
511    chown audioserver system /sys/devices/platform/17c50000.abox/0.abox_debug/gpr
512    chown audioserver system /sys/devices/platform/17c50000.abox/0.abox_debug/calliope_sram
513    chown audioserver system /sys/devices/platform/17c50000.abox/0.abox_debug/calliope_dram
514    chown audioserver system /sys/devices/platform/17c50000.abox/0.abox_debug/calliope_iva
515    chown audioserver system /sys/kernel/debug/abox/log-00
516
517# Permission for USB SELECT
518    chown system system /sys/class/android_usb/android0/enable
519    chmod 0660 /sys/class/android_usb/android0/enable
520    chown system system /sys/class/android_usb/android0/idVendor
521    chmod 0660 /sys/class/android_usb/android0/idVendor
522    chown system system /sys/class/android_usb/android0/idProduct
523    chmod 0660 /sys/class/android_usb/android0/idProduct
524    chown system system /sys/class/android_usb/android0/f_diag/clients
525    chmod 0660 /sys/class/android_usb/android0/f_diag/clients
526    chown system system /sys/class/android_usb/android0/functions
527    chmod 0660 /sys/class/android_usb/android0/functions
528    chown system system /sys/class/android_usb/android0/bDeviceClass
529    chmod 0660 /sys/class/android_usb/android0/bDeviceClass
530
531# Permission for UART SWITCH
532    chmod 0660 /sys/class/sec/switch/uart_sel
533    chown system system /sys/class/sec/switch/uart_sel
534
535# VTS sysfs file permission
536    chown audioserver system /sys/devices/platform/13810000.vts/vts_svoice_model
537    chown audioserver system /sys/devices/platform/13810000.vts/vts_google_model
538    chmod 0660 /sys/devices/platform/13810000.vts/vts_svoice_model
539    chmod 0660 /sys/devices/platform/13810000.vts/vts_google_model
540
541# WLAN firmware/driver path
542    chown wifi wifi /sys/module/bcmdhd/parameters/nvram_path
543    chown wifi wifi /sys/module/bcmdhd/parameters/firmware_path
544
545on property:persist.vendor.radio.no_modem_board=1
546    setprop ro.radio.noril yes
547
548on fs
549    mount_all --early
550    restorecon_recursive /mnt/vendor/efs
551    chown radio system /mnt/vendor/efs
552    restorecon_recursive /mnt/vendor/efs_backup
553    chown radio system /mnt/vendor/efs_backup
554    restorecon_recursive /mnt/vendor/modem_userdata
555    chown radio system /mnt/vendor/modem_userdata
556
557    # for cycle count backup
558    mkdir /mnt/vendor/persist/battery 0700 system system
559
560    restorecon_recursive /mnt/vendor/persist
561    restorecon_recursive /mnt/vendor/persist/aoc
562    restorecon_recursive /mnt/vendor/persist/audio
563    restorecon_recursive /mnt/vendor/persist/sensors
564    restorecon_recursive /mnt/vendor/persist/battery
565    restorecon_recursive /mnt/vendor/persist/modem
566    # Set up display-related directories and permissions
567    # Add restorecon_recursive command to make sure the restorecon label is persist_display_file.
568    restorecon_recursive /mnt/vendor/persist/display
569    mkdir /mnt/vendor/persist/data/sfs 0700 system system
570    mkdir /mnt/vendor/persist/data/tz 0700 system system
571    mkdir /mnt/vendor/persist/touch 0770 system system
572    mkdir /mnt/vendor/persist/audio 0770 system system
573    chown media audio /mnt/vendor/persist/audio
574
575# Permissions for ION
576    chmod 0660 /sys/class/ion_cma/ion_video_ext/isolated
577    chown system system /sys/class/ion_cma/ion_video_ext/isolated
578
579# Permissions for hwcomposer
580    chown system system /sys/class/backlight/panel0-backlight/als_table
581    chown system system /sys/class/backlight/panel0-backlight/brightness
582    chown system system /sys/class/backlight/panel0-backlight/dimming_on
583    chown system system /sys/class/backlight/panel0-backlight/hbm_mode
584    chown system system /sys/class/backlight/panel0-backlight/local_hbm_mode
585    chown system system /sys/class/backlight/panel0-backlight/allow_wakeup_by_state_change
586    chown system system /sys/devices/platform/exynos-drm/primary-panel/gamma
587    chown system system /sys/devices/platform/exynos-drm/primary-panel/min_vrefresh
588    chown system system /sys/devices/platform/exynos-drm/primary-panel/idle_delay_ms
589    chown system system /sys/devices/platform/exynos-drm/primary-panel/panel_need_handle_idle_exit
590    chown system system /sys/module/drm/parameters/vblankoffdelay
591    chown system system /sys/module/drm/parameters/debug
592    chown system system /sys/class/dqe0/atc/ambient_light
593    chown system system /sys/class/dqe0/atc/st
594    chown system system /sys/class/dqe0/atc/en
595    chown system system /sys/class/dqe0/atc/lt
596    chown system system /sys/class/dqe0/atc/ns
597    chown system system /sys/class/dqe0/atc/dither
598    chown system system /sys/class/dqe0/atc/pl_w1
599    chown system system /sys/class/dqe0/atc/pl_w2
600    chown system system /sys/class/dqe0/atc/ctmode
601    chown system system /sys/class/dqe0/atc/pp_en
602    chown system system /sys/class/dqe0/atc/upgrade_on
603    chown system system /sys/class/dqe0/atc/tdr_max
604    chown system system /sys/class/dqe0/atc/tdr_min
605    chown system system /sys/class/dqe0/atc/back_light
606    chown system system /sys/class/dqe0/atc/dstep
607    chown system system /sys/class/dqe0/atc/scale_mode
608    chown system system /sys/class/dqe0/atc/threshold_1
609    chown system system /sys/class/dqe0/atc/threshold_2
610    chown system system /sys/class/dqe0/atc/threshold_3
611    chown system system /sys/class/dqe0/atc/gain_limit
612    chown system system /sys/class/dqe0/atc/lt_calc_ab_shift
613    chown system system /sys/devices/platform/1c300000.drmdecon/early_wakeup
614    chmod 0660 /sys/devices/platform/1c300000.drmdecon/early_wakeup
615    chown system system /sys/devices/platform/1c302000.drmdecon/early_wakeup
616    chmod 0660 /sys/devices/platform/1c302000.drmdecon/early_wakeup
617
618# Copy DRM Key
619#    copy /system/app/wv.keys /factory/wv.keys
620
621# Permission for DRM Key
622#    chmod 0644 /factory/wv.keys
623
624# Permission for flashlight control for HAL3.3
625# The Istor espresso board does not have the flash led h/w, So the below permission line are blocked.
626# If you want to test the flashlight in board which have the flash led h/w, Enable the below blocked lines.
627    chmod 0660 /sys/class/camera/flash/rear_torch_flash
628    chown system camera /sys/class/camera/flash/rear_torch_flash
629#load ecd firmware
630    write /proc/ecd/load_firmware 1
631
632service abox /vendor/bin/main_abox 17c50000.abox
633    class late_start
634    user audioserver
635    group audioserver
636    seclabel u:r:abox:s0
637
638# on userdebug and eng builds, enable kgdb on the serial console
639on property:ro.debuggable=1
640    write /sys/module/kgdboc/parameters/kgdboc ttyFIQ1
641    write /sys/module/fiq_debugger/parameters/kgdb_enable 1
642
643# Touch
644on property:vendor.device.modules.ready=1
645    chown system system /sys/class/spi_master/spi11/spi11.0/stm_fts_cmd
646    chown system system /sys/class/spi_master/spi11/spi11.0/glove_mode
647    chown system system /sys/class/spi_master/spi6/spi6.0/stm_fts_cmd
648    chown system system /sys/class/spi_master/spi6/spi6.0/glove_mode
649    chown system system /sys/devices/virtual/sec/tsp/fw_version
650    chown system system /sys/devices/virtual/sec/tsp/cmd
651    chown system system /sys/devices/virtual/sec/tsp/cmd_result
652    chown system system /sys/devices/virtual/sec/tsp/status
653    chown system system /sys/class/spi_master/spi11/spi11.0/input/nvt_touch/force_touch_active
654    chown system system /sys/class/spi_master/spi11/spi11.0/input/nvt_touch/nvt_dttw_mode
655    # Allow access to touch
656    chown system input /dev/touch_offload
657    chmod 660 /dev/touch_offload
658
659# Route touch_sensitivity_mode to persist
660on property:debug.touch_sensitivity_mode=0
661    setprop persist.vendor.touch_sensitivity_mode 0
662
663on property:debug.touch_sensitivity_mode=1
664    setprop persist.vendor.touch_sensitivity_mode 1
665
666on property:init.svc.vendor.charger=running
667    stop keymaster-4-0
668
669    setprop sys.usb.configfs 1
670    setprop vendor.setup.power 1
671
672    # keep one little and one big
673    write /sys/devices/system/cpu/cpu1/online 0
674    write /sys/devices/system/cpu/cpu2/online 0
675    write /sys/devices/system/cpu/cpu3/online 0
676    write /sys/devices/system/cpu/cpu5/online 0
677    write /sys/devices/system/cpu/cpu6/online 0
678    write /sys/devices/system/cpu/cpu7/online 0
679
680on property:sys.boot_completed=1
681    # Enable ZRAM on boot_complete
682    swapon_all /vendor/etc/fstab.${ro.board.platform}
683    write /proc/sys/vm/swappiness 60
684
685    # Force empty CMA
686    write /sys/kernel/vendor_mm/cma/farawimg/force_empty 1
687
688    # Back to default VM settings
689    write /proc/sys/vm/dirty_expire_centisecs 3000
690    write /proc/sys/vm/dirty_background_ratio 10
691
692    # Reset DDR frequency
693    write /sys/devices/platform/17000010.devfreq_mif/devfreq/17000010.devfreq_mif/exynos_data/cancel_boot_freq 1
694    write /sys/devices/platform/17000020.devfreq_int/devfreq/17000020.devfreq_int/exynos_data/cancel_boot_freq 1
695
696    # Setup final cpuset
697    write /dev/cpuset/top-app/cpus ${persist.device_config.vendor_system_native.top-app_cpuset:-0-7}
698    write /dev/cpuset/foreground/cpus ${persist.device_config.vendor_system_native.foreground_cpuset:-0-3,4-5}
699    write /dev/cpuset/background/cpus ${persist.device_config.vendor_system_native.background_cpuset:-0-3}
700    write /dev/cpuset/system-background/cpus ${persist.device_config.vendor_system_native.system-background_cpuset:-0-3}
701    write /dev/cpuset/restricted/cpus ${persist.device_config.vendor_system_native.restricted_cpuset:-0-3}
702    write /dev/cpuset/camera-daemon/cpus ${persist.device_config.vendor_system_native.camera-daemon_cpuset:-0-7}
703    setprop vendor.powerhal.init 1
704
705    # Setup final cpu.uclamp
706    write /proc/vendor_sched/groups/ta/uclamp_min 1
707    write /proc/vendor_sched/groups/fg/uclamp_min 0
708    write /proc/vendor_sched/groups/sys/prefer_idle 0
709
710    # Set ug group
711    write /proc/vendor_sched/groups/bg/ug 0
712    write /proc/vendor_sched/groups/sys_bg/ug 0
713    write /proc/vendor_sched/groups/ota/ug 0
714    write /proc/vendor_sched/groups/dex2oat/ug 1
715    write /proc/vendor_sched/groups/ta/ug 1
716
717    # Set bg group throttle
718    write /proc/vendor_sched/ug_bg_group_throttle ${persist.device_config.vendor_system_native.ug_bg_group_throttle:-308}
719
720    # Set uclamp.max for some groups, which could indicate cpu importance used in scheduling
721    write /proc/vendor_sched/groups/bg/uclamp_max 512
722    write /proc/vendor_sched/groups/sys_bg/uclamp_max 512
723    write /proc/vendor_sched/groups/ota/uclamp_max 512
724    write /proc/vendor_sched/groups/dex2oat/uclamp_max 615
725
726    # Set PMU freq limit parameters
727    write /sys/devices/system/cpu/cpufreq/policy0/sched_pixel/lcpi_threshold 2
728    write /sys/devices/system/cpu/cpufreq/policy0/sched_pixel/spc_threshold 59
729    write /sys/devices/system/cpu/cpufreq/policy0/sched_pixel/limit_frequency 1401000
730    write /sys/devices/system/cpu/cpufreq/policy4/sched_pixel/lcpi_threshold 6
731    write /sys/devices/system/cpu/cpufreq/policy4/sched_pixel/spc_threshold 64
732    write /sys/devices/system/cpu/cpufreq/policy4/sched_pixel/limit_frequency 1826000
733    write /sys/devices/system/cpu/cpufreq/policy6/sched_pixel/lcpi_threshold 5
734    write /sys/devices/system/cpu/cpufreq/policy6/sched_pixel/spc_threshold 69
735    write /sys/devices/system/cpu/cpufreq/policy6/sched_pixel/limit_frequency 2507000
736    write /proc/vendor_sched/pmu_poll_time 10
737
738    # Disable PMU freq limit
739    write /sys/devices/system/cpu/cpufreq/policy0/sched_pixel/pmu_limit_enable 1
740    write /sys/devices/system/cpu/cpufreq/policy4/sched_pixel/pmu_limit_enable 1
741    write /sys/devices/system/cpu/cpufreq/policy6/sched_pixel/pmu_limit_enable 1
742    write /proc/vendor_sched/pmu_poll_enable 0
743
744    # Setup cpu.shares to throttle background groups (bg ~ 5% sysbg ~ 5% dex2oat ~2.5%)
745    write /dev/cpuctl/background/cpu.shares 1024
746    write /dev/cpuctl/system-background/cpu.shares 1024
747    write /dev/cpuctl/dex2oat/cpu.shares 512
748    write /dev/cpuctl/system/cpu.shares 20480
749    # We only have system and background groups holding tasks and the groups below are empty
750    write /dev/cpuctl/camera-daemon/cpu.shares 20480
751    write /dev/cpuctl/foreground/cpu.shares 20480
752    write /dev/cpuctl/nnapi-hal/cpu.shares 20480
753    write /dev/cpuctl/rt/cpu.shares 20480
754    write /dev/cpuctl/top-app/cpu.shares 20480
755
756    # gvotables for dumpstate
757    chown system system /sys/kernel/debug/gvotables
758
759    # AOC reset permission
760    chown root system /sys/devices/platform/19000000.aoc/reset
761    chmod 0220 /sys/devices/platform/19000000.aoc/reset
762
763    # write serialno to battery path for pairing
764    write /sys/class/power_supply/battery/dev_sn ${ro.boot.serialno}
765
766# Test Harness Mode default battery profile.
767on  property:persist.sys.test_harness=1 && property:persist.vendor.testing_battery_profile=0
768    setprop persist.vendor.charge.stop.level 70
769    setprop persist.vendor.charge.start.level 35
770    setprop vendor.battery.defender.disable 1
771
772# Extremely restricted battery profile.
773on  property:persist.sys.test_harness=1 && property:persist.vendor.testing_battery_profile=1
774    setprop persist.vendor.charge.stop.level 50
775    setprop persist.vendor.charge.start.level 35
776    setprop vendor.battery.defender.disable 1
777
778# Normal behavior (as if the device was a regular device)
779on  property:persist.sys.test_harness=1 && property:persist.vendor.testing_battery_profile=2
780    setprop persist.vendor.charge.stop.level 100
781    setprop persist.vendor.charge.start.level 0
782
783# Unrestricted, allows charging to 100%
784on  property:persist.sys.test_harness=1 && property:persist.vendor.testing_battery_profile=3
785    setprop persist.vendor.charge.stop.level 100
786    setprop persist.vendor.charge.start.level 0
787    setprop vendor.battery.defender.disable 1
788
789# ACA (Adaptice Charge Always On) persist properties
790on property:persist.vendor.adaptive.charge.soc=*
791    write /sys/class/power_supply/battery/charge_limit ${persist.vendor.adaptive.charge.soc}
792
793service init_display /vendor/bin/init.display.sh
794    class main
795    user root
796    group root system
797    disabled
798    oneshot
799
800# bugreport is triggered by holding down volume down, volume up and power
801service bugreport /system/bin/dumpstate -d -p -z
802    class main
803    disabled
804    oneshot
805    keycodes 114 115 116
806
807# Proxy for Secure Storage
808on post-fs-data
809    mkdir /data/vendor/rebootescrow 0770 hsm hsm
810    start vendor.rebootescrow-citadel
811    mkdir /data/vendor/ss 0770 root system
812    mkdir /mnt/vendor/persist/ss 0770 root system
813    restorecon_recursive /mnt/vendor/persist/ss
814    symlink /mnt/vendor/persist/ss /data/vendor/ss/persist
815    chown root system /data/vendor/ss/persist
816    chmod 0770 /data/vendor/ss/persist
817    chown system system /data/vendor/ss/persist/nsp
818
819    restart storageproxyd
820
821service storageproxyd /vendor/bin/storageproxyd -d /dev/trusty-ipc-dev0 \
822        -r /dev/sg1 -p /data/vendor/ss -t ufs
823    class early_hal
824    user system
825    group system
826
827# Write build info to kdebuginfo
828on property:ro.build.fingerprint=*
829    write /sys/module/debug_kinfo/parameters/build_info ${ro.build.fingerprint}
830
831# Bluetooth
832on early-boot
833    chown bluetooth system /sys/devices/platform/175b0000.serial/serial0/serial0-0/bluetooth/hci0/rfkill0/state
834    chown bluetooth system /sys/devices/platform/odm/odm:btbcm/rfkill/rfkill0/state
835    chown bluetooth system /sys/devices/platform/odm/odm:btbcm/rfkill/rfkill2/state
836
837on post-fs-data
838    chown bluetooth system /proc/bluetooth/sleep/btwake
839    chown bluetooth system /proc/bluetooth/sleep/lpm
840    chown bluetooth system /proc/bluetooth/sleep/btwrite
841    mkdir /data/vendor/bluetooth 0770 bluetooth system
842
843on post-fs-data
844    mkdir /data/vendor/powerstats 0771 system system
845    chown system system /data/vendor/powerstats
846    # Thermal Residency Stats (write 1 to reset)
847    chown system system /sys/kernel/metrics/thermal/tr_by_group/tmu/stats_reset
848    chown system system /sys/kernel/metrics/thermal/tr_by_group/spmic/stats_reset
849
850on property:vendor.thermal.link_ready=1
851    # BCL
852    write /sys/devices/virtual/pmic/mitigation/clock_ratio/tpu_light_clk_ratio 0x80041c3
853    write /sys/devices/virtual/pmic/mitigation/clock_ratio/cpu2_light_clk_ratio 0xfff041c3
854    write /sys/devices/virtual/pmic/mitigation/clock_ratio/gpu_heavy_clk_ratio 0xfff04385
855    write /sys/devices/virtual/pmic/mitigation/clock_ratio/tpu_heavy_clk_ratio 0xfff041c1
856    write /sys/devices/virtual/pmic/mitigation/clock_ratio/cpu2_heavy_clk_ratio 0xfff041c0
857    write /dev/thermal/tz-by-name/smpl_gm/policy user_space
858    write /dev/thermal/tz-by-name/vdroop1/policy user_space
859    write /dev/thermal/tz-by-name/vdroop2/policy user_space
860    write /dev/thermal/tz-by-name/ocp_cpu1/policy user_space
861    write /dev/thermal/tz-by-name/ocp_cpu2/policy user_space
862    write /dev/thermal/tz-by-name/ocp_tpu/policy user_space
863    write /dev/thermal/tz-by-name/ocp_gpu/policy user_space
864    write /dev/thermal/tz-by-name/soft_ocp_cpu1/policy user_space
865    write /dev/thermal/tz-by-name/soft_ocp_cpu2/policy user_space
866    write /dev/thermal/tz-by-name/soft_ocp_tpu/policy user_space
867    write /dev/thermal/tz-by-name/soft_ocp_gpu/policy user_space
868    write /dev/thermal/tz-by-name/soc/policy user_space
869    write /dev/thermal/tz-by-name/batoilo/policy user_space
870    write /sys/devices/virtual/pmic/mitigation/triggered_lvl/smpl_lvl 3100
871    write /sys/devices/virtual/pmic/mitigation/clock_div/tpu_clk_div 0x1
872    write /sys/devices/virtual/pmic/mitigation/clock_div/gpu_clk_div 0x1
873    write /sys/devices/virtual/pmic/mitigation/clock_div/cpu2_clk_div 0x1
874    chown system system /dev/thermal/tz-by-name/soc/mode
875    chown system system /dev/thermal/tz-by-name/batoilo/trip_point_0_temp
876    chown system system /dev/thermal/tz-by-name/batoilo/trip_point_0_hyst
877    chown system system /dev/thermal/tz-by-name/vdroop2/trip_point_0_temp
878    chown system system /dev/thermal/tz-by-name/vdroop2/trip_point_0_hyst
879    chown system system /dev/thermal/tz-by-name/vdroop1/trip_point_0_temp
880    chown system system /dev/thermal/tz-by-name/vdroop1/trip_point_0_hyst
881    chown system system /dev/thermal/tz-by-name/smpl_gm/trip_point_0_temp
882    chown system system /dev/thermal/tz-by-name/smpl_gm/trip_point_0_hyst
883    chown system system /dev/thermal/tz-by-name/ocp_cpu1/trip_point_0_temp
884    chown system system /dev/thermal/tz-by-name/ocp_cpu1/trip_point_0_hyst
885    chown system system /dev/thermal/tz-by-name/ocp_cpu2/trip_point_0_temp
886    chown system system /dev/thermal/tz-by-name/ocp_cpu2/trip_point_0_hyst
887    chown system system /dev/thermal/tz-by-name/ocp_tpu/trip_point_0_temp
888    chown system system /dev/thermal/tz-by-name/ocp_tpu/trip_point_0_hyst
889    chown system system /dev/thermal/tz-by-name/ocp_gpu/trip_point_0_temp
890    chown system system /dev/thermal/tz-by-name/ocp_gpu/trip_point_0_hyst
891    chown system system /dev/thermal/tz-by-name/soft_ocp_cpu1/trip_point_0_temp
892    chown system system /dev/thermal/tz-by-name/soft_ocp_cpu1/trip_point_0_hyst
893    chown system system /dev/thermal/tz-by-name/soft_ocp_cpu2/trip_point_0_temp
894    chown system system /dev/thermal/tz-by-name/soft_ocp_cpu2/trip_point_0_hyst
895    chown system system /dev/thermal/tz-by-name/soft_ocp_tpu/trip_point_0_temp
896    chown system system /dev/thermal/tz-by-name/soft_ocp_tpu/trip_point_0_hyst
897    chown system system /dev/thermal/tz-by-name/soft_ocp_gpu/trip_point_0_temp
898    chown system system /dev/thermal/tz-by-name/soft_ocp_gpu/trip_point_0_hyst
899    chown system system /dev/thermal/tz-by-name/soc/trip_point_0_temp
900    chown system system /dev/thermal/tz-by-name/soc/trip_point_0_hyst
901    # Thermal
902    chown system system /dev/thermal/tz-by-name/quiet_therm/trip_point_0_temp
903    chown system system /dev/thermal/tz-by-name/quiet_therm/trip_point_0_hyst
904    chown system system /dev/thermal/tz-by-name/neutral_therm/trip_point_0_temp
905    chown system system /dev/thermal/tz-by-name/neutral_therm/trip_point_0_hyst
906    chown system system /dev/thermal/tz-by-name/usb_pwr_therm2/trip_point_0_temp
907    chown system system /dev/thermal/tz-by-name/usb_pwr_therm2/trip_point_0_hyst
908    chown system system /dev/thermal/tz-by-name/usb_pwr_therm2/emul_temp
909    chmod 664 /dev/thermal/cdev-by-name/thermal-cpufreq-0/user_vote
910    chown system system /dev/thermal/cdev-by-name/thermal-cpufreq-0/user_vote
911    chmod 664 /dev/thermal/cdev-by-name/thermal-cpufreq-1/user_vote
912    chown system system /dev/thermal/cdev-by-name/thermal-cpufreq-1/user_vote
913    chmod 664 /dev/thermal/cdev-by-name/thermal-cpufreq-2/user_vote
914    chown system system /dev/thermal/cdev-by-name/thermal-cpufreq-2/user_vote
915    chmod 664 /dev/thermal/cdev-by-name/thermal-gpufreq-0/user_vote
916    chown system system /dev/thermal/cdev-by-name/thermal-gpufreq-0/user_vote
917    chmod 664 /dev/thermal/cdev-by-name/tpu_cooling/user_vote
918    chown system system /dev/thermal/cdev-by-name/tpu_cooling/user_vote
919    chmod 664 /dev/thermal/cdev-by-name/fcc/cur_state
920    chown system system /dev/thermal/cdev-by-name/fcc/cur_state
921    chmod 664 /dev/thermal/cdev-by-name/dc_icl/cur_state
922    chown system system /dev/thermal/cdev-by-name/dc_icl/cur_state
923    chmod 664 /dev/thermal/cdev-by-name/wlc_fcc/cur_state
924    chown system system /dev/thermal/cdev-by-name/wlc_fcc/cur_state
925    chmod 664 /dev/thermal/cdev-by-name/usbc-port/cur_state
926    chown system system /dev/thermal/cdev-by-name/usbc-port/cur_state
927
928on charger
929    write /proc/vendor_sched/groups/sys/uclamp_min 0
930    write /proc/vendor_sched/groups/sys/prefer_idle 0
931
932    # Use charger thermal config
933    setprop vendor.thermal.config "thermal_info_config_charge.json"
934
935    # Wait for insmod_sh to finish all common modules
936    wait_for_prop vendor.common.modules.ready 1
937
938    # Create thermal symlink in off charging mode
939    mkdir /dev/thermal 0750 system system
940    mkdir /dev/thermal/tz-by-name 0750 system system
941    mkdir /dev/thermal/cdev-by-name 0750 system system
942    start vendor.thermal.symlinks
943
944    # Cancel boot devfreq and uclamp
945    write /sys/devices/platform/17000010.devfreq_mif/devfreq/17000010.devfreq_mif/exynos_data/cancel_boot_freq 1
946    write /sys/devices/platform/17000020.devfreq_int/devfreq/17000020.devfreq_int/exynos_data/cancel_boot_freq 1
947    write /proc/vendor_sched/groups/ta/uclamp_min 0
948    write /proc/vendor_sched/groups/ta/prefer_idle 0
949    write /proc/vendor_sched/groups/fg/uclamp_min 0
950    write /proc/vendor_sched/groups/fg/prefer_idle 0
951    write /proc/vendor_sched/groups/sys/uclamp_min 0
952    write /proc/vendor_sched/groups/sys/prefer_idle 0
953
954    # Enable SICD
955    write /sys/devices/system/cpu/cpupm/cpupm/sicd 1
956
957on property:vendor.disable.bcl.control=1
958    write /sys/devices/virtual/pmic/mitigation/instruction/enable_mitigation 0
959
960on property:vendor.disable.bcl.control=0
961    write /sys/devices/virtual/pmic/mitigation/instruction/enable_mitigation 1
962
963on property:ro.boot.mode=charger && property:init.svc.vendor.charger=running
964    # Disable dock-defend in Off Mode Charger
965    write /sys/devices/platform/google,charger/dd_state -1
966
967# Cpuset experiment
968on property:persist.device_config.vendor_system_native.top-app_cpuset=*
969    write /dev/cpuset/top-app/cpus ${persist.device_config.vendor_system_native.top-app_cpuset:-0-7}
970on property:persist.device_config.vendor_system_native.foreground_cpuset=*
971    write /dev/cpuset/foreground/cpus ${persist.device_config.vendor_system_native.foreground_cpuset:-0-3,4-5}
972on property:persist.device_config.vendor_system_native.background_cpuset=*
973    write /dev/cpuset/background/cpus ${persist.device_config.vendor_system_native.background_cpuset:-0-3}
974on property:persist.device_config.vendor_system_native.system-background_cpuset=*
975    write /dev/cpuset/system-background/cpus ${persist.device_config.vendor_system_native.system-background_cpuset:-0-3}
976on property:persist.device_config.vendor_system_native.restricted_cpuset=*
977    write /dev/cpuset/restricted/cpus ${persist.device_config.vendor_system_native.restricted_cpuset:-0-3}
978on property:persist.device_config.vendor_system_native.camera-daemon_cpuset=*
979    write /dev/cpuset/camera-daemon/cpus ${persist.device_config.vendor_system_native.camera-daemon_cpuset:-0-7}
980
981# Set esim property for LPA
982on property:persist.vendor.modem.esim_profiles_exist=*
983    setprop persist.modem.esim_profiles_exist ${persist.vendor.modem.esim_profiles_exist}
984