* [PATCH v1] Bluetooth: btusb: support download nvm with different board id for wcn6855
@ 2020-12-03 4:57 Zijun Hu
2020-12-03 7:55 ` kernel test robot
2020-12-03 14:05 ` Marcel Holtmann
0 siblings, 2 replies; 3+ messages in thread
From: Zijun Hu @ 2020-12-03 4:57 UTC (permalink / raw)
To: marcel, johan.hedberg
Cc: linux-kernel, linux-bluetooth, linux-arm-msm, bgodavar, c-hbandi,
hemantg, mka, rjliao, zijuhu, tjiang
From: Tim Jiang <tjiang@codeaurora.org>
we define many nvm files for wcn6855 btsoc and host driver
should find the correct nvm file based on board ID and then
download it.
Signed-off-by: Tim Jiang <tjiang@codeaurora.org>
---
drivers/bluetooth/btusb.c | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 3bbe8f43e7fa..c5d4a3084282 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -3469,12 +3469,14 @@ static int btusb_set_bdaddr_wcn6855(struct hci_dev *hdev,
#define QCA_SYSCFG_UPDATED 0x40
#define QCA_PATCH_UPDATED 0x80
#define QCA_DFU_TIMEOUT 3000
+#define QCA_FLAG_MULTI_NVM 0x80
struct qca_version {
__le32 rom_version;
__le32 patch_version;
__le32 ram_version;
- __le32 ref_clock;
+ __le16 board_id;
+ __le16 flag;
__u8 reserved[4];
} __packed;
@@ -3657,8 +3659,14 @@ static int btusb_setup_qca_load_nvm(struct hci_dev *hdev,
char fwname[64];
int err;
- snprintf(fwname, sizeof(fwname), "qca/nvm_usb_%08x.bin",
- le32_to_cpu(ver->rom_version));
+ if (((ver->flag >> 8) & 0xff) == QCA_FLAG_MULTI_NVM) {
+ snprintf(fwname, sizeof(fwname), "qca/nvm_usb_%08x_%04x.bin",
+ le32_to_cpu(ver->rom_version),
+ le16_to_cpu(ver->board_id));
+ } else {
+ snprintf(fwname, sizeof(fwname), "qca/nvm_usb_%08x.bin",
+ le32_to_cpu(ver->rom_version));
+ }
err = request_firmware(&fw, fwname, &hdev->dev);
if (err) {
@@ -3725,6 +3733,11 @@ static int btusb_setup_qca(struct hci_dev *hdev)
return err;
}
+ err = btusb_qca_send_vendor_req(udev, QCA_GET_TARGET_VERSION, &ver,
+ sizeof(ver));
+ if (err < 0)
+ return err;
+
if (!(status & QCA_SYSCFG_UPDATED)) {
err = btusb_setup_qca_load_nvm(hdev, &ver, info);
if (err < 0)
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1] Bluetooth: btusb: support download nvm with different board id for wcn6855
2020-12-03 4:57 [PATCH v1] Bluetooth: btusb: support download nvm with different board id for wcn6855 Zijun Hu
@ 2020-12-03 7:55 ` kernel test robot
2020-12-03 14:05 ` Marcel Holtmann
1 sibling, 0 replies; 3+ messages in thread
From: kernel test robot @ 2020-12-03 7:55 UTC (permalink / raw)
To: Zijun Hu, marcel, johan.hedberg
Cc: kbuild-all, linux-kernel, linux-bluetooth, linux-arm-msm,
bgodavar, c-hbandi, hemantg, mka, rjliao
[-- Attachment #1: Type: text/plain, Size: 3751 bytes --]
Hi Zijun,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on bluetooth-next/master]
[also build test WARNING on linux/master linus/master v5.10-rc6 next-20201201]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Zijun-Hu/Bluetooth-btusb-support-download-nvm-with-different-board-id-for-wcn6855/20201203-130200
base: https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git master
config: arm-randconfig-s031-20201203 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-179-ga00755aa-dirty
# https://github.com/0day-ci/linux/commit/623a173767a07fecb449a96f4f897379a4dcd9ba
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Zijun-Hu/Bluetooth-btusb-support-download-nvm-with-different-board-id-for-wcn6855/20201203-130200
git checkout 623a173767a07fecb449a96f4f897379a4dcd9ba
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
"sparse warnings: (new ones prefixed by >>)"
drivers/bluetooth/btusb.c:1841:18: sparse: sparse: cast to restricted __le16
drivers/bluetooth/btusb.c:1845:18: sparse: sparse: cast to restricted __le16
drivers/bluetooth/btusb.c:1849:18: sparse: sparse: cast to restricted __le16
drivers/bluetooth/btusb.c:1853:18: sparse: sparse: cast to restricted __le16
drivers/bluetooth/btusb.c:1857:18: sparse: sparse: cast to restricted __le16
drivers/bluetooth/btusb.c:2367:25: sparse: sparse: cast to restricted __le16
drivers/bluetooth/btusb.c:2376:25: sparse: sparse: cast to restricted __le16
drivers/bluetooth/btusb.c:2377:25: sparse: sparse: cast to restricted __le16
drivers/bluetooth/btusb.c:2378:25: sparse: sparse: cast to restricted __le16
drivers/bluetooth/btusb.c:3631:28: sparse: sparse: cast to restricted __le32
>> drivers/bluetooth/btusb.c:3662:18: sparse: sparse: restricted __le16 degrades to integer
vim +3662 drivers/bluetooth/btusb.c
3653
3654 static int btusb_setup_qca_load_nvm(struct hci_dev *hdev,
3655 struct qca_version *ver,
3656 const struct qca_device_info *info)
3657 {
3658 const struct firmware *fw;
3659 char fwname[64];
3660 int err;
3661
> 3662 if (((ver->flag >> 8) & 0xff) == QCA_FLAG_MULTI_NVM) {
3663 snprintf(fwname, sizeof(fwname), "qca/nvm_usb_%08x_%04x.bin",
3664 le32_to_cpu(ver->rom_version),
3665 le16_to_cpu(ver->board_id));
3666 } else {
3667 snprintf(fwname, sizeof(fwname), "qca/nvm_usb_%08x.bin",
3668 le32_to_cpu(ver->rom_version));
3669 }
3670
3671 err = request_firmware(&fw, fwname, &hdev->dev);
3672 if (err) {
3673 bt_dev_err(hdev, "failed to request NVM file: %s (%d)",
3674 fwname, err);
3675 return err;
3676 }
3677
3678 bt_dev_info(hdev, "using NVM file: %s", fwname);
3679
3680 err = btusb_setup_qca_download_fw(hdev, fw, info->nvm_hdr);
3681
3682 release_firmware(fw);
3683
3684 return err;
3685 }
3686
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 25671 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v1] Bluetooth: btusb: support download nvm with different board id for wcn6855
2020-12-03 4:57 [PATCH v1] Bluetooth: btusb: support download nvm with different board id for wcn6855 Zijun Hu
2020-12-03 7:55 ` kernel test robot
@ 2020-12-03 14:05 ` Marcel Holtmann
1 sibling, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2020-12-03 14:05 UTC (permalink / raw)
To: Zijun Hu
Cc: Johan Hedberg, LKML, linux-bluetooth, MSM,
Balakrishna Godavarthi, c-hbandi, Hemantg, mka, rjliao, tjiang
Hi Zijun,
> we define many nvm files for wcn6855 btsoc and host driver
> should find the correct nvm file based on board ID and then
> download it.
>
> Signed-off-by: Tim Jiang <tjiang@codeaurora.org>
> ---
> drivers/bluetooth/btusb.c | 19 ++++++++++++++++---
> 1 file changed, 16 insertions(+), 3 deletions(-)
patch has been applied to bluetooth-next tree.
Regards
Marcel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-12-03 14:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03 4:57 [PATCH v1] Bluetooth: btusb: support download nvm with different board id for wcn6855 Zijun Hu
2020-12-03 7:55 ` kernel test robot
2020-12-03 14:05 ` Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).