init.qti.kernel.rc 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. #=============================================================================
  2. # Copyright (c) 2019-2023 Qualcomm Technologies, Inc.
  3. # All Rights Reserved.
  4. # Confidential and Proprietary - Qualcomm Technologies, Inc.
  5. #
  6. # Copyright (c) 2009-2012, 2014-2019, The Linux Foundation. All rights reserved.
  7. #
  8. # Redistribution and use in source and binary forms, with or without
  9. # modification, are permitted provided that the following conditions are met:
  10. # * Redistributions of source code must retain the above copyright
  11. # notice, this list of conditions and the following disclaimer.
  12. # * Redistributions in binary form must reproduce the above copyright
  13. # notice, this list of conditions and the following disclaimer in the
  14. # documentation and/or other materials provided with the distribution.
  15. # * Neither the name of The Linux Foundation nor
  16. # the names of its contributors may be used to endorse or promote
  17. # products derived from this software without specific prior written
  18. # permission.
  19. #
  20. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  21. # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  22. # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  23. # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  24. # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  25. # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  26. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  27. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  28. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  29. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  30. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31. #=============================================================================
  32. import /vendor/etc/init/hw/init.qti.kernel.test.rc
  33. on early-init
  34. # Set the console loglevel to < KERN_WARN
  35. # Set the default message loglevel to KERN_INFO
  36. write /proc/sys/kernel/printk "4 6 1 7"
  37. exec_start gki.modprobe
  38. # wait for system modules to be loaded first before loading vendor modules
  39. wait_for_prop odm.system.all.modules.ready 1
  40. start vendor.modprobe
  41. # Mount tracefs in /sys/kernel/tracing as CONFIG_DEBUG_FS might be
  42. # disabled and /sys/kernel/debug/tracing might not be available
  43. mount tracefs tracefs /sys/kernel/tracing
  44. chmod 0755 /sys/kernel/tracing
  45. chown root system /dev/kmsg
  46. chmod 0620 /dev/kmsg
  47. write /proc/sys/kernel/sched_boost 1
  48. write /proc/sys/kernel/firmware_config/force_sysfs_fallback 1
  49. on post-fs
  50. wait_for_prop vendor.all.modules.ready 1
  51. # Create cgroup mount point for memory
  52. mkdir /sys/fs/cgroup/memory/bg 0750 root system
  53. write /sys/fs/cgroup/memory/bg/memory.swappiness 140
  54. write /sys/fs/cgroup/memory/bg/memory.move_charge_at_immigrate 1
  55. chown root system /sys/fs/cgroup/memory/bg/tasks
  56. chmod 0660 /sys/fs/cgroup/memory/bg/tasks
  57. # update scheduler tunables
  58. write /dev/cpuctl/foreground/cpu.uclamp.sched_boost_no_override 1
  59. write /dev/cpuctl/top-app/cpu.uclamp.sched_boost_no_override 1
  60. write /dev/cpuctl/background/cpu.uclamp.colocate 0
  61. write /dev/cpuctl/foreground/cpu.uclamp.colocate 0
  62. write /dev/cpuctl/top-app/cpu.uclamp.colocate 1
  63. # set aggressive read ahead for dm-0 and dm-1 during boot up
  64. write /sys/block/dm-0/queue/read_ahead_kb 2048
  65. write /sys/block/dm-1/queue/read_ahead_kb 2048
  66. write /sys/block/dm-2/queue/read_ahead_kb 2048
  67. on early-boot
  68. # Allow subsystem (modem etc) debugging
  69. exec_background u:r:vendor_qti_init_shell_bg:s0 -- /vendor/bin/init.qti.write.sh /sys/kernel/boot_adsp/boot 1
  70. exec_background u:r:vendor_qti_init_shell_bg:s0 -- /vendor/bin/init.qti.write.sh /sys/kernel/boot_cdsp/boot 1
  71. exec_background u:r:vendor_qti_init_shell_bg:s0 -- /vendor/bin/init.qti.write.sh /sys/devices/virtual/cvp/cvp/boot 1
  72. on boot
  73. # Allow access to dload sysfs node
  74. chown root system /sys/kernel/dload/emmc_dload
  75. chmod 0660 /sys/kernel/dload/emmc_dload
  76. chown root system /dev/block/bootdevice/by-name/ramdump
  77. chmod 0660 /dev/block/bootdevice/by-name/ramdump
  78. chown root system /sys/kernel/dload/dload_mode
  79. chmod 0660 /sys/kernel/dload/dload_mode
  80. # set the io-scheduler to bfq on all eMMC and SD devices
  81. write /sys/class/block/mmcblk0/queue/scheduler bfq
  82. write /sys/class/block/mmcblk1/queue/scheduler bfq
  83. # update io-scheduler tunables
  84. write /sys/class/block/mmcblk0/queue/iosched/slice_idle 0
  85. write /sys/class/block/mmcblk1/queue/iosched/slice_idle 0
  86. # Allow access to memory hotplug device attributes
  87. chown system system /sys/kernel/mem-offline/anon_migrate
  88. on post-fs-data
  89. # Create directory used for dump collection
  90. mkdir /data/vendor/ssrdump 0770 root system
  91. on property:persist.sys.ssr.enable_debug=*
  92. write /sys/module/subsys_pil_tz/parameters/enable_debug ${persist.sys.ssr.enable_debug}
  93. on property:persist.sys.mba_boot_timeout=*
  94. write /sys/module/pil_msa/parameters/pbl_mba_boot_timeout_ms ${persist.sys.mba_boot_timeout}
  95. on property:persist.sys.modem_auth_timeout=*
  96. write /sys/module/pil_msa/parameters/modem_auth_timeout_ms ${persist.sys.modem_auth_timeout}
  97. on property:persist.sys.pil_proxy_timeout=*
  98. write /sys/module/peripheral_loader/parameters/proxy_timeout_ms ${persist.sys.pil_proxy_timeout}
  99. on property:persist.vendor.ssr.enable_ramdumps=1
  100. write /sys/module/subsystem_restart/parameters/enable_ramdumps 1
  101. on property:persist.vendor.ssr.enable_ramdumps=0
  102. write /sys/module/subsystem_restart/parameters/enable_ramdumps 0
  103. on property:persist.vendor.sys.rawdump_copy=1
  104. write /sys/kernel/dload/emmc_dload 1
  105. on property:persist.vendor.sys.rawdump_copy=0
  106. write /sys/kernel/dload/emmc_dload 0
  107. service kernel-boot /vendor/bin/sh /vendor/bin/init.qti.kernel.sh
  108. class core
  109. user root
  110. group root
  111. disabled
  112. oneshot
  113. service kernel-post-boot /vendor/bin/sh /vendor/bin/init.kernel.post_boot.sh
  114. class core
  115. user root
  116. group root system wakelock graphics
  117. disabled
  118. oneshot
  119. on property:sys.boot_completed=1
  120. write /dev/kmsg "Boot completed "
  121. #Reset read ahead for dm-0, dm-1 and dm-2 to 512kb
  122. write /sys/block/dm-0/queue/read_ahead_kb 512
  123. write /sys/block/dm-1/queue/read_ahead_kb 512
  124. write /sys/block/dm-2/queue/read_ahead_kb 512
  125. write /proc/sys/vm/page-cluster 0
  126. start kernel-boot
  127. start kernel-post-boot
  128. on charger
  129. start kernel-post-boot
  130. service vendor.msm_irqbalance /vendor/bin/msm_irqbalance -f /system/vendor/etc/msm_irqbalance.conf
  131. class core
  132. user root
  133. group root
  134. disabled
  135. service gki.modprobe /vendor/bin/system_dlkm_modprobe.sh
  136. class main
  137. user root
  138. group root system
  139. disabled
  140. stdio_to_kmsg
  141. seclabel u:r:vendor_modprobe:s0
  142. oneshot
  143. service vendor.modprobe /vendor/bin/vendor_modprobe.sh
  144. class main
  145. user root
  146. group root system
  147. disabled
  148. stdio_to_kmsg
  149. seclabel u:r:vendor_modprobe:s0
  150. oneshot