From 4ff47aa650f48c588bd3e9f6465bb0e77578ef88 Mon Sep 17 00:00:00 2001 From: August Date: Wed, 15 Aug 2018 19:06:14 +0800 Subject: [PATCH] update ap6212 configuration, but can't work now --- .../common/init.wireless.broadcom.rc | 30 ++++++---- .../softwinner/tulip-m64-hdmi/configs/:wq | 11 ---- .../softwinner/tulip-m64/BoardConfig.mk | 5 +- .../configs/bluetooth/bdroid_buildcfg.h | 59 +++++++++++++++++++ .../configs/bluetooth/vnd_tulip-m64.txt | 21 +++++++ .../tulip-m64/configs/init.wireless.rc | 4 +- android/hardware/aw/wlan/config/config.mk | 4 ++ 7 files changed, 106 insertions(+), 28 deletions(-) delete mode 100644 android/device/softwinner/tulip-m64-hdmi/configs/:wq create mode 100755 android/device/softwinner/tulip-m64/configs/bluetooth/vnd_tulip-m64.txt diff --git a/android/device/softwinner/common/init.wireless.broadcom.rc b/android/device/softwinner/common/init.wireless.broadcom.rc index 88a13deaff..bc95eb7813 100644 --- a/android/device/softwinner/common/init.wireless.broadcom.rc +++ b/android/device/softwinner/common/init.wireless.broadcom.rc @@ -1,24 +1,24 @@ on boot - insmod /system/vendor/modules/bcmdhd.ko + #insmod /system/vendor/modules/bcmdhd.ko insmod /system/vendor/modules/bcm_btlpm.ko # bluetooth power up/down interface chmod 0660 /sys/class/rfkill/rfkill0/state chmod 0660 /sys/class/rfkill/rfkill0/type - chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/state - chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/type + chown bluetooth net_bt_admin /sys/class/rfkill/rfkill0/state + chown bluetooth net_bt_admin /sys/class/rfkill/rfkill0/type write /sys/class/rfkill/rfkill0/state 0 # bluetooth LPM chmod 0220 /proc/bluetooth/sleep/lpm chmod 0220 /proc/bluetooth/sleep/btwrite - chown bluetooth net_bt_stack /proc/bluetooth/sleep/lpm - chown bluetooth net_bt_stack /proc/bluetooth/sleep/btwrite + chown bluetooth net_bt_admin /proc/bluetooth/sleep/lpm + chown bluetooth net_bt_admin /proc/bluetooth/sleep/btwrite # bluetooth MAC address programming - chown bluetooth net_bt_stack ro.bt.bdaddr_path - chown bluetooth net_bt_stack /system/etc/bluetooth - chown bluetooth net_bt_stack /data/misc/bluetooth + chown bluetooth net_bt_admin ro.bt.bdaddr_path + chown bluetooth net_bt_admin /system/etc/bluetooth + chown bluetooth net_bt_admin /data/misc/bluetooth setprop ro.bt.bdaddr_path "/data/misc/bluetooth/bdaddr" # to observe dnsmasq.leases file for dhcp information of soft ap. @@ -26,20 +26,24 @@ on boot # broadcom wifi service # 1 broadcom wifi sta service -service wpa_supplicant /system/bin/wpa_supplicant \ - -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \ - -I/system/etc/wifi/wpa_supplicant_overlay.conf \ - -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0 +service wpa_supplicant_broadcom /system/vendor/bin/hw/wpa_supplicant \ + -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \ + -m/data/misc/wifi/p2p_supplicant.conf \ + -puse_p2p_group_interface=1p2p_device=1use_multi_chan_concurrent=1 \ + -O/data/misc/wifi/sockets \ + -e/data/misc/wifi/entropy.bin \ + -g@android:wpa_wlan0 class main socket wpa_wlan0 dgram 660 wifi wifi disabled oneshot # 2 broadcom wifi sta p2p concurrent service -service p2p_supplicant /system/bin/wpa_supplicant \ +service p2p_supplicant /system/vendor/bin/wpa_supplicant \ -iwlan0 -Dnl80211 -c/data/misc/wifi/wpa_supplicant.conf \ -I/system/etc/wifi/p2p_supplicant_overlay.conf \ -puse_p2p_group_interface=1p2p_device=1use_multi_chan_concurrent=1 \ + -O/data/misc/wifi/sockets \ -m/data/misc/wifi/p2p_supplicant.conf \ -e/data/misc/wifi/entropy.bin -g@android:wpa_wlan0 class main diff --git a/android/device/softwinner/tulip-m64-hdmi/configs/:wq b/android/device/softwinner/tulip-m64-hdmi/configs/:wq deleted file mode 100644 index 33cfff308f..0000000000 --- a/android/device/softwinner/tulip-m64-hdmi/configs/:wq +++ /dev/null @@ -1,11 +0,0 @@ -on boot - # MAC Program - mkdir /data/misc/bluedroid 0770 bluetooth net_bt_admin - exec - root system -- /vendor/xbin/macprog.sh - chmod 775 /data/misc/wifi - - # Bluetooth - # UART device - chmod 0660 /dev/ttyS1 - chown bluetooth net_bt_admin /dev/ttyS1 - diff --git a/android/device/softwinner/tulip-m64/BoardConfig.mk b/android/device/softwinner/tulip-m64/BoardConfig.mk index 98652a9123..62eca27ad9 100755 --- a/android/device/softwinner/tulip-m64/BoardConfig.mk +++ b/android/device/softwinner/tulip-m64/BoardConfig.mk @@ -93,14 +93,15 @@ endif # 2. Bluetooth Configuration # make sure BOARD_HAVE_BLUETOOTH is true for every bt vendor -BOARD_BLUETOOTH_VENDOR := realtek +BOARD_BLUETOOTH_VENDOR := broadcom # 2.1 broadcom bt configuration # BOARD_HAVE_BLUETOOTH_NAME: ap6210/ap6212/ap6330/ap6335 ifeq ($(BOARD_BLUETOOTH_VENDOR), broadcom) BOARD_HAVE_BLUETOOTH := true BOARD_HAVE_BLUETOOTH_BCM := true - BOARD_HAVE_BLUETOOTH_NAME := ap6255 + BOARD_HAVE_BLUETOOTH_NAME := ap6212 + BOARD_CUSTOM_BT_CONFIG := $(TOP_DIR)device/softwinner/$(basename $(TARGET_DEVICE))/configs/bluetooth/vnd_$(basename $(TARGET_DEVICE)).txt BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR := $(TOP_DIR)device/softwinner/$(basename $(TARGET_DEVICE))/configs/bluetooth/ endif diff --git a/android/device/softwinner/tulip-m64/configs/bluetooth/bdroid_buildcfg.h b/android/device/softwinner/tulip-m64/configs/bluetooth/bdroid_buildcfg.h index 948beeaeb7..176e50a272 100755 --- a/android/device/softwinner/tulip-m64/configs/bluetooth/bdroid_buildcfg.h +++ b/android/device/softwinner/tulip-m64/configs/bluetooth/bdroid_buildcfg.h @@ -17,6 +17,8 @@ #ifndef _BDROID_BUILDCFG_H #define _BDROID_BUILDCFG_H +#ifdef BLUETOOTH_RTK + /* #define BTM_DEF_LOCAL_NAME "Realtek Bluetooth" */ @@ -70,4 +72,61 @@ #define BT_HCI_DEVICE_NODE_MAX_LEN 512 #define KERNEL_MISSING_CLOCK_BOOTTIME_ALARM TRUE + +#else +#define BTM_DEF_LOCAL_NAME "BPI-M64" +#define BTA_DM_COD {0x20, BTM_COD_MAJOR_AUDIO, BTM_COD_MINOR_SET_TOP_BOX} + +#define BLE_VND_INCLUDED TRUE + +// Turn off BLE_PRIVACY_SPT. Remote reconnect fails on +// often if this is enabled. +#define BLE_PRIVACY_SPT FALSE + +// Force connection interval to 13.75ms +#define BTM_BLE_CONN_INT_MIN_DEF 11 /* 13.75ms = 11 * 1.25 */ +#define BTM_BLE_CONN_INT_MAX_DEF BTM_BLE_CONN_INT_MIN_DEF + +// Allow better battery life +#define BTM_BLE_CONN_SLAVE_LATENCY_DEF 24 + +// Detect disconnects faster +#define BTM_BLE_CONN_TIMEOUT_DEF 300 + +// Increase background scanning to reduce reconnect time +#define BTM_BLE_SCAN_SLOW_INT_1 110 /* 68.75 ms = 110 *0.625 */ +#define BTM_BLE_SCAN_SLOW_WIN_1 8 /* 5 ms = 8 *0.625 */ + +// Disable HFP +#define BTIF_HF_SERVICES (BTA_HSP_SERVICE_MASK) +#define BTIF_HF_SERVICE_NAMES { BTIF_HSAG_SERVICE_NAME, NULL } + +// Disable compiling code in Bluedroid for profiles we don't support +#define BTA_PAN_INCLUDED FALSE +#define BNEP_INCLUDED FALSE +#define AVDT_INCLUDED FALSE +#define PAN_INCLUDED FALSE +#define AVCT_INCLUDED FALSE + +/* We will support a remote + 4 game controllers. To be able to + * allocate sufficient bandwidth for all devices we will restrict the + * Game Controllers to a sniff interval of 13.75ms. + */ +#define BTA_DM_PM_SNIFF4_MAX 22 +#define BTA_DM_PM_SNIFF4_MIN 22 +#define BTA_DM_PM_SNIFF4_ATTEMPT 1 +#define BTA_DM_PM_SNIFF4_TIMEOUT 0 + +#define BTA_DM_PM_SNIFF_HH_OPEN_IDX BTA_DM_PM_SNIFF4 +#define BTA_DM_PM_HH_OPEN_DELAY 0 + +#define BTA_DM_PM_SNIFF_HH_ACTIVE_IDX BTA_DM_PM_SNIFF4 +#define BTA_DM_PM_HH_ACTIVE_DELAY 0 + +#define BTA_DM_PM_SNIFF_HH_IDLE_IDX BTA_DM_PM_SNIFF4 +#define BTA_DM_PM_HH_IDLE_DELAY 0 + +// Change I/O capabilities to output only so pairing uses passkey instead of pin +#define BTM_LOCAL_IO_CAPS BTM_IO_CAP_OUT +#endif #endif diff --git a/android/device/softwinner/tulip-m64/configs/bluetooth/vnd_tulip-m64.txt b/android/device/softwinner/tulip-m64/configs/bluetooth/vnd_tulip-m64.txt new file mode 100755 index 0000000000..1a69211177 --- /dev/null +++ b/android/device/softwinner/tulip-m64/configs/bluetooth/vnd_tulip-m64.txt @@ -0,0 +1,21 @@ +#Set baudrate to 1500000 +UART_TARGET_BAUD_RATE=1500000 +BLUETOOTH_UART_DEVICE_PORT = "/dev/ttyS1" +FW_PATCHFILE_LOCATION = "/system/vendor/modules/" +LPM_IDLE_TIMEOUT_MULTIPLE = 5 +LPM_SLEEP_MODE = FALSE +BT_WAKE_VIA_PROC = TRUE +BTVND_DBG = TRUE +BTHW_DBG = TRUE +VNDUSERIAL_DBG = TRUE +UPIO_DBG = TRUE +SCO_PCM_ROUTING = 0x00 +SCO_PCM_IF_CLOCK_RATE = 0x04 +SCO_PCM_IF_FRAME_TYPE = 0x00 +SCO_PCM_IF_SYNC_MODE = 0x00 +SCO_PCM_IF_CLOCK_MODE = 0x00 +PCM_DATA_FMT_SHIFT_MODE = 0x00 +PCM_DATA_FMT_FILL_BITS = 0x03 +PCM_DATA_FMT_FILL_METHOD = 0x00 +PCM_DATA_FMT_FILL_NUM = 0x00 +PCM_DATA_FMT_JUSTIFY_MODE = 0x0 diff --git a/android/device/softwinner/tulip-m64/configs/init.wireless.rc b/android/device/softwinner/tulip-m64/configs/init.wireless.rc index e26506b96d..33cfff308f 100755 --- a/android/device/softwinner/tulip-m64/configs/init.wireless.rc +++ b/android/device/softwinner/tulip-m64/configs/init.wireless.rc @@ -6,6 +6,6 @@ on boot # Bluetooth # UART device - chmod 0660 /dev/rtk_btusb - chown bluetooth net_bt_admin /dev/rtk_btusb + chmod 0660 /dev/ttyS1 + chown bluetooth net_bt_admin /dev/ttyS1 diff --git a/android/hardware/aw/wlan/config/config.mk b/android/hardware/aw/wlan/config/config.mk index 0f1afd42bf..a5df05f4a8 100755 --- a/android/hardware/aw/wlan/config/config.mk +++ b/android/hardware/aw/wlan/config/config.mk @@ -19,3 +19,7 @@ PRODUCT_COPY_FILES += \ hardware/aw/wlan/config/wpa_supplicant_overlay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/wpa_supplicant_overlay.conf \ hardware/aw/wlan/config/p2p_supplicant_overlay.conf:$(TARGET_COPY_OUT_VENDOR)/etc/wifi/p2p_supplicant_overlay.conf ######################## + +PRODUCT_COPY_FILES += \ + $(TOP_DIR)device/softwinner/common/init.wireless.broadcom.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.wireless.broadcom.rc \ + $(TOP_DIR)device/softwinner/$(basename $(TARGET_DEVICE))/configs/init.wireless.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/init.wireless.rc