device: add bluetooth support for nanopi5/6

Signed-off-by: hmz007 <hmz007@gmail.com>
Change-Id: I7c2388f91213166174d0db72384e5bfbf35bbf10
master
hmz007 1 year ago
parent e3da518132
commit c170371150

@ -24,6 +24,8 @@ PRODUCT_BRAND ?= Android
PRODUCT_MODEL ?= FriendlyELEC RK3588
PRODUCT_MANUFACTURER ?= FriendlyELEC (www.friendlyelec.com)
include device/friendlyelec/nanopi3/bluetooth.mk
# for testing only
ifeq ($(INSTALL_GAPPS_FOR_TESTING), yes)

@ -0,0 +1,73 @@
#
# Copyright 2014 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.
#
# Bluetooth HAL
ifeq ($(TARGET_USE_BTLINUX_HAL_IMPL),true)
DEVICE_MANIFEST_FILE += device/friendlyelec/nanopi3/manifest_bluetooth.xml
PRODUCT_PACKAGES += \
android.hardware.bluetooth@1.0-impl \
android.hardware.bluetooth@1.1-service.btlinux
PRODUCT_PACKAGES += \
libaptX_encoder \
libaptXHD_encoder \
libldacBT_enc \
libldacBT_abr
PRODUCT_PACKAGES += android.hardware.bluetooth.audio@2.0-impl
# From device/rockchip/common/modules/bluetooth.mk
PRODUCT_PACKAGES += \
libbluetooth_audio_session \
libbluetooth_audio_session_aidl \
android.hardware.bluetooth.audio-impl \
audio.bluetooth.default
PRODUCT_PRODUCT_PROPERTIES += \
bluetooth.core.le.inquiry_scan_interval=3000
# Set supported Bluetooth profiles to enabled
PRODUCT_PRODUCT_PROPERTIES += \
bluetooth.profile.asha.central.enabled?=true \
bluetooth.profile.a2dp.source.enabled?=true \
bluetooth.profile.avrcp.target.enabled?=true \
bluetooth.profile.bas.client.enabled?=true \
bluetooth.profile.gatt.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.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
# Audio policy
PRODUCT_COPY_FILES += \
frameworks/av/services/audiopolicy/config/a2dp_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/a2dp_audio_policy_configuration_7_0.xml \
frameworks/av/services/audiopolicy/config/bluetooth_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUT_VENDOR)/etc/bluetooth_audio_policy_configuration_7_0.xml
# Feature
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.bluetooth.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth.xml
ifeq ($(BOARD_BLUETOOTH_LE_SUPPORT),true)
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.bluetooth_le.xml:$(TARGET_COPY_OUT_VENDOR)/etc/permissions/android.hardware.bluetooth_le.xml
endif
endif

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2021, 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.
*/
-->
<manifest version="1.0" type="device">
<hal format="hidl">
<name>android.hardware.bluetooth</name>
<transport>hwbinder</transport>
<version>1.1</version>
<interface>
<name>IBluetoothHci</name>
<instance>default</instance>
</interface>
</hal>
</manifest>

@ -200,7 +200,14 @@ PRODUCT_COPY_FILES += \
endif
# Bluetooth
ifneq ($(TARGET_USE_BTLINUX_HAL_IMPL),true)
ifeq ($(call math_gt_or_eq,$(ROCKCHIP_LUNCHING_API_LEVEL),34),true)
DEVICE_MANIFEST_FILE += \
device/rockchip/common/manifests/android.hardware.bluetooth@1.0-service.xml
endif
$(call inherit-product, device/rockchip/common/modules/bluetooth.mk)
endif
ifeq ($(BOARD_WIFI_SUPPORT),true)
PRODUCT_COPY_FILES += \

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
/*
** Copyright 2021, 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.
*/
-->
<manifest version="1.0" type="device">
<hal format="hidl">
<name>android.hardware.bluetooth</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IBluetoothHci</name>
<instance>default</instance>
</interface>
</hal>
</manifest>

@ -17,14 +17,5 @@
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>android.hardware.bluetooth</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IBluetoothHci</name>
<instance>default</instance>
</interface>
</hal>
</manifest>

@ -48,9 +48,9 @@ WIFI_DRIVER_FW_PATH_STA := "/vendor/etc/firmware/fw_bcm4329.bin"
WIFI_DRIVER_FW_PATH_P2P := "/vendor/etc/firmware/fw_bcm4329_p2p.bin"
WIFI_DRIVER_FW_PATH_AP := "/vendor/etc/firmware/fw_bcm4329_apsta.bin"
BOARD_HAVE_BLUETOOTH := true
BOARD_HAVE_BLUETOOTH_BCM := true
#BOARD_HAVE_BLUETOOTH_RTK := true
BOARD_HAVE_BLUETOOTH_AIC := true
BOARD_HAVE_BLUETOOTH_SEEKWAVE := true
BOARD_HAVE_BLUETOOTH_BCM ?= true
#BOARD_HAVE_BLUETOOTH_RTK ?= true
BOARD_HAVE_BLUETOOTH_AIC ?= true
BOARD_HAVE_BLUETOOTH_SEEKWAVE ?= true
BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR ?= device/rockchip/$(TARGET_BOARD_PLATFORM)/bluetooth
endif

