├── .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 | 
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