peridot: Switch to source built usb and gadget service

Change-Id: Id1c43d7eac61d41021d55cbbacd34a411871198e
This commit is contained in:
AdarshGrewal
2025-08-16 01:01:57 +05:30
parent ea8a53bf20
commit 7f21c9e03b
11 changed files with 0 additions and 2244 deletions

View File

@@ -554,24 +554,6 @@ prebuilt_etc_xml {
soc_specific: true,
}
prebuilt_etc_xml {
name: "android.hardware.usb-service.qti.xml",
owner: "xiaomi",
src: "proprietary/vendor/etc/vintf/manifest/android.hardware.usb-service.qti.xml",
filename_from_src: true,
sub_dir: "vintf/manifest",
soc_specific: true,
}
prebuilt_etc_xml {
name: "android.hardware.usb.gadget-service.qti.xml",
owner: "xiaomi",
src: "proprietary/vendor/etc/vintf/manifest/android.hardware.usb.gadget-service.qti.xml",
filename_from_src: true,
sub_dir: "vintf/manifest",
soc_specific: true,
}
prebuilt_etc_xml {
name: "android.hardware.weaver-service.nxp.xml",
owner: "xiaomi",

View File

@@ -1063,8 +1063,6 @@ PRODUCT_COPY_FILES += \
vendor/xiaomi/peridot/proprietary/vendor/bin/hw/android.hardware.secure_element-service.qti:$(TARGET_COPY_OUT_VENDOR)/bin/hw/android.hardware.secure_element-service.qti \
vendor/xiaomi/peridot/proprietary/vendor/bin/hw/android.hardware.security.keymint-service-qti:$(TARGET_COPY_OUT_VENDOR)/bin/hw/android.hardware.security.keymint-service-qti \
vendor/xiaomi/peridot/proprietary/vendor/bin/hw/android.hardware.security.keymint-service.strongbox-nxp:$(TARGET_COPY_OUT_VENDOR)/bin/hw/android.hardware.security.keymint-service.strongbox-nxp \
vendor/xiaomi/peridot/proprietary/vendor/bin/hw/android.hardware.usb-service.qti:$(TARGET_COPY_OUT_VENDOR)/bin/hw/android.hardware.usb-service.qti \
vendor/xiaomi/peridot/proprietary/vendor/bin/hw/android.hardware.usb.gadget-service.qti:$(TARGET_COPY_OUT_VENDOR)/bin/hw/android.hardware.usb.gadget-service.qti \
vendor/xiaomi/peridot/proprietary/vendor/bin/hw/android.hardware.weaver-service.nxp-qti:$(TARGET_COPY_OUT_VENDOR)/bin/hw/android.hardware.weaver-service.nxp-qti \
vendor/xiaomi/peridot/proprietary/vendor/bin/hw/mfp-daemon:$(TARGET_COPY_OUT_VENDOR)/bin/hw/mfp-daemon \
vendor/xiaomi/peridot/proprietary/vendor/bin/hw/qconfigservice:$(TARGET_COPY_OUT_VENDOR)/bin/hw/qconfigservice \
@@ -1091,7 +1089,6 @@ PRODUCT_COPY_FILES += \
vendor/xiaomi/peridot/proprietary/vendor/bin/ims_rtp_daemon:$(TARGET_COPY_OUT_VENDOR)/bin/ims_rtp_daemon \
vendor/xiaomi/peridot/proprietary/vendor/bin/imsdaemon:$(TARGET_COPY_OUT_VENDOR)/bin/imsdaemon \
vendor/xiaomi/peridot/proprietary/vendor/bin/init.qcom.sensors.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qcom.sensors.sh \
vendor/xiaomi/peridot/proprietary/vendor/bin/init.qcom.usb.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qcom.usb.sh \
vendor/xiaomi/peridot/proprietary/vendor/bin/init.qti.graphics.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qti.graphics.sh \
vendor/xiaomi/peridot/proprietary/vendor/bin/init.qti.write.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.qti.write.sh \
vendor/xiaomi/peridot/proprietary/vendor/bin/irsc_util:$(TARGET_COPY_OUT_VENDOR)/bin/irsc_util \
@@ -1322,8 +1319,6 @@ PRODUCT_COPY_FILES += \
vendor/xiaomi/peridot/proprietary/vendor/etc/init/android.hardware.secure_element-service.qti.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/android.hardware.secure_element-service.qti.rc \
vendor/xiaomi/peridot/proprietary/vendor/etc/init/android.hardware.security.keymint-service-qti.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/android.hardware.security.keymint-service-qti.rc \
vendor/xiaomi/peridot/proprietary/vendor/etc/init/android.hardware.security.keymint-service.strongbox-nxp.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/android.hardware.security.keymint-service.strongbox-nxp.rc \
vendor/xiaomi/peridot/proprietary/vendor/etc/init/android.hardware.usb-service.qti.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/android.hardware.usb-service.qti.rc \
vendor/xiaomi/peridot/proprietary/vendor/etc/init/android.hardware.usb.gadget-service.qti.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/android.hardware.usb.gadget-service.qti.rc \
vendor/xiaomi/peridot/proprietary/vendor/etc/init/android.hardware.weaver-service.nxp.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/android.hardware.weaver-service.nxp.rc \
vendor/xiaomi/peridot/proprietary/vendor/etc/init/cnd.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/cnd.rc \
vendor/xiaomi/peridot/proprietary/vendor/etc/init/com.qualcomm.qti.wifidisplayhal@1.0-service.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/com.qualcomm.qti.wifidisplayhal@1.0-service.rc \
@@ -1334,7 +1329,6 @@ PRODUCT_COPY_FILES += \
vendor/xiaomi/peridot/proprietary/vendor/etc/init/hw/init.batterysecret.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.batterysecret.rc \
vendor/xiaomi/peridot/proprietary/vendor/etc/init/hw/init.mi_ambient.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.mi_ambient.rc \
vendor/xiaomi/peridot/proprietary/vendor/etc/init/hw/init.mi_thermald.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.mi_thermald.rc \
vendor/xiaomi/peridot/proprietary/vendor/etc/init/hw/init.qcom.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.qcom.usb.rc \
vendor/xiaomi/peridot/proprietary/vendor/etc/init/hw/init.qti.kernel.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.qti.kernel.rc \
vendor/xiaomi/peridot/proprietary/vendor/etc/init/ims-dataservice-daemon.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/ims-dataservice-daemon.rc \
vendor/xiaomi/peridot/proprietary/vendor/etc/init/ims_rtp_daemon.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/ims_rtp_daemon.rc \
@@ -1552,7 +1546,6 @@ PRODUCT_COPY_FILES += \
vendor/xiaomi/peridot/proprietary/vendor/etc/thermal-engine.conf:$(TARGET_COPY_OUT_VENDOR)/etc/thermal-engine.conf \
vendor/xiaomi/peridot/proprietary/vendor/etc/thermal-map.conf:$(TARGET_COPY_OUT_VENDOR)/etc/thermal-map.conf \
vendor/xiaomi/peridot/proprietary/vendor/etc/thermald-devices.conf:$(TARGET_COPY_OUT_VENDOR)/etc/thermald-devices.conf \
vendor/xiaomi/peridot/proprietary/vendor/etc/usb_compositions.conf:$(TARGET_COPY_OUT_VENDOR)/etc/usb_compositions.conf \
vendor/xiaomi/peridot/proprietary/vendor/etc/usecaseKvManager.xml:$(TARGET_COPY_OUT_VENDOR)/etc/usecaseKvManager.xml \
vendor/xiaomi/peridot/proprietary/vendor/etc/wfdconfig.xml:$(TARGET_COPY_OUT_VENDOR)/etc/wfdconfig.xml \
vendor/xiaomi/peridot/proprietary/vendor/etc/xtwifi.conf:$(TARGET_COPY_OUT_VENDOR)/etc/xtwifi.conf \
@@ -2802,8 +2795,6 @@ PRODUCT_PACKAGES += \
android.hardware.security.keymint-service-qti.xml \
android.hardware.security.keymint3-service.strongbox-nxp.xml \
android.hardware.security.sharedsecret3-service.strongbox-nxp.xml \
android.hardware.usb-service.qti.xml \
android.hardware.usb.gadget-service.qti.xml \
android.hardware.weaver-service.nxp.xml \
atfwd-saidl.xml \
bttpi-saidl.xml \

View File

@@ -1,210 +0,0 @@
#!/vendor/bin/sh
# Copyright (c) 2012-2018, 2020-2021 The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of The Linux Foundation nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Changes from Qualcomm Innovation Center are provided under the following license:
# Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause-Clear
#
# Set platform variables
soc_hwplatform=`cat /sys/devices/soc0/hw_platform 2> /dev/null`
soc_machine=`cat /sys/devices/soc0/machine 2> /dev/null`
soc_machine=${soc_machine:0:2}
soc_id=`cat /sys/devices/soc0/soc_id 2> /dev/null`
#
# Check ESOC for external modem
#
# Note: currently only a single MDM/SDX is supported
#
esoc_name=`cat /sys/bus/esoc/devices/esoc0/esoc_name 2> /dev/null`
target=`getprop ro.board.platform`
#
# Override USB default composition
#
if [ "$(getprop ro.build.type)" != "user" ]; then
# If USB persist config not set, set default configuration
if [ "$(getprop persist.vendor.usb.config)" == "" ]; then
if [ "$esoc_name" != "" ]; then
setprop persist.vendor.usb.config diag,diag_mdm,qdss,qdss_mdm,serial_cdev,dpl,rmnet,adb
else
case "$(getprop ro.baseband)" in
"apq")
setprop persist.vendor.usb.config diag,adb
;;
*)
case "$soc_hwplatform" in
"Dragon" | "SBC")
setprop persist.vendor.usb.config diag,adb
;;
*)
case "$soc_machine" in
"SA")
setprop persist.vendor.usb.config diag,adb
;;
*)
case "$target" in
"msm8996")
setprop persist.vendor.usb.config diag,serial_cdev,serial_tty,rmnet_ipa,mass_storage,adb
;;
"msm8909")
setprop persist.vendor.usb.config diag,serial_smd,rmnet_qti_bam,adb
;;
"msm8937")
if [ -d /config/usb_gadget ]; then
setprop persist.vendor.usb.config diag,serial_cdev,rmnet,dpl,adb
else
case "$soc_id" in
"313" | "320")
setprop persist.vendor.usb.config diag,serial_smd,rmnet_ipa,adb
;;
*)
setprop persist.vendor.usb.config diag,serial_smd,rmnet_qti_bam,adb
;;
esac
fi
;;
"msm8953")
if [ -d /config/usb_gadget ]; then
setprop persist.vendor.usb.config diag,serial_cdev,rmnet,dpl,adb
else
setprop persist.vendor.usb.config diag,serial_smd,rmnet_ipa,adb
fi
;;
"msm8998" | "sdm660" | "apq8098_latv")
setprop persist.vendor.usb.config diag,serial_cdev,rmnet,adb
;;
"monaco")
setprop persist.vendor.usb.config diag,qdss,rmnet,adb
;;
"sdm845" | "sdm710")
setprop persist.vendor.usb.config diag,serial_cdev,rmnet,dpl,adb
;;
"msmnile" | "sm6150" | "trinket" | "lito" | "atoll" | "bengal" | "lahaina" | "holi" | \
"taro" | "kalama" | "pineapple" | "blair" | "pitti" )
setprop persist.vendor.usb.config diag,serial_cdev,rmnet,dpl,qdss,adb
;;
"gen4")
setprop persist.vendor.usb.config adb
;;
*)
setprop persist.vendor.usb.config diag,adb
;;
esac
;;
esac
;;
esac
;;
esac
fi
fi
fi
# This check is needed for GKI 1.0 targets where QDSS is not available
if [ "$(getprop persist.vendor.usb.config)" == "diag,serial_cdev,rmnet,dpl,qdss,adb" -a \
! -d /config/usb_gadget/g1/functions/qdss.qdss ]; then
setprop persist.vendor.usb.config diag,serial_cdev,rmnet,dpl,adb
fi
# Start peripheral mode on primary USB controllers for Automotive platforms
case "$soc_machine" in
"SA")
if [ -f /sys/bus/platform/devices/a600000.ssusb/mode ]; then
default_mode=`cat /sys/bus/platform/devices/a600000.ssusb/mode`
case "$default_mode" in
"none")
echo peripheral > /sys/bus/platform/devices/a600000.ssusb/mode
;;
esac
fi
;;
esac
# check configfs is mounted or not
if [ -d /config/usb_gadget ]; then
machine_type=`cat /sys/devices/soc0/machine`
# Chip ID & serial are used for unique MSM identification in Product String
# If not present, then omit them instead of using 0x00000000
msm_chipid=`cat /sys/devices/soc0/nproduct_id`;
if [ "$msm_chipid" != "" ]; then
msm_chipid_hex=`printf _CID:%04X $msm_chipid`
fi
msm_serial=`cat /sys/devices/soc0/serial_number`;
if [ "$msm_serial" != "" ]; then
msm_serial_hex=`printf _SN:%08X $msm_serial`
fi
setprop vendor.usb.product_string "$machine_type-$soc_hwplatform$msm_chipid_hex$msm_serial_hex"
# ADB requires valid iSerialNumber; if ro.serialno is missing, use dummy
serialnumber=`cat /config/usb_gadget/g1/strings/0x409/serialnumber 2> /dev/null`
if [ "$serialnumber" == "" ]; then
serialno=1234567
echo $serialno > /config/usb_gadget/g1/strings/0x409/serialnumber
fi
setprop vendor.usb.configfs 1
fi
# update product
if [ "$(getprop ro.boot.factorybuild)" != "1" ]; then
marketname=`getprop ro.product.odm.marketname`
if [ "$marketname" != "" ]; then
setprop vendor.usb.product_string "$marketname"
else
setprop vendor.usb.product_string "$(getprop ro.product.model)"
fi
fi
#
# Initialize RNDIS Diag option. If unset, set it to 'none'.
#
diag_extra=`getprop persist.vendor.usb.config.extra`
if [ "$diag_extra" == "" ]; then
setprop persist.vendor.usb.config.extra none
fi
# enable rps cpus on msm8937 target
setprop vendor.usb.rps_mask 0
case "$soc_id" in
"294" | "295" | "353" | "354")
setprop vendor.usb.rps_mask 40
;;
esac
#
# Initialize UVC conifguration.
#
if [ -d /config/usb_gadget/g1/functions/uvc.0 ]; then
setprop vendor.usb.uvc.function.init 1
fi

