├── .gitignore ├── board-info.txt ├── configs ├── properties │ ├── odm.prop │ ├── product.prop │ ├── system_ext.prop │ ├── system.prop │ └── vendor.prop ├── idc │ ├── uinput-fpc.idc │ └── uinput-goodix.idc ├── keylayout │ ├── uinput-goodix.kl │ └── uinput-fpc.kl ├── vintf │ ├── manifest_xiaomi.xml │ ├── framework_manifest.xml │ ├── compatibility_matrix.xml │ ├── manifest_pineapple.xml │ └── compatibility_matrix.xiaomi.xml └── config │ └── config.fs ├── .gitattributes ├── Android.bp ├── bootctrl ├── android.hardware.boot-service.qti.rc ├── boot-service.qti.xml ├── android.hardware.boot-service.qti.recovery.rc ├── libboot_control_qti │ ├── Android.bp │ └── libboot_control_qti.h ├── Android.bp ├── main.cpp ├── BootControl.h └── BootControl.cpp ├── healthd-ext ├── android.hardware.health-service.xiaomi_recovery.rc ├── android.hardware.health-service.xiaomi.xml ├── android.hardware.health-service.xiaomi.rc ├── Android.bp └── main.cpp ├── AndroidProducts.mk ├── lineage_houji.mk ├── setup-makefiles.sh ├── rootdir ├── etc │ ├── init.houji.rc │ ├── charger_fw_fstab.qti │ ├── init.recovery.qcom.rc │ ├── ueventd-odm.rc │ └── fstab.qcom ├── Android.bp └── bin │ ├── init.class_main.sh │ ├── init.qcom.class_core.sh │ ├── init.qcom.early_boot.sh │ └── init.qcom.sh ├── README.md ├── gpt-utils ├── Android.bp ├── recovery-ufs-bsg.h ├── gpt-utils.h └── recovery-ufs-bsg.cpp ├── power └── power-mode.cpp ├── extract-files.sh ├── device.mk ├── BoardConfig.mk └── Android.mk /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | -------------------------------------------------------------------------------- /board-info.txt: -------------------------------------------------------------------------------- 1 | require board=pineapple|houji -------------------------------------------------------------------------------- /configs/properties/odm.prop: -------------------------------------------------------------------------------- 1 | # Qti 2 | ro.vendor.qti.va_odm.support=1 3 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto eol=lf 3 | -------------------------------------------------------------------------------- /Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2023 The LineageOS Project 3 | // 4 | // SPDX-License-Identifier: Apache-2.0 5 | // 6 | 7 | soong_namespace { 8 | imports: [ 9 | "hardware/qcom-caf/bootctrl", 10 | ], 11 | } 12 | -------------------------------------------------------------------------------- /configs/properties/product.prop: -------------------------------------------------------------------------------- 1 | # Blur 2 | ro.sf.blurs_are_expensive=1 3 | ro.surface_flinger.supports_background_blur=1 4 | 5 | # Radio 6 | persist.vendor.radio.hidl_dev_service=true 7 | ro.vendor.radio.5g=3 8 | ro.vendor.radio.features_common=3 9 | -------------------------------------------------------------------------------- /bootctrl/android.hardware.boot-service.qti.rc: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. 2 | # SPDX-License-Identifier: BSD-3-Clause-Clear 3 | 4 | service vendor.boot-qti /vendor/bin/hw/android.hardware.boot-service.qti 5 | class early_hal 6 | user root 7 | group root 8 | -------------------------------------------------------------------------------- /healthd-ext/android.hardware.health-service.xiaomi_recovery.rc: -------------------------------------------------------------------------------- 1 | service vendor.health-recovery /system/bin/hw/android.hardware.health-service.xiaomi_recovery 2 | class hal 3 | seclabel u:r:hal_health_default:s0 4 | user system 5 | group system 6 | capabilities WAKE_ALARM BLOCK_SUSPEND 7 | file /dev/kmsg w 8 | -------------------------------------------------------------------------------- /AndroidProducts.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2023 The Android Open Source Project 3 | # 4 | # SPDX-License-Identifier: Apache-2.0 5 | # 6 | 7 | PRODUCT_MAKEFILES := \ 8 | $(LOCAL_DIR)/lineage_houji.mk 9 | 10 | COMMON_LUNCH_CHOICES := \ 11 | lineage_houji-eng \ 12 | lineage_houji-userdebug \ 13 | lineage_houji-user 14 | -------------------------------------------------------------------------------- /bootctrl/boot-service.qti.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | android.hardware.boot 7 | IBootControl/default 8 | 9 | 10 | -------------------------------------------------------------------------------- /healthd-ext/android.hardware.health-service.xiaomi.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | android.hardware.health 9 | 2 10 | IHealth/default 11 | 12 | 13 | -------------------------------------------------------------------------------- /bootctrl/android.hardware.boot-service.qti.recovery.rc: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. 2 | # SPDX-License-Identifier: BSD-3-Clause-Clear 3 | 4 | service vendor.boot-qti /system/bin/hw/android.hardware.boot-service.qti.recovery 5 | class early_hal 6 | user root 7 | group root 8 | seclabel u:r:hal_bootctl_default:s0 9 | interface aidl android.hardware.boot.IBootControl/default 10 | -------------------------------------------------------------------------------- /configs/idc/uinput-fpc.idc: -------------------------------------------------------------------------------- 1 | # 2 | # FPC1020 Touch sensor driver 3 | # 4 | # Copyright (c) 2013,2014 Fingerprint Cards AB 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | 11 | device.internal = 1 12 | 13 | keyboard.layout = uinput-fpc 14 | keyboard.builtIn = 1 15 | keyboard.orientationAware = 1 16 | 17 | -------------------------------------------------------------------------------- /configs/properties/system_ext.prop: -------------------------------------------------------------------------------- 1 | # Camera 2 | persist.vendor.camera.privapp.list=org.lineageos.aperture.org.codeaurora.snapcam,com.android.camera,com.google.camera 3 | vendor.camera.aux.packagelist=org.lineageos.aperture,org.codeaurora.snapcam,com.android.camera,com.google.camera 4 | 5 | # DPM 6 | persist.vendor.dpm.feature=11 7 | 8 | # Radio 9 | ro.telephony.sim_slots.count=2 10 | telephony.active_modems.max_count=2 11 | 12 | # Media 13 | vendor.media.target_variant=_pineapple 14 | -------------------------------------------------------------------------------- /configs/idc/uinput-goodix.idc: -------------------------------------------------------------------------------- 1 | # 2 | # FPC1020 Touch sensor driver 3 | # 4 | # Copyright (c) 2013,2014 Fingerprint Cards AB 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | 11 | device.internal = 1 12 | 13 | keyboard.layout = uinput-goodix 14 | keyboard.builtIn = 1 15 | keyboard.orientationAware = 1 16 | 17 | -------------------------------------------------------------------------------- /healthd-ext/android.hardware.health-service.xiaomi.rc: -------------------------------------------------------------------------------- 1 | service vendor.health-default /vendor/bin/hw/android.hardware.health-service.xiaomi 2 | class hal 3 | user system 4 | group system 5 | capabilities WAKE_ALARM BLOCK_SUSPEND 6 | file /dev/kmsg w 7 | 8 | service vendor.charger /vendor/bin/hw/android.hardware.health-service.xiaomi --charger 9 | class charger 10 | seclabel u:r:charger_vendor:s0 11 | user system 12 | group system wakelock input graphics 13 | capabilities SYS_BOOT WAKE_ALARM BLOCK_SUSPEND 14 | file /dev/kmsg w 15 | -------------------------------------------------------------------------------- /configs/keylayout/uinput-goodix.kl: -------------------------------------------------------------------------------- 1 | # 2 | # FPC1020 Touch sensor driver 3 | # 4 | # Copyright (c) 2013,2014 Fingerprint Cards AB 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | 11 | #single click 12 | key 353 DPAD_CENTER VIRTUAL 13 | #double click 14 | key 306 BUTTON_C VIRTUAL 15 | # HOME --> DPAD_CENTER 16 | key 102 DPAD_CENTER VIRTUAL 17 | #key 105 DPAD_LEFT VIRTUAL 18 | #key 106 DPAD_RIGHT VIRTUAL 19 | 20 | -------------------------------------------------------------------------------- /configs/vintf/manifest_xiaomi.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | vendor.xiaomi.hardware.bgservice 4 | hwbinder 5 | @1.0::IBGService/default 6 | 7 | 8 | vendor.xiaomi.hidl.minet 9 | hwbinder 10 | @1.0::IMiNetService/default 11 | 12 | 13 | vendor.xiaomi.hidl.miwill 14 | hwbinder 15 | @1.0::IMiwillService/default 16 | 17 | -------------------------------------------------------------------------------- /bootctrl/libboot_control_qti/Android.bp: -------------------------------------------------------------------------------- 1 | cc_library { 2 | name: "libboot_control_qti", 3 | vendor: true, 4 | recovery_available: true, 5 | shared_libs: [ 6 | "android.hardware.boot@1.1", 7 | "libbase", 8 | "libcutils", 9 | "liblog", 10 | "libz", 11 | ], 12 | static_libs: [ 13 | "libboot_control", 14 | "libbootloader_message_vendor", 15 | "libfstab", 16 | "libgptutils.pineapple", 17 | ], 18 | owner: "qti", 19 | cflags: [ 20 | "-Wall", 21 | "-Werror", 22 | ], 23 | srcs: [ 24 | "libboot_control_qti.cpp", 25 | ], 26 | export_include_dirs: ["."], 27 | } 28 | -------------------------------------------------------------------------------- /lineage_houji.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2023 The Android Open Source Project 3 | # 4 | # SPDX-License-Identifier: Apache-2.0 5 | # 6 | 7 | # Inherit from products. Most specific first. 8 | $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit_only.mk) 9 | $(call inherit-product, $(SRC_TARGET_DIR)/product/full_base_telephony.mk) 10 | 11 | # Inherit some common Lineage stuff. 12 | $(call inherit-product, vendor/lineage/config/common_full_phone.mk) 13 | 14 | # Inherit from houji device. 15 | $(call inherit-product, device/xiaomi/houji/device.mk) 16 | 17 | ## Device identifier 18 | PRODUCT_BRAND := Xiaomi 19 | PRODUCT_DEVICE := houji 20 | PRODUCT_MANUFACTURER := Xiaomi 21 | PRODUCT_NAME := lineage_houji 22 | 23 | # GMS 24 | PRODUCT_GMS_CLIENTID_BASE := android-xiaomi 25 | -------------------------------------------------------------------------------- /configs/keylayout/uinput-fpc.kl: -------------------------------------------------------------------------------- 1 | # 2 | # FPC1020 Touch sensor driver 3 | # 4 | # Copyright (c) 2013,2014 Fingerprint Cards AB 5 | # 6 | # This program is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU General Public License Version 2 8 | # as published by the Free Software Foundation. 9 | # 10 | 11 | #key 304 DPAD_CENTER VIRTUAL 12 | #key 102 HOME VIRTUAL 13 | #key 108 SYSTEM_NAVIGATION_DOWN 14 | #key 103 SYSTEM_NAVIGATION_DOWN 15 | # Swipe Up 16 | #key 103 DPAD_UP VIRTUAL 17 | 18 | # Swipe Down 19 | #key 108 DPAD_DOWN VIRTUAL 20 | 21 | # Single Tap 22 | key 105 DPAD_CENTER VIRTUAL 23 | 24 | # Double Tap 25 | key 106 BUTTON_C VIRTUAL 26 | 27 | # Keymap between kernel and framework. 28 | # Refer to input-event-codes.h(kernel) and KeyEvent.java(framework) for more details. 29 | -------------------------------------------------------------------------------- /setup-makefiles.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2016 The CyanogenMod Project 4 | # Copyright (C) 2017-2020 The LineageOS Project 5 | # 6 | # SPDX-License-Identifier: Apache-2.0 7 | # 8 | 9 | set -e 10 | 11 | DEVICE=houji 12 | VENDOR=xiaomi 13 | 14 | # Load extract_utils and do some sanity checks 15 | MY_DIR="${BASH_SOURCE%/*}" 16 | if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi 17 | 18 | ANDROID_ROOT="${MY_DIR}/../../.." 19 | 20 | HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" 21 | if [ ! -f "${HELPER}" ]; then 22 | echo "Unable to find helper script at ${HELPER}" 23 | exit 1 24 | fi 25 | source "${HELPER}" 26 | 27 | # Initialize the helper 28 | setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" 29 | 30 | # Warning headers and guards 31 | write_headers 32 | 33 | write_makefiles "${MY_DIR}/proprietary-files.txt" true 34 | 35 | # Finish 36 | write_footers 37 | -------------------------------------------------------------------------------- /rootdir/etc/init.houji.rc: -------------------------------------------------------------------------------- 1 | on early-boot 2 | # Notification LEDs 3 | chown system system /sys/class/leds/red/blink 4 | chown system system /sys/class/leds/red/breath 5 | chown system system /sys/class/leds/red/brightness 6 | chown system system /sys/class/leds/red/max_brightness 7 | 8 | chown system system /sys/class/leds/green/blink 9 | chown system system /sys/class/leds/green/breath 10 | chown system system /sys/class/leds/green/brightness 11 | chown system system /sys/class/leds/green/max_brightness 12 | 13 | chown system system /sys/class/leds/blue/blink 14 | chown system system /sys/class/leds/blue/breath 15 | chown system system /sys/class/leds/blue/brightness 16 | chown system system /sys/class/leds/blue/max_brightness 17 | 18 | on boot 19 | # DT2W 20 | chown system system /dev/xiaomi-touch 21 | chmod 0660 /dev/xiaomi-touch 22 | 23 | # Modem 24 | chmod 0777 /dev/smd8 25 | chown radio radio /dev/smd8 26 | mkdir /data/vendor/modem 0777 radio radio 27 | 28 | on post-fs-data 29 | # Fingerprint 30 | mkdir /data/vendor/goodix 0770 system system 31 | mkdir /mnt/vendor/persist/goodix 0770 system system 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Device tree for Xiaomi 14 2 | 3 | Xiaomi 14 (codenamed _"houji"_) is a high-end smartphone from Xiaomi. 4 | 5 | It was announced & released in October 2023. 6 | 7 | ## Device specifications 8 | 9 | | Basic | Spec Sheet | 10 | | ---------: | :---------------------------------------------------------------- | 11 | | SoC | Snapdragon® 8 Gen 3 (SM8650-AB) | 12 | | CPU | Octa-core CPU with 1x Cortex-X4 & 5x Cortex-A720 & 2x Cortex-A520 | 13 | | GPU | Adreno 750 (770 MHz) | 14 | | Memory | 8/12/16GB RAM (LPDDR5X 8533Mbps) | 15 | | Shipped OS | 14.0 with HyperOS 1.0 | 16 | | Storage | 256/512/1024 GB (UFS 4.0) | 17 | | Battery | 4610 mAh, non-removable, 90W wired/50W wireless fast-charge | 18 | | Display | 2670x1200 pixels, 6.36 inches, 120 Hz, 12bit, LTPO, DCI-P3 | 19 | | Camera | 50MP primary, 50MP ultra-wide, 75mm floating-telephoto | 20 | 21 | ![Xiaomi 14](https://cdn.cnbj0.fds.api.mi-img.com/b2c-shopapi-pms/pms_1698304467.93796032.png) 22 | -------------------------------------------------------------------------------- /gpt-utils/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2018 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 | 17 | cc_library { 18 | name: "libgptutils.pineapple", 19 | vendor: true, 20 | recovery_available: true, 21 | shared_libs: [ 22 | "libcutils", 23 | "liblog", 24 | "libz", 25 | ], 26 | cflags: [ 27 | "-Wall", 28 | "-Werror", 29 | "-D_BSG_FRAMEWORK_KERNEL_HEADERS", 30 | ], 31 | srcs: [ 32 | "gpt-utils.cpp", 33 | "recovery-ufs-bsg.cpp", 34 | ], 35 | owner: "qti", 36 | header_libs: [ 37 | "generated_kernel_headers", 38 | ], 39 | export_include_dirs: ["."], 40 | } 41 | -------------------------------------------------------------------------------- /healthd-ext/Android.bp: -------------------------------------------------------------------------------- 1 | cc_defaults { 2 | name: "android.hardware.health-service.xiaomi-defaults", 3 | relative_install_path: "hw", 4 | vintf_fragments: ["android.hardware.health-service.xiaomi.xml"], 5 | vendor: true, 6 | recovery_available: true, 7 | 8 | defaults: [ 9 | "libhealth_aidl_impl_user", 10 | ], 11 | 12 | include_dirs: [ 13 | "system/core/healthd", 14 | "system/core/healthd/include", 15 | "system/core/healthd/include_charger" 16 | ], 17 | 18 | static_libs: [ 19 | "libhealth_aidl_impl", 20 | ], 21 | 22 | srcs: [ 23 | "main.cpp", 24 | ], 25 | 26 | cflags: [ 27 | "-Wall", 28 | "-Werror", 29 | ], 30 | } 31 | 32 | cc_binary { 33 | name: "android.hardware.health-service.xiaomi", 34 | recovery: false, 35 | vendor: true, 36 | defaults: ["android.hardware.health-service.xiaomi-defaults"], 37 | init_rc: ["android.hardware.health-service.xiaomi.rc"], 38 | overrides: ["charger","android.hardware.health-service.qti"], 39 | } 40 | 41 | cc_binary { 42 | name: "android.hardware.health-service.xiaomi_recovery", 43 | vendor: false, 44 | recovery: true, 45 | defaults: ["android.hardware.health-service.xiaomi-defaults"], 46 | init_rc: ["android.hardware.health-service.xiaomi_recovery.rc"], 47 | overrides: ["charger.recovery", "android.hardware.health-service.qti_recovery"], 48 | } 49 | -------------------------------------------------------------------------------- /power/power-mode.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2021 The LineageOS Project 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #define SET_CUR_VALUE 0 13 | #define TOUCH_DOUBLETAP_MODE 14 14 | #define TOUCH_MAGIC 't' 15 | #define TOUCH_IOC_SETMODE _IO(TOUCH_MAGIC, SET_CUR_VALUE) 16 | #define TOUCH_DEV_PATH "/dev/xiaomi-touch" 17 | #define TOUCH_ID 0 18 | 19 | namespace aidl { 20 | namespace android { 21 | namespace hardware { 22 | namespace power { 23 | namespace impl { 24 | 25 | using ::aidl::android::hardware::power::Mode; 26 | 27 | bool isDeviceSpecificModeSupported(Mode type, bool* _aidl_return) { 28 | switch (type) { 29 | case Mode::DOUBLE_TAP_TO_WAKE: 30 | *_aidl_return = true; 31 | return true; 32 | default: 33 | return false; 34 | } 35 | } 36 | 37 | bool setDeviceSpecificMode(Mode type, bool enabled) { 38 | switch (type) { 39 | case Mode::DOUBLE_TAP_TO_WAKE: { 40 | int fd = open(TOUCH_DEV_PATH, O_RDWR); 41 | int arg[3] = {TOUCH_ID, TOUCH_DOUBLETAP_MODE, enabled ? 1 : 0}; 42 | ioctl(fd, TOUCH_IOC_SETMODE, &arg); 43 | close(fd); 44 | return true; 45 | } 46 | default: 47 | return false; 48 | } 49 | } 50 | 51 | } // namespace impl 52 | } // namespace power 53 | } // namespace hardware 54 | } // namespace android 55 | } // namespace aidl 56 | -------------------------------------------------------------------------------- /extract-files.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2016 The CyanogenMod Project 4 | # Copyright (C) 2017-2020 The LineageOS Project 5 | # 6 | # SPDX-License-Identifier: Apache-2.0 7 | # 8 | 9 | set -e 10 | 11 | DEVICE=houji 12 | VENDOR=xiaomi 13 | 14 | # Load extract_utils and do some sanity checks 15 | MY_DIR="${BASH_SOURCE%/*}" 16 | if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi 17 | 18 | ANDROID_ROOT="${MY_DIR}/../../.." 19 | 20 | HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" 21 | if [ ! -f "${HELPER}" ]; then 22 | echo "Unable to find helper script at ${HELPER}" 23 | exit 1 24 | fi 25 | source "${HELPER}" 26 | 27 | # Default to sanitizing the vendor folder before extraction 28 | CLEAN_VENDOR=true 29 | 30 | KANG= 31 | SECTION= 32 | 33 | while [ "${#}" -gt 0 ]; do 34 | case "${1}" in 35 | -n | --no-cleanup) 36 | CLEAN_VENDOR=false 37 | ;; 38 | -k | --kang) 39 | KANG="--kang" 40 | ;; 41 | -s | --section) 42 | SECTION="${2}" 43 | shift 44 | CLEAN_VENDOR=false 45 | ;; 46 | *) 47 | SRC="${1}" 48 | ;; 49 | esac 50 | shift 51 | done 52 | 53 | if [ -z "${SRC}" ]; then 54 | SRC="adb" 55 | fi 56 | 57 | function blob_fixup() { 58 | case "${1}" in 59 | *.xml) 60 | sed -i s/xml=version/xml\ version/g "${2}" 61 | ;; 62 | esac 63 | } 64 | 65 | # Initialize the helper 66 | setup_vendor "${DEVICE}" "${VENDOR}" "${ANDROID_ROOT}" false "${CLEAN_VENDOR}" 67 | 68 | extract "${MY_DIR}/proprietary-files.txt" "${SRC}" "${KANG}" --section "${SECTION}" 69 | 70 | "${MY_DIR}/setup-makefiles.sh" 71 | -------------------------------------------------------------------------------- /bootctrl/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2022 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 | 17 | cc_defaults { 18 | name: "android.hardware.boot-service.qti.common", 19 | relative_install_path: "hw", 20 | defaults: ["libboot_control_defaults"], 21 | vintf_fragments: ["boot-service.qti.xml"], 22 | shared_libs: [ 23 | "libboot_control_qti", 24 | "libbase", 25 | "libbinder_ndk", 26 | "android.hardware.boot@1.1", 27 | "android.hardware.boot-V1-ndk", 28 | ], 29 | static_libs: [ 30 | "libboot_control", 31 | ], 32 | srcs: ["main.cpp", "BootControl.cpp"], 33 | } 34 | 35 | cc_binary { 36 | name: "android.hardware.boot-service.qti", 37 | defaults: ["android.hardware.boot-service.qti.common"], 38 | init_rc: ["android.hardware.boot-service.qti.rc"], 39 | vendor: true, 40 | } 41 | 42 | cc_binary { 43 | name: "android.hardware.boot-service.qti.recovery", 44 | defaults: ["android.hardware.boot-service.qti.common"], 45 | init_rc: ["android.hardware.boot-service.qti.recovery.rc"], 46 | recovery: true, 47 | } 48 | -------------------------------------------------------------------------------- /configs/properties/system.prop: -------------------------------------------------------------------------------- 1 | # Audio 2 | audio.sys.noisy.broadcast.delay=600 3 | audio.sys.offload.pstimeout.secs=3 4 | 5 | # Charger 6 | ro.charger.enable_suspend=1 7 | 8 | # CNE 9 | persist.vendor.cne.feature=1 10 | 11 | # FUSE passthrough 12 | persist.sys.fuse.passthrough.enable=true 13 | 14 | # Graphics 15 | debug.sf.disable_backpressure=1 16 | 17 | # IMS 18 | persist.dbg.volte_avail_ovr=1 19 | persist.dbg.vt_avail_ovr=1 20 | persist.dbg.wfc_avail_ovr=1 21 | 22 | # Media 23 | media.aac_51_output_enabled=true 24 | media.settings.xml=/vendor/etc/media_profiles_pineapple.xml 25 | media.stagefright.enable-aac=true 26 | media.stagefright.enable-fma2dp=true 27 | media.stagefright.enable-http=true 28 | media.stagefright.enable-player=true 29 | media.stagefright.enable-qcp=true 30 | media.stagefright.enable-scan=true 31 | media.stagefright.thumbnail.prefer_hw_codecs=true 32 | ro.mediaserver.64b.enable=true 33 | 34 | # NFC 35 | ro.nfc.port=I2C 36 | 37 | # Radio VoNR Calling 38 | persist.radio.is_vonr_enabled_0=true 39 | persist.radio.is_vonr_enabled_1=true 40 | 41 | # Radio 42 | DEVICE_PROVISIONED=1 43 | persist.vendor.radio.atfwd.start=true 44 | persist.vendor.data.mode=concurrent 45 | ril.subscription.types=NV,RUIM 46 | ro.telephony.default_network=33,33 47 | telephony.lteOnCdmaDevice=1 48 | 49 | # Sensors 50 | persist.vendor.sensors.enable.mag_filter=true 51 | 52 | # SSR 53 | persist.vendor.ssr.enable_ramdumps=1 54 | 55 | # WiFi display 56 | persist.debug.wfd.enable=1 57 | persist.sys.wfd.virtual=0 58 | 59 | # WLAN 60 | ro.hardware.wlan.chip=kiwi_v2 61 | ro.hardware.wlan.dbs=2 62 | ro.hardware.wlan.mimo=1 63 | ro.hardware.wlan.vendor=qcom 64 | 65 | # Zygote 66 | persist.device_config.runtime_native.usap_pool_enabled=true 67 | 68 | # Xiaomi 69 | ro.miui.notch=1 70 | ro.product.mod_device=houji_global 71 | -------------------------------------------------------------------------------- /rootdir/Android.bp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2024 The LineageOS Project 3 | // SPDX-License-Identifier: Apache-2.0 4 | // 5 | 6 | sh_binary { 7 | name: "init.class_main.sh", 8 | src: "bin/init.class_main.sh", 9 | vendor: true, 10 | } 11 | 12 | sh_binary { 13 | name: "init.qcom.class_core.sh", 14 | src: "bin/init.qcom.class_core.sh", 15 | vendor: true, 16 | } 17 | 18 | sh_binary { 19 | name: "init.qcom.early_boot.sh", 20 | src: "bin/init.qcom.early_boot.sh", 21 | vendor: true, 22 | } 23 | 24 | sh_binary { 25 | name: "init.qcom.post_boot.sh", 26 | src: "bin/init.qcom.post_boot.sh", 27 | vendor: true, 28 | } 29 | 30 | sh_binary { 31 | name: "init.qcom.sh", 32 | src: "bin/init.qcom.sh", 33 | vendor: true, 34 | } 35 | 36 | prebuilt_etc { 37 | name: "charger_fw_fstab.qti", 38 | src: "etc/charger_fw_fstab.qti", 39 | vendor: true, 40 | } 41 | 42 | prebuilt_etc { 43 | name: "fstab.qcom", 44 | src: "etc/fstab.qcom", 45 | vendor: true, 46 | vendor_ramdisk_available: true, 47 | } 48 | 49 | prebuilt_etc { 50 | name: "init.qcom.rc", 51 | src: "etc/init.qcom.rc", 52 | sub_dir: "init/hw", 53 | vendor: true, 54 | } 55 | 56 | prebuilt_etc { 57 | name: "init.houji.rc", 58 | src: "etc/init.houji.rc", 59 | sub_dir: "init", 60 | vendor: true, 61 | } 62 | 63 | prebuilt_etc { 64 | name: "init.recovery.qcom.rc", 65 | src: "etc/init.recovery.qcom.rc", 66 | sub_dir: "init", 67 | recovery: true, 68 | } 69 | 70 | prebuilt_etc { 71 | name: "init.target.rc", 72 | src: "etc/init.target.rc", 73 | sub_dir: "init/hw", 74 | vendor: true, 75 | } 76 | 77 | prebuilt_etc { 78 | name: "ueventd-odm.rc", 79 | filename: "ueventd.rc", 80 | src: "etc/ueventd-odm.rc", 81 | device_specific: true, 82 | } 83 | 84 | prebuilt_etc { 85 | name: "ueventd.qcom.rc", 86 | filename: "ueventd.rc", 87 | src: "etc/ueventd.qcom.rc", 88 | vendor: true, 89 | } 90 | -------------------------------------------------------------------------------- /bootctrl/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022 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 | /* 17 | * Changes from Qualcomm Innovation Center are provided under the following license: 18 | * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. 19 | * SPDX-License-Identifier: BSD-3-Clause-Clear 20 | */ 21 | #include "BootControl.h" 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | 28 | using aidl::android::hardware::boot::BootControl; 29 | using aidl::android::hardware::boot::IBootControl; 30 | 31 | int main(int, char* argv[]) { 32 | android::base::InitLogging(argv, android::base::KernelLogger); 33 | ABinderProcess_setThreadPoolMaxThreadCount(0); 34 | std::shared_ptr service = ndk::SharedRefBase::make(); 35 | 36 | const std::string instance = std::string(BootControl::descriptor) + "/default"; 37 | if (service != nullptr) { 38 | auto status = AServiceManager_addService(service->asBinder().get(), instance.c_str()); 39 | CHECK_EQ(status, STATUS_OK) << "Failed to add service " << instance << " " << status; 40 | LOG(INFO) << "IBootControl AIDL service running..."; 41 | 42 | ABinderProcess_joinThreadPool(); 43 | } 44 | ABinderProcess_joinThreadPool(); 45 | return EXIT_FAILURE; // should not reach 46 | } 47 | -------------------------------------------------------------------------------- /configs/vintf/framework_manifest.xml: -------------------------------------------------------------------------------- 1 | 28 | 29 | 30 | 31 | vendor.qti.hardware.radio.atcmdfwd 32 | hwbinder 33 | 1.0 34 | 35 | IAtCmdFwd 36 | AtCmdFwdService 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /rootdir/etc/charger_fw_fstab.qti: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019 - 2020, The Linux Foundation. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are 5 | # met: 6 | # * Redistributions of source code must retain the above copyright 7 | # notice, this list of conditions and the following disclaimer. 8 | # * Redistributions in binary form must reproduce the above 9 | # copyright notice, this list of conditions and the following 10 | # disclaimer in the documentation and/or other materials provided 11 | # with the distribution. 12 | # * Neither the name of The Linux Foundation nor the names of its 13 | # contributors may be used to endorse or promote products derived 14 | # from this software without specific prior written permission. 15 | # 16 | # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 17 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 19 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 20 | # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 23 | # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 24 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 25 | # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 26 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | # Android fstab file. 29 | # The filesystem that contains the filesystem checker binary (typically /system) cannot 30 | # specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK 31 | 32 | # 33 | /dev/block/bootdevice/by-name/modem /vendor/firmware_mnt vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait,slotselect 34 | -------------------------------------------------------------------------------- /bootctrl/BootControl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022 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 | /* 17 | * Changes from Qualcomm Innovation Center are provided under the following license: 18 | * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. 19 | * SPDX-License-Identifier: BSD-3-Clause-Clear 20 | */ 21 | #pragma once 22 | 23 | #include 24 | #include 25 | 26 | namespace aidl::android::hardware::boot { 27 | 28 | class BootControl final : public BnBootControl { 29 | public: 30 | BootControl(); 31 | ::ndk::ScopedAStatus getActiveBootSlot(int32_t* _aidl_return) override; 32 | ::ndk::ScopedAStatus getCurrentSlot(int32_t* _aidl_return) override; 33 | ::ndk::ScopedAStatus getNumberSlots(int32_t* _aidl_return) override; 34 | ::ndk::ScopedAStatus getSnapshotMergeStatus( 35 | ::aidl::android::hardware::boot::MergeStatus* _aidl_return) override; 36 | ::ndk::ScopedAStatus getSuffix(int32_t in_slot, std::string* _aidl_return) override; 37 | ::ndk::ScopedAStatus isSlotBootable(int32_t in_slot, bool* _aidl_return) override; 38 | ::ndk::ScopedAStatus isSlotMarkedSuccessful(int32_t in_slot, bool* _aidl_return) override; 39 | ::ndk::ScopedAStatus markBootSuccessful() override; 40 | ::ndk::ScopedAStatus setActiveBootSlot(int32_t in_slot) override; 41 | ::ndk::ScopedAStatus setSlotAsUnbootable(int32_t in_slot) override; 42 | ::ndk::ScopedAStatus setSnapshotMergeStatus( 43 | ::aidl::android::hardware::boot::MergeStatus in_status) override; 44 | }; 45 | 46 | } // namespace aidl::android::hardware::boot 47 | -------------------------------------------------------------------------------- /rootdir/etc/init.recovery.qcom.rc: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2017-2018,2020-2021 The Linux Foundation. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are met: 5 | # * Redistributions of source code must retain the above copyright 6 | # notice, this list of conditions and the following disclaimer. 7 | # * Redistributions in binary form must reproduce the above copyright 8 | # notice, this list of conditions and the following disclaimer in the 9 | # documentation and/or other materials provided with the distribution. 10 | # * Neither the name of The Linux Foundation nor 11 | # the names of its contributors may be used to endorse or promote 12 | # products derived from this software without specific prior written 13 | # permission. 14 | # 15 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 19 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 21 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 22 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 23 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 24 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 25 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | # 27 | 28 | on init 29 | write /sys/class/backlight/panel0-backlight/brightness 200 30 | setprop sys.usb.configfs 1 31 | 32 | on property:ro.boot.usbcontroller=* 33 | setprop sys.usb.controller ${ro.boot.usbcontroller} 34 | wait /sys/bus/platform/devices/${ro.boot.usb.dwc3_msm:-a600000.ssusb}/mode 35 | write /sys/bus/platform/devices/${ro.boot.usb.dwc3_msm:-a600000.ssusb}/mode peripheral 36 | wait /sys/class/udc/${ro.boot.usbcontroller} 1 37 | 38 | on fs 39 | wait /dev/block/platform/soc/${ro.boot.bootdevice} 40 | symlink /dev/block/platform/soc/${ro.boot.bootdevice} /dev/block/bootdevice -------------------------------------------------------------------------------- /bootctrl/libboot_control_qti/libboot_control_qti.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, The Linux Foundation. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above 10 | * copyright notice, this list of conditions and the following 11 | * disclaimer in the documentation and/or other materials provided 12 | * with the distribution. 13 | * * Neither the name of The Linux Foundation nor the names of its 14 | * contributors may be used to endorse or promote products derived 15 | * from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 21 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #pragma once 31 | 32 | #include 33 | #include 34 | 35 | using MergeStatus = ::android::hardware::boot::V1_1::MergeStatus; 36 | 37 | // IBootControl 1.0 methods 38 | bool bootcontrol_init(); 39 | unsigned get_number_slots(); 40 | unsigned get_current_slot(); 41 | int mark_boot_successful(); 42 | int set_active_boot_slot(unsigned slot); 43 | int set_slot_as_unbootable(unsigned slot); 44 | int is_slot_bootable(unsigned slot); 45 | int is_slot_marked_successful(unsigned slot); 46 | const char* get_suffix(unsigned slot); 47 | 48 | // IBootControl 1.1 methods 49 | bool set_snapshot_merge_status(MergeStatus status); 50 | MergeStatus get_snapshot_merge_status(); 51 | 52 | // IBootControl 1.2 methods 53 | int get_active_boot_slot(); 54 | -------------------------------------------------------------------------------- /configs/vintf/compatibility_matrix.xml: -------------------------------------------------------------------------------- 1 | 28 | 29 | 30 | android.frameworks.sensorservice 31 | 1.0 32 | 33 | ISensorManager 34 | default 35 | 36 | 37 | 38 | android.hidl.allocator 39 | 1.0 40 | 41 | IAllocator 42 | ashmem 43 | 44 | 45 | 46 | android.hidl.manager 47 | 1.0 48 | 49 | IServiceManager 50 | default 51 | 52 | 53 | 54 | android.hidl.memory 55 | 1.0 56 | 57 | IMapper 58 | ashmem 59 | 60 | 61 | 62 | android.hidl.token 63 | 1.0 64 | 65 | ITokenManager 66 | default 67 | 68 | 69 | 70 | vendor.qti.hardware.sigma_miracast 71 | hwbinder 72 | 1.0 73 | 74 | Isigma_miracast 75 | sigmahal 76 | sigmahal64 77 | 78 | 79 | 80 | vendor.qti.hardware.qccsyshal 81 | hwbinder 82 | 1.0-2 83 | 84 | IQccsyshal 85 | qccsyshal 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /rootdir/bin/init.class_main.sh: -------------------------------------------------------------------------------- 1 | #! /vendor/bin/sh 2 | 3 | # Copyright (c) 2013-2014, 2019 The Linux Foundation. All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of The Linux Foundation nor 13 | # the names of its contributors may be used to endorse or promote 14 | # products derived from this software without specific prior written 15 | # permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 26 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 27 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | # 29 | 30 | # 31 | # start ril-daemon only for targets on which radio is present 32 | # 33 | baseband=`getprop ro.baseband` 34 | sgltecsfb=`getprop persist.vendor.radio.sglte_csfb` 35 | datamode=`getprop persist.vendor.data.mode` 36 | low_ram=`getprop ro.config.low_ram` 37 | 38 | case "$baseband" in 39 | "apq" | "sda" | "qcs" ) 40 | setprop ro.vendor.radio.noril yes 41 | stop vendor.ril-daemon 42 | stop vendor.qcrild 43 | stop vendor.qcrild2 44 | stop vendor.qcrild3 45 | esac 46 | 47 | case "$baseband" in 48 | "msm" | "csfb" | "svlte2a" | "mdm" | "mdm2" | "sglte" | "sglte2" | "dsda2" | "unknown" | "dsda3" | "sdm" | "sdx" | "sm6") 49 | 50 | start vendor.qcrild 51 | 52 | case "$baseband" in 53 | "svlte2a" | "csfb") 54 | start qmiproxy 55 | ;; 56 | "sglte" | "sglte2" ) 57 | if [ "x$sgltecsfb" != "xtrue" ]; then 58 | start qmiproxy 59 | else 60 | setprop persist.vendor.radio.voice.modem.index 0 61 | fi 62 | ;; 63 | esac 64 | 65 | multisim=`getprop persist.radio.multisim.config` 66 | 67 | if [ "$multisim" = "dsds" ] || [ "$multisim" = "dsda" ]; then 68 | start vendor.qcrild2 69 | elif [ "$multisim" = "tsts" ]; then 70 | start vendor.qcrild2 71 | start vendor.qcrild3 72 | fi 73 | 74 | case "$datamode" in 75 | "tethered") 76 | start vendor.dataqti 77 | if [ "$low_ram" != "true" ]; then 78 | start vendor.dataadpl 79 | fi 80 | ;; 81 | "concurrent") 82 | start vendor.dataqti 83 | if [ "$low_ram" != "true" ]; then 84 | start vendor.dataadpl 85 | fi 86 | ;; 87 | *) 88 | ;; 89 | esac 90 | esac 91 | 92 | # 93 | # Allow persistent faking of bms 94 | # User needs to set fake bms charge in persist.vendor.bms.fake_batt_capacity 95 | # 96 | fake_batt_capacity=`getprop persist.vendor.bms.fake_batt_capacity` 97 | case "$fake_batt_capacity" in 98 | "") ;; #Do nothing here 99 | * ) 100 | echo "$fake_batt_capacity" > /sys/class/power_supply/battery/capacity 101 | ;; 102 | esac 103 | -------------------------------------------------------------------------------- /device.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2023 The Android Open Source Project 3 | # 4 | # SPDX-License-Identifier: Apache-2.0 5 | # 6 | 7 | # Call the proprietary setup. 8 | $(call inherit-product, vendor/xiaomi/houji/houji-vendor.mk) 9 | 10 | # Enable virtual A/B. 11 | $(call inherit-product, $(SRC_TARGET_DIR)/product/generic_ramdisk.mk) 12 | $(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota/launch_with_vendor_ramdisk.mk) 13 | 14 | # Enable project quotas and casefolding for emulated storage without sdcardfs. 15 | $(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk) 16 | 17 | # Setup dalvik vm configs 18 | $(call inherit-product, frameworks/native/build/phone-xhdpi-6144-dalvik-heap.mk) 19 | 20 | # AAPT 21 | PRODUCT_AAPT_CONFIG := normal 22 | PRODUCT_AAPT_PREF_CONFIG := xxhdpi 23 | 24 | # A/B 25 | AB_OTA_POSTINSTALL_CONFIG += \ 26 | RUN_POSTINSTALL_system=true \ 27 | POSTINSTALL_PATH_system=system/bin/otapreopt_script \ 28 | FILESYSTEM_TYPE_system=erofs \ 29 | POSTINSTALL_OPTIONAL_system=true 30 | 31 | AB_OTA_POSTINSTALL_CONFIG += \ 32 | RUN_POSTINSTALL_vendor=true \ 33 | POSTINSTALL_PATH_vendor=bin/checkpoint_gc \ 34 | FILESYSTEM_TYPE_vendor=erofs \ 35 | POSTINSTALL_OPTIONAL_vendor=true 36 | 37 | PRODUCT_PACKAGES += \ 38 | checkpoint_gc \ 39 | otapreopt_script 40 | 41 | # Boot animation 42 | TARGET_BOOT_ANIMATION_RES := 1200 43 | 44 | # Boot control 45 | PRODUCT_PACKAGES += \ 46 | android.hardware.boot-service.qti \ 47 | android.hardware.boot-service.qti.recovery \ 48 | libboot_control_qti \ 49 | libgptutils.pineapple 50 | 51 | # Boot control HAL test app 52 | PRODUCT_PACKAGES_DEBUG += \ 53 | bootctl 54 | 55 | # Fastboot 56 | PRODUCT_PACKAGES += \ 57 | fastbootd \ 58 | android.hardware.fastboot-service.example_recovery 59 | 60 | # F2fs utilities 61 | PRODUCT_PACKAGES += \ 62 | sg_write_buffer \ 63 | f2fs_io \ 64 | check_f2fs 65 | 66 | # Health 67 | PRODUCT_PACKAGES += \ 68 | android.hardware.health-service.xiaomi \ 69 | android.hardware.health-service.xiaomi_recovery \ 70 | android.hardware.health@1.0.vendor \ 71 | android.hardware.health@2.1.vendor 72 | 73 | # Input 74 | PRODUCT_COPY_FILES += \ 75 | $(LOCAL_PATH)/configs/idc/uinput-fpc.idc:$(TARGET_COPY_OUT_SYSTEM)/usr/idc/uinput-fpc.idc \ 76 | $(LOCAL_PATH)/configs/idc/uinput-goodix.idc:$(TARGET_COPY_OUT_SYSTEM)/usr/idc/uinput-goodix.idc \ 77 | $(LOCAL_PATH)/configs/keylayout/uinput-fpc.kl:$(TARGET_COPY_OUT_SYSTEM)/usr/keylayout/uinput-fpc.kl \ 78 | $(LOCAL_PATH)/configs/keylayout/uinput-goodix.kl:$(TARGET_COPY_OUT_SYSTEM)/usr/keylayout/uinput-goodix.kl 79 | 80 | # Partitions 81 | PRODUCT_BUILD_SUPER_PARTITION := false 82 | PRODUCT_USE_DYNAMIC_PARTITIONS := true 83 | 84 | # Rootdir 85 | PRODUCT_PACKAGES += \ 86 | charger_fw_fstab.qti \ 87 | fstab.qcom \ 88 | fstab.qcom.vendor_ramdisk \ 89 | init.class_main.sh \ 90 | init.qcom.class_core.sh \ 91 | init.qcom.early_boot.sh \ 92 | init.qcom.post_boot.sh \ 93 | init.qcom.rc \ 94 | init.qcom.sh \ 95 | init.recovery.qcom.rc \ 96 | init.target.rc \ 97 | ueventd.qcom.rc \ 98 | ueventd-odm.rc 99 | 100 | # Shipping API 101 | PRODUCT_SHIPPING_API_LEVEL := 34 102 | 103 | # Soong namespaces 104 | PRODUCT_SOONG_NAMESPACES += \ 105 | $(LOCAL_PATH) 106 | 107 | # Telephony 108 | PRODUCT_PACKAGES += \ 109 | ims-ext-common \ 110 | ims_ext_common.xml \ 111 | qti-telephony-hidl-wrapper \ 112 | qti_telephony_hidl_wrapper.xml \ 113 | qti-telephony-utils \ 114 | qti_telephony_utils.xml \ 115 | telephony-ext 116 | 117 | PRODUCT_BOOT_JARS += \ 118 | telephony-ext 119 | 120 | # Update engine 121 | PRODUCT_PACKAGES += \ 122 | update_engine \ 123 | update_engine_sideload \ 124 | update_verifier 125 | 126 | PRODUCT_PACKAGES_DEBUG += \ 127 | update_engine_client 128 | 129 | # Vendor API 130 | BOARD_API_LEVEL := 34 131 | BOARD_SHIPPING_API_LEVEL := 34 132 | -------------------------------------------------------------------------------- /gpt-utils/recovery-ufs-bsg.h: -------------------------------------------------------------------------------- 1 | #ifndef __RECOVERY_UFS_BSG_H__ 2 | #define __RECOVERY_UFS_BSG_H__ 3 | 4 | /* 5 | * Copyright (c) 2020 The Linux Foundation. All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are 9 | * 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 13 | * copyright notice, this list of conditions and the following 14 | * disclaimer in the documentation and/or other materials provided 15 | * with the distribution. 16 | * * Neither the name of The Linux Foundation nor the names of its 17 | * contributors may be used to endorse or promote products derived 18 | * from this software without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 21 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 23 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 24 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 27 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 29 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 30 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | 49 | #ifdef ANDROID 50 | #include "cutils/log.h" 51 | #endif 52 | 53 | #ifdef OE 54 | #include 55 | #define LOGI(...) syslog(LOG_NOTICE, "INFO:" __VA_ARGS__) 56 | #define LOGV(...) syslog(LOG_NOTICE,"VERB:" __VA_ARGS__) 57 | #define LOGD(...) syslog(LOG_DEBUG,"DBG:" __VA_ARGS__) 58 | #define LOGE(...) syslog(LOG_ERR,"ERR:" __VA_ARGS__) 59 | #define LOGW(...) syslog(LOG_WARNING,"WRN:" __VA_ARGS__) 60 | #define strlcat(d,s,l) snprintf(d+strlen(d),l,"%s",s) 61 | #endif 62 | 63 | 64 | 65 | #define FNAME_SZ 64 66 | 67 | #define SG_IO 0x2285 68 | 69 | #define DWORD(b3, b2, b1, b0) htobe32((b3 << 24) | (b2 << 16) |\ 70 | (b1 << 8) | b0) 71 | 72 | /* UFS BSG device nodes */ 73 | char ufs_bsg_dev[FNAME_SZ] = "/dev/ufs-bsg"; 74 | 75 | int fd_ufs_bsg; 76 | 77 | int32_t set_ufs_lun(uint8_t lun_id); 78 | 79 | #ifdef _BSG_FRAMEWORK_KERNEL_HEADERS 80 | /* UPIU Transaction Codes */ 81 | enum { 82 | UTP_UPIU_NOP_OUT = 0x00, 83 | UTP_UPIU_COMMAND = 0x01, 84 | UTP_UPIU_DATA_OUT = 0x02, 85 | UTP_UPIU_TASK_REQ = 0x04, 86 | UTP_UPIU_QUERY_REQ = 0x16, 87 | }; 88 | 89 | /* UPIU Query Function field */ 90 | enum { 91 | QUERY_REQ_FUNC_STD_READ = 0x01, 92 | QUERY_REQ_FUNC_STD_WRITE = 0x81, 93 | }; 94 | 95 | enum query_req_opcode { 96 | QUERY_REQ_OP_READ_DESC = 0x1, 97 | QUERY_REQ_OP_WRITE_DESC = 0x2, 98 | QUERY_REQ_OP_READ_ATTR = 0x3, 99 | QUERY_REQ_OP_WRITE_ATTR = 0x4, 100 | QUERY_REQ_OP_READ_FLAG = 0x5, 101 | QUERY_REQ_OP_SET_FLAG = 0x6, 102 | QUERY_REQ_OP_CLEAR_FLAG = 0x7, 103 | QUERY_REQ_OP_TOGGLE_FLAG = 0x8, 104 | }; 105 | 106 | enum query_desc_idn { 107 | QUERY_DESC_IDN_DEVICE = 0x0, 108 | QUERY_DESC_IDN_UNIT = 0x2, 109 | QUERY_DESC_IDN_GEOMETRY = 0x7, 110 | }; 111 | 112 | enum query_desc_size { 113 | QUERY_DESC_SIZE_DEVICE = 0x40, 114 | QUERY_DESC_SIZE_GEOMETRY = 0x48, 115 | QUERY_DESC_SIZE_UNIT = 0x23, 116 | }; 117 | 118 | enum bsg_ioctl_dir { 119 | BSG_IOCTL_DIR_TO_DEV, 120 | BSG_IOCTL_DIR_FROM_DEV, 121 | }; 122 | 123 | enum query_attr_idn { 124 | QUERY_ATTR_IDN_BOOT_LU_EN = 0x00, 125 | QUERY_ATTR_IDN_RESERVED = 0x01, 126 | QUERY_ATTR_IDN_POWER_MODE = 0x02, 127 | QUERY_ATTR_IDN_ACTIVE_ICC_LVL = 0x03, 128 | }; 129 | #endif /* _BSG_FRAMEWORK_KERNEL_HEADERS */ 130 | 131 | #endif /* __RECOVERY_UFS_BSG_H__ */ 132 | -------------------------------------------------------------------------------- /healthd-ext/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved. 3 | * SPDX-License-Identifier: BSD-3-Clause-Clear 4 | */ 5 | 6 | #define LOG_TAG "android.hardware.health-service.xiaomi" 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | using aidl::android::hardware::health::HalHealthLoop; 16 | using aidl::android::hardware::health::Health; 17 | 18 | #if !CHARGER_FORCE_NO_UI 19 | using aidl::android::hardware::health::charger::ChargerCallback; 20 | using aidl::android::hardware::health::charger::ChargerModeMain; 21 | namespace aidl::android::hardware::health { 22 | class ChargerCallbackImpl : public ChargerCallback { 23 | public: 24 | ChargerCallbackImpl(const std::shared_ptr& service) : ChargerCallback(service) {} 25 | bool ChargerEnableSuspend() override { return true; } 26 | }; 27 | } //namespace aidl::android::hardware::health 28 | #endif 29 | 30 | namespace aidl::android::hardware::health { 31 | static constexpr int kChargeCounterMultiplier = 1000; // mAh to uAh 32 | static constexpr int kChargeTimeToFullMultiplier = 60; // mins to secs 33 | class HealthImpl : public Health { 34 | public: 35 | using Health::Health; 36 | virtual ~HealthImpl() {} 37 | ndk::ScopedAStatus getChargeCounterUah(int32_t* out) override; 38 | protected: 39 | void UpdateHealthInfo(HealthInfo* health_info) override; 40 | }; 41 | void HealthImpl::UpdateHealthInfo(HealthInfo* health_info) { 42 | if (health_info->batteryChargeTimeToFullNowSeconds == 65535) { 43 | health_info->batteryChargeTimeToFullNowSeconds = -1; 44 | } else { 45 | health_info->batteryChargeTimeToFullNowSeconds *= kChargeTimeToFullMultiplier; 46 | } 47 | health_info->batteryChargeCounterUah *= kChargeCounterMultiplier; 48 | } 49 | ndk::ScopedAStatus HealthImpl::getChargeCounterUah(int32_t* out) { 50 | *out *= kChargeCounterMultiplier; 51 | return ndk::ScopedAStatus::ok(); 52 | } 53 | } // namespace aidl::android::hardware::health 54 | 55 | static constexpr const char* gInstanceName = "default"; 56 | static constexpr std::string_view gChargerArg{"--charger"}; 57 | 58 | constexpr const char *ucsiPSYName[]{ 59 | "ucsi-source-psy-soc:qcom,pmic_glink:qcom,ucsi1", 60 | "ucsi-source-psy-soc:qcom,pmic_glink:qcom,ucsi2" 61 | }; 62 | 63 | #define RETRY_COUNT 100 64 | 65 | void qti_healthd_board_init(struct healthd_config *hc) 66 | { 67 | int fd; 68 | unsigned char retries = RETRY_COUNT; 69 | int ret = 0; 70 | unsigned char buf; 71 | 72 | hc->ignorePowerSupplyNames.push_back(android::String8(ucsiPSYName[0])); 73 | hc->ignorePowerSupplyNames.push_back(android::String8(ucsiPSYName[1])); 74 | retry: 75 | if (!retries) { 76 | KLOG_ERROR(LOG_TAG, "Cannot open battery/capacity, fd=%d\n", fd); 77 | return; 78 | } 79 | 80 | fd = open("/sys/class/power_supply/battery/capacity", 0440); 81 | if (fd >= 0) { 82 | KLOG_INFO(LOG_TAG, "opened battery/capacity after %d retries\n", RETRY_COUNT - retries); 83 | while (retries) { 84 | ret = read(fd, &buf, 1); 85 | if(ret >= 0) { 86 | KLOG_INFO(LOG_TAG, "Read Batt Capacity after %d retries ret : %d\n", RETRY_COUNT - retries, ret); 87 | close(fd); 88 | return; 89 | } 90 | 91 | retries--; 92 | usleep(100000); 93 | } 94 | 95 | KLOG_ERROR(LOG_TAG, "Failed to read Battery Capacity ret=%d\n", ret); 96 | close(fd); 97 | return; 98 | } 99 | 100 | retries--; 101 | usleep(100000); 102 | goto retry; 103 | } 104 | 105 | int main(int argc, char** argv) { 106 | #ifdef __ANDROID_RECOVERY__ 107 | android::base::InitLogging(argv, android::base::KernelLogger); 108 | #endif 109 | auto config = std::make_unique(); 110 | qti_healthd_board_init(config.get()); 111 | ::android::hardware::health::InitHealthdConfig(config.get()); 112 | auto binder = ndk::SharedRefBase::make(gInstanceName, std::move(config)); 113 | 114 | if (argc >= 2 && argv[1] == gChargerArg) { 115 | #if !CHARGER_FORCE_NO_UI 116 | KLOG_INFO(LOG_TAG, "Starting charger mode with UI."); 117 | auto charger_callback = std::make_shared(binder); 118 | return ChargerModeMain(binder, charger_callback); 119 | #endif 120 | KLOG_INFO(LOG_TAG, "Starting charger mode without UI."); 121 | } else { 122 | KLOG_INFO(LOG_TAG, "Starting health HAL."); 123 | } 124 | 125 | auto hal_health_loop = std::make_shared(binder, binder); 126 | return hal_health_loop->StartLoop(); 127 | } 128 | -------------------------------------------------------------------------------- /rootdir/etc/ueventd-odm.rc: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted (subject to the limitations in the 5 | # disclaimer below) provided that the following conditions are met: 6 | # 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # 10 | # * Redistributions in binary form must reproduce the above 11 | # copyright notice, this list of conditions and the following 12 | # disclaimer in the documentation and/or other materials provided 13 | # with the distribution. 14 | # 15 | # * Neither the name of The Linux Foundation nor the names of its 16 | # contributors may be used to endorse or promote products derived 17 | # from this software without specific prior written permission. 18 | # 19 | # NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE 20 | # GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT 21 | # HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 22 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 24 | # IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 25 | # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 27 | # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 29 | # IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 30 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 31 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | 33 | # Base path for all VM's 34 | firmware_directories /product/vm-system/ 35 | 36 | # TrustedUI VM 37 | external_firmware_handler /devices/platform/soc/soc:qcom,guestvm_loader@f3c00000/firmware/trustedvm.mdt system "/vendor/bin/vmmgr -r" 38 | external_firmware_handler /devices/platform/soc/soc:qcom,guestvm_loader@f3c00000/firmware/trustedvm.b00 system "/vendor/bin/vmmgr -r" 39 | external_firmware_handler /devices/platform/soc/soc:qcom,guestvm_loader@f3c00000/firmware/trustedvm.b01 system "/vendor/bin/vmmgr -r" 40 | external_firmware_handler /devices/platform/soc/soc:qcom,guestvm_loader@f3c00000/firmware/trustedvm.b02 system "/vendor/bin/vmmgr -r" 41 | external_firmware_handler /devices/platform/soc/soc:qcom,guestvm_loader@f3c00000/firmware/trustedvm.b03 system "/vendor/bin/vmmgr -r" 42 | external_firmware_handler /devices/platform/soc/soc:qcom,guestvm_loader@f3c00000/firmware/trustedvm.b04 system "/vendor/bin/vmmgr -r" 43 | external_firmware_handler /devices/platform/soc/soc:qcom,guestvm_loader@f3c00000/firmware/trustedvm.b05 system "/vendor/bin/vmmgr -r" 44 | 45 | external_firmware_handler /devices/platform/soc/soc:gh-secure-vm-loader@0/firmware/trustedvm.mdt system "/vendor/bin/vmmgr -r" 46 | external_firmware_handler /devices/platform/soc/soc:gh-secure-vm-loader@0/firmware/trustedvm.b00 system "/vendor/bin/vmmgr -r" 47 | external_firmware_handler /devices/platform/soc/soc:gh-secure-vm-loader@0/firmware/trustedvm.b01 system "/vendor/bin/vmmgr -r" 48 | external_firmware_handler /devices/platform/soc/soc:gh-secure-vm-loader@0/firmware/trustedvm.b02 system "/vendor/bin/vmmgr -r" 49 | external_firmware_handler /devices/platform/soc/soc:gh-secure-vm-loader@0/firmware/trustedvm.b03 system "/vendor/bin/vmmgr -r" 50 | external_firmware_handler /devices/platform/soc/soc:gh-secure-vm-loader@0/firmware/trustedvm.b04 system "/vendor/bin/vmmgr -r" 51 | external_firmware_handler /devices/platform/soc/soc:gh-secure-vm-loader@0/firmware/trustedvm.b05 system "/vendor/bin/vmmgr -r" 52 | 53 | # OEM VM 54 | external_firmware_handler /devices/platform/soc/soc:qcom,guestvm_loader@f8000000/firmware/oemvm.mdt system "/vendor/bin/vmmgr -r" 55 | external_firmware_handler /devices/platform/soc/soc:qcom,guestvm_loader@f8000000/firmware/oemvm.b01 system "/vendor/bin/vmmgr -r" 56 | external_firmware_handler /devices/platform/soc/soc:qcom,guestvm_loader@f8000000/firmware/oemvm.b02 system "/vendor/bin/vmmgr -r" 57 | external_firmware_handler /devices/platform/soc/soc:qcom,guestvm_loader@f8000000/firmware/oemvm.b03 system "/vendor/bin/vmmgr -r" 58 | external_firmware_handler /devices/platform/soc/soc:qcom,guestvm_loader@f8000000/firmware/oemvm.b04 system "/vendor/bin/vmmgr -r" 59 | external_firmware_handler /devices/platform/soc/soc:qcom,guestvm_loader@f8000000/firmware/oemvm.b05 system "/vendor/bin/vmmgr -r" 60 | 61 | external_firmware_handler /devices/platform/soc/soc:gh-secure-vm-loader@1/firmware/oemvm.mdt system "/vendor/bin/vmmgr -r" 62 | external_firmware_handler /devices/platform/soc/soc:gh-secure-vm-loader@1/firmware/oemvm.b01 system "/vendor/bin/vmmgr -r" 63 | external_firmware_handler /devices/platform/soc/soc:gh-secure-vm-loader@1/firmware/oemvm.b02 system "/vendor/bin/vmmgr -r" 64 | external_firmware_handler /devices/platform/soc/soc:gh-secure-vm-loader@1/firmware/oemvm.b03 system "/vendor/bin/vmmgr -r" 65 | external_firmware_handler /devices/platform/soc/soc:gh-secure-vm-loader@1/firmware/oemvm.b04 system "/vendor/bin/vmmgr -r" 66 | external_firmware_handler /devices/platform/soc/soc:gh-secure-vm-loader@1/firmware/oemvm.b05 system "/vendor/bin/vmmgr -r" 67 | # xiaomi display feature 68 | subsystem mi_display 69 | devname uevent_devpath 70 | dirname /dev/mi_display 71 | 72 | # xiaomi display feature 73 | /dev/mi_display/* 0666 root graphics 74 | -------------------------------------------------------------------------------- /configs/config/config.fs: -------------------------------------------------------------------------------- 1 | [AID_VENDOR_QTI_DIAG] 2 | value:2901 3 | 4 | [AID_VENDOR_QDSS] 5 | value:2902 6 | 7 | [AID_VENDOR_RFS] 8 | value:2903 9 | 10 | [AID_VENDOR_RFS_SHARED] 11 | value:2904 12 | 13 | [AID_VENDOR_ADPL_ODL] 14 | value:2905 15 | 16 | [AID_VENDOR_QRTR] 17 | value:2906 18 | 19 | [AID_VENDOR_THERMAL] 20 | value:2907 21 | 22 | [AID_VENDOR_FASTRPC] 23 | value:2908 24 | 25 | [AID_VENDOR_QTR] 26 | value:2909 27 | 28 | [AID_VENDOR_NXP_STRONGBOX] 29 | value:2910 30 | 31 | [AID_VENDOR_NXP_WEAVER] 32 | value:2911 33 | 34 | [AID_VENDOR_SSGTZD] 35 | value:2912 36 | 37 | [AID_VENDOR_THALES_STRONGBOX] 38 | value:2913 39 | 40 | [AID_VENDOR_QCC] 41 | value:2914 42 | 43 | [AID_VENDOR_NXP_AUTHSECRET] 44 | value:2915 45 | 46 | [AID_VENDOR_THALES_WEAVER] 47 | value:2916 48 | 49 | [vendor/bin/hw/android.hardware.security.keymint-service.strongbox-nxp] 50 | mode: 0755 51 | user: AID_VENDOR_NXP_STRONGBOX 52 | group: AID_SYSTEM 53 | caps: SYS_ADMIN SYS_NICE 54 | 55 | [vendor/bin/hw/android.hardware.weaver-service.nxp] 56 | mode: 0755 57 | user: AID_VENDOR_NXP_WEAVER 58 | group: AID_SYSTEM 59 | caps: SYS_ADMIN SYS_NICE 60 | 61 | [vendor/bin/hw/android.hardware.security.keymint-service.strongbox-thales] 62 | mode: 0755 63 | user: AID_VENDOR_THALES_STRONGBOX 64 | group: AID_SYSTEM 65 | caps: SYS_ADMIN SYS_NICE 66 | 67 | [vendor/bin/hw/android.hardware.weaver-service.thales] 68 | mode: 0755 69 | user: AID_VENDOR_THALES_WEAVER 70 | group: AID_SYSTEM 71 | caps: SYS_ADMIN SYS_NICE 72 | 73 | [vendor/bin/wcnss_filter] 74 | mode: 0755 75 | user: AID_BLUETOOTH 76 | group: AID_BLUETOOTH 77 | caps: BLOCK_SUSPEND 78 | 79 | [system/vendor/bin/wcnss_filter] 80 | mode: 0755 81 | user: AID_BLUETOOTH 82 | group: AID_BLUETOOTH 83 | caps: BLOCK_SUSPEND 84 | 85 | [vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti] 86 | mode: 0755 87 | user: AID_BLUETOOTH 88 | group: AID_BLUETOOTH 89 | caps: BLOCK_SUSPEND NET_ADMIN 90 | 91 | [system/vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti] 92 | mode: 0755 93 | user: AID_SYSTEM 94 | group: AID_SYSTEM 95 | caps: BLOCK_SUSPEND NET_ADMIN 96 | 97 | [vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti-lazy] 98 | mode: 0755 99 | user: AID_BLUETOOTH 100 | group: AID_BLUETOOTH 101 | caps: BLOCK_SUSPEND NET_ADMIN 102 | 103 | [system/vendor/bin/hw/android.hardware.bluetooth@1.0-service-qti-lazy] 104 | mode: 0755 105 | user: AID_SYSTEM 106 | group: AID_SYSTEM 107 | caps: BLOCK_SUSPEND NET_ADMIN 108 | 109 | [system/bin/cnss-daemon] 110 | mode: 0755 111 | user: AID_BLUETOOTH 112 | group: AID_BLUETOOTH 113 | caps: NET_BIND_SERVICE 114 | 115 | [vendor/bin/pm-service] 116 | mode: 0755 117 | user: AID_SYSTEM 118 | group: AID_SYSTEM 119 | caps: NET_BIND_SERVICE 120 | 121 | [system/vendor/bin/pm-service] 122 | mode: 0755 123 | user: AID_SYSTEM 124 | group: AID_SYSTEM 125 | caps: NET_BIND_SERVICE 126 | 127 | [system/bin/pm-service] 128 | mode: 0755 129 | user: AID_SYSTEM 130 | group: AID_SYSTEM 131 | caps: NET_BIND_SERVICE 132 | 133 | [vendor/bin/pd-mapper] 134 | mode: 0755 135 | user: AID_SYSTEM 136 | group: AID_SYSTEM 137 | caps: NET_BIND_SERVICE 138 | 139 | [system/vendor/bin/pd-mapper] 140 | mode: 0755 141 | user: AID_SYSTEM 142 | group: AID_SYSTEM 143 | caps: NET_BIND_SERVICE 144 | 145 | [system/bin/pd-mapper] 146 | mode: 0755 147 | user: AID_SYSTEM 148 | group: AID_SYSTEM 149 | caps: NET_BIND_SERVICE 150 | 151 | [vendor/bin/imsdatadaemon] 152 | mode: 0755 153 | user: AID_RADIO 154 | group: AID_RADIO 155 | caps: NET_BIND_SERVICE 156 | 157 | [system/vendor/bin/imsdatadaemon] 158 | mode: 0755 159 | user: AID_RADIO 160 | group: AID_RADIO 161 | caps: NET_BIND_SERVICE 162 | 163 | [vendor/bin/ims_rtp_daemon] 164 | mode: 0755 165 | user: AID_RADIO 166 | group: AID_RADIO 167 | caps: NET_BIND_SERVICE 168 | 169 | [system/vendor/bin/ims_rtp_daemon] 170 | mode: 0755 171 | user: AID_RADIO 172 | group: AID_RADIO 173 | caps: NET_BIND_SERVICE 174 | 175 | [vendor/bin/imsrcsd] 176 | mode: 0755 177 | user: AID_RADIO 178 | group: AID_RADIO 179 | caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM 180 | 181 | [system/vendor/bin/imsrcsd] 182 | mode: 0755 183 | user: AID_RADIO 184 | group: AID_RADIO 185 | caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM 186 | 187 | [vendor/bin/imsdaemon] 188 | mode: 0755 189 | user: AID_RADIO 190 | group: AID_RADIO 191 | caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM 192 | 193 | [vendor/bin/cnd] 194 | mode: 0755 195 | user: AID_SYSTEM 196 | group: AID_SYSTEM 197 | caps: NET_BIND_SERVICE BLOCK_SUSPEND NET_ADMIN 198 | 199 | [system/vendor/bin/cnd] 200 | mode: 0755 201 | user: AID_SYSTEM 202 | group: AID_SYSTEM 203 | caps: NET_BIND_SERVICE BLOCK_SUSPEND NET_ADMIN 204 | 205 | [vendor/bin/slim_daemon] 206 | mode: 0755 207 | user: AID_GPS 208 | group: AID_GPS 209 | caps: NET_BIND_SERVICE 210 | 211 | [system/vendor/bin/slim_daemon] 212 | mode: 0755 213 | user: AID_GPS 214 | group: AID_GPS 215 | caps: NET_BIND_SERVICE 216 | 217 | [vendor/bin/loc_launcher] 218 | mode: 0755 219 | user: AID_GPS 220 | group: AID_GPS 221 | caps: SETUID SETGID 222 | 223 | [system/vendor/bin/loc_launcher] 224 | mode: 0755 225 | user: AID_GPS 226 | group: AID_GPS 227 | caps: SETUID SETGID 228 | 229 | [vendor/bin/xtwifi-client] 230 | mode: 0755 231 | user: AID_GPS 232 | group: AID_GPS 233 | caps: NET_BIND_SERVICE BLOCK_SUSPEND WAKE_ALARM 234 | 235 | [vendor/bin/sensors.qti] 236 | mode: 0755 237 | user: AID_SYSTEM 238 | group: AID_SYSTEM 239 | caps: NET_BIND_SERVICE 240 | 241 | [firmware/] 242 | mode: 0771 243 | user: AID_SYSTEM 244 | group: AID_SYSTEM 245 | caps: 0 246 | 247 | [firmware/image/*] 248 | mode: 0771 249 | user: AID_SYSTEM 250 | group: AID_SYSTEM 251 | caps: 0 252 | 253 | [vendor/firmware_mnt/image/*] 254 | mode: 0771 255 | user: AID_SYSTEM 256 | group: AID_SYSTEM 257 | caps: 0 258 | 259 | [bt_firmware/] 260 | mode: 0771 261 | user: AID_SYSTEM 262 | group: AID_SYSTEM 263 | caps: 0 264 | 265 | [persist/] 266 | mode: 0771 267 | user: AID_SYSTEM 268 | group: AID_SYSTEM 269 | caps: 0 270 | 271 | [dsp/] 272 | mode: 0771 273 | user: AID_MEDIA 274 | group: AID_MEDIA 275 | caps: 0 276 | -------------------------------------------------------------------------------- /bootctrl/BootControl.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022 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 | /* 17 | * Changes from Qualcomm Innovation Center are provided under the following license: 18 | * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. 19 | * SPDX-License-Identifier: BSD-3-Clause-Clear 20 | */ 21 | 22 | #include "BootControl.h" 23 | #include 24 | 25 | #include 26 | 27 | #include 28 | 29 | #include 30 | 31 | #include "BootControl.h" 32 | 33 | using HIDLMergeStatus = ::android::hardware::boot::V1_1::MergeStatus; 34 | using ndk::ScopedAStatus; 35 | 36 | namespace aidl::android::hardware::boot { 37 | 38 | BootControl::BootControl() { 39 | CHECK(bootcontrol_init()); 40 | } 41 | 42 | ScopedAStatus BootControl::getActiveBootSlot(int32_t* _aidl_return) { 43 | int32_t ret = get_active_boot_slot(); 44 | if (ret < 0){ 45 | *_aidl_return = 0; 46 | } 47 | else { 48 | *_aidl_return = ret; 49 | } 50 | return ScopedAStatus::ok(); 51 | } 52 | 53 | ScopedAStatus BootControl::getCurrentSlot(int32_t* _aidl_return) { 54 | *_aidl_return = get_current_slot(); 55 | return ScopedAStatus::ok(); 56 | } 57 | 58 | ScopedAStatus BootControl::getNumberSlots(int32_t* _aidl_return) { 59 | *_aidl_return = get_number_slots(); 60 | return ScopedAStatus::ok(); 61 | } 62 | 63 | namespace { 64 | 65 | static constexpr MergeStatus ToAIDLMergeStatus(HIDLMergeStatus status) { 66 | switch (status) { 67 | case HIDLMergeStatus::NONE: 68 | return MergeStatus::NONE; 69 | case HIDLMergeStatus::UNKNOWN: 70 | return MergeStatus::UNKNOWN; 71 | case HIDLMergeStatus::SNAPSHOTTED: 72 | return MergeStatus::SNAPSHOTTED; 73 | case HIDLMergeStatus::MERGING: 74 | return MergeStatus::MERGING; 75 | case HIDLMergeStatus::CANCELLED: 76 | return MergeStatus::CANCELLED; 77 | default: 78 | return MergeStatus::NONE; 79 | } 80 | } 81 | 82 | static constexpr HIDLMergeStatus ToHIDLMergeStatus(MergeStatus status) { 83 | switch (status) { 84 | case MergeStatus::NONE: 85 | return HIDLMergeStatus::NONE; 86 | case MergeStatus::UNKNOWN: 87 | return HIDLMergeStatus::UNKNOWN; 88 | case MergeStatus::SNAPSHOTTED: 89 | return HIDLMergeStatus::SNAPSHOTTED; 90 | case MergeStatus::MERGING: 91 | return HIDLMergeStatus::MERGING; 92 | case MergeStatus::CANCELLED: 93 | return HIDLMergeStatus::CANCELLED; 94 | default: 95 | return HIDLMergeStatus::NONE; 96 | } 97 | } 98 | 99 | } 100 | 101 | ScopedAStatus BootControl::getSnapshotMergeStatus(MergeStatus* _aidl_return) { 102 | *_aidl_return = ToAIDLMergeStatus(get_snapshot_merge_status()); 103 | return ScopedAStatus::ok(); 104 | } 105 | 106 | ScopedAStatus BootControl::getSuffix(int32_t in_slot, std::string* _aidl_return) { 107 | if (!get_suffix(in_slot)) { 108 | // Old HIDL hal returns empty string for invalid slots. We should maintain this behavior in 109 | // AIDL for compatibility. 110 | _aidl_return->clear(); 111 | } 112 | else { 113 | *_aidl_return = get_suffix(in_slot); 114 | } 115 | return ScopedAStatus::ok(); 116 | } 117 | 118 | ScopedAStatus BootControl::isSlotBootable(int32_t in_slot, bool* _aidl_return) { 119 | int32_t ret = is_slot_bootable(in_slot); 120 | if (ret < 0) { 121 | return ScopedAStatus::fromServiceSpecificErrorWithMessage(INVALID_SLOT, (std::string("Invalid slot ") + std::to_string(in_slot)).c_str()); 122 | } 123 | if (ret) { 124 | *_aidl_return = true; 125 | } 126 | else { 127 | *_aidl_return = false; 128 | } 129 | return ScopedAStatus::ok(); 130 | } 131 | 132 | ScopedAStatus BootControl::isSlotMarkedSuccessful(int32_t in_slot, bool* _aidl_return) { 133 | int32_t ret = is_slot_marked_successful(in_slot); 134 | if (ret < 0) { 135 | return ScopedAStatus::fromServiceSpecificErrorWithMessage(INVALID_SLOT, (std::string("Invalid slot ") + std::to_string(in_slot)).c_str()); 136 | } 137 | if (ret) { 138 | *_aidl_return = true; 139 | } 140 | else { 141 | *_aidl_return = false; 142 | } 143 | return ScopedAStatus::ok(); 144 | } 145 | 146 | ScopedAStatus BootControl::markBootSuccessful() { 147 | int ret = mark_boot_successful(); 148 | if (ret == 0) { 149 | return ScopedAStatus::ok(); 150 | } 151 | else { 152 | return ScopedAStatus::fromServiceSpecificErrorWithMessage(COMMAND_FAILED, "Operation failed"); 153 | } 154 | } 155 | 156 | ScopedAStatus BootControl::setActiveBootSlot(int32_t in_slot) { 157 | int ret = set_active_boot_slot(in_slot); 158 | if (ret == 0) { 159 | return ScopedAStatus::ok(); 160 | } 161 | else { 162 | return ScopedAStatus::fromServiceSpecificErrorWithMessage(COMMAND_FAILED, "Operation failed"); 163 | } 164 | } 165 | 166 | ScopedAStatus BootControl::setSlotAsUnbootable(int32_t in_slot) { 167 | int ret = set_slot_as_unbootable(in_slot); 168 | if (ret == 0) { 169 | return ScopedAStatus::ok(); 170 | } 171 | else { 172 | return ScopedAStatus::fromServiceSpecificErrorWithMessage(COMMAND_FAILED, "Operation failed"); 173 | } 174 | } 175 | 176 | ScopedAStatus BootControl::setSnapshotMergeStatus(MergeStatus in_status) { 177 | if (!set_snapshot_merge_status(ToHIDLMergeStatus(in_status))) { 178 | return ScopedAStatus::fromServiceSpecificErrorWithMessage(COMMAND_FAILED, 179 | "Operation failed"); 180 | } 181 | return ScopedAStatus::ok(); 182 | } 183 | 184 | } // namespace aidl::android::hardware::boot 185 | -------------------------------------------------------------------------------- /configs/properties/vendor.prop: -------------------------------------------------------------------------------- 1 | # Camera 2 | camera.disable_zsl_mode=true 3 | ro.camera.enableCamera1MaxZsl=1 4 | ro.hardware.camera=xiaomi 5 | 6 | # Display 7 | vendor.display.comp_mask=0 8 | vendor.display.disable_excl_rect=0 9 | vendor.display.disable_excl_rect_partial_fb=1 10 | vendor.display.disable_hw_recovery_dump=1 11 | vendor.display.disable_offline_rotator=1 12 | vendor.display.disable_scaler=0 13 | vendor.display.disable_sdr_dimming=1 14 | vendor.display.disable_sdr_histogram=1 15 | vendor.display.disable_stc_dimming=1 16 | vendor.display.enable_async_powermode=0 17 | vendor.display.enable_async_vds_creation=1 18 | vendor.display.enable_display_extensions=1 19 | vendor.display.enable_dpps_dynamic_fps=1 20 | vendor.display.enable_early_wakeup=1 21 | vendor.display.enable_hdr10_gpu_target=1 22 | vendor.display.enable_optimize_refresh=0 23 | vendor.display.enable_rc_support=1 24 | vendor.display.use_smooth_motion=0 25 | vendor.display.vds_allow_hwc=1 26 | 27 | # displayfeature 28 | persist.vendor.dc_backlight.enable=false 29 | persist.vendor.dc_backlight.threshold=0 30 | ro.vendor.bcbc.enable=true 31 | ro.vendor.beluga.c=0x4800 32 | ro.vendor.beluga.p=0x3 33 | ro.vendor.beluga.s=0x900 34 | ro.vendor.beluga.t=0x240 35 | ro.vendor.cabc.enable=fasle 36 | ro.vendor.colorpick_adjust=true 37 | ro.vendor.dfps.enable=false 38 | ro.vendor.display.ai_disp.enable=true 39 | ro.vendor.display.default_fps=60 40 | ro.vendor.display.mi_calib.enable=true 41 | ro.vendor.display.nature_mode.enable=true 42 | ro.vendor.display.touch.idle.enable=true 43 | ro.vendor.display.type=oled 44 | ro.vendor.fps.switch.default=true 45 | ro.vendor.fps.switch.thermal=true 46 | ro.vendor.gcp.enable=1 47 | ro.vendor.hbm_backlight.enable=true 48 | ro.vendor.histogram.enable=true 49 | ro.vendor.localhbm.enable=true 50 | ro.vendor.soft_backlight.enable=true 51 | ro.vendor.standard.video.enable=true 52 | ro.vendor.thermal.dimming.enable=true 53 | ro.vendor.video_box.version=2 54 | ro.vendor.whitepoint_calibration_enable=false 55 | ro.vendor.xiaomi.bl.poll=true 56 | sys.displayfeature.entry.enable=true 57 | sys.displayfeature_hidl=false 58 | ro.vendor.displayfeature.dump=true 59 | 60 | # Dolby 61 | ro.vendor.audio.dolby.dax.version=DAX3_3.8.5.20_r1 62 | 63 | # DPM 64 | persist.vendor.dpm.vndr.idletimer.mode=default 65 | persist.vendor.dpm.vndr.halservice.enable=1 66 | persist.vendor.dpm.vndr.feature=11 67 | 68 | # DRM 69 | drm.service.enabled=true 70 | 71 | # Fingerprint 72 | persist.vendor.sys.fp.expolevel=0x88 73 | persist.vendor.sys.fp.fod.location.X_Y=491,2282 74 | persist.vendor.sys.fp.fod.size.width_height=218,218 75 | ro.hardware.fp.fod.location=low 76 | ro.hardware.fp.fod.touch.ctl.version=2.0 77 | ro.hardware.fp.fod.lowlight.lux.threshold=3 78 | ro.hardware.fp.fod.lowlight.brightness.threshold=411 79 | ro.hardware.fp.fod=true 80 | ro.hardware.fp.mievent=true 81 | 82 | # Graphics 83 | debug.egl.hw=0 84 | debug.sf.disable_client_composition_cache=1 85 | debug.sf.enable_advanced_sf_phase_offset=1 86 | debug.sf.use_phase_offsets_as_durations=1 87 | debug.sf.enable_gl_backpressure=1 88 | debug.sf.enable_hwc_vds=0 89 | debug.sf.late.app.duration=13666666 90 | debug.sf.early.app.duration=13666666 91 | debug.sf.earlyGl.app.duration=13666666 92 | debug.sf.early.sf.duration=10500000 93 | debug.sf.earlyGl.sf.duration=10500000 94 | debug.sf.late.sf.duration=10500000 95 | debug.sf.hw=0 96 | debug.sf.predict_hwc_composition_strategy=0 97 | debug.sf.set_idle_timer_ms=1100 98 | debug.sf.treat_170m_as_sRGB=1 99 | persist.sys.sf.color_mode=0 100 | persist.sys.sf.color_saturation=1.0 101 | ro.gfx.driver.1=com.qualcomm.qti.gpudrivers.pineapple.api34 102 | ro.hardware.egl=adreno 103 | ro.hardware.vulkan=adreno 104 | ro.opengles.version=196610 105 | ro.surface_flinger.force_hwc_copy_for_virtual_displays=true 106 | ro.surface_flinger.has_HDR_display=true 107 | ro.surface_flinger.has_wide_color_display=true 108 | ro.surface_flinger.max_frame_buffer_acquired_buffers=3 109 | ro.surface_flinger.max_virtual_display_dimension=4096 110 | ro.surface_flinger.protected_contents=true 111 | ro.surface_flinger.set_touch_timer_ms=200 112 | ro.surface_flinger.supports_background_blur=1 113 | ro.surface_flinger.use_color_management=true 114 | ro.surface_flinger.use_content_detection_for_refresh_rate=true 115 | ro.surface_flinger.wcg_composition_dataspace=143261696 116 | ro.vendor.all_modes.colorpick_adjust=true 117 | vendor.gralloc.disable_ubwc=0 118 | 119 | # Haptics 120 | sys.haptic.motor=linear 121 | sys.haptic.infinitelevel=true 122 | sys.haptic.dynamiceffect=true 123 | sys.haptic.dynamiceffect.richtap=true 124 | sys.haptic.down.weak=0 125 | sys.haptic.down.normal=2 126 | sys.haptic.down.strong=5 127 | sys.haptic.down=5,2 128 | sys.haptic.tap.normal=3,2 129 | sys.haptic.tap.light=5,2 130 | sys.haptic.flick=5,2 131 | sys.haptic.flick.light=7,2 132 | sys.haptic.switch=9,2 133 | sys.haptic.mesh.heavy=8,2 134 | sys.haptic.mesh.normal=5,2 135 | sys.haptic.mesh.light=5,1 136 | sys.haptic.long.press=0,1 137 | sys.haptic.popup.normal=6,2 138 | sys.haptic.popup.light=6,1 139 | sys.haptic.pickup=2,2 140 | sys.haptic.scroll.edge=7,0 141 | sys.haptic.trigger.drawer=2,0 142 | sys.haptic.hold=4,0 143 | sys.haptic.runin=13 144 | sys.haptic.intensityforkeyboard=true 145 | sys.haptic.device_type=agm 146 | 147 | # Incremental 148 | ro.incremental.enable=yes 149 | 150 | # Keystore 151 | ro.hardware.keystore_desede=true 152 | 153 | # Media 154 | debug.c2.use_dmabufheaps=1 155 | debug.config.media.video.aie.support=true 156 | debug.config.media.video.ais.support=true 157 | debug.config.media.video.frc.support=true 158 | debug.mdpcomp.logs=0 159 | debug.media.video.chipset=6 160 | debug.media.video.frc=false 161 | debug.media.video.vpp=false 162 | debug.stagefright.c2inputsurface=-1 163 | debug.stagefright.ccodec=4 164 | debug.stagefright.omx_default_rank=0 165 | media.stagefright.thumbnail.prefer_hw_codecs=true 166 | ro.vendor.media.video.frc.support=true 167 | ro.vendor.media.video.vpp.support=true 168 | vendor.media.vpp.aie.cade=100 169 | vendor.media.vpp.aie.ltm=1 170 | vendor.media.vpp.aie.ltmacebrih=0 171 | vendor.media.vpp.aie.ltmacebril=20 172 | vendor.media.vpp.aie.ltmacestr=37 173 | vendor.media.vpp.aie.ltmsatgain=55 174 | vendor.media.vpp.aie.ltmsatoff=55 175 | vendor.media.vpp.debug.value.use=false 176 | vendor.mm.enable.qcom_parser=16777215 177 | vendor.media.omx=0 178 | 179 | # QCOM 180 | persist.vendor.qcomsysd.enabled=1 181 | 182 | # QFP 183 | persist.vendor.qfp=true 184 | 185 | # QSPM 186 | ro.vendor.qspm.enable=true 187 | 188 | # Radio 189 | persist.radio.multisim.config=dsds 190 | persist.vendor.radio.apm_sim_not_pwdn=1 191 | persist.vendor.radio.custom_ecc=1 192 | persist.vendor.radio.dynamic_sar=1 193 | persist.vendor.radio.enable_temp_dds=true 194 | persist.vendor.radio.enableadvancedscan=true 195 | persist.vendor.radio.procedure_bytes=SKIP 196 | persist.vendor.radio.sib16_support=1 197 | ro.vendor.radio.5g=3 198 | ro.vendor.radio.features_common=3 199 | 200 | # RCS 201 | persist.vendor.rcs.singlereg.feature=1 202 | 203 | # USB 204 | sys.usb.mtp.batchcancel=1 205 | vendor.usb.product_string=Xiaomi 13 206 | vendor.usb.rndis.func.name=gsi 207 | vendor.usb.rmnet.func.name=gsi 208 | vendor.usb.rmnet.inst.name=rmnet 209 | vendor.usb.dpl.inst.name=dpl 210 | vendor.usb.controller=a600000.dwc3 211 | vendor.usb.qdss.inst.name=qdss_sw 212 | vendor.usb.diag.func.name=ffs 213 | vendor.usb.use_ffs_mtp=1 214 | vendor.usb.use_gadget_hal=0 215 | 216 | # VCB 217 | persist.vendor.vcb.ability=true 218 | persist.vendor.vcb.enable=false 219 | 220 | # WiFi 221 | ro.vendor.net.enable_dual_wifi=1 222 | ro.vendor.net.enable_passpoint_r1=1 223 | wifi.aware.interface=wifi-aware0 224 | -------------------------------------------------------------------------------- /rootdir/bin/init.qcom.class_core.sh: -------------------------------------------------------------------------------- 1 | #!/vendor/bin/sh 2 | 3 | # Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of The Linux Foundation nor 13 | # the names of its contributors may be used to endorse or promote 14 | # products derived from this software without specific prior written 15 | # permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 26 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 27 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | # 29 | 30 | # Set platform variables 31 | target=`getprop ro.board.platform` 32 | if [ -f /sys/devices/soc0/hw_platform ]; then 33 | soc_hwplatform=`cat /sys/devices/soc0/hw_platform` 2> /dev/null 34 | else 35 | soc_hwplatform=`cat /sys/devices/system/soc/soc0/hw_platform` 2> /dev/null 36 | fi 37 | if [ -f /sys/devices/soc0/soc_id ]; then 38 | soc_hwid=`cat /sys/devices/soc0/soc_id` 2> /dev/null 39 | else 40 | soc_hwid=`cat /sys/devices/system/soc/soc0/id` 2> /dev/null 41 | fi 42 | if [ -f /sys/devices/soc0/platform_version ]; then 43 | soc_hwver=`cat /sys/devices/soc0/platform_version` 2> /dev/null 44 | else 45 | soc_hwver=`cat /sys/devices/system/soc/soc0/platform_version` 2> /dev/null 46 | fi 47 | 48 | 49 | # Dynamic Memory Managment (DMM) provides a sys file system to the userspace 50 | # that can be used to plug in/out memory that has been configured as unstable. 51 | # This unstable memory can be in Active or In-Active State. 52 | # Each of which the userspace can request by writing to a sys file. 53 | # 54 | # ro.dev.dmm = 1; Indicates that DMM is enabled in the Android User Space. This 55 | # property is set in the Android system properties file. 56 | # 57 | # If ro.dev.dmm.dpd.start_address is set here then the target has a memory 58 | # configuration that supports DynamicMemoryManagement. 59 | init_DMM() 60 | { 61 | block=-1 62 | 63 | case "$target" in 64 | "msm7630_surf" | "msm7630_1x" | "msm7630_fusion" | "msm8960") 65 | ;; 66 | *) 67 | return 68 | ;; 69 | esac 70 | 71 | mem="/sys/devices/system/memory" 72 | op=`cat $mem/movable_start_bytes` 73 | case "$op" in 74 | "0") 75 | log -p i -t DMM DMM Disabled. movable_start_bytes not set: $op 76 | ;; 77 | 78 | "$mem/movable_start_bytes: No such file or directory ") 79 | log -p i -t DMM DMM Disabled. movable_start_bytes does not exist: $op 80 | ;; 81 | 82 | *) 83 | log -p i -t DMM DMM available. movable_start_bytes at $op 84 | movable_start_bytes=0x`cat $mem/movable_start_bytes` 85 | block_size_bytes=0x`cat $mem/block_size_bytes` 86 | block=$((#${movable_start_bytes}/${block_size_bytes})) 87 | 88 | chown -h system.system $mem/memory$block/state 89 | chown -h system.system $mem/probe 90 | chown -h system.system $mem/active 91 | chown -h system.system $mem/remove 92 | 93 | case "$target" in 94 | "msm7630_surf" | "msm7630_1x" | "msm7630_fusion") 95 | echo $movable_start_bytes > $mem/probe 96 | case "$?" in 97 | "0") 98 | log -p i -t DMM $movable_start_bytes to physical hotplug succeeded. 99 | ;; 100 | *) 101 | log -p e -t DMM $movable_start_bytes to physical hotplug failed. 102 | return 103 | ;; 104 | esac 105 | 106 | echo online > $mem/memory$block/state 107 | case "$?" in 108 | "0") 109 | log -p i -t DMM \'echo online\' to logical hotplug succeeded. 110 | ;; 111 | *) 112 | log -p e -t DMM \'echo online\' to logical hotplug failed. 113 | return 114 | ;; 115 | esac 116 | ;; 117 | esac 118 | 119 | setprop ro.dev.dmm.dpd.start_address $movable_start_bytes 120 | setprop ro.dev.dmm.dpd.block $block 121 | ;; 122 | esac 123 | 124 | case "$target" in 125 | "msm8960") 126 | return 127 | ;; 128 | esac 129 | 130 | # For 7X30 targets: 131 | # ro.dev.dmm.dpd.start_address is set when the target has a 2x256Mb memory 132 | # configuration. This is also used to indicate that the target is capable of 133 | # setting EBI-1 to Deep Power Down or Self Refresh. 134 | op=`cat $mem/low_power_memory_start_bytes` 135 | case "$op" in 136 | "0") 137 | log -p i -t DMM Self-Refresh-Only Disabled. low_power_memory_start_bytes not set:$op 138 | ;; 139 | "$mem/low_power_memory_start_bytes No such file or directory ") 140 | log -p i -t DMM Self-Refresh-Only Disabled. low_power_memory_start_bytes does not exist:$op 141 | ;; 142 | *) 143 | log -p i -t DMM Self-Refresh-Only available. low_power_memory_start_bytes at $op 144 | ;; 145 | esac 146 | } 147 | 148 | # 149 | # For controlling console and shell on console on 8960 - perist.serial.enable 8960 150 | # On other target use default ro.debuggable property. 151 | # 152 | serial=`getprop persist.serial.enable` 153 | dserial=`getprop ro.debuggable` 154 | case "$target" in 155 | "msm8960") 156 | case "$serial" in 157 | "0") 158 | echo 0 > /sys/devices/platform/msm_serial_hsl.0/console 159 | ;; 160 | "1") 161 | echo 1 > /sys/devices/platform/msm_serial_hsl.0/console 162 | start console 163 | ;; 164 | *) 165 | case "$dserial" in 166 | "1") 167 | start console 168 | ;; 169 | esac 170 | ;; 171 | esac 172 | ;; 173 | 174 | "msm8610" | "msm8974" | "msm8226") 175 | case "$serial" in 176 | "0") 177 | echo 0 > /sys/devices/f991f000.serial/console 178 | ;; 179 | "1") 180 | echo 1 > /sys/devices/f991f000.serial/console 181 | start console 182 | ;; 183 | *) 184 | case "$dserial" in 185 | "1") 186 | start console 187 | ;; 188 | esac 189 | ;; 190 | esac 191 | ;; 192 | *) 193 | case "$dserial" in 194 | "1") 195 | start console 196 | ;; 197 | esac 198 | ;; 199 | esac 200 | 201 | case "$target" in 202 | "msm7630_surf" | "msm7630_1x" | "msm7630_fusion") 203 | insmod /system/lib/modules/ss_mfcinit.ko 204 | insmod /system/lib/modules/ss_vencoder.ko 205 | insmod /system/lib/modules/ss_vdecoder.ko 206 | chmod -h 0666 /dev/ss_mfc_reg 207 | chmod -h 0666 /dev/ss_vdec 208 | chmod -h 0666 /dev/ss_venc 209 | 210 | init_DMM 211 | ;; 212 | 213 | "msm8960") 214 | init_DMM 215 | ;; 216 | esac 217 | -------------------------------------------------------------------------------- /rootdir/etc/fstab.qcom: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019-2020 The Linux Foundation. All rights reserved. 2 | # 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted (subject to the limitations in the 5 | # disclaimer below) provided that the following conditions are met: 6 | # 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # 10 | # * Redistributions in binary form must reproduce the above 11 | # copyright notice, this list of conditions and the following 12 | # disclaimer in the documentation and/or other materials provided 13 | # with the distribution. 14 | # 15 | # * Neither the name of The Linux Foundation nor the names of its 16 | # contributors may be used to endorse or promote products derived 17 | # from this software without specific prior written permission. 18 | # 19 | # NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE 20 | # GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT 21 | # HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 22 | # WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 23 | # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 24 | # IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 25 | # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 27 | # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 29 | # IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 30 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 31 | # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | 33 | # Android fstab file. 34 | # The filesystem that contains the filesystem checker binary (typically /system) cannot 35 | # specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK 36 | 37 | # 38 | system /system ext4 ro,barrier=1,discard wait,slotselect,avb=vbmeta_system,logical,first_stage_mount,avb_keys=/avb/q-gsi.avbpubkey:/avb/r-gsi.avbpubkey:/avb/s-gsi.avbpubkey:/avb/t-gsi.avbpubkey:/avb/u-gsi.avbpubkey 39 | system /system erofs ro wait,slotselect,avb=vbmeta_system,logical,first_stage_mount,avb_keys=/avb/q-gsi.avbpubkey:/avb/r-gsi.avbpubkey:/avb/s-gsi.avbpubkey:/avb/t-gsi.avbpubkey:/avb/u-gsi.avbpubkey 40 | system_ext /system_ext ext4 ro,barrier=1,discard wait,slotselect,avb=vbmeta_system,logical,first_stage_mount 41 | system_ext /system_ext erofs ro wait,slotselect,avb=vbmeta_system,logical,first_stage_mount 42 | product /product ext4 ro,barrier=1,discard wait,slotselect,avb=vbmeta_system,logical,first_stage_mount 43 | product /product erofs ro wait,slotselect,avb=vbmeta_system,logical,first_stage_mount 44 | vendor /vendor ext4 ro,barrier=1,discard wait,slotselect,avb=vbmeta,logical,first_stage_mount 45 | vendor /vendor erofs ro wait,slotselect,avb=vbmeta,logical,first_stage_mount 46 | vendor_dlkm /vendor_dlkm ext4 ro,barrier=1,discard wait,slotselect,avb=vbmeta,logical,first_stage_mount 47 | vendor_dlkm /vendor_dlkm erofs ro wait,slotselect,avb=vbmeta,logical,first_stage_mount 48 | system_dlkm /system_dlkm ext4 ro,barrier=1,discard wait,slotselect,avb=vbmeta,logical,first_stage_mount 49 | system_dlkm /system_dlkm erofs ro wait,slotselect,avb=vbmeta,logical,first_stage_mount 50 | odm /odm ext4 ro,barrier=1,discard wait,slotselect,avb=vbmeta,logical,first_stage_mount 51 | odm /odm erofs ro wait,slotselect,avb=vbmeta,logical,first_stage_mount 52 | /dev/block/by-name/boot /boot emmc defaults slotselect,avb=vbmeta,first_stage_mount 53 | /dev/block/by-name/init_boot /init_boot emmc defaults slotselect,avb=vbmeta,first_stage_mount 54 | /dev/block/by-name/vendor_boot /vendor_boot emmc defaults slotselect,avb=vbmeta,first_stage_mount 55 | /dev/block/by-name/dtbo /dtbo emmc defaults slotselect,avb=vbmeta,first_stage_mount 56 | /dev/block/by-name/recovery /recovery emmc defaults slotselect,avb=vbmeta,first_stage_mount 57 | /dev/block/by-name/metadata /metadata f2fs noatime,nosuid,nodev,discard wait,check,formattable,first_stage_mount 58 | /dev/block/bootdevice/by-name/persist /mnt/vendor/persist ext4 noatime,nosuid,nodev,barrier=1 wait 59 | /dev/block/bootdevice/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,reserve_root=32768,resgid=1065,fsync_mode=nobarrier,inlinecrypt latemount,wait,check,formattable,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized+wrappedkey_v0,keydirectory=/metadata/vold/metadata_encryption,metadata_encryption=aes-256-xts:wrappedkey_v0,quota,reservedsize=128M,sysfs_path=/sys/devices/platform/soc/1d84000.ufshc,checkpoint=fs 60 | /dev/block/bootdevice/by-name/misc /misc emmc defaults defaults 61 | /devices/platform/soc/8804000.sdhci/mmc_host* /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,encryptable=footer 62 | /devices/platform/soc/*.ssusb/*.dwc3/xhci-hcd.*.auto* /storage/usbotg vfat nosuid,nodev wait,voldmanaged=usbotg:auto 63 | /dev/block/bootdevice/by-name/modemfirmware /vendor/modem_firmware vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait,slotselect 64 | /dev/block/bootdevice/by-name/modem /vendor/firmware_mnt vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait,slotselect 65 | /dev/block/bootdevice/by-name/dsp /vendor/dsp ext4 ro,nosuid,nodev,barrier=1 wait,slotselect 66 | /dev/block/bootdevice/by-name/vm-persist /mnt/product/vm-persist ext4 noatime,nosuid,nodev,barrier=1 wait 67 | /dev/block/bootdevice/by-name/bluetooth /vendor/bt_firmware vfat ro,shortname=lower,uid=1002,gid=3002,dmask=227,fmask=337,context=u:object_r:bt_firmware_file:s0 wait,slotselect 68 | /dev/block/bootdevice/by-name/qmcs /mnt/vendor/qmcs vfat noatime,nosuid,nodev,context=u:object_r:vendor_qmcs_file:s0 wait,check,formattable 69 | /dev/block/bootdevice/by-name/spunvm /mnt/vendor/spunvm vfat noatime,nosuid,nodev,context=u:object_r:vendor_spunvm_file:s0 wait,check,formattable 70 | -------------------------------------------------------------------------------- /BoardConfig.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2023 The Android Open Source Project 3 | # 4 | # SPDX-License-Identifier: Apache-2.0 5 | # 6 | 7 | DEVICE_PATH := device/xiaomi/houji 8 | KERNEL_PATH := $(DEVICE_PATH)-kernel 9 | 10 | # A/B 11 | AB_OTA_UPDATER := true 12 | 13 | AB_OTA_PARTITIONS += \ 14 | boot \ 15 | init_boot \ 16 | vendor_boot \ 17 | dtbo \ 18 | vbmeta \ 19 | vbmeta_system \ 20 | odm \ 21 | product \ 22 | recovery \ 23 | system \ 24 | system_ext \ 25 | system_dlkm \ 26 | vendor \ 27 | vendor_dlkm 28 | 29 | # Architecture 30 | TARGET_ARCH := arm64 31 | TARGET_ARCH_VARIANT := armv8-2a-dotprod 32 | TARGET_CPU_ABI := arm64-v8a 33 | TARGET_CPU_VARIANT := generic 34 | TARGET_CPU_VARIANT_RUNTIME := kryo300 35 | 36 | # Boot control 37 | SOONG_CONFIG_NAMESPACES += ufsbsg 38 | SOONG_CONFIG_ufsbsg += ufsframework 39 | SOONG_CONFIG_ufsbsg_ufsframework := bsg 40 | 41 | # Bootloader 42 | TARGET_BOARD_INFO_FILE := $(DEVICE_PATH)/board-info.txt 43 | TARGET_BOOTLOADER_BOARD_NAME := pineapple 44 | TARGET_NO_BOOTLOADER := true 45 | TARGET_USES_UEFI := true 46 | 47 | # Build 48 | BUILD_BROKEN_DUP_RULES := true 49 | BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true 50 | BUILD_BROKEN_INCORRECT_PARTITION_IMAGES := true 51 | BUILD_BROKEN_VENDOR_PROPERTY_NAMESPACE := true 52 | 53 | # Display 54 | TARGET_SCREEN_DENSITY := 480 55 | 56 | # DTB 57 | BOARD_USES_DT := true 58 | TARGET_NEEDS_DTBOIMAGE := true 59 | TARGET_KERNEL_APPEND_DTB := false 60 | BOARD_USES_QCOM_MERGE_DTBS_SCRIPT := true 61 | BOARD_PREBUILT_DTBIMAGE_DIR := $(KERNEL_PATH)/dtbs 62 | BOARD_PREBUILT_DTBOIMAGE := $(KERNEL_PATH)/dtbo.img 63 | 64 | # Filesystem 65 | TARGET_FS_CONFIG_GEN := $(DEVICE_PATH)/configs/config/config.fs 66 | 67 | # Kernel 68 | BOARD_KERNEL_PAGESIZE := 4096 69 | BOARD_KERNEL_BASE := 0x00000000 70 | 71 | BOARD_KERNEL_CMDLINE := \ 72 | video=vfb:640x400,bpp=32,memsize=3072000 \ 73 | disable_dma32=on \ 74 | swinfo.fingerprint=$(LINEAGE_VERSION) \ 75 | mtdoops.fingerprint=$(LINEAGE_VERSION) 76 | 77 | BOARD_BOOTCONFIG := \ 78 | androidboot.hardware=qcom \ 79 | androidboot.memcg=1 \ 80 | androidboot.usbcontroller=a600000.dwc3 \ 81 | androidboot.load_modules_parallel=true \ 82 | androidboot.init_fatal_reboot_target=recovery 83 | 84 | BOARD_BOOT_HEADER_VERSION := 4 85 | BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOT_HEADER_VERSION) 86 | 87 | BOARD_KERNEL_IMAGE_NAME := Image 88 | 89 | BOARD_INCLUDE_DTB_IN_BOOTIMG := true 90 | BOARD_RAMDISK_USE_LZ4 := true 91 | BOARD_USES_GENERIC_KERNEL_IMAGE := true 92 | 93 | # Kill lineage kernel build task while preserving kernel 94 | TARGET_NO_KERNEL_OVERRIDE := true 95 | 96 | # Workaround to make lineage's soong generator work 97 | TARGET_KERNEL_SOURCE := $(KERNEL_PATH)/kernel-headers 98 | 99 | # Kernel Binary 100 | TARGET_KERNEL_VERSION := 6.1 101 | LOCAL_KERNEL := $(KERNEL_PATH)/Image 102 | PRODUCT_COPY_FILES += \ 103 | $(LOCAL_KERNEL):kernel 104 | 105 | # Kernel modules 106 | ## system_dlkm kernel modules 107 | BOARD_SYSTEM_KERNEL_MODULES_LOAD := $(strip $(shell cat $(KERNEL_PATH)/system_dlkm/modules.load)) 108 | 109 | ## vendor_boot kernel modules 110 | BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD := $(strip $(shell cat $(KERNEL_PATH)/vendor_ramdisk/modules.load)) 111 | BOARD_VENDOR_RAMDISK_KERNEL_MODULES := $(addprefix $(KERNEL_PATH)/vendor_ramdisk/, $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES_LOAD)) 112 | BOARD_VENDOR_RAMDISK_KERNEL_MODULES_BLOCKLIST_FILE := $(KERNEL_PATH)/vendor_ramdisk/modules.blocklist 113 | 114 | ## Also add recovery modules to vendor ramdisk 115 | BOARD_VENDOR_RAMDISK_RECOVERY_KERNEL_MODULES_LOAD := $(strip $(shell cat $(KERNEL_PATH)/vendor_ramdisk/modules.load.recovery)) 116 | RECOVERY_MODULES := $(addprefix $(KERNEL_PATH)/vendor_ramdisk/, $(BOARD_VENDOR_RAMDISK_RECOVERY_KERNEL_MODULES_LOAD)) 117 | 118 | ## Prevent duplicated entries (to solve duplicated build rules problem) 119 | BOARD_VENDOR_RAMDISK_KERNEL_MODULES := $(sort $(BOARD_VENDOR_RAMDISK_KERNEL_MODULES) $(RECOVERY_MODULES)) 120 | 121 | ## Vendor modules (installed to vendor_dlkm) 122 | BOARD_VENDOR_KERNEL_MODULES_LOAD := $(strip $(shell cat $(KERNEL_PATH)/vendor_dlkm/modules.load)) 123 | BOARD_VENDOR_KERNEL_MODULES := $(addprefix $(KERNEL_PATH)/vendor_dlkm/, $(BOARD_VENDOR_KERNEL_MODULES_LOAD)) 124 | BOARD_VENDOR_KERNEL_MODULES_BLOCKLIST_FILE := $(KERNEL_PATH)/vendor_dlkm/modules.blocklist 125 | 126 | # Metadata 127 | BOARD_USES_METADATA_PARTITION := true 128 | 129 | # OTA assert 130 | TARGET_OTA_ASSERT_DEVICE := houji 131 | 132 | # Partitions 133 | BOARD_FLASH_BLOCK_SIZE := 262144 134 | 135 | BOARD_BOOTIMAGE_PARTITION_SIZE := 100663296 136 | BOARD_KERNEL-GKI_BOOTIMAGE_PARTITION_SIZE := $(BOARD_BOOTIMAGE_PARTITION_SIZE) 137 | BOARD_DTBOIMG_PARTITION_SIZE := 25165824 138 | BOARD_INIT_BOOT_IMAGE_PARTITION_SIZE := 8388608 139 | BOARD_RECOVERYIMAGE_PARTITION_SIZE := 104857600 140 | BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE := 100663296 141 | 142 | BOARD_SUPER_PARTITION_SIZE := 8321499136 143 | BOARD_SUPER_PARTITION_GROUPS := qti_dynamic_partitions 144 | BOARD_QTI_DYNAMIC_PARTITIONS_PARTITION_LIST := odm product system system_dlkm system_ext vendor vendor_dlkm 145 | BOARD_QTI_DYNAMIC_PARTITIONS_SIZE := 8317304832 146 | 147 | BOARD_PARTITION_LIST := $(call to-upper, $(BOARD_QTI_DYNAMIC_PARTITIONS_PARTITION_LIST)) 148 | $(foreach p, $(BOARD_PARTITION_LIST), $(eval BOARD_$(p)IMAGE_FILE_SYSTEM_TYPE := erofs)) 149 | 150 | TARGET_COPY_OUT_ODM := odm 151 | TARGET_COPY_OUT_PRODUCT := product 152 | TARGET_COPY_OUT_SYSTEM_DLKM := system_dlkm 153 | TARGET_COPY_OUT_SYSTEM_EXT := system_ext 154 | TARGET_COPY_OUT_VENDOR := vendor 155 | TARGET_COPY_OUT_VENDOR_DLKM := vendor_dlkm 156 | 157 | BOARD_USES_SYSTEM_DLKMIMAGE := true 158 | BOARD_USES_VENDOR_DLKMIMAGE := true 159 | 160 | # Platform 161 | BOARD_USES_QCOM_HARDWARE := true 162 | TARGET_BOARD_PLATFORM := pineapple 163 | 164 | # Power 165 | TARGET_POWERHAL_MODE_EXT := $(DEVICE_PATH)/power/power-mode.cpp 166 | 167 | # Properties 168 | TARGET_ODM_PROP += $(DEVICE_PATH)/configs/properties/odm.prop 169 | TARGET_PRODUCT_PROP += $(DEVICE_PATH)/configs/properties/product.prop 170 | TARGET_SYSTEM_PROP += $(DEVICE_PATH)/configs/properties/system.prop 171 | TARGET_SYSTEM_EXT_PROP += $(DEVICE_PATH)/configs/properties/system_ext.prop 172 | TARGET_VENDOR_PROP += $(DEVICE_PATH)/configs/properties/vendor.prop 173 | 174 | # Recovery 175 | BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE := true 176 | BOARD_USES_RECOVERY_AS_BOOT := false 177 | TARGET_RECOVERY_PIXEL_FORMAT := RGBX_8888 178 | TARGET_RECOVERY_FSTAB := $(DEVICE_PATH)/rootdir/etc/fstab.qcom 179 | TARGET_USERIMAGES_USE_EXT4 := true 180 | TARGET_USERIMAGES_USE_F2FS := true 181 | 182 | # RIL 183 | ENABLE_VENDOR_RIL_SERVICE := true 184 | 185 | # Sepolicy 186 | include device/qcom/sepolicy_vndr/SEPolicy.mk 187 | 188 | # Use sha256 hash algorithm for system_dlkm partition 189 | BOARD_AVB_SYSTEM_DLKM_ADD_HASHTREE_FOOTER_ARGS += --hash_algorithm sha256 190 | BOARD_AVB_VENDOR_ADD_HASHTREE_FOOTER_ARGS += --hash_algorithm sha256 191 | BOARD_AVB_VENDOR_DLKM_ADD_HASHTREE_FOOTER_ARGS += --hash_algorithm sha256 192 | BOARD_AVB_ODM_ADD_HASHTREE_FOOTER_ARGS += --hash_algorithm sha256 193 | 194 | # VINTF 195 | DEVICE_FRAMEWORK_MANIFEST_FILE := $(DEVICE_PATH)/configs/vintf/framework_manifest.xml 196 | DEVICE_MANIFEST_SKUS := pineapple 197 | DEVICE_MANIFEST_PINEAPPLE_FILES := \ 198 | $(DEVICE_PATH)/configs/vintf/manifest_pineapple.xml \ 199 | $(DEVICE_PATH)/configs/vintf/manifest_xiaomi.xml 200 | DEVICE_MATRIX_FILE := $(DEVICE_PATH)/configs/vintf/compatibility_matrix.xml 201 | DEVICE_FRAMEWORK_COMPATIBILITY_MATRIX_FILE := \ 202 | $(DEVICE_PATH)/configs/vintf/compatibility_matrix.device.xml \ 203 | $(DEVICE_PATH)/configs/vintf/compatibility_matrix.xiaomi.xml \ 204 | vendor/lineage/config/device_framework_matrix.xml 205 | 206 | # Verified Boot 207 | BOARD_AVB_ENABLE := true 208 | BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flags 3 209 | BOARD_MOVE_GSI_AVB_KEYS_TO_VENDOR_BOOT := true 210 | 211 | BOARD_AVB_BOOT_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem 212 | BOARD_AVB_BOOT_ALGORITHM := SHA256_RSA4096 213 | BOARD_AVB_BOOT_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP) 214 | BOARD_AVB_BOOT_ROLLBACK_INDEX_LOCATION := 3 215 | 216 | BOARD_AVB_RECOVERY_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem 217 | BOARD_AVB_RECOVERY_ALGORITHM := SHA256_RSA4096 218 | BOARD_AVB_RECOVERY_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP) 219 | BOARD_AVB_RECOVERY_ROLLBACK_INDEX_LOCATION := 1 220 | 221 | BOARD_AVB_VBMETA_SYSTEM := system system_dlkm system_ext product 222 | BOARD_AVB_VBMETA_SYSTEM_ALGORITHM := SHA256_RSA4096 223 | BOARD_AVB_VBMETA_SYSTEM_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem 224 | BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP) 225 | BOARD_AVB_VBMETA_SYSTEM_ROLLBACK_INDEX_LOCATION := 2 226 | 227 | # Inherit from the proprietary version 228 | -include vendor/xiaomi/houji/BoardConfigVendor.mk 229 | -------------------------------------------------------------------------------- /gpt-utils/gpt-utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013,2016,2020 The Linux Foundation. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above 10 | * copyright notice, this list of conditions and the following 11 | * disclaimer in the documentation and/or other materials provided 12 | * with the distribution. 13 | * * Neither the name of The Linux Foundation nor the names of its 14 | * contributors may be used to endorse or promote products derived 15 | * from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 21 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | #ifndef __GPT_UTILS_H__ 31 | #define __GPT_UTILS_H__ 32 | #include 33 | #include 34 | #include 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | #include 39 | #include 40 | /****************************************************************************** 41 | * GPT HEADER DEFINES 42 | ******************************************************************************/ 43 | #define GPT_SIGNATURE "EFI PART" 44 | #define HEADER_SIZE_OFFSET 12 45 | #define HEADER_CRC_OFFSET 16 46 | #define PRIMARY_HEADER_OFFSET 24 47 | #define BACKUP_HEADER_OFFSET 32 48 | #define FIRST_USABLE_LBA_OFFSET 40 49 | #define LAST_USABLE_LBA_OFFSET 48 50 | #define PENTRIES_OFFSET 72 51 | #define PARTITION_COUNT_OFFSET 80 52 | #define PENTRY_SIZE_OFFSET 84 53 | #define PARTITION_CRC_OFFSET 88 54 | 55 | #define TYPE_GUID_OFFSET 0 56 | #define TYPE_GUID_SIZE 16 57 | #define PTN_ENTRY_SIZE 128 58 | #define UNIQUE_GUID_OFFSET 16 59 | #define FIRST_LBA_OFFSET 32 60 | #define LAST_LBA_OFFSET 40 61 | #define ATTRIBUTE_FLAG_OFFSET 48 62 | #define PARTITION_NAME_OFFSET 56 63 | #define MAX_GPT_NAME_SIZE 72 64 | 65 | /****************************************************************************** 66 | * AB RELATED DEFINES 67 | ******************************************************************************/ 68 | //Bit 48 onwords in the attribute field are the ones where we are allowed to 69 | //store our AB attributes. 70 | #define AB_FLAG_OFFSET (ATTRIBUTE_FLAG_OFFSET + 6) 71 | #define GPT_DISK_INIT_MAGIC 0xABCD 72 | #define AB_PARTITION_ATTR_SLOT_ACTIVE (0x1<<2) 73 | #define AB_PARTITION_ATTR_BOOT_SUCCESSFUL (0x1<<6) 74 | #define AB_PARTITION_ATTR_UNBOOTABLE (0x1<<7) 75 | #define AB_SLOT_ACTIVE_VAL 0x3F 76 | #define AB_SLOT_INACTIVE_VAL 0x0 77 | #define AB_SLOT_ACTIVE 1 78 | #define AB_SLOT_INACTIVE 0 79 | #define AB_SLOT_A_SUFFIX "_a" 80 | #define AB_SLOT_B_SUFFIX "_b" 81 | #define PTN_XBL "xbl" 82 | #define PTN_XBL_CFG "xbl_config" 83 | #define PTN_MULTIIMGOEM "multiimgoem" 84 | #define PTN_MULTIIMGQTI "multiimgqti" 85 | #define PTN_SWAP_LIST PTN_XBL, PTN_XBL_CFG, PTN_MULTIIMGOEM, PTN_MULTIIMGQTI, "sbl1", "rpm", "tz", "aboot", "abl", "hyp", "lksecapp", "keymaster", "cmnlib", "cmnlib32", "cmnlib64", "pmic", "apdp", "devcfg", "hosd", "keystore", "msadp", "mdtp", "mdtpsecapp", "dsp", "aop", "qupfw", "vbmeta", "dtbo", "imagefv", "ImageFv", "uefisecapp", "vm-bootsys", "shrm", "cpucp", "featenabler", "vbmeta_system", "uefi", "aop_config", "uefisecapp", "recovery", "qweslicstore", "xbl_ramdump" 86 | #define AB_PTN_LIST PTN_SWAP_LIST, "boot", "vendor_boot", "system", "system_ext", "product", "vendor", "vendor_dlkm", "odm", "modem", "bluetooth" 87 | #define BOOT_DEV_DIR "/dev/block/bootdevice/by-name" 88 | 89 | /****************************************************************************** 90 | * HELPER MACROS 91 | ******************************************************************************/ 92 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) 93 | /****************************************************************************** 94 | * TYPES 95 | ******************************************************************************/ 96 | enum boot_update_stage { 97 | UPDATE_MAIN = 1, 98 | UPDATE_BACKUP, 99 | UPDATE_FINALIZE 100 | }; 101 | 102 | enum gpt_instance { 103 | PRIMARY_GPT = 0, 104 | SECONDARY_GPT 105 | }; 106 | 107 | enum boot_chain { 108 | NORMAL_BOOT = 0, 109 | BACKUP_BOOT 110 | }; 111 | 112 | struct gpt_disk { 113 | //GPT primary header 114 | uint8_t *hdr; 115 | //primary header crc 116 | uint32_t hdr_crc; 117 | //GPT backup header 118 | uint8_t *hdr_bak; 119 | //backup header crc 120 | uint32_t hdr_bak_crc; 121 | //Partition entries array 122 | uint8_t *pentry_arr; 123 | //Partition entries array for backup table 124 | uint8_t *pentry_arr_bak; 125 | //Size of the pentry array 126 | uint32_t pentry_arr_size; 127 | //Size of each element in the pentry array 128 | uint32_t pentry_size; 129 | //CRC of the partition entry array 130 | uint32_t pentry_arr_crc; 131 | //CRC of the backup partition entry array 132 | uint32_t pentry_arr_bak_crc; 133 | //Path to block dev representing the disk 134 | char devpath[PATH_MAX]; 135 | //Block size of disk 136 | uint32_t block_size; 137 | uint32_t is_initialized; 138 | }; 139 | 140 | /****************************************************************************** 141 | * FUNCTION PROTOTYPES 142 | ******************************************************************************/ 143 | int prepare_boot_update(enum boot_update_stage stage); 144 | //GPT disk methods 145 | struct gpt_disk* gpt_disk_alloc(); 146 | //Free previously allocated gpt_disk struct 147 | void gpt_disk_free(struct gpt_disk *disk); 148 | //Get the details of the disk holding the partition whose name 149 | //is passed in via dev 150 | int gpt_disk_get_disk_info(const char *dev, struct gpt_disk *disk); 151 | 152 | //Get pointer to partition entry from a allocated gpt_disk structure 153 | uint8_t* gpt_disk_get_pentry(struct gpt_disk *disk, 154 | const char *partname, 155 | enum gpt_instance instance); 156 | 157 | //Update the crc fields of the modified disk structure 158 | int gpt_disk_update_crc(struct gpt_disk *disk); 159 | 160 | //Write the contents of struct gpt_disk back to the actual disk 161 | int gpt_disk_commit(struct gpt_disk *disk); 162 | 163 | //Return if the current device is UFS based or not 164 | int gpt_utils_is_ufs_device(); 165 | 166 | //Swtich betwieen using either the primary or the backup 167 | //boot LUN for boot. This is required since UFS boot partitions 168 | //cannot have a backup GPT which is what we use for failsafe 169 | //updates of the other 'critical' partitions. This function will 170 | //not be invoked for emmc targets and on UFS targets is only required 171 | //to be invoked for XBL. 172 | // 173 | //The algorithm to do this is as follows: 174 | //- Find the real block device(eg: /dev/block/sdb) that corresponds 175 | // to the /dev/block/bootdevice/by-name/xbl(bak) symlink 176 | // 177 | //- Once we have the block device 'node' name(sdb in the above example) 178 | // use this node to to locate the scsi generic device that represents 179 | // it by checking the file /sys/block/sdb/device/scsi_generic/sgY 180 | // 181 | //- Once we locate sgY we call the query ioctl on /dev/sgy to switch 182 | //the boot lun to either LUNA or LUNB 183 | int gpt_utils_set_xbl_boot_partition(enum boot_chain chain); 184 | 185 | //Given a vector of partition names as a input and a reference to a map, 186 | //populate the map to indicate which physical disk each of the partitions 187 | //sits on. The key in the map is the path to the block device where the 188 | //partiton lies and the value is a vector of strings indicating which of 189 | //the passed in partiton names sits on that device. 190 | int gpt_utils_get_partition_map(std::vector& partition_list, 191 | std::map>& partition_map); 192 | #ifdef __cplusplus 193 | } 194 | #endif 195 | #endif /* __GPT_UTILS_H__ */ 196 | -------------------------------------------------------------------------------- /gpt-utils/recovery-ufs-bsg.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020 The Linux Foundation. All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above 10 | * copyright notice, this list of conditions and the following 11 | * disclaimer in the documentation and/or other materials provided 12 | * with the distribution. 13 | * * Neither the name of The Linux Foundation nor the names of its 14 | * contributors may be used to endorse or promote products derived 15 | * from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED 18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS 21 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 24 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE 26 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN 27 | * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | */ 29 | 30 | 31 | #define LOG_TAG "recovery_ufs" 32 | 33 | #include "recovery-ufs-bsg.h" 34 | 35 | #ifndef _BSG_FRAMEWORK_KERNEL_HEADERS 36 | #ifndef _GENERIC_KERNEL_HEADERS 37 | #include 38 | #include 39 | #endif 40 | #endif 41 | 42 | //Size of the buffer that needs to be passed to the UFS ioctl 43 | #define UFS_ATTR_DATA_SIZE 32 44 | 45 | #ifdef _BSG_FRAMEWORK_KERNEL_HEADERS 46 | static int get_ufs_bsg_dev(void) 47 | { 48 | DIR *dir; 49 | struct dirent *ent; 50 | int ret = -ENODEV; 51 | 52 | if ((dir = opendir ("/dev")) != NULL) { 53 | /* read all the files and directories within directory */ 54 | while ((ent = readdir(dir)) != NULL) { 55 | if (!strcmp(ent->d_name, "ufs-bsg") || 56 | !strcmp(ent->d_name, "ufs-bsg0")) { 57 | snprintf(ufs_bsg_dev, FNAME_SZ, "/dev/%s", ent->d_name); 58 | ret = 0; 59 | break; 60 | } 61 | } 62 | if (ret) 63 | ALOGE("could not find the ufs-bsg dev\n"); 64 | closedir (dir); 65 | } else { 66 | /* could not open directory */ 67 | ALOGE("could not open /dev (error no: %d)\n", errno); 68 | ret = -EINVAL; 69 | } 70 | 71 | return ret; 72 | } 73 | 74 | int ufs_bsg_dev_open(void) 75 | { 76 | int ret; 77 | if (!fd_ufs_bsg) { 78 | fd_ufs_bsg = open(ufs_bsg_dev, O_RDWR); 79 | ret = errno; 80 | if (fd_ufs_bsg < 0) { 81 | ALOGE("Unable to open %s (error no: %d)", 82 | ufs_bsg_dev, errno); 83 | fd_ufs_bsg = 0; 84 | return ret; 85 | } 86 | } 87 | return 0; 88 | } 89 | 90 | void ufs_bsg_dev_close(void) 91 | { 92 | if (fd_ufs_bsg) { 93 | close(fd_ufs_bsg); 94 | fd_ufs_bsg = 0; 95 | } 96 | } 97 | 98 | static int ufs_bsg_ioctl(int fd, struct ufs_bsg_request *req, 99 | struct ufs_bsg_reply *rsp, __u8 *buf, __u32 buf_len, 100 | enum bsg_ioctl_dir dir) 101 | { 102 | int ret; 103 | struct sg_io_v4 sg_io{}; 104 | 105 | sg_io.guard = 'Q'; 106 | sg_io.protocol = BSG_PROTOCOL_SCSI; 107 | sg_io.subprotocol = BSG_SUB_PROTOCOL_SCSI_TRANSPORT; 108 | sg_io.request_len = sizeof(*req); 109 | sg_io.request = (__u64)req; 110 | sg_io.response = (__u64)rsp; 111 | sg_io.max_response_len = sizeof(*rsp); 112 | if (dir == BSG_IOCTL_DIR_FROM_DEV) { 113 | sg_io.din_xfer_len = buf_len; 114 | sg_io.din_xferp = (__u64)(buf); 115 | } else { 116 | sg_io.dout_xfer_len = buf_len; 117 | sg_io.dout_xferp = (__u64)(buf); 118 | } 119 | 120 | ret = ioctl(fd, SG_IO, &sg_io); 121 | if (ret) 122 | ALOGE("%s: Error from sg_io ioctl (return value: %d, error no: %d, reply result from LLD: %d\n)", 123 | __func__, ret, errno, rsp->result); 124 | 125 | if (sg_io.info || rsp->result) { 126 | ALOGE("%s: Error from sg_io info (check sg info: device_status: 0x%x, transport_status: 0x%x, driver_status: 0x%x, reply result from LLD: %d\n)", 127 | __func__, sg_io.device_status, sg_io.transport_status, 128 | sg_io.driver_status, rsp->result); 129 | ret = -EAGAIN; 130 | } 131 | 132 | return ret; 133 | } 134 | 135 | static void compose_ufs_bsg_query_req(struct ufs_bsg_request *req, __u8 func, 136 | __u8 opcode, __u8 idn, __u8 index, __u8 sel, 137 | __u16 length) 138 | { 139 | struct utp_upiu_header *hdr = &req->upiu_req.header; 140 | struct utp_upiu_query *qr = &req->upiu_req.qr; 141 | 142 | req->msgcode = UTP_UPIU_QUERY_REQ; 143 | hdr->dword_0 = DWORD(UTP_UPIU_QUERY_REQ, 0, 0, 0); 144 | hdr->dword_1 = DWORD(0, func, 0, 0); 145 | hdr->dword_2 = DWORD(0, 0, length >> 8, (__u8)length); 146 | qr->opcode = opcode; 147 | qr->idn = idn; 148 | qr->index = index; 149 | qr->selector = sel; 150 | qr->length = htobe16(length); 151 | } 152 | 153 | 154 | static int ufs_query_attr(int fd, __u32 value, 155 | __u8 func, __u8 opcode, __u8 idn, 156 | __u8 index, __u8 sel) 157 | { 158 | struct ufs_bsg_request req{}; 159 | struct ufs_bsg_reply rsp{}; 160 | enum bsg_ioctl_dir dir = BSG_IOCTL_DIR_FROM_DEV; 161 | int ret = 0; 162 | 163 | if (opcode == QUERY_REQ_OP_WRITE_DESC || opcode == QUERY_REQ_OP_WRITE_ATTR) 164 | dir = BSG_IOCTL_DIR_TO_DEV; 165 | 166 | req.upiu_req.qr.value = htobe32(value); 167 | 168 | compose_ufs_bsg_query_req(&req, func, opcode, idn, index, sel, 0); 169 | 170 | ret = ufs_bsg_ioctl(fd, &req, &rsp, 0, 0, dir); 171 | if (ret) 172 | ALOGE("%s: Error from ufs_bsg_ioctl (return value: %d, error no: %d\n)", 173 | __func__, ret, errno); 174 | 175 | return ret; 176 | } 177 | 178 | int32_t set_boot_lun(char *sg_dev __unused,uint8_t lun_id) 179 | { 180 | int32_t ret; 181 | __u32 boot_lun_id = lun_id; 182 | 183 | ret = get_ufs_bsg_dev(); 184 | if (ret) 185 | return ret; 186 | ALOGV("Found the ufs bsg dev: %s\n", ufs_bsg_dev); 187 | 188 | ret = ufs_bsg_dev_open(); 189 | if (ret) 190 | return ret; 191 | ALOGV("Opened ufs bsg dev: %s\n", ufs_bsg_dev); 192 | 193 | ret = ufs_query_attr(fd_ufs_bsg, boot_lun_id, QUERY_REQ_FUNC_STD_WRITE, 194 | QUERY_REQ_OP_WRITE_ATTR, QUERY_ATTR_IDN_BOOT_LU_EN, 0, 0); 195 | if (ret) { 196 | ALOGE("Error requesting ufs attr idn %d via query ioctl (return value: %d, error no: %d)", 197 | QUERY_ATTR_IDN_BOOT_LU_EN, ret, errno); 198 | goto out; 199 | } 200 | out: 201 | ufs_bsg_dev_close(); 202 | return ret; 203 | } 204 | #endif 205 | 206 | #ifndef _BSG_FRAMEWORK_KERNEL_HEADERS 207 | int32_t set_boot_lun(char *sg_dev, uint8_t boot_lun_id) 208 | { 209 | #ifndef _GENERIC_KERNEL_HEADERS 210 | int fd = -1; 211 | int rc; 212 | struct ufs_ioctl_query_data *data = NULL; 213 | size_t ioctl_data_size = sizeof(struct ufs_ioctl_query_data) + UFS_ATTR_DATA_SIZE; 214 | 215 | data = (struct ufs_ioctl_query_data*)malloc(ioctl_data_size); 216 | if (!data) { 217 | fprintf(stderr, "%s: Failed to alloc query data struct\n", 218 | __func__); 219 | goto error; 220 | } 221 | memset(data, 0, ioctl_data_size); 222 | data->opcode = UPIU_QUERY_OPCODE_WRITE_ATTR; 223 | data->idn = QUERY_ATTR_IDN_BOOT_LU_EN; 224 | data->buf_size = UFS_ATTR_DATA_SIZE; 225 | data->buffer[0] = boot_lun_id; 226 | fd = open(sg_dev, O_RDWR); 227 | if (fd < 0) { 228 | fprintf(stderr, "%s: Failed to open %s(%s)\n", 229 | __func__, 230 | sg_dev, 231 | strerror(errno)); 232 | goto error; 233 | } 234 | rc = ioctl(fd, UFS_IOCTL_QUERY, data); 235 | if (rc) { 236 | fprintf(stderr, "%s: UFS query ioctl failed(%s)\n", 237 | __func__, 238 | strerror(errno)); 239 | goto error; 240 | } 241 | close(fd); 242 | free(data); 243 | return 0; 244 | error: 245 | if (fd >= 0) 246 | close(fd); 247 | if (data) 248 | free(data); 249 | return -1; 250 | #else 251 | return 0; 252 | #endif 253 | } 254 | #endif 255 | 256 | -------------------------------------------------------------------------------- /configs/vintf/manifest_pineapple.xml: -------------------------------------------------------------------------------- 1 | 34 | 35 | 36 | 37 | vendor.qti.hardware.capabilityconfigstore 38 | hwbinder 39 | 1.0 40 | 41 | ICapabilityConfigStore 42 | default 43 | 44 | 45 | 46 | android.hardware.audio 47 | hwbinder 48 | 7.1 49 | 50 | IDevicesFactory 51 | default 52 | 53 | 54 | 55 | android.hardware.audio.effect 56 | hwbinder 57 | 7.0 58 | 59 | IEffectsFactory 60 | default 61 | 62 | 63 | 64 | 65 | vendor.qti.hardware.dsp 66 | hwbinder 67 | 1.0 68 | 69 | IDspService 70 | dspservice 71 | 72 | 73 | 74 | android.hardware.gatekeeper 75 | 1 76 | 77 | IGatekeeper 78 | default 79 | 80 | 81 | 82 | 83 | android.hardware.nfc 84 | 1 85 | INfc/default 86 | 87 | 88 | vendor.nxp.nxpnfc_aidl 89 | 1 90 | INxpNfc/default 91 | 92 | 93 | android.hardware.secure_element 94 | 1 95 | ISecureElement/eSE1 96 | 97 | 98 | 99 | 100 | com.qualcomm.qti.uceservice 101 | hwbinder 102 | 2.3 103 | 104 | IUceService 105 | com.qualcomm.qti.uceservice 106 | 107 | 108 | 109 | 110 | vendor.qti.ims.callinfo 111 | hwbinder 112 | 1.0 113 | 114 | IService 115 | default 116 | 117 | 118 | 119 | 120 | com.qualcomm.qti.imscmservice 121 | hwbinder 122 | 2.2 123 | 124 | IImsCmService 125 | qti.ims.connectionmanagerservice 126 | 127 | 128 | 129 | vendor.qti.hardware.cacert 130 | hwbinder 131 | 1.0 132 | 133 | IService 134 | default 135 | 136 | 137 | 138 | 139 | vendor.qti.hardware.factory 140 | hwbinder 141 | 1.1 142 | 143 | IFactory 144 | default 145 | 146 | 147 | 148 | 149 | vendor.qti.hardware.secureprocessor.device 150 | hwbinder 151 | 1.0 152 | 153 | ISecureProcessor 154 | qti-tee 155 | qti-tvm 156 | 157 | 158 | 159 | 160 | android.hardware.bluetooth 161 | hwbinder 162 | 1.1 163 | 164 | IBluetoothHci 165 | default 166 | 167 | 168 | 169 | vendor.qti.hardware.bluetooth_audio 170 | hwbinder 171 | 2.1 172 | 173 | IBluetoothAudioProvidersFactory 174 | default 175 | 176 | 177 | 178 | vendor.qti.hardware.btconfigstore 179 | hwbinder 180 | 2.0 181 | 182 | IBTConfigStore 183 | default 184 | 185 | 186 | 187 | 188 | vendor.qti.hardware.fm 189 | hwbinder 190 | 1.0 191 | 192 | IFmHci 193 | default 194 | 195 | 196 | 197 | 198 | com.dsi.ant 199 | hwbinder 200 | 1.0 201 | 202 | IAnt 203 | default 204 | 205 | 206 | 207 | 208 | 209 | vendor.qti.hardware.wifi.wifilearner 210 | hwbinder 211 | 1.0 212 | 213 | IWifiStats 214 | wifiStats 215 | 216 | 217 | 218 | 219 | vendor.qti.hardware.bluetooth_sar 220 | hwbinder 221 | 1.1 222 | 223 | IBluetoothSar 224 | default 225 | 226 | 227 | 228 | 229 | vendor.qti.spu 230 | hwbinder 231 | 1.1 232 | 233 | ISPUManager 234 | default 235 | 236 | 237 | 238 | vendor.qti.spu 239 | hwbinder 240 | 2.0 241 | 242 | ISPUManager 243 | default 244 | 245 | 246 | 247 | vendor.qti.hardware.spu 248 | 2 249 | 250 | ISPUManager 251 | default 252 | 253 | 254 | 255 | android.hardware.security.keymint 256 | 3 257 | IKeyMintDevice/strongbox 258 | 259 | 260 | android.hardware.security.keymint 261 | 3 262 | IRemotelyProvisionedComponent/strongbox 263 | 264 | 265 | -------------------------------------------------------------------------------- /Android.mk: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2023 The Android Open Source Project 3 | # 4 | # SPDX-License-Identifier: Apache-2.0 5 | # 6 | 7 | LOCAL_PATH := $(call my-dir) 8 | 9 | ifeq ($(TARGET_DEVICE),houji) 10 | include $(call all-makefiles-under,$(LOCAL_PATH)) 11 | include $(CLEAR_VARS) 12 | 13 | # A/B builds require us to create the mount points at compile time. 14 | FIRMWARE_MOUNT_POINT := $(TARGET_OUT_VENDOR)/firmware_mnt 15 | $(FIRMWARE_MOUNT_POINT): $(LOCAL_INSTALLED_MODULE) 16 | @echo "Creating $(FIRMWARE_MOUNT_POINT)" 17 | @mkdir -p $(TARGET_OUT_VENDOR)/firmware_mnt 18 | 19 | BT_FIRMWARE_MOUNT_POINT := $(TARGET_OUT_VENDOR)/bt_firmware 20 | $(BT_FIRMWARE_MOUNT_POINT): $(LOCAL_INSTALLED_MODULE) 21 | @echo "Creating $(BT_FIRMWARE_MOUNT_POINT)" 22 | @mkdir -p $(TARGET_OUT_VENDOR)/bt_firmware 23 | 24 | DSP_MOUNT_POINT := $(TARGET_OUT_VENDOR)/dsp 25 | $(DSP_MOUNT_POINT): $(LOCAL_INSTALLED_MODULE) 26 | @echo "Creating $(DSP_MOUNT_POINT)" 27 | @mkdir -p $(TARGET_OUT_VENDOR)/dsp 28 | 29 | MODEM_FIRMWARE_MOUNT_POINT := $(TARGET_OUT_VENDOR)/modem_firmware 30 | $(MODEM_FIRMWARE_MOUNT_POINT): $(LOCAL_INSTALLED_MODULE) 31 | @echo "Creating $(MODEM_FIRMWARE_MOUNT_POINT)" 32 | @mkdir -p $(TARGET_OUT_VENDOR)/modem_firmware 33 | 34 | ALL_DEFAULT_INSTALLED_MODULES += \ 35 | $(FIRMWARE_MOUNT_POINT) \ 36 | $(BT_FIRMWARE_MOUNT_POINT) \ 37 | $(DSP_MOUNT_POINT) \ 38 | $(MODEM_FIRMWARE_MOUNT_POINT) 39 | 40 | VM_SYSTEM_MOUNT_POINT := $(TARGET_OUT_PRODUCT)/vm-system 41 | $(VM_SYSTEM_MOUNT_POINT): $(LOCAL_INSTALLED_MODULE) 42 | @echo "Creating $(VM_SYSTEM_MOUNT_POINT)" 43 | @mkdir -p $(TARGET_OUT_PRODUCT)/vm-system 44 | 45 | ALL_DEFAULT_INSTALLED_MODULES += \ 46 | $(VM_SYSTEM_MOUNT_POINT) 47 | 48 | IMS_LIBS := libimscamera_jni.so libimsmedia_jni.so 49 | IMS_SYMLINKS := $(addprefix $(TARGET_OUT_SYSTEM_EXT_APPS_PRIVILEGED)/ims/lib/arm64/,$(notdir $(IMS_LIBS))) 50 | $(IMS_SYMLINKS): $(LOCAL_INSTALLED_MODULE) 51 | @echo "Creating IMS lib link: $@" 52 | @mkdir -p $(dir $@) 53 | @rm -rf $@ 54 | $(hide) ln -sf /system_ext/lib64/$(notdir $@) $@ 55 | 56 | CNE_LIBS := libvndfwk_detect_jni.qti_vendor.so 57 | CNE_SYMLINKS := $(addprefix $(TARGET_OUT_VENDOR_APPS)/CneApp/lib/arm64/,$(notdir $(CNE_LIBS))) 58 | $(CNE_SYMLINKS): $(LOCAL_INSTALLED_MODULE) 59 | @echo "Creating CNE lib link: $@" 60 | @mkdir -p $(dir $@) 61 | @rm -rf $@ 62 | $(hide) ln -sf /vendor/lib64/$(notdir $@) $@ 63 | 64 | EGL_LIB64_SYMLINKS := $(TARGET_OUT_VENDOR)/lib64 65 | $(EGL_LIB64_SYMLINKS): $(LOCAL_INSTALLED_MODULE) 66 | @echo "Creating EGL lib64 symlinks: $@" 67 | @mkdir -p $@ 68 | $(hide) ln -sf egl/libEGL_adreno.so $@/libEGL_adreno.so 69 | $(hide) ln -sf egl/libGLESv2_adreno.so $@/libGLESv2_adreno.so 70 | $(hide) ln -sf egl/libq3dtools_adreno.so $@/libq3dtools_adreno.so 71 | 72 | ALL_DEFAULT_INSTALLED_MODULES += \ 73 | $(CNE_SYMLINKS) \ 74 | $(IMS_SYMLINKS) \ 75 | $(EGL_LIB_SYMLINKS) \ 76 | $(EGL_LIB64_SYMLINKS) 77 | 78 | RFS_APQ_GNSS_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/apq/gnss/ 79 | $(RFS_APQ_GNSS_SYMLINKS): $(LOCAL_INSTALLED_MODULE) 80 | @echo "Creating RFS APQ GNSS folder structure: $@" 81 | @rm -rf $@/* 82 | @mkdir -p $(dir $@)/readonly/vendor 83 | $(hide) ln -sf /data/vendor/tombstones/rfs/modem $@/ramdumps 84 | $(hide) ln -sf /mnt/vendor/persist/rfs/apq/gnss $@/readwrite 85 | $(hide) ln -sf /mnt/vendor/persist/rfs/shared $@/shared 86 | $(hide) ln -sf /mnt/vendor/persist/hlos_rfs/shared $@/hlos 87 | $(hide) ln -sf /vendor/firmware_mnt $@/readonly/firmware 88 | $(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware 89 | 90 | ALL_DEFAULT_INSTALLED_MODULES += \ 91 | $(RFS_APQ_GNSS_SYMLINKS) 92 | 93 | RFS_MDM_ADSP_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/mdm/adsp/ 94 | $(RFS_MDM_ADSP_SYMLINKS): $(LOCAL_INSTALLED_MODULE) 95 | @echo "Creating RFS MDM ADSP folder structure: $@" 96 | @rm -rf $@/* 97 | @mkdir -p $(dir $@)/readonly/vendor 98 | $(hide) ln -sf /data/vendor/tombstones/rfs/lpass $@/ramdumps 99 | $(hide) ln -sf /mnt/vendor/persist/rfs/mdm/adsp $@/readwrite 100 | $(hide) ln -sf /mnt/vendor/persist/rfs/shared $@/shared 101 | $(hide) ln -sf /mnt/vendor/persist/hlos_rfs/shared $@/hlos 102 | $(hide) ln -sf /vendor/firmware_mnt $@/readonly/firmware 103 | $(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware 104 | 105 | RFS_MDM_CDSP_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/mdm/cdsp/ 106 | $(RFS_MDM_CDSP_SYMLINKS): $(LOCAL_INSTALLED_MODULE) 107 | @echo "Creating RFS MDM CDSP folder structure: $@" 108 | @rm -rf $@/* 109 | @mkdir -p $(dir $@)/readonly/vendor 110 | $(hide) ln -sf /data/vendor/tombstones/rfs/cdsp $@/ramdumps 111 | $(hide) ln -sf /mnt/vendor/persist/rfs/mdm/cdsp $@/readwrite 112 | $(hide) ln -sf /mnt/vendor/persist/rfs/shared $@/shared 113 | $(hide) ln -sf /mnt/vendor/persist/hlos_rfs/shared $@/hlos 114 | $(hide) ln -sf /vendor/firmware_mnt $@/readonly/firmware 115 | $(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware 116 | 117 | RFS_MDM_MPSS_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/mdm/mpss/ 118 | $(RFS_MDM_MPSS_SYMLINKS): $(LOCAL_INSTALLED_MODULE) 119 | @echo "Creating RFS MDM MPSS folder structure: $@" 120 | @rm -rf $@/* 121 | @mkdir -p $(dir $@)/readonly/vendor 122 | $(hide) ln -sf /data/vendor/tombstones/rfs/modem $@/ramdumps 123 | $(hide) ln -sf /mnt/vendor/persist/rfs/mdm/mpss $@/readwrite 124 | $(hide) ln -sf /mnt/vendor/persist/rfs/shared $@/shared 125 | $(hide) ln -sf /mnt/vendor/persist/hlos_rfs/shared $@/hlos 126 | $(hide) ln -sf /vendor/firmware_mnt $@/readonly/firmware 127 | $(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware 128 | 129 | RFS_MDM_SLPI_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/mdm/slpi/ 130 | $(RFS_MDM_SLPI_SYMLINKS): $(LOCAL_INSTALLED_MODULE) 131 | @echo "Creating RFS MDM SLPI folder structure: $@" 132 | @rm -rf $@/* 133 | @mkdir -p $(dir $@)/readonly/vendor 134 | $(hide) ln -sf /data/vendor/tombstones/rfs/slpi $@/ramdumps 135 | $(hide) ln -sf /mnt/vendor/persist/rfs/mdm/slpi $@/readwrite 136 | $(hide) ln -sf /mnt/vendor/persist/rfs/shared $@/shared 137 | $(hide) ln -sf /mnt/vendor/persist/hlos_rfs/shared $@/hlos 138 | $(hide) ln -sf /vendor/firmware_mnt $@/readonly/firmware 139 | $(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware 140 | 141 | RFS_MDM_TN_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/mdm/tn/ 142 | $(RFS_MDM_TN_SYMLINKS): $(LOCAL_INSTALLED_MODULE) 143 | @echo "Creating RFS MDM TN folder structure: $@" 144 | @rm -rf $@/* 145 | @mkdir -p $(dir $@)/readonly/vendor 146 | $(hide) ln -sf /data/vendor/tombstones/rfs/tn $@/ramdumps 147 | $(hide) ln -sf /mnt/vendor/persist/rfs/mdm/tn $@/readwrite 148 | $(hide) ln -sf /mnt/vendor/persist/rfs/shared $@/shared 149 | $(hide) ln -sf /mnt/vendor/persist/hlos_rfs/shared $@/hlos 150 | $(hide) ln -sf /vendor/firmware_mnt $@/readonly/firmware 151 | $(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware 152 | 153 | RFS_MDM_WPSS_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/mdm/wpss/ 154 | $(RFS_MDM_WPSS_SYMLINKS): $(LOCAL_INSTALLED_MODULE) 155 | @echo "Creating RFS MDM WPSS folder structure: $@" 156 | @rm -rf $@/* 157 | @mkdir -p $(dir $@)/readonly/vendor 158 | $(hide) ln -sf /data/vendor/tombstones/rfs/wpss $@/ramdumps 159 | $(hide) ln -sf /mnt/vendor/persist/rfs/mdm/wpss $@/readwrite 160 | $(hide) ln -sf /mnt/vendor/persist/rfs/shared $@/shared 161 | $(hide) ln -sf /mnt/vendor/persist/hlos_rfs/shared $@/hlos 162 | $(hide) ln -sf /vendor/firmware_mnt $@/readonly/firmware 163 | $(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware 164 | 165 | ALL_DEFAULT_INSTALLED_MODULES += \ 166 | $(RFS_MDM_ADSP_SYMLINKS) \ 167 | $(RFS_MDM_CDSP_SYMLINKS) \ 168 | $(RFS_MDM_MPSS_SYMLINKS) \ 169 | $(RFS_MDM_SLPI_SYMLINKS) \ 170 | $(RFS_MDM_TN_SYMLINKS) \ 171 | $(RFS_MDM_WPSS_SYMLINKS) 172 | 173 | RFS_MSM_ADSP_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/msm/adsp/ 174 | $(RFS_MSM_ADSP_SYMLINKS): $(LOCAL_INSTALLED_MODULE) 175 | @echo "Creating RFS MSM ADSP folder structure: $@" 176 | @rm -rf $@/* 177 | @mkdir -p $(dir $@)/readonly/vendor 178 | $(hide) ln -sf /data/vendor/tombstones/rfs/lpass $@/ramdumps 179 | $(hide) ln -sf /mnt/vendor/persist/rfs/msm/adsp $@/readwrite 180 | $(hide) ln -sf /mnt/vendor/persist/rfs/shared $@/shared 181 | $(hide) ln -sf /mnt/vendor/persist/hlos_rfs/shared $@/hlos 182 | $(hide) ln -sf /vendor/firmware_mnt $@/readonly/firmware 183 | $(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware 184 | 185 | RFS_MSM_CDSP_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/msm/cdsp/ 186 | $(RFS_MSM_CDSP_SYMLINKS): $(LOCAL_INSTALLED_MODULE) 187 | @echo "Creating RFS MSM CDSP folder structure: $@" 188 | @rm -rf $@/* 189 | @mkdir -p $(dir $@)/readonly/vendor 190 | $(hide) ln -sf /data/vendor/tombstones/rfs/cdsp $@/ramdumps 191 | $(hide) ln -sf /mnt/vendor/persist/rfs/msm/cdsp $@/readwrite 192 | $(hide) ln -sf /mnt/vendor/persist/rfs/shared $@/shared 193 | $(hide) ln -sf /mnt/vendor/persist/hlos_rfs/shared $@/hlos 194 | $(hide) ln -sf /vendor/firmware_mnt $@/readonly/firmware 195 | $(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware 196 | 197 | RFS_MSM_MPSS_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/msm/mpss/ 198 | $(RFS_MSM_MPSS_SYMLINKS): $(LOCAL_INSTALLED_MODULE) 199 | @echo "Creating RFS MSM MPSS folder structure: $@" 200 | @rm -rf $@/* 201 | @mkdir -p $(dir $@)/readonly/vendor 202 | $(hide) ln -sf /data/vendor/tombstones/rfs/modem $@/ramdumps 203 | $(hide) ln -sf /mnt/vendor/persist/rfs/msm/mpss $@/readwrite 204 | $(hide) ln -sf /mnt/vendor/persist/rfs/shared $@/shared 205 | $(hide) ln -sf /mnt/vendor/persist/hlos_rfs/shared $@/hlos 206 | $(hide) ln -sf /vendor/firmware_mnt $@/readonly/firmware 207 | $(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware 208 | 209 | RFS_MSM_SLPI_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/msm/slpi/ 210 | $(RFS_MSM_SLPI_SYMLINKS): $(LOCAL_INSTALLED_MODULE) 211 | @echo "Creating RFS MSM SLPI folder structure: $@" 212 | @rm -rf $@/* 213 | @mkdir -p $(dir $@)/readonly/vendor 214 | $(hide) ln -sf /data/vendor/tombstones/rfs/slpi $@/ramdumps 215 | $(hide) ln -sf /mnt/vendor/persist/rfs/msm/slpi $@/readwrite 216 | $(hide) ln -sf /mnt/vendor/persist/rfs/shared $@/shared 217 | $(hide) ln -sf /mnt/vendor/persist/hlos_rfs/shared $@/hlos 218 | $(hide) ln -sf /vendor/firmware_mnt $@/readonly/firmware 219 | $(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware 220 | 221 | RFS_MSM_WPSS_SYMLINKS := $(TARGET_OUT_VENDOR)/rfs/msm/wpss/ 222 | $(RFS_MSM_WPSS_SYMLINKS): $(LOCAL_INSTALLED_MODULE) 223 | @echo "Creating RFS MSM WPSS folder structure: $@" 224 | @rm -rf $@/* 225 | @mkdir -p $(dir $@)/readonly/vendor 226 | $(hide) ln -sf /data/vendor/tombstones/rfs/wpss $@/ramdumps 227 | $(hide) ln -sf /mnt/vendor/persist/rfs/msm/wpss $@/readwrite 228 | $(hide) ln -sf /mnt/vendor/persist/rfs/shared $@/shared 229 | $(hide) ln -sf /mnt/vendor/persist/hlos_rfs/shared $@/hlos 230 | $(hide) ln -sf /vendor/firmware_mnt $@/readonly/firmware 231 | $(hide) ln -sf /vendor/firmware $@/readonly/vendor/firmware 232 | 233 | ALL_DEFAULT_INSTALLED_MODULES += \ 234 | $(RFS_MSM_ADSP_SYMLINKS) \ 235 | $(RFS_MSM_CDSP_SYMLINKS) \ 236 | $(RFS_MSM_MPSS_SYMLINKS) \ 237 | $(RFS_MSM_SLPI_SYMLINKS) \ 238 | $(RFS_MSM_WPSS_SYMLINKS) 239 | 240 | FIRMWARE_WLAN_KIWI_V2_SYMLINKS := $(TARGET_OUT_VENDOR)/firmware/wlan/qca_cld/kiwi_v2/ 241 | $(FIRMWARE_WLAN_KIWI_V2_SYMLINKS): $(LOCAL_INSTALLED_MODULE) 242 | @echo "Creating firmware wlan qca_cld kiwi_v2 symlinks: $@" 243 | mkdir -p $@ 244 | $(hide) ln -sf /vendor/etc/wifi/kiwi_v2/WCNSS_qcom_cfg.ini $@/WCNSS_qcom_cfg.ini 245 | $(hide) ln -sf /mnt/vendor/persist/kiwi_v2/wlan_mac.bin $@/wlan_mac.bin 246 | 247 | FIRMWARE_WLANMDSP_SYMLINKS := $(TARGET_OUT_VENDOR)/firmware/ 248 | $(FIRMWARE_WLANMDSP_SYMLINKS): $(LOCAL_INSTALLED_MODULE) 249 | @echo "Creating firmware wlanmdsp.otaupdate symlinks: $@" 250 | mkdir -p $@ 251 | $(hide) ln -sf /data/vendor/firmware/wlanmdsp.mbn $@/wlanmdsp.otaupdate 252 | 253 | ALL_DEFAULT_INSTALLED_MODULES += \ 254 | $(FIRMWARE_WLAN_KIWI_V2_SYMLINKS) \ 255 | $(FIRMWARE_WLANMDSP_SYMLINKS) 256 | 257 | endif 258 | -------------------------------------------------------------------------------- /rootdir/bin/init.qcom.early_boot.sh: -------------------------------------------------------------------------------- 1 | #! /vendor/bin/sh 2 | 3 | # Copyright (c) 2012-2013,2016,2018-2020 The Linux Foundation. All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of The Linux Foundation nor 13 | # the names of its contributors may be used to endorse or promote 14 | # products derived from this software without specific prior written 15 | # permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 26 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 27 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | # 29 | 30 | export PATH=/vendor/bin 31 | 32 | # Set platform variables 33 | if [ -f /sys/devices/soc0/hw_platform ]; then 34 | soc_hwplatform=`cat /sys/devices/soc0/hw_platform` 2> /dev/null 35 | else 36 | soc_hwplatform=`cat /sys/devices/system/soc/soc0/hw_platform` 2> /dev/null 37 | fi 38 | if [ -f /sys/devices/soc0/soc_id ]; then 39 | soc_hwid=`cat /sys/devices/soc0/soc_id` 2> /dev/null 40 | else 41 | soc_hwid=`cat /sys/devices/system/soc/soc0/id` 2> /dev/null 42 | fi 43 | if [ -f /sys/devices/soc0/platform_version ]; then 44 | soc_hwver=`cat /sys/devices/soc0/platform_version` 2> /dev/null 45 | else 46 | soc_hwver=`cat /sys/devices/system/soc/soc0/platform_version` 2> /dev/null 47 | fi 48 | 49 | if [ -f /sys/class/drm/card0-DSI-1/modes ]; then 50 | echo "detect" > /sys/class/drm/card0-DSI-1/status 51 | mode_file=/sys/class/drm/card0-DSI-1/modes 52 | while read line; do 53 | fb_width=${line%%x*}; 54 | break; 55 | done < $mode_file 56 | elif [ -f /sys/class/graphics/fb0/virtual_size ]; then 57 | res=`cat /sys/class/graphics/fb0/virtual_size` 2> /dev/null 58 | fb_width=${res%,*} 59 | fi 60 | 61 | log -t BOOT -p i "MSM target '$1', SoC '$soc_hwplatform', HwID '$soc_hwid', SoC ver '$soc_hwver'" 62 | 63 | #For drm based display driver 64 | vbfile=/sys/module/drm/parameters/vblankoffdelay 65 | if [ -w $vbfile ]; then 66 | echo -1 > $vbfile 67 | else 68 | log -t DRM_BOOT -p w "file: '$vbfile' or perms doesn't exist" 69 | fi 70 | 71 | function set_density_by_fb() { 72 | project=`getprop ro.build.product` 73 | #put default density based on width 74 | if [ -z $fb_width ]; then 75 | case "$project" in 76 | "houji") 77 | setprop vendor.display.lcd_density 480 78 | ;; 79 | "shennong") 80 | setprop vendor.display.lcd_density 560 81 | ;; 82 | "manet") 83 | setprop vendor.display.lcd_density 560 84 | ;; 85 | *) 86 | setprop vendor.display.lcd_density 440 87 | ;; 88 | esac 89 | else 90 | if [ $fb_width -ge 1600 ]; then 91 | setprop vendor.display.lcd_density 640 92 | elif [ $fb_width -ge 1440 ]; then 93 | setprop vendor.display.lcd_density 560 94 | elif [ $fb_width -ge 1080 ]; then 95 | setprop vendor.display.lcd_density 480 96 | elif [ $fb_width -ge 720 ]; then 97 | setprop vendor.display.lcd_density 320 #for 720X1280 resolution 98 | elif [ $fb_width -ge 480 ]; then 99 | setprop vendor.display.lcd_density 240 #for 480X854 QRD resolution 100 | else 101 | setprop vendor.display.lcd_density 160 102 | fi 103 | case "$project" in 104 | "houji") 105 | setprop vendor.display.lcd_density 480 106 | ;; 107 | esac 108 | fi 109 | } 110 | 111 | target=`getprop ro.board.platform` 112 | case "$target" in 113 | "msm7630_surf" | "msm7630_1x" | "msm7630_fusion") 114 | case "$soc_hwplatform" in 115 | "FFA" | "SVLTE_FFA") 116 | # linking to surf_keypad_qwerty.kcm.bin instead of surf_keypad_numeric.kcm.bin so that 117 | # the UI keyboard works fine. 118 | ln -s /system/usr/keychars/surf_keypad_qwerty.kcm.bin /system/usr/keychars/surf_keypad.kcm.bin 119 | ;; 120 | "Fluid") 121 | setprop vendor.display.lcd_density 240 122 | setprop qcom.bt.dev_power_class 2 123 | ;; 124 | *) 125 | ln -s /system/usr/keychars/surf_keypad_qwerty.kcm.bin /system/usr/keychars/surf_keypad.kcm.bin 126 | ;; 127 | esac 128 | ;; 129 | "sm6150") 130 | case "$soc_hwplatform" in 131 | "ADP") 132 | setprop vendor.display.lcd_density 160 133 | ;; 134 | esac 135 | case "$soc_hwid" in 136 | 365|366) 137 | sku_ver=`cat /sys/devices/platform/soc/aa00000.qcom,vidc1/sku_version` 2> /dev/null 138 | setprop vendor.media.target.version 1 139 | if [ $sku_ver -eq 1 ]; then 140 | setprop vendor.media.target.version 2 141 | fi 142 | ;; 143 | 355|369|377|384) 144 | setprop vendor.chre.enabled 0 145 | ;; 146 | *) 147 | esac 148 | ;; 149 | "msm8660") 150 | case "$soc_hwplatform" in 151 | "Fluid") 152 | setprop vendor.display.lcd_density 240 153 | ;; 154 | "Dragon") 155 | setprop ro.sound.alsa "WM8903" 156 | ;; 157 | esac 158 | ;; 159 | 160 | "msm8960") 161 | # lcd density is write-once. Hence the separate switch case 162 | case "$soc_hwplatform" in 163 | "Liquid") 164 | if [ "$soc_hwver" == "196608" ]; then # version 0x30000 is 3D sku 165 | setprop ro.sf.hwrotation 90 166 | fi 167 | 168 | setprop vendor.display.lcd_density 160 169 | ;; 170 | "MTP") 171 | setprop vendor.display.lcd_density 240 172 | ;; 173 | *) 174 | case "$soc_hwid" in 175 | "109") 176 | setprop vendor.display.lcd_density 160 177 | ;; 178 | *) 179 | setprop vendor.display.lcd_density 240 180 | ;; 181 | esac 182 | ;; 183 | esac 184 | 185 | #Set up composition type based on the target 186 | case "$soc_hwid" in 187 | 87) 188 | #8960 189 | setprop debug.composition.type dyn 190 | ;; 191 | 153|154|155|156|157|138) 192 | #8064 V2 PRIME | 8930AB | 8630AB | 8230AB | 8030AB | 8960AB 193 | setprop debug.composition.type c2d 194 | ;; 195 | *) 196 | esac 197 | ;; 198 | 199 | "msm8974") 200 | case "$soc_hwplatform" in 201 | "Liquid") 202 | setprop vendor.display.lcd_density 160 203 | # Liquid do not have hardware navigation keys, so enable 204 | # Android sw navigation bar 205 | setprop ro.hw.nav_keys 0 206 | ;; 207 | "Dragon") 208 | setprop vendor.display.lcd_density 240 209 | ;; 210 | *) 211 | setprop vendor.display.lcd_density 320 212 | ;; 213 | esac 214 | ;; 215 | 216 | "msm8226") 217 | case "$soc_hwplatform" in 218 | *) 219 | setprop vendor.display.lcd_density 320 220 | ;; 221 | esac 222 | ;; 223 | 224 | "msm8610" | "apq8084" | "mpq8092") 225 | case "$soc_hwplatform" in 226 | *) 227 | setprop vendor.display.lcd_density 240 228 | ;; 229 | esac 230 | ;; 231 | "apq8084") 232 | case "$soc_hwplatform" in 233 | "Liquid") 234 | setprop vendor.display.lcd_density 320 235 | # Liquid do not have hardware navigation keys, so enable 236 | # Android sw navigation bar 237 | setprop ro.hw.nav_keys 0 238 | ;; 239 | "SBC") 240 | setprop vendor.display.lcd_density 200 241 | # SBC do not have hardware navigation keys, so enable 242 | # Android sw navigation bar 243 | setprop qemu.hw.mainkeys 0 244 | ;; 245 | *) 246 | setprop vendor.display.lcd_density 480 247 | ;; 248 | esac 249 | ;; 250 | "msm8996") 251 | case "$soc_hwplatform" in 252 | "Dragon") 253 | setprop vendor.display.lcd_density 240 254 | setprop qemu.hw.mainkeys 0 255 | ;; 256 | "ADP") 257 | setprop vendor.display.lcd_density 160 258 | setprop qemu.hw.mainkeys 0 259 | ;; 260 | "SBC") 261 | setprop vendor.display.lcd_density 240 262 | setprop qemu.hw.mainkeys 0 263 | ;; 264 | *) 265 | setprop vendor.display.lcd_density 560 266 | ;; 267 | esac 268 | ;; 269 | "msm8937" | "msm8940") 270 | # Set vendor.opengles.version based on chip id. 271 | # MSM8937 and MSM8940 variants supports OpenGLES 3.1 272 | # 196608 is decimal for 0x30000 to report version 3.0 273 | # 196609 is decimal for 0x30001 to report version 3.1 274 | # 196610 is decimal for 0x30002 to report version 3.2 275 | case "$soc_hwid" in 276 | 294|295|296|297|298|313|353|354|363|364) 277 | setprop vendor.opengles.version 196610 278 | if [ $soc_hwid = 354 ] 279 | then 280 | setprop vendor.media.target.version 1 281 | log -t BOOT -p i "SDM429 early_boot prop set for: HwID '$soc_hwid'" 282 | fi 283 | ;; 284 | 303|307|308|309|320) 285 | # Vulkan is not supported for 8917 variants 286 | setprop vendor.opengles.version 196608 287 | setprop persist.graphics.vulkan.disable true 288 | ;; 289 | *) 290 | setprop vendor.opengles.version 196608 291 | ;; 292 | esac 293 | ;; 294 | "msm8909") 295 | case "$soc_hwplatform" in 296 | *) 297 | setprop persist.graphics.vulkan.disable true 298 | ;; 299 | esac 300 | ;; 301 | "msm8998" | "apq8098_latv") 302 | case "$soc_hwplatform" in 303 | *) 304 | setprop vendor.display.lcd_density 560 305 | ;; 306 | esac 307 | ;; 308 | "sdm845") 309 | case "$soc_hwplatform" in 310 | *) 311 | if [ $fb_width -le 1600 ]; then 312 | setprop vendor.display.lcd_density 560 313 | else 314 | setprop vendor.display.lcd_density 640 315 | fi 316 | ;; 317 | esac 318 | ;; 319 | "msmnile") 320 | case "$soc_hwplatform" in 321 | *) 322 | if [ $fb_width -le 1600 ]; then 323 | setprop vendor.display.lcd_density 560 324 | else 325 | setprop vendor.display.lcd_density 640 326 | fi 327 | ;; 328 | esac 329 | ;; 330 | "kona") 331 | case "$soc_hwplatform" in 332 | *) 333 | setprop vendor.media.target_variant "_kona" 334 | if [ $fb_width -le 1600 ]; then 335 | setprop vendor.display.lcd_density 560 336 | else 337 | setprop vendor.display.lcd_density 640 338 | fi 339 | ;; 340 | esac 341 | ;; 342 | "lito") 343 | case "$soc_hwid" in 344 | 400|440) 345 | sku_ver=`cat /sys/devices/platform/soc/aa00000.qcom,vidc1/sku_version` 2> /dev/null 346 | if [ $sku_ver -eq 1 ]; then 347 | setprop vendor.media.target.version 1 348 | fi 349 | ;; 350 | 434|459) 351 | sku_ver=`cat /sys/devices/platform/soc/aa00000.qcom,vidc1/sku_version` 2> /dev/null 352 | setprop vendor.media.target.version 2 353 | if [ $sku_ver -eq 1 ]; then 354 | setprop vendor.media.target.version 3 355 | fi 356 | ;; 357 | esac 358 | ;; 359 | "bengal") 360 | case "$soc_hwid" in 361 | 441) 362 | setprop vendor.fastrpc.disable.cdsprpcd.daemon 1 363 | setprop vendor.gralloc.disable_ubwc 1 364 | 365 | # 196609 is decimal for 0x30001 to report version 3.1 366 | setprop vendor.opengles.version 196609 367 | ;; 368 | 471) 369 | #scuba APQ 370 | setprop vendor.gralloc.disable_ubwc 1 371 | ;; 372 | esac 373 | ;; 374 | "sdm710" | "msmpeafowl") 375 | case "$soc_hwplatform" in 376 | *) 377 | if [ $fb_width -le 1600 ]; then 378 | setprop vendor.display.lcd_density 560 379 | else 380 | setprop vendor.display.lcd_density 640 381 | fi 382 | 383 | sku_ver=`cat /sys/devices/platform/soc/aa00000.qcom,vidc1/sku_version` 2> /dev/null 384 | if [ $sku_ver -eq 1 ]; then 385 | setprop vendor.media.target.version 1 386 | fi 387 | ;; 388 | esac 389 | ;; 390 | "msm8953") 391 | cap_ver = 1 392 | if [ -e "/sys/devices/platform/soc/1d00000.qcom,vidc/capability_version" ]; then 393 | cap_ver=`cat /sys/devices/platform/soc/1d00000.qcom,vidc/capability_version` 2> /dev/null 394 | else 395 | cap_ver=`cat /sys/devices/soc/1d00000.qcom,vidc/capability_version` 2> /dev/null 396 | fi 397 | 398 | if [ $cap_ver -eq 1 ]; then 399 | setprop vendor.media.target.version 1 400 | fi 401 | ;; 402 | #Set property to differentiate SDM660 & SDM455 403 | #SOC ID for SDM455 is 385 404 | "sdm660") 405 | case "$soc_hwplatform" in 406 | *) 407 | if [ $fb_width -le 1600 ]; then 408 | setprop vendor.display.lcd_density 560 409 | else 410 | setprop vendor.display.lcd_density 640 411 | fi 412 | 413 | if [ $soc_hwid -eq 385 ]; then 414 | setprop vendor.media.target.version 1 415 | fi 416 | ;; 417 | esac 418 | ;; 419 | "holi") 420 | setprop vendor.media.target_variant "_holi" 421 | ;; 422 | esac 423 | 424 | baseband=`getprop ro.baseband` 425 | #enable atfwd daemon all targets except sda, apq, qcs 426 | case "$baseband" in 427 | "apq" | "sda" | "qcs" ) 428 | setprop persist.vendor.radio.atfwd.start false;; 429 | *) 430 | setprop persist.vendor.radio.atfwd.start true;; 431 | esac 432 | 433 | #set default lcd density 434 | #Since lcd density has read only 435 | #property, it will not overwrite previous set 436 | #property if any target is setting forcefully. 437 | set_density_by_fb 438 | 439 | 440 | # set Lilliput LCD density for ADP 441 | product=`getprop ro.board.platform` 442 | 443 | case "$product" in 444 | "msmnile_au") 445 | setprop vendor.display.lcd_density 160 446 | echo 902400000 > /sys/class/devfreq/soc:qcom,cpu0-cpu-l3-lat/min_freq 447 | echo 1612800000 > /sys/class/devfreq/soc:qcom,cpu0-cpu-l3-lat/max_freq 448 | echo 902400000 > /sys/class/devfreq/soc:qcom,cpu4-cpu-l3-lat/min_freq 449 | echo 1612800000 > /sys/class/devfreq/soc:qcom,cpu4-cpu-l3-lat/max_freq 450 | ;; 451 | *) 452 | ;; 453 | esac 454 | case "$product" in 455 | "sm6150_au") 456 | setprop vendor.display.lcd_density 160 457 | ;; 458 | *) 459 | ;; 460 | esac 461 | case "$product" in 462 | "sdmshrike_au") 463 | setprop vendor.display.lcd_density 160 464 | ;; 465 | *) 466 | ;; 467 | esac 468 | 469 | case "$product" in 470 | "msmnile_gvmq") 471 | setprop vendor.display.lcd_density 160 472 | ;; 473 | *) 474 | ;; 475 | esac 476 | # Setup display nodes & permissions 477 | # HDMI can be fb1 or fb2 478 | # Loop through the sysfs nodes and determine 479 | # the HDMI(dtv panel) 480 | 481 | function set_perms() { 482 | #Usage set_perms 483 | chown -h $2 $1 484 | chmod $3 $1 485 | } 486 | 487 | # check for the type of driver FB or DRM 488 | fb_driver=/sys/class/graphics/fb0 489 | if [ -e "$fb_driver" ] 490 | then 491 | # check for mdp caps 492 | file=/sys/class/graphics/fb0/mdp/caps 493 | if [ -f "$file" ] 494 | then 495 | setprop vendor.gralloc.disable_ubwc 1 496 | cat $file | while read line; do 497 | case "$line" in 498 | *"ubwc"*) 499 | setprop vendor.gralloc.enable_fb_ubwc 1 500 | setprop vendor.gralloc.disable_ubwc 0 501 | esac 502 | done 503 | fi 504 | else 505 | set_perms /sys/devices/virtual/hdcp/msm_hdcp/min_level_change system.graphics 0660 506 | fi 507 | 508 | # allow system_graphics group to access pmic secure_mode node 509 | set_perms /sys/class/lcd_bias/secure_mode system.graphics 0660 510 | set_perms /sys/class/leds/wled/secure_mode system.graphics 0660 511 | 512 | boot_reason=`cat /proc/sys/kernel/boot_reason` 513 | reboot_reason=`getprop ro.boot.alarmboot` 514 | if [ "$boot_reason" = "3" ] || [ "$reboot_reason" = "true" ]; then 515 | setprop ro.vendor.alarm_boot true 516 | else 517 | setprop ro.vendor.alarm_boot false 518 | fi 519 | 520 | # copy GPU frequencies to vendor property 521 | if [ -f /sys/class/kgsl/kgsl-3d0/gpu_available_frequencies ]; then 522 | gpu_freq=`cat /sys/class/kgsl/kgsl-3d0/gpu_available_frequencies` 2> /dev/null 523 | setprop vendor.gpu.available_frequencies "$gpu_freq" 524 | fi 525 | -------------------------------------------------------------------------------- /rootdir/bin/init.qcom.sh: -------------------------------------------------------------------------------- 1 | #! /vendor/bin/sh 2 | 3 | # Copyright (c) 2009-2016, The Linux Foundation. All rights reserved. 4 | # 5 | # Redistribution and use in source and binary forms, with or without 6 | # modification, are permitted provided that the following conditions are met: 7 | # * Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | # * Redistributions in binary form must reproduce the above copyright 10 | # notice, this list of conditions and the following disclaimer in the 11 | # documentation and/or other materials provided with the distribution. 12 | # * Neither the name of The Linux Foundation nor 13 | # the names of its contributors may be used to endorse or promote 14 | # products derived from this software without specific prior written 15 | # permission. 16 | # 17 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | # IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 20 | # NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 21 | # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 23 | # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 24 | # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 25 | # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 26 | # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 27 | # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | # 29 | 30 | target=`getprop ro.board.platform` 31 | low_ram=`getprop ro.config.low_ram` 32 | if [ -f /sys/devices/soc0/soc_id ]; then 33 | platformid=`cat /sys/devices/soc0/soc_id` 34 | else 35 | platformid=`cat /sys/devices/system/soc/soc0/id` 36 | fi 37 | 38 | start_battery_monitor() 39 | { 40 | if ls /sys/bus/spmi/devices/qpnp-bms-*/fcc_data ; then 41 | chown -h root.system /sys/module/pm8921_bms/parameters/* 42 | chown -h root.system /sys/module/qpnp_bms/parameters/* 43 | chown -h root.system /sys/bus/spmi/devices/qpnp-bms-*/fcc_data 44 | chown -h root.system /sys/bus/spmi/devices/qpnp-bms-*/fcc_temp 45 | chown -h root.system /sys/bus/spmi/devices/qpnp-bms-*/fcc_chgcyl 46 | chmod 0660 /sys/module/qpnp_bms/parameters/* 47 | chmod 0660 /sys/module/pm8921_bms/parameters/* 48 | mkdir -p /data/bms 49 | chown -h root.system /data/bms 50 | chmod 0770 /data/bms 51 | start battery_monitor 52 | fi 53 | } 54 | 55 | start_charger_monitor() 56 | { 57 | if ls /sys/module/qpnp_charger/parameters/charger_monitor; then 58 | chown -h root.system /sys/module/qpnp_charger/parameters/* 59 | chown -h root.system /sys/class/power_supply/battery/input_current_max 60 | chown -h root.system /sys/class/power_supply/battery/input_current_trim 61 | chown -h root.system /sys/class/power_supply/battery/input_current_settled 62 | chown -h root.system /sys/class/power_supply/battery/voltage_min 63 | chmod 0664 /sys/class/power_supply/battery/input_current_max 64 | chmod 0664 /sys/class/power_supply/battery/input_current_trim 65 | chmod 0664 /sys/class/power_supply/battery/input_current_settled 66 | chmod 0664 /sys/class/power_supply/battery/voltage_min 67 | chmod 0664 /sys/module/qpnp_charger/parameters/charger_monitor 68 | start charger_monitor 69 | fi 70 | } 71 | 72 | start_vm_bms() 73 | { 74 | if [ -e /dev/vm_bms ]; then 75 | chown -h root.system /sys/class/power_supply/bms/current_now 76 | chown -h root.system /sys/class/power_supply/bms/voltage_ocv 77 | chmod 0664 /sys/class/power_supply/bms/current_now 78 | chmod 0664 /sys/class/power_supply/bms/voltage_ocv 79 | start vm_bms 80 | fi 81 | } 82 | 83 | start_msm_irqbalance_8939() 84 | { 85 | if [ -f /vendor/bin/msm_irqbalance ]; then 86 | case "$platformid" in 87 | "239" | "293" | "294" | "295" | "304" | "338" | "313" | "353" | "354") 88 | start vendor.msm_irqbalance;; 89 | "349" | "350" ) 90 | start vendor.msm_irqbal_lb;; 91 | esac 92 | fi 93 | } 94 | 95 | start_msm_irqbalance_msmnile() 96 | { 97 | if [ -f /vendor/bin/msm_irqbalance ]; then 98 | start vendor.msm_irqbalance 99 | fi 100 | } 101 | 102 | start_msm_irqbalance_kona() 103 | { 104 | if [ -f /vendor/bin/msm_irqbalance ]; then 105 | start vendor.msm_irqbalance 106 | fi 107 | } 108 | 109 | start_msm_irqbalance_lito() 110 | { 111 | if [ -f /vendor/bin/msm_irqbalance ]; then 112 | start vendor.msm_irqbalance 113 | fi 114 | } 115 | 116 | start_msm_irqbalance_atoll() 117 | { 118 | if [ -f /vendor/bin/msm_irqbalance ]; then 119 | start vendor.msm_irqbalance 120 | fi 121 | } 122 | 123 | start_msm_irqbalance660() 124 | { 125 | if [ -f /vendor/bin/msm_irqbalance ]; then 126 | case "$platformid" in 127 | "317" | "321" | "324" | "325" | "326" | "336" | "345" | "346" | "360" | "393") 128 | start vendor.msm_irqbalance;; 129 | "318" | "327" | "385") 130 | start vendor.msm_irqbl_sdm630;; 131 | esac 132 | fi 133 | } 134 | 135 | start_msm_irqbalance() 136 | { 137 | if [ -f /vendor/bin/msm_irqbalance ]; then 138 | start vendor.msm_irqbalance 139 | fi 140 | } 141 | 142 | baseband=`getprop ro.baseband` 143 | echo 1 > /proc/sys/net/ipv6/conf/default/accept_ra_defrtr 144 | 145 | case "$baseband" in 146 | "svlte2a") 147 | start bridgemgrd 148 | ;; 149 | esac 150 | 151 | case "$target" in 152 | "msm7630_surf" | "msm7630_1x" | "msm7630_fusion") 153 | if [ -f /sys/devices/soc0/hw_platform ]; then 154 | value=`cat /sys/devices/soc0/hw_platform` 155 | else 156 | value=`cat /sys/devices/system/soc/soc0/hw_platform` 157 | fi 158 | case "$value" in 159 | "Fluid") 160 | start profiler_daemon;; 161 | esac 162 | ;; 163 | "msm8660" ) 164 | if [ -f /sys/devices/soc0/hw_platform ]; then 165 | platformvalue=`cat /sys/devices/soc0/hw_platform` 166 | else 167 | platformvalue=`cat /sys/devices/system/soc/soc0/hw_platform` 168 | fi 169 | case "$platformvalue" in 170 | "Fluid") 171 | start profiler_daemon;; 172 | esac 173 | ;; 174 | "msm8960") 175 | case "$baseband" in 176 | "msm") 177 | start_battery_monitor;; 178 | esac 179 | 180 | if [ -f /sys/devices/soc0/hw_platform ]; then 181 | platformvalue=`cat /sys/devices/soc0/hw_platform` 182 | else 183 | platformvalue=`cat /sys/devices/system/soc/soc0/hw_platform` 184 | fi 185 | case "$platformvalue" in 186 | "Fluid") 187 | start profiler_daemon;; 188 | "Liquid") 189 | start profiler_daemon;; 190 | esac 191 | ;; 192 | "msm8974") 193 | platformvalue=`cat /sys/devices/soc0/hw_platform` 194 | case "$platformvalue" in 195 | "Fluid") 196 | start profiler_daemon;; 197 | "Liquid") 198 | start profiler_daemon;; 199 | esac 200 | case "$baseband" in 201 | "msm") 202 | start_battery_monitor 203 | ;; 204 | esac 205 | start_charger_monitor 206 | ;; 207 | "sdm660") 208 | if [ -f /sys/devices/soc0/soc_id ]; then 209 | soc_id=`cat /sys/devices/soc0/soc_id` 210 | else 211 | soc_id=`cat /sys/devices/system/soc/soc0/id` 212 | fi 213 | 214 | if [ -f /sys/devices/soc0/hw_platform ]; then 215 | hw_platform=`cat /sys/devices/soc0/hw_platform` 216 | else 217 | hw_platform=`cat /sys/devices/system/soc/soc0/hw_platform` 218 | fi 219 | 220 | case "$soc_id" in 221 | "317" | "324" | "325" | "326" | "318" | "327" ) 222 | case "$hw_platform" in 223 | "Surf") 224 | setprop qemu.hw.mainkeys 0 225 | ;; 226 | "MTP") 227 | setprop qemu.hw.mainkeys 0 228 | ;; 229 | "RCM") 230 | setprop qemu.hw.mainkeys 0 231 | ;; 232 | "QRD") 233 | setprop qemu.hw.mainkeys 0 234 | ;; 235 | esac 236 | ;; 237 | esac 238 | start_msm_irqbalance660 239 | ;; 240 | "apq8084") 241 | platformvalue=`cat /sys/devices/soc0/hw_platform` 242 | case "$platformvalue" in 243 | "Fluid") 244 | start profiler_daemon;; 245 | "Liquid") 246 | start profiler_daemon;; 247 | esac 248 | ;; 249 | "msm8226") 250 | start_charger_monitor 251 | ;; 252 | "msm8610") 253 | start_charger_monitor 254 | ;; 255 | "msm8916") 256 | start_vm_bms 257 | start_msm_irqbalance_8939 258 | if [ -f /sys/devices/soc0/soc_id ]; then 259 | soc_id=`cat /sys/devices/soc0/soc_id` 260 | else 261 | soc_id=`cat /sys/devices/system/soc/soc0/id` 262 | fi 263 | 264 | if [ -f /sys/devices/soc0/platform_subtype_id ]; then 265 | platform_subtype_id=`cat /sys/devices/soc0/platform_subtype_id` 266 | fi 267 | if [ -f /sys/devices/soc0/hw_platform ]; then 268 | hw_platform=`cat /sys/devices/soc0/hw_platform` 269 | fi 270 | case "$soc_id" in 271 | "239") 272 | case "$hw_platform" in 273 | "Surf") 274 | case "$platform_subtype_id" in 275 | "1") 276 | setprop qemu.hw.mainkeys 0 277 | ;; 278 | esac 279 | ;; 280 | "MTP") 281 | case "$platform_subtype_id" in 282 | "3") 283 | setprop qemu.hw.mainkeys 0 284 | ;; 285 | esac 286 | ;; 287 | esac 288 | ;; 289 | esac 290 | ;; 291 | "msm8994" | "msm8992" | "msm8998" | "apq8098_latv" | "sdm845" | "sdm710" | "qcs605" | "sm6150" | "trinket" | "bengal") 292 | start_msm_irqbalance 293 | ;; 294 | "msm8996") 295 | if [ -f /sys/devices/soc0/hw_platform ]; then 296 | hw_platform=`cat /sys/devices/soc0/hw_platform` 297 | fi 298 | case "$hw_platform" in 299 | "MTP" | "CDP") 300 | #Loop through the sysfs nodes and determine the correct sysfs to change the permission and ownership. 301 | for count in 0 1 2 3 4 5 6 7 8 9 10 302 | do 303 | dir="/sys/devices/soc/75ba000.i2c/i2c-12/12-0020/input/input"$count 304 | if [ -d "$dir" ]; then 305 | chmod 0660 $dir/secure_touch_enable 306 | chmod 0440 $dir/secure_touch 307 | chown system.drmrpc $dir/secure_touch_enable 308 | chown system.drmrpc $dir/secure_touch 309 | break 310 | fi 311 | done 312 | ;; 313 | esac 314 | ;; 315 | "msm8909") 316 | start_vm_bms 317 | ;; 318 | "msmnile") 319 | start_msm_irqbalance_msmnile 320 | ;; 321 | "kona") 322 | start_msm_irqbalance_kona 323 | ;; 324 | "lito") 325 | start_msm_irqbalance_lito 326 | ;; 327 | "atoll") 328 | start_msm_irqbalance_atoll 329 | ;; 330 | "msm8937") 331 | start_msm_irqbalance_8939 332 | if [ -f /sys/devices/soc0/soc_id ]; then 333 | soc_id=`cat /sys/devices/soc0/soc_id` 334 | else 335 | soc_id=`cat /sys/devices/system/soc/soc0/id` 336 | fi 337 | 338 | if [ -f /sys/devices/soc0/hw_platform ]; then 339 | hw_platform=`cat /sys/devices/soc0/hw_platform` 340 | else 341 | hw_platform=`cat /sys/devices/system/soc/soc0/hw_platform` 342 | fi 343 | if [ "$low_ram" != "true" ]; then 344 | case "$soc_id" in 345 | "294" | "295" | "303" | "307" | "308" | "309" | "313" | "320" | "353" | "354" | "363" | "364") 346 | case "$hw_platform" in 347 | "Surf") 348 | setprop qemu.hw.mainkeys 0 349 | ;; 350 | "MTP") 351 | setprop qemu.hw.mainkeys 0 352 | ;; 353 | "RCM") 354 | setprop qemu.hw.mainkeys 0 355 | ;; 356 | "QRD") 357 | setprop qemu.hw.mainkeys 0 358 | ;; 359 | esac 360 | ;; 361 | esac 362 | fi 363 | ;; 364 | "msm8953") 365 | start_msm_irqbalance_8939 366 | if [ -f /sys/devices/soc0/soc_id ]; then 367 | soc_id=`cat /sys/devices/soc0/soc_id` 368 | else 369 | soc_id=`cat /sys/devices/system/soc/soc0/id` 370 | fi 371 | 372 | if [ -f /sys/devices/soc0/hw_platform ]; then 373 | hw_platform=`cat /sys/devices/soc0/hw_platform` 374 | else 375 | hw_platform=`cat /sys/devices/system/soc/soc0/hw_platform` 376 | fi 377 | case "$soc_id" in 378 | "293" | "304" | "338" | "351" | "349" | "350" ) 379 | case "$hw_platform" in 380 | "Surf") 381 | setprop qemu.hw.mainkeys 0 382 | ;; 383 | "MTP") 384 | setprop qemu.hw.mainkeys 0 385 | ;; 386 | "RCM") 387 | setprop qemu.hw.mainkeys 0 388 | ;; 389 | "QRD") 390 | setprop qemu.hw.mainkeys 0 391 | ;; 392 | esac 393 | ;; 394 | esac 395 | ;; 396 | "sdm710") 397 | if [ -f /sys/devices/soc0/soc_id ]; then 398 | soc_id=`cat /sys/devices/soc0/soc_id` 399 | else 400 | soc_id=`cat /sys/devices/system/soc/soc0/id` 401 | fi 402 | 403 | if [ -f /sys/devices/soc0/hw_platform ]; then 404 | hw_platform=`cat /sys/devices/soc0/hw_platform` 405 | else 406 | hw_platform=`cat /sys/devices/system/soc/soc0/hw_platform` 407 | fi 408 | case "$soc_id" in 409 | "336" | "337" | "347" | "360" | "393" ) 410 | case "$hw_platform" in 411 | "Surf") 412 | setprop qemu.hw.mainkeys 0 413 | ;; 414 | "MTP") 415 | setprop qemu.hw.mainkeys 0 416 | ;; 417 | "RCM") 418 | setprop qemu.hw.mainkeys 0 419 | ;; 420 | "QRD") 421 | setprop qemu.hw.mainkeys 0 422 | ;; 423 | esac 424 | ;; 425 | esac 426 | ;; 427 | esac 428 | 429 | # 430 | # Make modem config folder and copy firmware config to that folder for RIL 431 | # 432 | 433 | # wait for mbnota process finished, Max wait time 0.5 * 20 seconds 434 | 435 | retry_time=0 436 | while [ "$retry_time" -lt 20 ] 437 | do 438 | log -p i -t "init.qcom.sh" "retry_time is $retry_time" 439 | MBNOTAPID=`getprop init.svc.vendor.mbnota` 440 | log -p i -t "init.qcom.sh" "MBNOTAPID is $MBNOTAPID" 441 | if [ "$MBNOTAPID" == "running" ]; then 442 | log -p i -t "init.qcom.sh" "process is exist" 443 | let retry_time++ 444 | sleep 0.5 445 | continue 446 | else 447 | log -p i -t "init.qcom.sh" "process is not exist" 448 | break 449 | fi 450 | done 451 | 452 | 453 | if [ -f /data/vendor/mbnconfig/image/modem_pr/mcfg/configs/mbn_build_utc.txt ]; then 454 | # for mbnota design 455 | if [ -f /data/vendor/modem_config/mbn_build_utc.txt ]; then 456 | prev_version_info=`cat /data/vendor/modem_config/mbn_build_utc.txt` 457 | else 458 | prev_version_info="" 459 | fi 460 | 461 | cur_version_info=`cat /data/vendor/mbnconfig/image/modem_pr/mcfg/configs/mbn_build_utc.txt` 462 | if [ "$prev_version_info" != "$cur_version_info" ]; then 463 | # add W for group recursively before delete 464 | chmod g+w -R /data/vendor/modem_config/* 465 | rm -rf /data/vendor/modem_config/* 466 | # preserve the read only mode for all subdir and files 467 | log -p i -t "init.qcom.sh" "copy start" 468 | cp --preserve=m -dr /data/vendor/mbnconfig/image/modem_pr/mcfg/configs/* /data/vendor/modem_config 469 | cp --preserve=m -d /data/vendor/mbnconfig/image/modem_pr/mbn_ota.txt /data/vendor/modem_config/ 470 | # the group must be root, otherwise this script could not add "W" for group recursively 471 | chown -hR radio.root /data/vendor/modem_config/* 472 | log -p i -t "init.qcom.sh" "copy end" 473 | fi 474 | else 475 | # for legacy design 476 | if [ -f /data/vendor/modem_config/ver_info.txt ]; then 477 | prev_version_info=`cat /data/vendor/modem_config/ver_info.txt` 478 | else 479 | prev_version_info="" 480 | fi 481 | 482 | cur_version_info=`cat /vendor/modem_firmware/verinfo/ver_info.txt` 483 | if [ ! -f /vendor/modem_firmware/verinfo/ver_info.txt -o "$prev_version_info" != "$cur_version_info" ]; then 484 | # add W for group recursively before delete 485 | chmod g+w -R /data/vendor/modem_config/* 486 | rm -rf /data/vendor/modem_config/* 487 | # preserve the read only mode for all subdir and files 488 | cp --preserve=m -dr /vendor/modem_firmware/image/modem_pr/mcfg/configs/* /data/vendor/modem_config 489 | cp --preserve=m -d /vendor/modem_firmware/verinfo/ver_info.txt /data/vendor/modem_config/ 490 | cp --preserve=m -d /vendor/modem_firmware/image/modem_pr/mbn_ota.txt /data/vendor/modem_config/ 491 | # the group must be root, otherwise this script could not add "W" for group recursively 492 | chown -hR radio.root /data/vendor/modem_config/* 493 | fi 494 | fi 495 | chmod g-w /data/vendor/modem_config 496 | setprop ro.vendor.ril.mbn_copy_completed 1 497 | 498 | #check build variant for printk logging 499 | #current default minimum boot-time-default 500 | buildvariant=`getprop ro.build.type` 501 | case "$buildvariant" in 502 | "userdebug" | "eng") 503 | #set default loglevel to KERN_INFO 504 | echo "6 6 1 7" > /proc/sys/kernel/printk 505 | ;; 506 | *) 507 | #set default loglevel to KERN_WARNING 508 | echo "4 4 1 4" > /proc/sys/kernel/printk 509 | ;; 510 | esac 511 | -------------------------------------------------------------------------------- /configs/vintf/compatibility_matrix.xiaomi.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.fingerprints.extension 4 | 3.0 5 | 6 | IFingerprintSensorTest 7 | default 8 | 9 | 10 | 11 | com.fingerprints.extension 12 | 3.0 13 | 14 | IFingerprintNavigation 15 | default 16 | 17 | 18 | 19 | com.fingerprints.extension3 20 | 21 | IFingerprintNavigation 22 | default 23 | 24 | 25 | IFingerprintSensorTest 26 | default 27 | 28 | 29 | 30 | vendor.dolby.hardware.dms 31 | 2.0 32 | 33 | IDms 34 | default 35 | 36 | 37 | 38 | vendor.rongcard.hardware.eid 39 | 1.0 40 | 41 | IEidDevice 42 | default 43 | 44 | 45 | 46 | vendor.xiaomi.cit.bluetooth 47 | 1.0 48 | 49 | IBluetoothService 50 | default 51 | 52 | 53 | 54 | vendor.xiaomi.cit.bluetooth 55 | 56 | IBluetoothService 57 | default 58 | 59 | 60 | 61 | vendor.xiaomi.cit.wifi 62 | 1.0 63 | 64 | IWifiService 65 | default 66 | 67 | 68 | 69 | vendor.xiaomi.cit.wifi 70 | 71 | IWifiService 72 | default 73 | 74 | 75 | 76 | vendor.xiaomi.hardware.aidlbgservice 77 | 78 | IBGService 79 | default 80 | 81 | 82 | 83 | vendor.xiaomi.hardware.antdtx 84 | 1.0 85 | 86 | IAntdtxService 87 | default 88 | 89 | 90 | 91 | vendor.xiaomi.hardware.aon 92 | 93 | IAlwaysOn 94 | miaonservicehal 95 | 96 | 97 | 98 | vendor.xiaomi.hardware.bgservice 99 | 1.0 100 | 101 | IBGService 102 | default 103 | 104 | 105 | 106 | vendor.xiaomi.hardware.bgservice 107 | 1.0 108 | 109 | IBGService 110 | default 111 | 112 | 113 | 114 | vendor.xiaomi.hardware.blackbox 115 | 116 | IBlackboxImpl 117 | default 118 | 119 | 120 | 121 | vendor.xiaomi.hardware.campostproc 122 | 1.0 123 | 124 | IMiPostProcService 125 | default 126 | 127 | 128 | 129 | vendor.xiaomi.hardware.citsensorservice 130 | 1.1 131 | 132 | ICitSensorService 133 | default 134 | 135 | 136 | 137 | vendor.xiaomi.hardware.citvendorservice 138 | 1.0 139 | 140 | ICitVendorService 141 | default 142 | 143 | 144 | 145 | vendor.xiaomi.hardware.cld 146 | 1.0 147 | 148 | ICld 149 | default 150 | 151 | 152 | 153 | vendor.xiaomi.hardware.displayfeature 154 | 1.0 155 | 156 | IDisplayFeature 157 | default 158 | 159 | 160 | 161 | vendor.xiaomi.hardware.displayfeature 162 | 1.0 163 | 164 | IDisplayFeature 165 | default 166 | 167 | 168 | 169 | vendor.xiaomi.hardware.displayfeature_aidl 170 | 2 171 | 172 | IDisplayFeature 173 | default 174 | 175 | 176 | 177 | vendor.xiaomi.hardware.dtool 178 | 1.0 179 | 180 | IDtool 181 | default 182 | 183 | 184 | 185 | vendor.xiaomi.hardware.dtool1 186 | 187 | IDtool 188 | default 189 | 190 | 191 | 192 | vendor.xiaomi.hardware.fbo 193 | 1.0 194 | 195 | IFbo 196 | default 197 | 198 | 199 | 200 | vendor.xiaomi.hardware.fingerprintextension 201 | 1.0 202 | 203 | IXiaomiFingerprint 204 | default 205 | 206 | 207 | 208 | vendor.xiaomi.hardware.fingerprintextension 209 | 210 | IXiaomiFingerprint 211 | default 212 | 213 | 214 | 215 | vendor.xiaomi.hardware.fx.tunnel 216 | 1.0 217 | 218 | IMiFxTunnel 219 | default 220 | 221 | 222 | 223 | vendor.xiaomi.hardware.fx.tunnel 224 | 225 | IMiFxTunnel 226 | default 227 | 228 | 229 | 230 | vendor.xiaomi.hardware.keyboardnanoapp 231 | 1.0 232 | 233 | IKeyboardNanoapp 234 | default 235 | 236 | 237 | 238 | vendor.xiaomi.hardware.mfidoca 239 | 1.0 240 | 241 | IFidoService 242 | default 243 | 244 | 245 | 246 | vendor.xiaomi.hardware.micharge 247 | 1.0 248 | 249 | IMiCharge 250 | default 251 | 252 | 253 | 254 | vendor.xiaomi.hardware.micharge 255 | 256 | IMiCharge 257 | default 258 | 259 | 260 | 261 | vendor.xiaomi.hardware.midevauth 262 | 1.0 263 | 2.0 264 | 265 | IMidevauthService 266 | default 267 | 268 | 269 | 270 | vendor.xiaomi.hardware.miface 271 | 1.0 272 | 273 | IMiFace 274 | default 275 | 276 | 277 | 278 | vendor.xiaomi.hardware.mimd 279 | 1.0 280 | 281 | IMimd 282 | default 283 | 284 | 285 | 286 | vendor.xiaomi.hardware.mioob 287 | 1.0 288 | 289 | IMiOob 290 | default 291 | 292 | 293 | 294 | vendor.xiaomi.hardware.miperf 295 | 1.0 296 | 297 | IMiPerf 298 | default 299 | 300 | 301 | 302 | vendor.xiaomi.hardware.miriskmanager 303 | 1.0 304 | 305 | IMiRiskManager 306 | default 307 | 308 | 309 | 310 | vendor.xiaomi.hardware.misight 311 | 312 | ILogMgr 313 | default 314 | 315 | 316 | IMiSight 317 | default 318 | 319 | 320 | 321 | vendor.xiaomi.hardware.misight 322 | 323 | ILogMgr 324 | default 325 | 326 | 327 | IMiSight 328 | default 329 | 330 | 331 | 332 | vendor.xiaomi.hardware.misys 333 | 1.0 334 | 335 | IMiSys 336 | default 337 | 338 | 339 | 340 | vendor.xiaomi.hardware.misys 341 | 2.0 342 | 343 | IMiSys 344 | default 345 | 346 | 347 | 348 | vendor.xiaomi.hardware.misys 349 | 3.0 350 | 351 | IMiSys 352 | default 353 | 354 | 355 | 356 | vendor.xiaomi.hardware.misys 357 | 4.0 358 | 359 | IMiSys 360 | default 361 | 362 | 363 | 364 | vendor.xiaomi.hardware.misys.common 365 | 366 | IMiSysImpl 367 | default 368 | 369 | 370 | 371 | vendor.xiaomi.hardware.misys.core 372 | 373 | IMiSysCore 374 | default 375 | 376 | 377 | 378 | vendor.xiaomi.hardware.mitrustedui 379 | 380 | IMiTrustedUIService 381 | default 382 | 383 | 384 | 385 | vendor.xiaomi.hardware.mlipay 386 | 1.0-1 387 | 388 | IMlipayService 389 | default 390 | 391 | 392 | 393 | vendor.xiaomi.hardware.mrm 394 | 395 | IMrm 396 | default 397 | 398 | 399 | 400 | vendor.xiaomi.hardware.mrm 401 | 402 | IMiCertificate 403 | default 404 | 405 | 406 | 407 | vendor.xiaomi.hardware.mrm 408 | 409 | IMrmRemoteAuth 410 | default 411 | 412 | 413 | 414 | vendor.xiaomi.hardware.mtdservice 415 | 1.0-3 416 | 417 | IMTService 418 | default 419 | 420 | 421 | 422 | vendor.xiaomi.hardware.otrpagent 423 | 1.0 424 | 425 | IOTrPAgent 426 | default 427 | 428 | 429 | 430 | vendor.xiaomi.hardware.otrpagent 431 | 2.0 432 | 433 | IOTrPAgent 434 | default 435 | 436 | 437 | 438 | vendor.xiaomi.hardware.quickcamera 439 | 1.0 440 | 441 | IQuickCameraService 442 | default 443 | 444 | 445 | 446 | vendor.xiaomi.hardware.quickcamera 447 | 448 | IQuickCameraService 449 | default 450 | 451 | 452 | 453 | vendor.xiaomi.hardware.satellite 454 | 1.0 455 | 456 | INTNRadio 457 | satellite_slot1 458 | 459 | 460 | 461 | vendor.xiaomi.hardware.seccam 462 | 463 | IMiSecCam 464 | default 465 | 466 | 467 | 468 | vendor.xiaomi.hardware.swap 469 | 1.0 470 | 471 | ISwap 472 | default 473 | 474 | 475 | 476 | vendor.xiaomi.hardware.tidaservice 477 | 1.0-2 478 | 479 | ITidaService 480 | default 481 | 482 | 483 | 484 | vendor.xiaomi.hardware.touchfeature 485 | 1.0 486 | 487 | ITouchFeature 488 | default 489 | 490 | 491 | 492 | vendor.xiaomi.hardware.vibratorfeature 493 | 1.0 494 | 495 | IVibratorFeature 496 | default 497 | 498 | 499 | 500 | vendor.xiaomi.hardware.vsimapp 501 | 1.0 502 | 503 | IVSIMService 504 | default 505 | 506 | 507 | 508 | vendor.xiaomi.hidl.minet 509 | 1.0 510 | 511 | IMiNetService 512 | default 513 | 514 | 515 | 516 | vendor.xiaomi.hidl.miwill 517 | 1.0 518 | 519 | IMiwillService 520 | default 521 | 522 | 523 | 524 | vendor.xiaomi.hw.touchfeature 525 | 1.0 526 | 527 | ITouchFeature 528 | default 529 | 530 | 531 | 532 | vendor.xiaomi.modem.qms 533 | 1.0 534 | 535 | IMiQms 536 | default 537 | 538 | 539 | 540 | vendor.xiaomi.mslg.keeper 541 | 1.0 542 | 543 | IMSLgKeeper 544 | default 545 | 546 | 547 | 548 | vendor.xiaomi.sensor.citsensorservice 549 | 550 | ICitSensorService 551 | default 552 | 553 | 554 | 555 | vendor.xiaomi.sensor.citsensorservice 556 | 1.1 557 | 558 | ICitSensorService 559 | default 560 | 561 | 562 | 563 | vendor.xiaomi.sensor.citsensorservice 564 | 2.0 565 | 566 | ICitSensorService 567 | default 568 | 569 | 570 | 571 | vendor.xiaomi.sensor.communicate 572 | 1.0 573 | 574 | ISensorCommunicate 575 | default 576 | 577 | 578 | 579 | 580 | --------------------------------------------------------------------------------