| ReStranger | 1b85f70 | 2025-09-30 04:05:06 +0300 | [diff] [blame] | 1 | #! /vendor/bin/sh |
| 2 | #============================================================================= |
| 3 | # Copyright (c) 2019-2020 Qualcomm Technologies, Inc. |
| 4 | # All Rights Reserved. |
| 5 | # Confidential and Proprietary - Qualcomm Technologies, Inc. |
| 6 | # |
| 7 | # Copyright (c) 2009-2012, 2014-2019, The Linux Foundation. All rights reserved. |
| 8 | # |
| 9 | # Redistribution and use in source and binary forms, with or without |
| 10 | # modification, are permitted provided that the following conditions are met: |
| 11 | # * Redistributions of source code must retain the above copyright |
| 12 | # notice, this list of conditions and the following disclaimer. |
| 13 | # * Redistributions in binary form must reproduce the above copyright |
| 14 | # notice, this list of conditions and the following disclaimer in the |
| 15 | # documentation and/or other materials provided with the distribution. |
| 16 | # * Neither the name of The Linux Foundation nor |
| 17 | # the names of its contributors may be used to endorse or promote |
| 18 | # products derived from this software without specific prior written |
| 19 | # permission. |
| 20 | # |
| 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 22 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 23 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 24 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
| 25 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 26 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 27 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; |
| 28 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, |
| 29 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR |
| 30 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF |
| 31 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 32 | #============================================================================= |
| 33 | |
| 34 | verify_pasr_support() |
| 35 | { |
| 36 | ddr_type=`od -An -tx /proc/device-tree/memory/ddr_device_type` |
| 37 | ddr_type5="08" |
| 38 | |
| 39 | if [ -d /sys/kernel/mem-offline ]; then |
| 40 | #only LPDDR5 supports PAAR |
| 41 | if [ ${ddr_type:4:2} != $ddr_type5 ]; then |
| 42 | setprop vendor.pasr.activemode.enabled false |
| 43 | fi |
| 44 | |
| 45 | setprop vendor.pasr.enabled true |
| 46 | fi |
| 47 | } |
| 48 | |
| 49 | start_msm_irqbalance() |
| 50 | { |
| 51 | if [ -f /vendor/bin/msm_irqbalance ]; then |
| 52 | start vendor.msm_irqbalance |
| 53 | fi |
| 54 | } |
| 55 | start_msm_irqbalance |
| 56 | verify_pasr_support |