Merge branch d4a into aosp-main

* origin/d4a:
  sm8x50-userdebug: Add a generic build target for Snapdragon 8 gen devboards

Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
diff --git a/Android.mk b/Android.mk
index c2ac0e9..602e63e 100644
--- a/Android.mk
+++ b/Android.mk
@@ -20,7 +20,7 @@
 # to only building on ARM if they include assembly. Individual makefiles
 # are responsible for having their own logic, for fine-grained control.
 
-ifneq ($(filter db845c rb5 linaro_swr sm8x50, $(TARGET_BOARD_PLATFORM)),)
+ifneq ($(filter db845c linaro_swr sm8x50, $(TARGET_BOARD_PLATFORM)),)
 
 LOCAL_PATH := $(call my-dir)
 
@@ -31,7 +31,6 @@
 $(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.rb5))
 
 # If some modules are built directly from this directory (not subdirectories),
 # their rules should be written here.
diff --git a/AndroidProducts.mk b/AndroidProducts.mk
index b3b5f95..fd0884a 100644
--- a/AndroidProducts.mk
+++ b/AndroidProducts.mk
@@ -12,14 +12,10 @@
 PRODUCT_MAKEFILES := \
     $(LOCAL_DIR)/db845c.mk \
     $(LOCAL_DIR)/db845c_mini.mk \
-    $(LOCAL_DIR)/rb5.mk \
-    $(LOCAL_DIR)/rb5_mini.mk \
     $(LOCAL_DIR)/sm8450_mini.mk \
     $(LOCAL_DIR)/linaro_swr.mk \
     $(LOCAL_DIR)/sm8x50/sm8x50.mk
 
 COMMON_LUNCH_CHOICES := \
     db845c-trunk_staging-userdebug \
-    rb5-trunk_staging-userdebug \
     sm8x50-trunk_staging-userdebug
-
diff --git a/db845c/device.mk b/db845c/device.mk
index 6f08e0a..fb1b719 100644
--- a/db845c/device.mk
+++ b/db845c/device.mk
@@ -67,6 +67,6 @@
 $(call inherit-product-if-exists, vendor/linaro/rb5/$(EXPECTED_LINARO_VENDOR_VERSION)/device.mk)
 
 TARGET_HARDWARE := db845c
-TARGET_KERNEL_USE ?= 6.1
+TARGET_KERNEL_USE ?= 6.6
 
 include device/linaro/dragonboard/device-common.mk
diff --git a/full.mk b/full.mk
index 78374b5..00e3eb8 100644
--- a/full.mk
+++ b/full.mk
@@ -64,7 +64,7 @@
 
 # Enable BT
 PRODUCT_PACKAGES += \
-    android.hardware.bluetooth@1.1-service.btlinux
+    android.hardware.bluetooth-service.default
 
 PRODUCT_COPY_FILES += \
     frameworks/native/data/etc/android.hardware.bluetooth.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth.xml \
diff --git a/installer/rb5/README b/installer/rb5/README
index ee59bdb..fc9ae1d 100644
--- a/installer/rb5/README
+++ b/installer/rb5/README
@@ -2,7 +2,7 @@
 and AOSP images(built from sources) on rb5.
 
 First, make sure you have built the AOSP images for RB5 by
-running the rb5-userdebug lunch target.
+running the db845c-trunk_staging-userdebug lunch target.
 
 
 Boot the board into fastboot mode:
diff --git a/installer/rb5/flash-all-aosp.sh b/installer/rb5/flash-all-aosp.sh
index 28eb0e4..d3063c7 100755
--- a/installer/rb5/flash-all-aosp.sh
+++ b/installer/rb5/flash-all-aosp.sh
@@ -2,10 +2,10 @@
 
 INSTALLER_DIR="`dirname ${0}`"
 
-# for cases that don't run "lunch rb5-userdebug"
+# for cases that don't run "lunch db845c-trunk_staging-userdebug"
 if [ -z "${ANDROID_BUILD_TOP}" ]; then
     ANDROID_BUILD_TOP="`readlink -f ${INSTALLER_DIR}/../../../../../`"
-    ANDROID_PRODUCT_OUT="${ANDROID_BUILD_TOP}/out/target/product/rb5"
+    ANDROID_PRODUCT_OUT="${ANDROID_BUILD_TOP}/out/target/product/db845c"
 fi
 
 if [ ! -d "${ANDROID_PRODUCT_OUT}" ]; then