View File

@@ -1,7 +0,0 @@
# Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause-Clear
service vendor.usb-hal /vendor/bin/hw/android.hardware.usb-service.qti
class hal
user system
group system mtp usb

View File

@@ -1,7 +0,0 @@
# Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause-Clear
service vendor.usbgadget-hal /vendor/bin/hw/android.hardware.usb.gadget-service.qti
class hal
user system
group system mtp usb

File diff suppressed because it is too large Load Diff

View File

@@ -1,73 +0,0 @@
# /vendor/etc/usb_compositions.conf: HSUSB VID PID supported compositions
#
# This file lists the vendor supported vid-pid compositions for HSUSB that are
# referenced in UsbGadget.cpp. Use the specified format below for compositions,
# where right-most column is the actual order of properties; these are few
# cases where adb does not appear in the end of the composition
#
# <properties> <vid> <pid> <actual order of properties>
mass_storage 0x05C6 0xF000
mass_storage,adb 0x05C6 0x9015 adb,mass_storage
diag,adb 0x05C6 0x901D
diag,adb,serial_cdev 0x05C6 0x901F
diag 0x05C6 0x900E
diag,serial_cdev,rmnet,adb 0x05C6 0x9091
diag,serial_cdev,rmnet 0x05C6 0x9092
rndis 0x2717 0xFF80
rndis,adb 0x2717 0xFF88
rndis,diag 0x05C6 0x902C
rndis,diag,adb 0x05C6 0x902D
rndis,serial_cdev 0x05C6 0x90B3
rndis,serial_cdev,adb 0x05C6 0x90B4
rndis,serial_cdev,diag 0x05C6 0x90B5
rndis,serial_cdev,diag,adb 0x05C6 0x90B6
mtp,diag 0x05C6 0x901B
mtp,diag,adb 0x05C6 0x903A
diag,qdss 0x05C6 0x904A diag,qdss_debug
diag,qdss,adb 0x05C6 0x9060 diag,qdss_debug,adb
rndis,diag,qdss 0x05C6 0x9081 rndis,diag,qdss_debug
rndis,diag,qdss,adb 0x05C6 0x9082 rndis,diag,qdss_debug,adb
diag,qdss,rmnet 0x05C6 0x9083 diag,qdss_debug,rmnet
diag,qdss,rmnet,adb 0x05C6 0x9084 diag,qdss_debug,adb,rmnet
ncm 0x05C6 0xA4A1
ncm,adb 0x05C6 0x908C
diag,serial_cdev 0x05C6 0x9004
diag,serial_cdev,rmnet,dpl 0x05C6 0x90B7
diag,serial_cdev,rmnet,dpl,adb 0x05C6 0x90B8
rndis,diag,dpl 0x05C6 0x90BF
rndis,diag,dpl,adb 0x05C6 0x90C0
ccid 0x05C6 0x90CE
ccid,adb 0x05C6 0x90CF
ccid,diag 0x05C6 0x90D0
ccid,diag,adb 0x05C6 0x90D1
diag,serial_cdev,rmnet,ccid 0x05C6 0x90D2
diag,serial_cdev,rmnet,ccid,adb 0x05C6 0x90D3
diag,diag_mdm,qdss,qdss_mdm,serial_cdev,serial_cdev_mdm,rmnet 0x05C6 0x90D7
diag,diag_mdm,qdss,qdss_mdm,serial_cdev,serial_cdev_mdm,rmnet,adb 0x05C6 0x90D8
diag,diag_mdm,qdss,qdss_mdm,serial_cdev,serial_cdev_mdm,dpl,rmnet 0x05C6 0x90DD
diag,diag_mdm,qdss,qdss_mdm,serial_cdev,serial_cdev_mdm,dpl,rmnet,adb 0x05C6 0x90DE
diag,serial_cdev,rmnet,dpl,qdss 0x05C6 0x90DC
diag,serial_cdev,rmnet,dpl,qdss,adb 0x05C6 0x90DB
diag,uac2,adb 0x05C6 0x90CA diag,adb,uac2
diag,uac2 0x05C6 0x901C
diag,uvc,adb 0x05C6 0x90CB diag,adb,uvc
diag,uvc 0x05C6 0x90DF
diag,uac2,uvc,adb 0x05C6 0x90CC diag,adb,uac2,uvc
diag,uac2,uvc 0x05C6 0x90E0
diag,diag_mdm,qdss,qdss_mdm,serial_cdev,dpl,rmnet 0x05C6 0x90E4
diag,diag_mdm,qdss,qdss_mdm,serial_cdev,dpl,rmnet,adb 0x05C6 0x90E5
rndis,diag,diag_mdm,qdss,qdss_mdm,serial_cdev,dpl 0x05C6 0x90E6
rndis,diag,diag_mdm,qdss,qdss_mdm,serial_cdev,dpl,adb 0x05C6 0x90E7
rndis,diag,qdss,serial_cdev,dpl 0x05C6 0x90E8
rndis,diag,qdss,serial_cdev,dpl,adb 0x05C6 0x90E9
diag,diag_mdm,adb 0x05C6 0x90D9
diag,diag_mdm,diag_mdm2,qdss,qdss_mdm,serial_cdev,dpl,rmnet 0x05C6 0x90F6
diag,diag_mdm,diag_mdm2,qdss,qdss_mdm,serial_cdev,dpl,rmnet,adb 0x05C6 0x90F7
rndis,diag,diag_mdm,diag_mdm2,qdss,qdss_mdm,serial_cdev,dpl 0x05C6 0x90F8
rndis,diag,diag_mdm,diag_mdm2,qdss,qdss_mdm,serial_cdev,dpl,adb 0x05C6 0x90F9
diag,diag_mdm,adb,ccid 0x05C6 0x9044 diag,diag_mdm,adb,ccid
diag,diag_mdm,qdss_mdm,dpl,adb 0x05C6 0x90FF
diag,qdss,dpl,adb 0x05C6 0x9104
diag,dpl 0x05C6 0x9105
diag,diag_cnss,serial_cdev,rmnet,dpl,qdss,adb 0x05C6 0x9110
diag,diag_cnss,serial_cdev,rmnet,dpl,qdss 0x05C6 0x9111

View File

@@ -1,13 +0,0 @@
<!-- Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause-Clear
-->
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.usb</name>
<version>1</version>
<interface>
<name>IUsb</name>
<instance>default</instance>
</interface>
</hal>
</manifest>

View File

@@ -1,13 +0,0 @@
<!-- Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
SPDX-License-Identifier: BSD-3-Clause-Clear
-->
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.usb.gadget</name>
<version>1</version>
<interface>
<name>IUsbGadget</name>
<instance>default</instance>
</interface>
</hal>
</manifest>