diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-07 04:48:19 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-07-07 04:48:19 +0000 |
commit | 46e83fa3f7ec126c890ccbf44e5b03fcdae721ec (patch) | |
tree | 122ace51887910533f7b104c3611621393fd6d1b | |
parent | 033d693ee7925a185366c88e690b3fded5b45e46 (diff) | |
parent | 62ab920a8e734fa141317b65e6a9e8dd9da794ff (diff) | |
download | dragonboard-46e83fa3f7ec126c890ccbf44e5b03fcdae721ec.tar.gz |
Snap for 10453563 from 62ab920a8e734fa141317b65e6a9e8dd9da794ff to mainline-media-releaseaml_med_341711000aml_med_341619000aml_med_341513600aml_med_341312300aml_med_341312020aml_med_341111000aml_med_341011000aml_med_340922010android14-mainline-media-release
Change-Id: I765a24de32df7e1bca6332ccc4abd736e0845c21
-rw-r--r-- | Android.mk | 1 | ||||
-rw-r--r-- | common.kl | 113 | ||||
-rw-r--r-- | db845c/BoardConfig.mk | 18 | ||||
-rw-r--r-- | db845c/device.mk | 2 | ||||
-rw-r--r-- | device-common.mk | 13 | ||||
-rwxr-xr-x | fetch-vendor-package.sh | 8 | ||||
-rw-r--r-- | full.mk | 10 | ||||
-rw-r--r-- | init.common.rc | 1 | ||||
-rw-r--r-- | init.common.usb.rc | 6 | ||||
-rw-r--r-- | manifest.xml | 13 | ||||
-rw-r--r-- | mini.mk | 2 | ||||
-rw-r--r-- | overlay/frameworks/base/core/res/res/values/config.xml | 8 | ||||
-rw-r--r-- | product.prop | 35 | ||||
-rw-r--r-- | qcom/pd-mapper/pd-mapper.c | 1 | ||||
-rw-r--r-- | qcom/qrtr/Makefile | 2 | ||||
-rw-r--r-- | qcom/qrtr/lib/libqrtr.h | 5 | ||||
-rw-r--r-- | qcom/qrtr/lib/qmi.c | 26 | ||||
-rw-r--r-- | qcom/qrtr/lib/qrtr.c | 4 | ||||
-rw-r--r-- | qcom/qrtr/src/list.h | 4 | ||||
-rw-r--r-- | qcom/qrtr/src/lookup.c | 2 | ||||
-rw-r--r-- | qcom/rmtfs/rmtfs.c | 9 | ||||
-rw-r--r-- | qcom/rmtfs/rmtfs.h | 1 | ||||
-rw-r--r-- | qcom/rmtfs/rproc.c | 122 | ||||
-rw-r--r-- | qcom/rmtfs/storage.c | 23 | ||||
-rw-r--r-- | rb5/BoardConfig.mk | 9 | ||||
-rw-r--r-- | rb5/device.mk | 2 | ||||
-rw-r--r-- | sepolicy/app.te | 2 | ||||
-rw-r--r-- | sepolicy/file_contexts | 1 | ||||
-rw-r--r-- | sepolicy/genfs_contexts | 1 | ||||
-rw-r--r-- | sm8450/BoardConfig.mk | 1 | ||||
-rwxr-xr-x | vendor-package-ver.sh | 6 |
31 files changed, 238 insertions, 213 deletions
@@ -31,7 +31,6 @@ $(eval $(call declare-1p-copy-files,device/linaro/dragonboard,.rc)) $(eval $(call declare-1p-copy-files,device/linaro/dragonboard,.sh)) $(eval $(call declare-1p-copy-files,device/linaro/dragonboard,.xml)) $(eval $(call declare-1p-copy-files,device/linaro/dragonboard,fstab.db845c)) -$(eval $(call declare-1p-copy-files,device/linaro/dragonboard,fstab.pixel3_mainline)) $(eval $(call declare-1p-copy-files,device/linaro/dragonboard,fstab.rb5)) # If some modules are built directly from this directory (not subdirectories), diff --git a/common.kl b/common.kl deleted file mode 100644 index a1302da..0000000 --- a/common.kl +++ /dev/null @@ -1,113 +0,0 @@ -# Copyright (C) 2010 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# -# Generic key layout file for full alphabetic US English PC style external keyboards. -# -# This file is intentionally very generic and is intended to support a broad rang of keyboards. -# Do not edit the generic key layout to support a specific keyboard; instead, create -# a new key layout file with the required keyboard configuration. -# - -key 399 GRAVE -key 1 BACK -key 2 1 -key 3 2 -key 4 3 -key 5 4 -key 6 5 -key 7 6 -key 8 7 -key 9 8 -key 10 9 -key 11 0 -key 158 BACK WAKE_DROPPED -key 230 SOFT_RIGHT WAKE -key 60 SOFT_RIGHT WAKE -key 107 ENDCALL WAKE_DROPPED -key 62 ENDCALL WAKE_DROPPED -key 229 MENU WAKE_DROPPED -key 139 MENU WAKE_DROPPED -key 59 MENU WAKE_DROPPED -key 127 SEARCH WAKE_DROPPED -key 217 SEARCH WAKE_DROPPED -key 228 POUND -key 227 STAR -key 231 CALL WAKE_DROPPED -key 61 CALL WAKE_DROPPED -key 232 DPAD_CENTER WAKE_DROPPED -key 108 DPAD_DOWN WAKE_DROPPED -key 103 DPAD_UP WAKE_DROPPED -key 102 HOME WAKE -key 105 DPAD_LEFT WAKE_DROPPED -key 106 DPAD_RIGHT WAKE_DROPPED -key 115 VOLUME_UP -key 114 VOLUME_DOWN -key 116 POWER WAKE -key 212 CAMERA - -key 16 Q -key 17 W -key 18 E -key 19 R -key 20 T -key 21 Y -key 22 U -key 23 I -key 24 O -key 25 P -key 26 LEFT_BRACKET -key 27 RIGHT_BRACKET -key 43 BACKSLASH - -key 30 A -key 31 S -key 32 D -key 33 F -key 34 G -key 35 H -key 36 J -key 37 K -key 38 L -key 39 SEMICOLON -key 40 APOSTROPHE -key 14 DEL - -key 44 Z -key 45 X -key 46 C -key 47 V -key 48 B -key 49 N -key 50 M -key 51 COMMA -key 52 PERIOD -key 53 SLASH -key 28 ENTER - -key 56 ALT_LEFT -key 100 ALT_RIGHT -key 42 SHIFT_LEFT -key 54 SHIFT_RIGHT -key 15 TAB -key 57 SPACE -key 150 EXPLORER -key 155 ENVELOPE - -key 12 MINUS -key 13 EQUALS -key 215 AT - - -key 82 MENU WAKE diff --git a/db845c/BoardConfig.mk b/db845c/BoardConfig.mk index 018213a..644f9a8 100644 --- a/db845c/BoardConfig.mk +++ b/db845c/BoardConfig.mk @@ -21,24 +21,28 @@ TARGET_NO_KERNEL := false BOARD_INCLUDE_DTB_IN_BOOTIMG := true ifeq ($(TARGET_USES_BOOT_HDR_V3), true) BOARD_BOOT_HEADER_VERSION := 3 - BOARD_KERNEL_PAGESIZE := 4096 - BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE := 103079215104 #96M + BOARD_KERNEL_CMDLINE += androidboot.hardware=db845c androidboot.boot_devices=soc@0/1d84000.ufshc + BOARD_KERNEL_CMDLINE += androidboot.verifiedbootstate=orange else - BOARD_BOOT_HEADER_VERSION := 2 - BOARD_KERNEL_PAGESIZE := 2048 + BOARD_BOOT_HEADER_VERSION := 4 + BOARD_BOOTCONFIG += androidboot.hardware=db845c androidboot.boot_devices=soc@0/1d84000.ufshc + BOARD_BOOTCONFIG += androidboot.verifiedbootstate=orange endif BOARD_MKBOOTIMG_ARGS := --header_version $(BOARD_BOOT_HEADER_VERSION) BOARD_KERNEL_BASE := 0x80000000 -BOARD_KERNEL_CMDLINE := earlycon firmware_class.path=/vendor/firmware/ androidboot.hardware=db845c -BOARD_KERNEL_CMDLINE += init=/init androidboot.boot_devices=soc@0/1d84000.ufshc printk.devkmsg=on +BOARD_KERNEL_PAGESIZE := 4096 +BOARD_KERNEL_CMDLINE += earlycon firmware_class.path=/vendor/firmware/ +BOARD_KERNEL_CMDLINE += init=/init printk.devkmsg=on BOARD_KERNEL_CMDLINE += deferred_probe_timeout=30 BOARD_KERNEL_CMDLINE += pcie_pme=nomsi #For WiFi to work on rb5 BOARD_KERNEL_CMDLINE += qcom_geni_serial.con_enabled=1 +BOARD_KERNEL_CMDLINE += console=ttyMSM0,115200n8 # Image Configuration BOARD_BOOTIMAGE_PARTITION_SIZE := 103079215104 #96M +BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE := 103079215104 #96M BOARD_USERDATAIMAGE_PARTITION_SIZE := 21474836480 #20G -BOARD_FLASH_BLOCK_SIZE := 512 +BOARD_FLASH_BLOCK_SIZE := 4096 # Super partition BOARD_SUPER_PARTITION_SIZE := 12437225472 BOARD_DB_DYNAMIC_PARTITIONS_SIZE := 12433031168 # Reserve 4M for DAP metadata diff --git a/db845c/device.mk b/db845c/device.mk index 63e24a1..ef754c1 100644 --- a/db845c/device.mk +++ b/db845c/device.mk @@ -25,7 +25,7 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota.mk) endif # Build generic Audio HAL -PRODUCT_PACKAGES := audio.primary.db845c +PRODUCT_PACKAGES += audio.primary.db845c # BootControl HAL PRODUCT_PACKAGES += \ diff --git a/device-common.mk b/device-common.mk index 6601cda..d2d2036 100644 --- a/device-common.mk +++ b/device-common.mk @@ -21,6 +21,7 @@ TARGET_USES_GKI ?= true ifeq ($(TARGET_USES_GKI), true) TARGET_MODS := $(wildcard $(TARGET_KERNEL_DIR)/*.ko) ifneq ($(TARGET_MODS),) + BOARD_DO_NOT_STRIP_VENDOR_RAMDISK_MODULES := true BOARD_VENDOR_RAMDISK_KERNEL_MODULES := $(TARGET_MODS) endif endif @@ -38,16 +39,14 @@ ifneq (,$(wildcard $(LINARO_VENDOR_PATH)/db845c/$(EXPECTED_LINARO_VENDOR_VERSION include $(LINARO_VENDOR_PATH)/db845c/$(EXPECTED_LINARO_VENDOR_VERSION)/version.mk ifneq ($(TARGET_LINARO_VENDOR_VERSION), $(EXPECTED_LINARO_VENDOR_VERSION)) $(warning TARGET_LINARO_VENDOR_VERSION ($(TARGET_LINARO_VENDOR_VERSION)) does not match exiting the build ($(EXPECTED_LINARO_VENDOR_VERSION)).) - $(warning Please download new binaries here:) - $(warning $(VND_PKG_URL) ) - $(warning And extract in the ANDROID_TOP_DIR) + $(warning Please download and extract the new binaries by running the following script:) + $(warning ./device/linaro/dragonboard/fetch-vendor-package.sh ) # Would be good to error out here, but that causes other issues endif else $(warning Missing Linaro Vendor Package!) - $(warning Please download new binaries here:) - $(warning $(VND_PKG_URL) ) - $(warning And extract in the ANDROID_TOP_DIR) + $(warning Please download and extract the vendor binaries by running the following script:) + $(warning ./device/linaro/dragonboard/fetch-vendor-package.sh ) # Would be good to error out here, but that causes other issues endif @@ -76,4 +75,4 @@ PRODUCT_COPY_FILES += \ device/linaro/dragonboard/fstab.common:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.$(TARGET_HARDWARE) \ device/linaro/dragonboard/init.common.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.$(TARGET_HARDWARE).rc \ device/linaro/dragonboard/init.common.usb.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.$(TARGET_HARDWARE).usb.rc \ - device/linaro/dragonboard/common.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/$(TARGET_HARDWARE).kl + frameworks/base/data/keyboards/Generic.kl:$(TARGET_COPY_OUT_VENDOR)/usr/keylayout/$(TARGET_HARDWARE).kl diff --git a/fetch-vendor-package.sh b/fetch-vendor-package.sh index 5e8d727..eb11206 100755 --- a/fetch-vendor-package.sh +++ b/fetch-vendor-package.sh @@ -13,6 +13,14 @@ PKG_FILE=extract-linaro_devices-${EXPECTED_LINARO_VENDOR_VERSION} pushd ${ANDROID_BUILD_TOP} +# remove the older vendor-package, if any, because upstream +# mesa prebuilts in linaro-vendor-package ain't declared +# within a contained namespace and we can run into build +# errors because of redefinition of mesa prebuilt modules +# from the previous vendor-package. +# FIXME move mesa prebuilts from Android.mk to Android.bp +rm -rf ${ANDROID_BUILD_TOP}/vendor/linaro/ + if [ ! -e "${PKG_FILE}.tgz" ]; then curl -L ${VND_PKG_URL} -o ${PKG_FILE}.tgz fi @@ -29,17 +29,17 @@ PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS := false $(call inherit-product, $(SRC_TARGET_DIR)/product/emulated_storage.mk) # vndk -PRODUCT_PACKAGES := vndk-sp +PRODUCT_PACKAGES += vndk-sp # HACK: Avoid usb crash PRODUCT_PRODUCT_PROPERTIES := \ persist.adb.nonblocking_ffs=0 \ ro.adb.nonblocking_ffs=0 -# Display +# DRM HAL PRODUCT_PACKAGES += \ - android.hardware.drm@1.3-service.clearkey \ - android.hardware.drm@1.3-service.widevine + android.hardware.drm-service.clearkey \ + android.hardware.drm-service.widevine # Mesa PRODUCT_PACKAGES += \ @@ -246,6 +246,8 @@ PRODUCT_COPY_FILES += \ frameworks/native/data/etc/android.software.opengles.deqp.level-2020-03-01.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.opengles.deqp.level.xml \ frameworks/native/data/etc/android.software.device_admin.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.software.device_admin.xml +TARGET_PRODUCT_PROP := $(LOCAL_PATH)/product.prop + DEVICE_MANIFEST_FILE := device/linaro/dragonboard/manifest.xml DEVICE_MATRIX_FILE := device/linaro/dragonboard/compatibility_matrix.xml diff --git a/init.common.rc b/init.common.rc index f15640a..51a42c6 100644 --- a/init.common.rc +++ b/init.common.rc @@ -61,6 +61,7 @@ on property:sys.boot_completed=1 service wpa_supplicant /vendor/bin/hw/wpa_supplicant \ -Dnl80211 -g@android:wpa_wlan0 + interface aidl android.hardware.wifi.supplicant.ISupplicant/default interface android.hardware.wifi.supplicant@1.0::ISupplicant default interface android.hardware.wifi.supplicant@1.1::ISupplicant default socket wpa_wlan0 dgram 660 wifi wifi diff --git a/init.common.usb.rc b/init.common.usb.rc index 79d4d58..f5da420 100644 --- a/init.common.usb.rc +++ b/init.common.usb.rc @@ -48,12 +48,6 @@ on property:sys.usb.ffs.ready=1 && property:sys.usb.config=mtp,adb && property:s write /config/usb_gadget/g1/os_desc/use 1 symlink /config/usb_gadget/g1/functions/ffs.mtp /config/usb_gadget/g1/configs/b.1/f1 -on property:sys.usb.config=rndis && property:sys.usb.configfs=1 - write /config/usb_gadget/g1/idProduct 0x4ee3 - -on property:sys.usb.ffs.ready=1 && property:sys.usb.config=rndis,adb && property:sys.usb.configfs=1 - write /config/usb_gadget/g1/idProduct 0x4ee4 - on property:sys.usb.config=ptp && property:sys.usb.configfs=1 write /config/usb_gadget/g1/idProduct 0x4ee5 write /config/usb_gadget/g1/os_desc/use 1 diff --git a/manifest.xml b/manifest.xml index 99c8500..d0a07a3 100644 --- a/manifest.xml +++ b/manifest.xml @@ -46,19 +46,6 @@ </interface> </hal> <hal format="hidl"> - <name>android.hardware.drm</name> - <transport>hwbinder</transport> - <version>1.3</version> - <interface> - <name>ICryptoFactory</name> - <instance>default</instance> - </interface> - <interface> - <name>IDrmFactory</name> - <instance>default</instance> - </interface> - </hal> - <hal format="hidl"> <name>android.hardware.graphics.composer</name> <transport>hwbinder</transport> <version>2.3</version> @@ -22,7 +22,7 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/updatable_apex.mk) PRODUCT_PACKAGES += \ android.hardware.keymaster@4.1-service \ android.hidl.allocator@1.0-service \ - android.system.suspend@1.0-service \ + android.system.suspend-service \ com.android.i18n \ com.android.runtime \ keystore2 \ diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml index f241581..1cbe785 100644 --- a/overlay/frameworks/base/core/res/res/values/config.xml +++ b/overlay/frameworks/base/core/res/res/values/config.xml @@ -63,14 +63,6 @@ <item>"softap.*"</item> </string-array> - <!-- List of regexpressions describing the interface (if any) that represent tetherable - USB interfaces. If the device doesn't want to support tethering over USB this should - be empty. An example would be "usb.*" --> - <string-array translatable="false" name="config_tether_usb_regexs"> - <item>"usb\\d"</item> - <item>"rndis\\d"</item> - </string-array> - <!-- List of regexpressions describing the interface (if any) that represent tetherable bluetooth interfaces. If the device doesn't want to support tethering over bluetooth this should be empty. --> diff --git a/product.prop b/product.prop new file mode 100644 index 0000000..d703af9 --- /dev/null +++ b/product.prop @@ -0,0 +1,35 @@ +# System props to enable aac vbr feature +persist.bluetooth.a2dp_aac.vbr_supported=true + +# Set the Bluetooth Class of Device +# Service Field: 0x5A -> 90 +# Bit 17: Networking +# Bit 19: Capturing +# Bit 20: Object Transfer +# Bit 22: Telephony +# MAJOR_CLASS: 0x02 -> 2 (Phone) +# MINOR_CLASS: 0x0C -> 12 (Smart Phone) +bluetooth.device.class_of_device=90,2,12 + +# Set supported Bluetooth profiles to enabled +bluetooth.profile.asha.central.enabled?=true +bluetooth.profile.a2dp.source.enabled?=true +bluetooth.profile.avrcp.target.enabled?=true +bluetooth.profile.bap.broadcast.assist.enabled?=true +bluetooth.profile.bap.unicast.client.enabled?=true +bluetooth.profile.bas.client.enabled?=true +bluetooth.profile.csip.set_coordinator.enabled?=true +bluetooth.profile.gatt.enabled?=true +bluetooth.profile.hap.client.enabled?=true +bluetooth.profile.hfp.ag.enabled?=true +bluetooth.profile.hid.device.enabled?=true +bluetooth.profile.hid.host.enabled?=true +bluetooth.profile.map.server.enabled?=true +bluetooth.profile.mcp.server.enabled?=true +bluetooth.profile.opp.enabled?=true +bluetooth.profile.pan.nap.enabled?=true +bluetooth.profile.pan.panu.enabled?=true +bluetooth.profile.pbap.server.enabled?=true +bluetooth.profile.sap.server.enabled?=true +bluetooth.profile.ccp.server.enabled?=true +bluetooth.profile.vcp.controller.enabled?=true diff --git a/qcom/pd-mapper/pd-mapper.c b/qcom/pd-mapper/pd-mapper.c index 664b77d..376d9fe 100644 --- a/qcom/pd-mapper/pd-mapper.c +++ b/qcom/pd-mapper/pd-mapper.c @@ -36,6 +36,7 @@ #include <fcntl.h> #include <libgen.h> #include <libqrtr.h> +#include <limits.h> #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/qcom/qrtr/Makefile b/qcom/qrtr/Makefile index f814aa2..036691c 100644 --- a/qcom/qrtr/Makefile +++ b/qcom/qrtr/Makefile @@ -126,7 +126,7 @@ $1: $1.in $(DESTDIR)$(servicedir)/$1: $1 @echo "INSTALL $$<" - @install -D -m 755 $$< $$@ + @install -D -m 644 $$< $$@ all-install += $(DESTDIR)$(servicedir)/$1 endef diff --git a/qcom/qrtr/lib/libqrtr.h b/qcom/qrtr/lib/libqrtr.h index 87433ed..93254df 100644 --- a/qcom/qrtr/lib/libqrtr.h +++ b/qcom/qrtr/lib/libqrtr.h @@ -4,6 +4,7 @@ #include <linux/qrtr.h> #include <sys/types.h> #include <sys/socket.h> +#include <stddef.h> #include <stdint.h> #ifdef __cplusplus @@ -11,7 +12,7 @@ extern "C" { #endif #ifndef offsetof -#define offsetof(type, md) ((unsigned long)&((type *)0)->md) +#define offsetof(type, md) ((size_t)&((type *)0)->md) #endif #ifndef container_of @@ -90,7 +91,7 @@ struct qmi_elem_info { uint32_t elem_size; enum qmi_array_type array_type; uint8_t tlv_type; - uint32_t offset; + size_t offset; struct qmi_elem_info *ei_array; }; diff --git a/qcom/qrtr/lib/qmi.c b/qcom/qrtr/lib/qmi.c index f1c0293..d217a2d 100644 --- a/qcom/qrtr/lib/qmi.c +++ b/qcom/qrtr/lib/qmi.c @@ -249,8 +249,8 @@ static int qmi_encode_struct_elem(struct qmi_elem_info *ei_array, LOGW("%s: STRUCT Encode failure\n", __func__); return rc; } - buf_dst = (char*)buf_dst + rc; - buf_src = (char*)buf_src + temp_ei->elem_size; + buf_dst = (void*)((char*)buf_dst + rc); + buf_src = (void*)((char*)buf_src + temp_ei->elem_size); encoded_bytes += rc; } @@ -310,7 +310,7 @@ static int qmi_encode_string_elem(struct qmi_elem_info *ei_array, encoded_bytes += rc; } - rc = qmi_encode_basic_elem((char*)buf_dst + encoded_bytes, buf_src, + rc = qmi_encode_basic_elem((void*)((char*)buf_dst + encoded_bytes), buf_src, string_len, temp_ei->elem_size); encoded_bytes += rc; @@ -354,7 +354,7 @@ static int qmi_encode(struct qmi_elem_info *ei_array, void *out_buf, buf_dst = buf_dst + (TLV_LEN_SIZE + TLV_TYPE_SIZE); while (temp_ei->data_type != QMI_EOTI) { - buf_src = (char*)in_c_struct + temp_ei->offset; + buf_src = (void*)((char*)in_c_struct + temp_ei->offset); tlv_type = temp_ei->tlv_type; if (temp_ei->array_type == NO_ARRAY) { @@ -522,8 +522,8 @@ static int qmi_decode_struct_elem(struct qmi_elem_info *ei_array, tlv_len - decoded_bytes, dec_level); if (rc < 0) return rc; - buf_src = (char*)buf_src + rc; - buf_dst = (char*)buf_dst + temp_ei->elem_size; + buf_src = (void*)((char*)buf_src + rc); + buf_dst = (void*)((char*)buf_dst + temp_ei->elem_size); decoded_bytes += rc; } @@ -585,7 +585,7 @@ static int qmi_decode_string_elem(struct qmi_elem_info *ei_array, return -EFAULT; } - rc = qmi_decode_basic_elem(buf_dst, (char*)buf_src + decoded_bytes, + rc = qmi_decode_basic_elem(buf_dst, (void*)((char*)buf_src + decoded_bytes), string_len, temp_ei->elem_size); *((char *)buf_dst + string_len) = '\0'; decoded_bytes += rc; @@ -654,7 +654,7 @@ static int qmi_decode(struct qmi_elem_info *ei_array, void *out_c_struct, tlv_pointer = buf_src; QMI_ENCDEC_DECODE_TLV(&tlv_type, &tlv_len, tlv_pointer); - buf_src = (uint8_t*)buf_src + (TLV_TYPE_SIZE + TLV_LEN_SIZE); + buf_src = (void*)((char*)buf_src + (TLV_TYPE_SIZE + TLV_LEN_SIZE)); decoded_bytes += (TLV_TYPE_SIZE + TLV_LEN_SIZE); temp_ei = find_ei(ei_array, tlv_type); if (!temp_ei && tlv_type < OPTIONAL_TLV_TYPE_START) { @@ -673,11 +673,11 @@ static int qmi_decode(struct qmi_elem_info *ei_array, void *out_c_struct, tlv_len = in_buf_len - decoded_bytes; } - buf_dst = (uint8_t*)out_c_struct + temp_ei->offset; + buf_dst = (void*)((char*)out_c_struct + temp_ei->offset); if (temp_ei->data_type == QMI_OPT_FLAG) { memcpy(buf_dst, &opt_flag_value, sizeof(uint8_t)); temp_ei = temp_ei + 1; - buf_dst = (uint8_t*)out_c_struct + temp_ei->offset; + buf_dst = (void*)((char*)out_c_struct + temp_ei->offset); } if (temp_ei->data_type == QMI_DATA_LEN) { @@ -687,7 +687,7 @@ static int qmi_decode(struct qmi_elem_info *ei_array, void *out_c_struct, 1, data_len_sz); memcpy(buf_dst, &data_len_value, sizeof(uint32_t)); temp_ei = temp_ei + 1; - buf_dst = (uint8_t*)out_c_struct + temp_ei->offset; + buf_dst = (void*)((char*)out_c_struct + temp_ei->offset); tlv_len -= data_len_sz; UPDATE_DECODE_VARIABLES(buf_src, decoded_bytes, rc); } @@ -777,7 +777,7 @@ ssize_t qmi_encode_message(struct qrtr_packet *pkt, int type, int msg_id, /* Encode message, if we have a message */ if (c_struct) { - msglen = qmi_encode(ei, (char*)pkt->data + sizeof(*hdr), c_struct, + msglen = qmi_encode(ei, (void*)((char*)pkt->data + sizeof(*hdr)), c_struct, pkt->data_len - sizeof(*hdr), 1); if (msglen < 0) return msglen; @@ -839,7 +839,7 @@ int qmi_decode_message(void *c_struct, unsigned int *txn, if (txn) *txn = hdr->txn_id; - return qmi_decode(ei, c_struct, (char*)pkt->data + sizeof(*hdr), pkt->data_len - sizeof(*hdr), 1); + return qmi_decode(ei, c_struct, (void*)((char*)pkt->data + sizeof(*hdr)), pkt->data_len - sizeof(*hdr), 1); } /* Common header in all QMI responses */ diff --git a/qcom/qrtr/lib/qrtr.c b/qcom/qrtr/lib/qrtr.c index 7c1c389..96756ba 100644 --- a/qcom/qrtr/lib/qrtr.c +++ b/qcom/qrtr/lib/qrtr.c @@ -52,7 +52,7 @@ int qrtr_open(int rport) } if (rport != 0) { - struct sockaddr_qrtr sq; + struct sockaddr_qrtr sq = {}; sq.sq_family = AF_QIPCRTR; sq.sq_node = 1; @@ -78,7 +78,7 @@ void qrtr_close(int sock) int qrtr_sendto(int sock, uint32_t node, uint32_t port, const void *data, unsigned int sz) { - struct sockaddr_qrtr sq; + struct sockaddr_qrtr sq = {}; int rc; sq.sq_family = AF_QIPCRTR; diff --git a/qcom/qrtr/src/list.h b/qcom/qrtr/src/list.h index d740743..1d1c8e6 100644 --- a/qcom/qrtr/src/list.h +++ b/qcom/qrtr/src/list.h @@ -1,8 +1,10 @@ #ifndef _LIST_H_ #define _LIST_H_ +#include <stddef.h> + #ifndef offsetof -#define offsetof(type, md) ((unsigned long)&((type *)0)->md) +#define offsetof(type, md) ((size_t)&((type *)0)->md) #endif #ifndef container_of diff --git a/qcom/qrtr/src/lookup.c b/qcom/qrtr/src/lookup.c index 3312e40..80cf984 100644 --- a/qcom/qrtr/src/lookup.c +++ b/qcom/qrtr/src/lookup.c @@ -64,6 +64,7 @@ static const struct { { 41, 0, "RF radiated performance enhancement service" }, { 42, 0, "Data system determination service" }, { 43, 0, "Subsystem control service" }, + { 47, 0, "Data Port Mapper service" }, { 49, 0, "IPA control service" }, { 51, 0, "CoreSight remote tracing service" }, { 52, 0, "Dynamic Heap Memory Sharing" }, @@ -76,6 +77,7 @@ static const struct { { 312, 0, "QBT1000 Ultrasonic Fingerprint Sensor service" }, { 769, 0, "SLIMbus control service" }, { 771, 0, "Peripheral Access Control Manager service" }, + { 4096, 0, "TFTP" }, { DIAG_SERVICE, 0, "DIAG service" }, }; diff --git a/qcom/rmtfs/rmtfs.c b/qcom/rmtfs/rmtfs.c index 93965f1..b3ed289 100644 --- a/qcom/rmtfs/rmtfs.c +++ b/qcom/rmtfs/rmtfs.c @@ -220,6 +220,10 @@ static void rmtfs_iovec(int sock, struct qrtr_packet *pkt) respond: dbgprintf("[RMTFS] iovec %d, %sforced => (%d:%d)\n", caller_id, force ? "" : "not ", resp.result.result, resp.result.error); + + if (is_write) + storage_sync(rmtfd); + for (i = 0; i < num_entries; i++) { dbgprintf("[RMTFS] %s %d:%d 0x%x\n", is_write ? "write" : "read", entries[i].sector_addr, @@ -445,7 +449,10 @@ static int run_rmtfs(int rprocfd) rproc_start(); for (;;) { - if (rprocfd >= 0 && sig_int_count == 1 && !sig_int_handled) { + if (sig_int_count == 1 && !sig_int_handled) { + if (rprocfd < 0) + break; + rproc_stop(); sig_int_handled = true; } else if (sig_int_count > 1) { diff --git a/qcom/rmtfs/rmtfs.h b/qcom/rmtfs/rmtfs.h index 242baa5..fa4b806 100644 --- a/qcom/rmtfs/rmtfs.h +++ b/qcom/rmtfs/rmtfs.h @@ -34,6 +34,7 @@ int storage_get_error(const struct rmtfd *rmtfd); void storage_exit(void); ssize_t storage_pread(const struct rmtfd *rmtfd, void *buf, size_t nbyte, off_t offset); ssize_t storage_pwrite(struct rmtfd *rmtfd, const void *buf, size_t nbyte, off_t offset); +int storage_sync(struct rmtfd *rmtfd); int rproc_init(void); int rproc_start(void); diff --git a/qcom/rmtfs/rproc.c b/qcom/rmtfs/rproc.c index 95b45cb..68dc3c9 100644 --- a/qcom/rmtfs/rproc.c +++ b/qcom/rmtfs/rproc.c @@ -13,13 +13,75 @@ #include "rmtfs.h" #define RPROC_BASE_PATH "/sys/bus/platform/drivers/qcom-q6v5-mss/" +#define RPROC_CLASS_PATH "/sys/class/remoteproc/" static pthread_t start_thread; static pthread_t stop_thread; static int rproc_state_fd; static int rproc_pipe[2]; -int rproc_init(void) +static int rproc_init_by_modalias(void) +{ + struct dirent *rproc_de; + char modalias[256]; + DIR *base_dir; + int modalias_fd; + int rproc_fd; + int state_fd = -1; + int base_fd; + int ret; + + base_fd = open(RPROC_CLASS_PATH, O_RDONLY | O_DIRECTORY); + if (base_fd < 0) + return -1; + + base_dir = fdopendir(base_fd); + if (!base_dir) { + fprintf(stderr, "failed to open remoteproc class path\n"); + close(base_fd); + return -1; + } + + while (state_fd < 0 && (rproc_de = readdir(base_dir)) != NULL) { + if (!strcmp(rproc_de->d_name, ".") || + !strcmp(rproc_de->d_name, "..")) + continue; + + rproc_fd = openat(base_fd, rproc_de->d_name, O_RDONLY | O_DIRECTORY); + if (rproc_fd < 0) + continue; + + modalias_fd = openat(rproc_fd, "device/modalias", O_RDONLY); + if (modalias_fd < 0) + goto close_rproc_fd; + + ret = read(modalias_fd, modalias, sizeof(modalias) - 1); + if (ret < 0) + goto close_modalias_fd; + modalias[ret] = '\0'; + + if (!strstr(modalias, "-mpss-pas") && !strstr(modalias, "-mss-pil")) + goto close_modalias_fd; + + state_fd = openat(rproc_fd, "state", O_WRONLY); + if (state_fd < 0) { + fprintf(stderr, + "unable to open remoteproc \"state\" control file of %s\n", + rproc_de->d_name); + } + +close_modalias_fd: + close(modalias_fd); +close_rproc_fd: + close(rproc_fd); + } + closedir(base_dir); + close(base_fd); + + return state_fd; +} + +static int rproc_init_by_mss_driver(void) { struct dirent *device_de; struct dirent *rproc_de; @@ -28,10 +90,8 @@ int rproc_init(void) DIR *base_dir; int device_fd; int rproc_fd; + int state_fd = -1; int base_fd; - int ret; - - rproc_state_fd = -1; base_fd = open(RPROC_BASE_PATH, O_RDONLY | O_DIRECTORY); if (base_fd < 0) @@ -44,7 +104,7 @@ int rproc_init(void) return -1; } - while (rproc_state_fd < 0 && (device_de = readdir(base_dir)) != NULL) { + while (state_fd < 0 && (device_de = readdir(base_dir)) != NULL) { if (!strcmp(device_de->d_name, ".") || !strcmp(device_de->d_name, "..")) continue; @@ -60,7 +120,7 @@ int rproc_init(void) } rproc_dir = fdopendir(rproc_base_fd); - while (rproc_state_fd < 0 && (rproc_de = readdir(rproc_dir)) != NULL) { + while (state_fd < 0 && (rproc_de = readdir(rproc_dir)) != NULL) { if (!strcmp(rproc_de->d_name, ".") || !strcmp(rproc_de->d_name, "..")) continue; @@ -69,8 +129,8 @@ int rproc_init(void) if (rproc_fd < 0) continue; - rproc_state_fd = openat(rproc_fd, "state", O_WRONLY); - if (rproc_state_fd < 0) { + state_fd = openat(rproc_fd, "state", O_WRONLY); + if (state_fd < 0) { fprintf(stderr, "unable to open remoteproc \"state\" control file of %s\n", device_de->d_name); @@ -86,15 +146,29 @@ int rproc_init(void) closedir(base_dir); close(base_fd); - if (rproc_state_fd < 0) - return -1; + return state_fd; +} + +int rproc_init(void) +{ + int state_fd; + int ret; + + state_fd = rproc_init_by_modalias(); + if (state_fd < 0) { + state_fd = rproc_init_by_mss_driver(); + if (state_fd < 0) + return -1; + } ret = pipe(rproc_pipe); if (ret < 0) { - close(rproc_state_fd); + close(state_fd); return -1; } + rproc_state_fd = state_fd; + return rproc_pipe[0]; } @@ -103,15 +177,22 @@ static void *do_rproc_start(void *unused __unused) ssize_t ret; ret = pwrite(rproc_state_fd, "start", 5, 0); - if (ret < 4) - fprintf(stderr, "failed to update start state\n"); + if (ret < 4) { + fprintf(stderr, "failed to update start state: %s\n", + strerror(errno)); + } return NULL; } int rproc_start() { - return pthread_create(&start_thread, NULL, do_rproc_start, NULL); + pthread_attr_t attr; + + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + + return pthread_create(&start_thread, &attr, do_rproc_start, NULL); } static void *do_rproc_stop(void *unused __unused) @@ -119,8 +200,10 @@ static void *do_rproc_stop(void *unused __unused) ssize_t ret; ret = pwrite(rproc_state_fd, "stop", 4, 0); - if (ret < 4) - fprintf(stderr, "failed to update stop state\n"); + if (ret < 4) { + fprintf(stderr, "failed to update stop state: %s\n", + strerror(errno)); + } ret = write(rproc_pipe[1], "Y", 1); if (ret != 1) { @@ -133,5 +216,10 @@ static void *do_rproc_stop(void *unused __unused) int rproc_stop(void) { - return pthread_create(&stop_thread, NULL, do_rproc_stop, NULL); + pthread_attr_t attr; + + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + + return pthread_create(&stop_thread, &attr, do_rproc_stop, NULL); } diff --git a/qcom/rmtfs/storage.c b/qcom/rmtfs/storage.c index c8e69ed..107b296 100644 --- a/qcom/rmtfs/storage.c +++ b/qcom/rmtfs/storage.c @@ -41,6 +41,7 @@ static const struct partition partition_table[] = { { "/boot/modem_fs2", "modem_fs2", "modemst2" }, { "/boot/modem_fsc", "modem_fsc", "fsc" }, { "/boot/modem_fsg", "modem_fsg", "fsg" }, + { "/boot/modem_tunning", "modem_tunning", "tunning" }, {} }; @@ -150,8 +151,10 @@ found: void storage_close(struct rmtfd *rmtfd) { - close(rmtfd->fd); - rmtfd->fd = -1; + if (rmtfd->fd >= 0) { + close(rmtfd->fd); + rmtfd->fd = -1; + } free(rmtfd->shadow_buf); rmtfd->shadow_buf = NULL; @@ -188,10 +191,8 @@ void storage_exit(void) { int i; - for (i = 0; i < MAX_CALLERS; i++) { - if (rmtfds[i].fd >= 0) - close(rmtfds[i].fd); - } + for (i = 0; i < MAX_CALLERS; i++) + storage_close(&rmtfds[i]); } ssize_t storage_pread(const struct rmtfd *rmtfd, void *buf, size_t nbyte, off_t offset) @@ -201,7 +202,7 @@ ssize_t storage_pread(const struct rmtfd *rmtfd, void *buf, size_t nbyte, off_t if (!storage_read_only) { n = pread(rmtfd->fd, buf, nbyte, offset); } else { - n = MIN(nbyte, rmtfd->shadow_len - offset); + n = MIN((ssize_t)nbyte, (ssize_t)rmtfd->shadow_len - offset); if (n > 0) memcpy(buf, (char*)rmtfd->shadow_buf + offset, n); else @@ -244,6 +245,14 @@ ssize_t storage_pwrite(struct rmtfd *rmtfd, const void *buf, size_t nbyte, off_t return nbyte; } +int storage_sync(struct rmtfd *rmtfd) +{ + if (storage_read_only) + return 0; + + return fdatasync(rmtfd->fd); +} + static int storage_populate_shadow_buf(struct rmtfd *rmtfd, const char *file) { ssize_t len; diff --git a/rb5/BoardConfig.mk b/rb5/BoardConfig.mk index 53b21f0..92f536b 100644 --- a/rb5/BoardConfig.mk +++ b/rb5/BoardConfig.mk @@ -22,14 +22,17 @@ BOARD_KERNEL_BASE := 0x80000000 BOARD_KERNEL_PAGESIZE := 4096 BOARD_INCLUDE_DTB_IN_BOOTIMG := true -BOARD_BOOT_HEADER_VERSION := 3 +BOARD_BOOT_HEADER_VERSION := 4 BOARD_MKBOOTIMG_ARGS := --header_version $(BOARD_BOOT_HEADER_VERSION) -BOARD_KERNEL_CMDLINE := earlycon firmware_class.path=/vendor/firmware/ androidboot.hardware=rb5 -BOARD_KERNEL_CMDLINE += init=/init androidboot.boot_devices=soc@0/1d84000.ufshc printk.devkmsg=on +BOARD_KERNEL_CMDLINE := earlycon firmware_class.path=/vendor/firmware/ +BOARD_KERNEL_CMDLINE += init=/init printk.devkmsg=on BOARD_KERNEL_CMDLINE += pcie_pme=nomsi #For WiFi to work BOARD_KERNEL_CMDLINE += deferred_probe_timeout=30 BOARD_KERNEL_CMDLINE += qcom_geni_serial.con_enabled=1 +BOARD_KERNEL_CMDLINE += console=ttyMSM0 +BOARD_BOOTCONFIG += androidboot.hardware=rb5 androidboot.boot_devices=soc@0/1d84000.ufshc +BOARD_BOOTCONFIG += androidboot.verifiedbootstate=orange # Image Configuration BOARD_BOOTIMAGE_PARTITION_SIZE := 103079215104 #96M diff --git a/rb5/device.mk b/rb5/device.mk index 8fc29a5..6f4f75a 100644 --- a/rb5/device.mk +++ b/rb5/device.mk @@ -25,7 +25,7 @@ PRODUCT_COPY_FILES := \ $(LOCAL_PATH)/mixer_paths.xml:$(TARGET_COPY_OUT_VENDOR)/etc/mixer_paths.xml \ # Build generic Audio HAL -PRODUCT_PACKAGES := audio.primary.rb5 +PRODUCT_PACKAGES += audio.primary.rb5 # BootControl HAL PRODUCT_PACKAGES += \ diff --git a/sepolicy/app.te b/sepolicy/app.te index 890e6e6..27030c9 100644 --- a/sepolicy/app.te +++ b/sepolicy/app.te @@ -1,4 +1,4 @@ # Few system/untrusted_app_xx apps eg. deskclock, # gallery3d et al. need read-only access to /dev/dri # as well, otherwise they don't open and crash. -gpu_access(appdomain -isolated_app) +gpu_access(appdomain -isolated_app_all) diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts index d7419dc..c7eb6db 100644 --- a/sepolicy/file_contexts +++ b/sepolicy/file_contexts @@ -20,6 +20,7 @@ /sys/devices/platform/soc@0/8300000.remoteproc u:object_r:sysfs_remoteproc:s0 /sys/devices/platform/soc@0/17300000.remoteproc u:object_r:sysfs_remoteproc:s0 /sys/devices/platform/soc@0/ae00000.mdss u:object_r:sysfs_gpu:s0 +/sys/devices/platform/soc@0/ae00000.display-subsystem u:object_r:sysfs_gpu:s0 #wakeups on db845c /sys/devices/platform/soc@0/1c00000.pci/pci0000:00/0000:00:00.0/0000:01:00.0/wakeup/wakeup1 u:object_r:sysfs_wakeup:s0 diff --git a/sepolicy/genfs_contexts b/sepolicy/genfs_contexts index 2a50d9c..4d7f4ea 100644 --- a/sepolicy/genfs_contexts +++ b/sepolicy/genfs_contexts @@ -6,6 +6,7 @@ genfscon sysfs /devices/platform/soc@0/4080000.remoteproc u:object_r:sysfs genfscon sysfs /devices/platform/soc@0/8300000.remoteproc u:object_r:sysfs_remoteproc:s0 genfscon sysfs /devices/platform/soc@0/17300000.remoteproc u:object_r:sysfs_remoteproc:s0 genfscon sysfs /devices/platform/soc@0/ae00000.mdss u:object_r:sysfs_gpu:s0 +genfscon sysfs /devices/platform/soc@0/ae00000.display-subsystem u:object_r:sysfs_gpu:s0 genfscon sysfs /class/udc u:object_r:sysfs_udc:s0 genfscon sysfs /firmware/devicetree/base/compatible u:object_r:sysfs_dt_compatible:s0 diff --git a/sm8450/BoardConfig.mk b/sm8450/BoardConfig.mk index de61cea..44d29d9 100644 --- a/sm8450/BoardConfig.mk +++ b/sm8450/BoardConfig.mk @@ -44,6 +44,7 @@ BOARD_MKBOOTIMG_ARGS := --header_version $(BOARD_BOOT_HEADER_VERSION) BOARD_KERNEL_CMDLINE := earlycon firmware_class.path=/vendor/firmware/ androidboot.hardware=sm8450 BOARD_KERNEL_CMDLINE += init=/init androidboot.boot_devices=soc@0/1d84000.ufshc printk.devkmsg=on BOARD_KERNEL_CMDLINE += allow_mismatched_32bit_el0 +BOARD_KERNEL_CMDLINE += console=ttyMSM0 # Image Configuration BOARD_BOOTIMAGE_PARTITION_SIZE := 67108864 #64M diff --git a/vendor-package-ver.sh b/vendor-package-ver.sh index 6179fc9..690f87e 100755 --- a/vendor-package-ver.sh +++ b/vendor-package-ver.sh @@ -1,9 +1,9 @@ #!/bin/bash -export EXPECTED_LINARO_VENDOR_VERSION=20220303 +export EXPECTED_LINARO_VENDOR_VERSION=20221126 #make sure to use sha512sum here -export EXPECTED_LINARO_VENDOR_SHA=1119c59e80094fc11624b19531f584e798fd048f0adfdbb5113d2539202898c7d2b13dc1d2ad679c555f1c79a64d3ffc1b45cdf414787e5a821499276ca0b36c -export VND_PKG_URL=https://releases.linaro.org/android/aosp-linaro-vendor-package/extract-linaro_devices-20220303.tgz +export EXPECTED_LINARO_VENDOR_SHA=b87346f0612809458f556d0770f32a542ffd200418fe89bf1bf11b250f8c9197cd7c3624c87d141837c315a308d166129f711cf8c7b0a31eafcc1c2b87556199 +export VND_PKG_URL=https://releases.linaro.org/android/aosp-linaro-vendor-package/extract-linaro_devices-20221126.tgz if [ "$1" = "url" ]; then echo $VND_PKG_URL |