From afbc34f04aacc7694e1eb49e9fe1dab24cab0258 Mon Sep 17 00:00:00 2001 From: Gonzalo Ruiz Date: Mon, 16 Mar 2020 18:15:52 +0100 Subject: [PATCH] firmware-qualcomm: generalize bluetooth customizations Generalize 'Disable Deep Sleep' and 'Enable Internal clock' customizations so they can be applied on every platform by defining BT_INTCLOCK_WORKAROUND to '1'. Disable the customizations by default and enable them for ccimx6ul only. Signed-off-by: Gonzalo Ruiz (cherry picked from commit 78ef498178abe587d6e2cb4b1ed8ba5f8979fb4e) --- .../firmware-qualcomm/firmware-qualcomm.bb | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm.bb b/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm.bb index e73ad50e7..0015d1384 100644 --- a/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm.bb +++ b/meta-digi-arm/recipes-bsp/firmware-qualcomm/firmware-qualcomm.bb @@ -8,6 +8,9 @@ LIC_FILES_CHKSUM = "file://${DIGI_EULA_FILE};md5=8c0ad592dd48ace3d25eed5bbb26ba7 # Selects whether to use proprietary or community driver QUALCOMM_WIFI_DRIVER ?= "proprietary" +# Selects whether to apply the "Deep Sleep + Internal Clock" workaround +BT_INTCLOCK_WORKAROUND ?= "0" +BT_INTCLOCK_WORKAROUND_ccimx6ul = "1" # Bluetooth firmware files FW_QUALCOMM_BT = " \ file://qca65X4_bt/nvm_tlv_3.2.bin \ @@ -83,13 +86,13 @@ do_install() { # Disable IBS over H4 for all the platforms in the bluetooth firmware awk 'BEGIN{printf "%c", 0x02}' | dd of="${D}${base_libdir}/firmware/qca/nvm_tlv_3.2.bin" bs=1 seek=54 count=1 conv=notrunc,fsync -} -do_install_append_ccimx6ul() { - # Disable DEEP SLEEP in the bluetooth firmware - awk 'BEGIN{printf "%c", 0x00}' | dd of="${D}${base_libdir}/firmware/qca/nvm_tlv_3.2.bin" bs=1 seek=74 count=1 conv=notrunc,fsync - # Enable Internal Clock in the bluetooth firmware - awk 'BEGIN{printf "%c%c", 0x01, 0x00}' | dd of="${D}${base_libdir}/firmware/qca/nvm_tlv_3.2.bin" bs=1 seek=93 count=2 conv=notrunc,fsync + if "${@oe.utils.conditional('BT_INTCLOCK_WORKAROUND', '1', 'true', 'false', d)}"; then + # Disable DEEP SLEEP in the bluetooth firmware + awk 'BEGIN{printf "%c", 0x00}' | dd of="${D}${base_libdir}/firmware/qca/nvm_tlv_3.2.bin" bs=1 seek=74 count=1 conv=notrunc,fsync + # Enable Internal Clock in the bluetooth firmware + awk 'BEGIN{printf "%c%c", 0x01, 0x00}' | dd of="${D}${base_libdir}/firmware/qca/nvm_tlv_3.2.bin" bs=1 seek=93 count=2 conv=notrunc,fsync + fi } QCA_MODEL ?= "qca6564"