diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.33/bluez-init b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.33/bluez-init index 7458716a2..96cf5a697 100755 --- a/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.33/bluez-init +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.33/bluez-init @@ -23,6 +23,7 @@ fi SCRIPTNAME="$(basename "${0}")" LOGFILE="/var/log/bluetoothd.log" +FIRMWARE_FILE="/lib/firmware/qca/nvm_tlv_3.2.bin" bt_init_qca6564() { MOD_VERSION="$(($(cat /proc/device-tree/digi,hwid,hv 2>/dev/null || true)))" @@ -32,8 +33,8 @@ bt_init_qca6564() { BT_EN_L="/sys/class/gpio/gpio${BT_EN_QCA_GPIO_NR}" [ -d "${BT_EN_L}" ] || printf "%s" ${BT_EN_QCA_GPIO_NR} > /sys/class/gpio/export printf out > ${BT_EN_L}/direction && sleep .1 - printf 0 > ${BT_EN_L}/value && sleep .1 - printf 1 > ${BT_EN_L}/value && sleep .1 + printf 0 > ${BT_EN_L}/value && sleep .2 + printf 1 > ${BT_EN_L}/value && sleep .2 [ -d "${BT_EN_L}" ] && printf "%s" ${BT_EN_QCA_GPIO_NR} > /sys/class/gpio/unexport # Module version older than revision 4 has swapped TX and RX lines @@ -47,7 +48,13 @@ bt_init_qca6564() { [ -d "${BT_CTS_L}" ] && printf "%s" ${BT_CTS_QCA_GPIO_NR} > /sys/class/gpio/unexport # Reduce the rate to avoid the need for HW flow control BT_RATE="115200" + BT_RATE_CODE="00" # 115200 bps BT_FLOW="noflow" + # Check the current FW file rate + if [ "$(hexdump -s 56 -n 1 -ve '1/1 "%.2x"' ${FIRMWARE_FILE})" != "${BT_RATE_CODE}" ]; then + # Modify the BT FW file rate + printf "\x${BT_RATE_CODE}" | dd of="${FIRMWARE_FILE}" bs=1 seek=56 count=1 conv=notrunc,fsync 2>/dev/null + fi fi if hciattach -t120 ttyBt qca ${BT_RATE:-3000000} ${BT_FLOW:-flow} 2>${LOGFILE}; then diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.33/ccimx6ul/0023-hciattach_rome-do-not-override-the-baudrate-in-the-N.patch b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.33/ccimx6ul/0023-hciattach_rome-do-not-override-the-baudrate-in-the-N.patch new file mode 100644 index 000000000..87424fb5b --- /dev/null +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5-5.33/ccimx6ul/0023-hciattach_rome-do-not-override-the-baudrate-in-the-N.patch @@ -0,0 +1,36 @@ +From: Isaac Hermida +Date: Fri, 30 Sep 2016 12:46:17 +0200 +Subject: [PATCH] hciattach_rome: do not override the baudrate in the NVM file + +Do not use hcitattach to override the NMV baudrate because we are +setting it directly in the firmware file. + +https://jira.digi.com/browse/DEL-3057 + +Signed-off-by: Isaac Hermida +--- + tools/hciattach_rome.c | 11 ++--------- + 1 file changed, 2 insertions(+), 9 deletions(-) + +diff --git a/tools/hciattach_rome.c b/tools/hciattach_rome.c +index 59bdc16e4e8f..4f0f8c82fa8d 100644 +--- a/tools/hciattach_rome.c ++++ b/tools/hciattach_rome.c +@@ -1903,15 +1903,8 @@ download: + } + fprintf(stderr, "%s: Download TLV file successfully \n", __FUNCTION__); + +- /* +- * Overriding the baud rate value in NVM file with the user +- * requested baud rate, since default baud rate in NVM file is 3M. +- */ +- err = rome_set_baudrate_req(fd, local_baud_rate, controller_baud_rate); +- if (err < 0) { +- fprintf(stderr, "%s: Baud rate change failed!\n", __FUNCTION__); +- goto error; +- } ++ /* Do not override the baudrate in the TLV file */ ++ fprintf(stderr, "%s: Skipping Override of baud rate!\n", __FUNCTION__); + + /* Perform HCI reset here*/ + err = rome_hci_reset_req(fd, local_baud_rate); diff --git a/meta-digi-dey/recipes-connectivity/bluez/bluez5_5.33.bbappend b/meta-digi-dey/recipes-connectivity/bluez/bluez5_5.33.bbappend index ea0c71714..06497331d 100644 --- a/meta-digi-dey/recipes-connectivity/bluez/bluez5_5.33.bbappend +++ b/meta-digi-dey/recipes-connectivity/bluez/bluez5_5.33.bbappend @@ -28,6 +28,7 @@ SRC_URI_append_ccimx6ul = " \ file://0017-bluetooth-Fix-flow-control-operation.patch \ file://0018-Adding-MDM-specific-code-under-_PLATFORM_MDM_.patch \ file://0019-Bluetooth-Fix-static-analysis-issues.patch \ + file://0023-hciattach_rome-do-not-override-the-baudrate-in-the-N.patch \ " inherit update-rc.d