diff --git a/installer/rb5/recovery.sh b/installer/rb5/recovery.sh
index 156a16d..626b9a6 100755
--- a/installer/rb5/recovery.sh
+++ b/installer/rb5/recovery.sh
@@ -2,7 +2,7 @@
 
 INSTALLER_DIR="`dirname ${0}`"
 
-# for cases that don't run "lunch rb5-userdebug"
+# for cases that don't run "lunch db845c-trunk_staging-userdebug"
 if [ -z "${ANDROID_BUILD_TOP}" ]; then
     ANDROID_BUILD_TOP="`readlink -f ${INSTALLER_DIR}/../../../../../`"
 fi
diff --git a/linaro_swr/device.mk b/linaro_swr/device.mk
index 5716fa0..829d02a 100644
--- a/linaro_swr/device.mk
+++ b/linaro_swr/device.mk
@@ -67,6 +67,6 @@
 $(call inherit-product-if-exists, vendor/linaro/rb5/$(EXPECTED_LINARO_VENDOR_VERSION)/device.mk)
 
 TARGET_HARDWARE := linaro_swr
-TARGET_KERNEL_USE ?= 6.1
+TARGET_KERNEL_USE ?= 6.6
 
 include device/linaro/dragonboard/device-common.mk
diff --git a/rb5.mk b/rb5.mk
deleted file mode 100644
index 27eab73..0000000
--- a/rb5.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-$(call inherit-product, device/linaro/dragonboard/full.mk)
-$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
-$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)
-$(call inherit-product, device/linaro/dragonboard/shared/graphics/drm_hwcomposer/device.mk)
-$(call inherit-product, device/linaro/dragonboard/shared/graphics/mesa/device.mk)
-$(call inherit-product, device/linaro/dragonboard/shared/graphics/minigbm_msm/device.mk)
-$(call inherit-product, device/linaro/dragonboard/rb5/device.mk)
-
-# Product overrides
-PRODUCT_NAME := rb5
-PRODUCT_DEVICE := rb5
-PRODUCT_BRAND := Android
diff --git a/rb5/BoardConfig.mk b/rb5/BoardConfig.mk
deleted file mode 100644
index 9cb6081..0000000
--- a/rb5/BoardConfig.mk
+++ /dev/null
@@ -1,55 +0,0 @@
-include device/linaro/dragonboard/BoardConfigCommon.mk
-
-# Primary Arch
-TARGET_ARCH := arm64
-TARGET_ARCH_VARIANT := armv8-2a
-TARGET_CPU_VARIANT := kryo385
-TARGET_CPU_ABI := arm64-v8a
-
-# Secondary Arch
-TARGET_2ND_ARCH := arm
-TARGET_2ND_ARCH_VARIANT := armv8-2a
-TARGET_2ND_CPU_VARIANT := kryo385
-TARGET_2ND_CPU_ABI := armeabi-v7a
-TARGET_2ND_CPU_ABI2 := armeabi
-
-# Board Information
-TARGET_BOOTLOADER_BOARD_NAME := rb5
-TARGET_BOARD_PLATFORM := rb5
-
-TARGET_NO_KERNEL := false
-BOARD_KERNEL_BASE := 0x80000000
-BOARD_KERNEL_PAGESIZE := 4096
-
-BOARD_INCLUDE_DTB_IN_BOOTIMG := true
-BOARD_BOOT_HEADER_VERSION := 4
-BOARD_MKBOOTIMG_ARGS := --header_version $(BOARD_BOOT_HEADER_VERSION)
-
-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 := 100663296 #96M
-BOARD_VENDOR_BOOTIMAGE_PARTITION_SIZE := 100663296 #96M
-BOARD_USERDATAIMAGE_PARTITION_SIZE := 21474836480
-BOARD_FLASH_BLOCK_SIZE := 131072
-
-# Super/Dynamic partition
-BOARD_SUPER_PARTITION_SIZE := 12437225472
-BOARD_DB_DYNAMIC_PARTITIONS_SIZE := 12433031168 # Reserve 4M for DAP metadata
-BOARD_SUPER_PARTITION_METADATA_DEVICE := super
-BOARD_SUPER_IMAGE_IN_UPDATE_PACKAGE := true
-# dlkm partition
-include device/linaro/dragonboard/shared/utils/dlkm_loader/BoardConfig.mk
-BOARD_SEPOLICY_DIRS += device/linaro/dragonboard/shared/utils/dlkm_loader/sepolicy/
-
-# Graphics
-include device/linaro/dragonboard/shared/graphics/drm_hwcomposer/BoardConfig.mk
-include device/linaro/dragonboard/shared/graphics/mesa/BoardConfig.mk
-BOARD_SEPOLICY_DIRS += device/linaro/dragonboard/shared/graphics/minigbm_msm/sepolicy/
diff --git a/rb5/device.mk b/rb5/device.mk
deleted file mode 100644
index 287ec9b..0000000
--- a/rb5/device.mk
+++ /dev/null
@@ -1,71 +0,0 @@
-#
-# Copyright (C) 2011 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.
-#
-
-# setup dalvik vm configs
-$(call inherit-product, frameworks/native/build/tablet-10in-xhdpi-2048-dalvik-heap.mk)
-
-include $(LOCAL_PATH)/../vendor-package-ver.mk
-
-$(call inherit-product, $(SRC_TARGET_DIR)/product/virtual_ab_ota/launch_with_vendor_ramdisk.mk)
-
-# dlkm_loader
-include device/linaro/dragonboard/shared/utils/dlkm_loader/device.mk
-
-PRODUCT_COPY_FILES := \
-    $(LOCAL_PATH)/mixer_paths.xml:$(TARGET_COPY_OUT_VENDOR)/etc/mixer_paths.xml \
-    device/linaro/dragonboard/shared/utils/dlkm_loader/dlkm_loader.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/dlkm_loader.rc
-
-# Build generic Audio HAL
-PRODUCT_PACKAGES += audio.primary.rb5
-
-# BootControl HAL
-PRODUCT_PACKAGES += \
-    android.hardware.boot@1.2-impl \
-    android.hardware.boot@1.2-impl.recovery \
-    android.hardware.boot@1.2-service
-
-# Set BT address
-PRODUCT_PACKAGES += bdaddr
-
-# Install bdaddr script
-PRODUCT_COPY_FILES += \
-    device/linaro/dragonboard/shared/utils/bdaddr/set_bdaddr.sh:$(TARGET_COPY_OUT_VENDOR)/bin/set_bdaddr.sh
-
-# Install scripts to set vendor.* properties
-PRODUCT_COPY_FILES += \
-    device/linaro/dragonboard/shared/utils/set_hw.sh:$(TARGET_COPY_OUT_VENDOR)/bin/set_hw.sh
-
-# Install scripts to set Ethernet MAC address
-PRODUCT_COPY_FILES += \
-    device/linaro/dragonboard/shared/utils/ethaddr/ethaddr.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/ethaddr.rc \
-    device/linaro/dragonboard/shared/utils/ethaddr/set_ethaddr.sh:$(TARGET_COPY_OUT_VENDOR)/bin/set_ethaddr.sh
-
-PRODUCT_VENDOR_PROPERTIES += ro.soc.manufacturer=Qualcomm
-PRODUCT_VENDOR_PROPERTIES += ro.soc.model=QRB5165
-
-PRODUCT_SOONG_NAMESPACES += \
-    vendor/linaro/rb5/$(EXPECTED_LINARO_VENDOR_VERSION)
-
-# Copy firmware files
-$(call inherit-product-if-exists, vendor/linaro/rb5/$(EXPECTED_LINARO_VENDOR_VERSION)/device.mk)
-
-TARGET_DTB := qrb5165-rb5.dtb
-TARGET_HARDWARE := rb5
-TARGET_KERNEL_USE ?= 6.1
-
-include device/linaro/dragonboard/device-common.mk
-
-PRODUCT_COPY_FILES += $(TARGET_KERNEL_DIR)/qrb5165-rb5.dtb:dtb.img
diff --git a/rb5/mixer_paths.xml b/rb5/mixer_paths.xml
deleted file mode 100644
index 86e67fc..0000000
--- a/rb5/mixer_paths.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<mixer>
-	<!-- Enable HDMI out -->
-	<ctl name="TERT_MI2S_RX Audio Mixer MultiMedia1" value="1" />
-</mixer>
diff --git a/rb5_mini.mk b/rb5_mini.mk
deleted file mode 100644
index 302e217..0000000
--- a/rb5_mini.mk
+++ /dev/null
@@ -1,7 +0,0 @@
-$(call inherit-product, device/linaro/dragonboard/mini.mk)
-$(call inherit-product, device/linaro/dragonboard/rb5/device.mk)
-
-# Product overrides
-PRODUCT_NAME := rb5_mini
-PRODUCT_DEVICE := rb5
-PRODUCT_BRAND := Android