@ -34,6 +34,12 @@ WIFI_DRIVER_FW_PATH_PARAM := "/dev/null"
WIFI_DRIVER_FW_PATH_STA := "/dev/null"
WIFI_DRIVER_FW_PATH_AP := "/dev/null"
BOARD_HAVE_BLUETOOTH_AIC := false
BOARD_HAVE_BLUETOOTH_BCM := false
BOARD_HAVE_BLUETOOTH_RTK := false
TARGET_USE_BTLINUX_HAL_IMPL := true
BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/rockchip/rk356x/nanopi5/bluetooth
# No dtbo.img in boot.img
BOARD_INCLUDE_DTB_IN_BOOTIMG :=
BOARD_PREBUILT_DTBIMAGE_DIR :=

@ -0,0 +1,29 @@
/*
* Copyright (C) 2012 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.
*/
#ifndef _BDROID_BUILDCFG_H
#define _BDROID_BUILDCFG_H
#define BTM_DEF_LOCAL_NAME "nanopi5"
#define BTA_DM_COD {0x1A, 0x01, 0x10}
#define BLE_PRIVACY_SPT FALSE
#define BLE_VND_INCLUDED FALSE
#define BTA_HCI_RESET FALSE
#endif

@ -37,6 +37,12 @@ WIFI_DRIVER_FW_PATH_PARAM := "/dev/null"
WIFI_DRIVER_FW_PATH_STA := "/dev/null"
WIFI_DRIVER_FW_PATH_AP := "/dev/null"
BOARD_HAVE_BLUETOOTH_AIC := false
BOARD_HAVE_BLUETOOTH_BCM := false
BOARD_HAVE_BLUETOOTH_RTK := false
TARGET_USE_BTLINUX_HAL_IMPL := true
BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/rockchip/rk356x/nanopi5/bluetooth
# No dtbo.img in boot.img
BOARD_INCLUDE_DTB_IN_BOOTIMG :=
BOARD_PREBUILT_DTBIMAGE_DIR :=

@ -17,15 +17,6 @@
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>android.hardware.bluetooth</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IBluetoothHci</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>android.hardware.graphics.composer</name>
<transport>hwbinder</transport>

@ -35,6 +35,12 @@ WIFI_DRIVER_FW_PATH_PARAM := "/dev/null"
WIFI_DRIVER_FW_PATH_STA := "/dev/null"
WIFI_DRIVER_FW_PATH_AP := "/dev/null"
BOARD_HAVE_BLUETOOTH_AIC := false
BOARD_HAVE_BLUETOOTH_BCM := false
BOARD_HAVE_BLUETOOTH_RTK := false
TARGET_USE_BTLINUX_HAL_IMPL := true
BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/rockchip/rk3588/nanopi6/bluetooth
# No dtbo.img in boot.img
BOARD_INCLUDE_DTB_IN_BOOTIMG :=
BOARD_PREBUILT_DTBIMAGE_DIR :=

@ -0,0 +1,29 @@
/*
* Copyright (C) 2012 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.
*/
#ifndef _BDROID_BUILDCFG_H
#define _BDROID_BUILDCFG_H
#define BTM_DEF_LOCAL_NAME "nanopi6"
#define BTA_DM_COD {0x1A, 0x01, 0x10}
#define BLE_PRIVACY_SPT TRUE
#define BLE_VND_INCLUDED FALSE
#define BTA_HCI_RESET FALSE
#endif

@ -37,6 +37,12 @@ WIFI_DRIVER_FW_PATH_PARAM := "/dev/null"
WIFI_DRIVER_FW_PATH_STA := "/dev/null"
WIFI_DRIVER_FW_PATH_AP := "/dev/null"
BOARD_HAVE_BLUETOOTH_AIC := false
BOARD_HAVE_BLUETOOTH_BCM := false
BOARD_HAVE_BLUETOOTH_RTK := false
TARGET_USE_BTLINUX_HAL_IMPL := true
BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := device/rockchip/rk3588/nanopi6/bluetooth
# No dtbo.img in boot.img
BOARD_INCLUDE_DTB_IN_BOOTIMG :=
BOARD_PREBUILT_DTBIMAGE_DIR :=

@ -17,15 +17,6 @@
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>android.hardware.bluetooth</name>
<transport>hwbinder</transport>
<version>1.0</version>
<interface>
<name>IBluetoothHci</name>
<instance>default</instance>
</interface>
</hal>
<hal format="hidl">
<name>android.hardware.graphics.composer</name>
<transport>hwbinder</transport>

Loading…
Cancel
Save