Forums - [BT] QCA9377 driver porting to ARM

20 posts / 0 new
Last post
[BT] QCA9377 driver porting to ARM
suhas.kunnath
Join Date: 14 Mar 18
Posts: 8
Posted: Thu, 2018-05-24 23:15

Hi,

We are trying to port qca9377.lea_.1.0_qdn_r1000015.2.tgz driver to an ARM based board.

Since the only document available for compiling the driver is for x86 platform, we are trying to cross-compile the package component wise.

We got bluez5.19 patched and built. We also have the linux kernel 4.4 also patched with the available patches and built.

But when we try
hciattach /dev/ttymxc0 qca
it loads the firmware and rampatch with lot of prints. And at the end after setting N_HCI line discipline it fails.
It says "Can't set device: Protocol not supported"
log : https://pastebin.com/raw/NcHBqdqb
And when we looked into the code we found that in hciattach code it is trying to set HCI_UART_IBS protocol when "qca" type is specified in the command line invocation.
But in the kernel driver there is no mention of this protocol and thus the ioctl call fails.
We could not find a patch that would add this protocol to the kernel driver.
The file backports.sh is trying to download some patch files to build the kernel driver with the In Band Sleep feature. But those files are getting downloaded as 0KB files. For example,
wget https://source.codeaurora.org/external/thundersoft/kernel/msm-3.10/patch... -O 0007-Bluetooth-add-Qualcomm-In-Band-Sleep-support-to-hci_.patch
is downloading a 0KB file.

How can we get this to work? Do you have any other set of patches for the kernel driver? Is there any document for cross compiling the qca9377.lea_.1.0_qdn_r1000015.2.tgz driver package?

  • Up0
  • Down0
matadeen
Join Date: 12 Oct 17
Posts: 29
Posted: Fri, 2018-05-25 04:59

Could  you please share the bluez5.19 patch, need to cross check.

  • Up0
  • Down0
suhas.kunnath
Join Date: 14 Mar 18
Posts: 8
Posted: Fri, 2018-05-25 05:15

Thank you for looking into the isssue.

There is a set of patches. So I have uploaded on google drive as an archive.
link : https://drive.google.com/file/d/13o9mBm9AUMY3K7se2S1lMBL9EeyLENdC/view?u...

  • Up0
  • Down0
matadeen
Join Date: 12 Oct 17
Posts: 29
Posted: Sun, 2018-05-27 19:24
Thanks for sharing the patch , I am looking into it. Can you please try with below command: 1. ./hciattach /dev/ttymxc0 qca 3000000 -t 120 flow 2./hciattach /dev/ttymxc0 qca 115200 noflow Share me the kernel patch also.
  • Up0
  • Down0
suhas.kunnath
Join Date: 14 Mar 18
Posts: 8
Posted: Sun, 2018-05-27 21:20

1. hciattach /dev/ttymxc0 qca 3000000 -t 120 flow
Yeilded same result as before. "Can't set device: Protocol not supported" and no hci device present.

2. hciattach /dev/ttymxc0 qca 115200 noflow
qca
frame_hci_cmd_pkt: Sending EDL_PATCH_VER_REQ_CMD
HCI-CMD -1:     0x1     0x0     0xfc    0x1     0x19
read_vs_hci_event: Wait for HCI-Vendor Specfic Event from SOC
wait_for_data: Timing out on select for 3 secs.
hci_send_vs_cmd: Failed to get HCI-VS Event from SOC
Failed to attach the patch payload to the Controller!
qca_soc_init: Fail to get Rome Version (0xffffff92)
Can't initialize device: Success

Kernel patches link: https://drive.google.com/open?id=1fcCA6CV4MMGus9YrBPqpdmxzARyOVeHm

  • Up0
  • Down0
suhas.kunnath
Join Date: 14 Mar 18
Posts: 8
Posted: Mon, 2018-05-28 23:26

Hi matadeen,

Do you have any updates on the issue?

  • Up0
  • Down0
suhas.kunnath
Join Date: 14 Mar 18
Posts: 8
Posted: Tue, 2018-05-29 23:59

Hi matadeen,

Can you confirm that qca9377 has been tested with bluetooth 4.2 + HS support in an ARM-linux environment?
Can you confirm that all the relevant source code, rampatch and firmware are included in the release "qca9377.lea_.1.0_qdn_r1000015.2.tgz" to bring up the qca9377 in a linux environment with bluetooth 4.2 + HS support?

  • Up0
  • Down0
matadeen
Join Date: 12 Oct 17
Posts: 29
Posted: Thu, 2018-05-31 07:33

Hi suhas,

I am trying to replicate the issue locally. Please give me some time. By default it is with the Fluoride stack not Bluez.

We have tested and released for x86 platform, not on the ARM linux environment. 

yes it have Bluetooth 4.2 +HS support. 

Regards,

Matadeen Mishra

  • Up0
  • Down0
matadeen
Join Date: 12 Oct 17
Posts: 29
Posted: Thu, 2018-05-31 07:41

Could you  find /dev/ttymxc0?

Can you please upload the kernel logs also.

  • Up0
  • Down0
suhas.kunnath
Join Date: 14 Mar 18
Posts: 8
Posted: Sun, 2018-06-03 22:02

Hi Matadeen,

We are able to access /dev/ttymxc0.
btattach -B /dev/ttymxc0 will bring up the hci0 device too. But without loding the rampatch/firmware. Bluetooth is in 4.1 mode.
btattach -B /dev/ttymxc0 -P qca fails. This will try to load some rampatch/firmware but names are different. Even if we rename the available files to match, it won't load.

Kernel log link : https://pastebin.com/raw/u9eqVHA2

  • Up0
  • Down0
suhas.kunnath
Join Date: 14 Mar 18
Posts: 8
Posted: Mon, 2018-06-11 04:52

Hi Matadeen,

Is there any update on the issue?

  • Up0
  • Down0
matadeen
Join Date: 12 Oct 17
Posts: 29
Posted: Wed, 2018-06-20 07:36

Hi suhas,

Could you please change below in your file it should fix the issue.

/tools/hciattach.c

        /* QCA ROME */
-        { "qca",    0x0000, 0x0000, HCI_UART_IBS, 115200, 115200,
+        { "qca",    0x0000, 0x0000, HCI_UART_H4, 115200, 115200,
                         FLOW_CTL, DISABLE_PM, NULL, qca, NULL },
 
Regards,
Matadeen Mishra
  • Up0
  • Down0
ivascumihaita
Join Date: 16 Nov 18
Posts: 1
Posted: Fri, 2018-11-16 07:11

Hello,

    Is my first post in this forum, i am not sure is the best way to post my problem to an existing post but I get a message that I cannot post new content on this forum.

    And this post is the closest it gets to my current issue.

   I am working wih QCA9378 chip and want to enable Bluetooth interface. The hardware is based on imx6ul CPU and I try to enable the interface on several kernels: 4.6.x, 4.8.x, 4.12.x, Th e only one it works is 4.1.15

    I have ported bluetooth and parts of usb stack to the old 4.1.15 kernel but still is crashing. I am beginning to think maybe there is an issue with bluez 5.19 which I see the gentleman that opened this post experiencd also.

    I get the following output after long time when doing a hciattach:

    # hciattach /dev/ttyACM0 bcsp

 

 

[  158.348046] 7a60: 00000000 dd0ce000 600e0013 dd758808 024000c0 dd758808 d8777bc0 d8777b14
[  158.356260] 7a80: d8729400 d8777abc d8777a50 d8777aa8 c016bd48 c08c4744 200e0013 ffffffff
[  158.364458]  r10:d8729400 r9:d8777b14 r8:d8777bc0 r7:d8777a8c r6:ffffffff r5:200e0013
[  158.372442]  r4:c08c4744
[  158.375044] [<c08c4708>] (_raw_spin_unlock_irqrestore) from [<c020a9e4>] (dma_pool_alloc+0x190/0x22c)
[  158.384285]  r5:dd758800 r4:dec7b600
[  158.387951] [<c020a854>] (dma_pool_alloc) from [<c05cd690>] (ehci_qtd_alloc+0x1c/0x60)
[  158.395891]  r10:d8729400 r9:dd6219d0 r8:d8777bc0 r7:00000000 r6:dd9d8e80 r5:dd9d8e88
[  158.403878]  r4:dd9d8e80
[  158.406474] [<c05cd674>] (ehci_qtd_alloc) from [<c05cd814>] (qh_urb_transaction+0x2c/0x474)
[  158.414847]  r5:dd9d8e88 r4:dd9d8e80
[  158.418514] [<c05cd7e8>] (qh_urb_transaction) from [<c05d2188>] (ehci_urb_enqueue+0x60/0xdbc)
[  158.427062]  r10:d8729400 r9:dd621800 r8:024000c0 r7:00000000 r6:dd9d8e80 r5:dd9d8e88
[  158.435046]  r4:d8777bc0
[  158.437644] [<c05d2128>] (ehci_urb_enqueue) from [<c05b7c50>] (usb_hcd_submit_urb+0xb4/0x86c)
[  158.446190]  r10:d8729400 r9:00000003 r8:024000c0 r7:00000000 r6:dd621800 r5:dd9d8e88
[  158.454175]  r4:dd9d8e80
[  158.456772] [<c05b7b9c>] (usb_hcd_submit_urb) from [<c05b93a4>] (usb_submit_urb+0x2a8/0x4fc)
[  158.465231]  r10:d8729400 r9:00000003 r8:00000204 r7:00000002 r6:dd717400 r5:024000c0
[  158.473215]  r4:dd9d8e80
[  158.475831] [<c05b90fc>] (usb_submit_urb) from [<bf07624c>] (acm_submit_read_urb+0x48/0x8c [cdc_acm])
[  158.485075]  r10:d8729400 r9:00000102 r8:dda2d800 r7:dda2db60 r6:dda2d800 r5:0000000f
[  158.493060]  r4:024000c0
[  158.495682] [<bf076204>] (acm_submit_read_urb [cdc_acm]) from [<bf077a38>] (acm_port_activate+0x13c/0x1a4 [cdc_acm])
[  158.506224]  r7:0000000f r6:dda2dd38 r5:00000000 r4:dda2d80c
[  158.512044] [<bf0778fc>] (acm_port_activate [cdc_acm]) from [<c0474420>] (tty_port_open+0x88/0xc8)
[  158.521027]  r9:00000102 r8:c1546ad8 r7:d87e93c0 r6:dda2d92c r5:d8729400 r4:dda2d80c
[  158.528960] [<c0474398>] (tty_port_open) from [<bf077488>] (acm_tty_open+0x20/0x24 [cdc_acm])
[  158.537506]  r9:00000102 r8:c1546ad8 r7:d873f650 r6:0a600000 r5:d87e93c0 r4:d8729400
[  158.545435] [<bf077468>] (acm_tty_open [cdc_acm]) from [<c046cbcc>] (tty_open+0xbc/0x674)
[  158.553655] [<c046cb10>] (tty_open) from [<c0218c64>] (chrdev_open+0xa4/0x180)
[  158.560899]  r10:00000000 r9:00000000 r8:00000000 r7:c093b0f4 r6:d87e93c0 r5:d873f650
[  158.568886]  r4:c40e13c0
[  158.571483] [<c0218bc0>] (chrdev_open) from [<c0211b40>] (do_dentry_open+0x1e4/0x308)
[  158.579333]  r7:c0218bc0 r6:d87e93c8 r5:d873f650 r4:d87e93c0
[  158.585132] [<c021195c>] (do_dentry_open) from [<c0212d28>] (vfs_open+0x60/0x88)
[  158.592550]  r9:00000000 r8:00000000 r7:d8777ea8 r6:d8777f5c r5:d87e93c0 r4:d8777ea8
[  158.600469] [<c0212cc8>] (vfs_open) from [<c0221d78>] (path_openat+0x4e0/0x1024)
[  158.607888]  r5:00000102 r4:de001508
[  158.611558] [<c0221898>] (path_openat) from [<c022447c>] (do_filp_open+0x68/0xcc)
[  158.619062]  r10:00000000 r9:d8776000 r8:c0107f84 r7:00000001 r6:d8777f5c r5:d8777ea8
[  158.627049]  r4:00000003
[  158.629644] [<c0224414>] (do_filp_open) from [<c0213070>] (do_sys_open+0x108/0x1c8)
[  158.637322]  r7:00000005 r6:d879f000 r5:ffffff9c r4:00000003
[  158.643123] [<c0212f68>] (do_sys_open) from [<c0213150>] (SyS_open+0x20/0x24)
[  158.650278]  r9:d8776000 r8:c0107f84 r7:00000005 r6:be99dd84 r5:be99cc08 r4:00037390
[  158.658195] [<c0213130>] (SyS_open) from [<c0107de0>] (ret_fast_syscall+0x0/0x1c)

 

   Does anybody know if there could be bluez issues and why it works only with 4.1.15 kernel. This issue has been reproduces by several engineers worldwide on different ARM platforms.

 

Thanks,

       Mihaita

  • Up0
  • Down0
matadeen
Join Date: 12 Oct 17
Posts: 29
Posted: Sun, 2019-01-20 01:23

Hi Mihaita,

Could you please share the patch you have applied to the Kernel and BlueZ.

Also share the kernel logs and terminal logs of (hciattach /dev/ttyACM0 bcsp).

Regards,

Matadeen Mishra

  • Up0
  • Down0
silvia.ritsch
Join Date: 31 Mar 20
Posts: 3
Posted: Thu, 2020-04-23 06:03

Hi,

I am having the same issue as suhas.kunnath on my arm platform. I have patched and built bluez using bluez.sh from qca9377.lea_.3.0_qdn_r3000017.1.tgz.

Running

hciattach /dev/ttyPS1 qca 3000000 noflow

outputs

qca
frame_hci_cmd_pkt: Sending EDL_PATCH_VER_REQ_CMD
HCI-CMD -1:     0x1     0x0     0xfc    0x1     0x19
read_vs_hci_event: Wait for HCI-Vendor Specfic Event from SOC
wait_for_data: Timing out on select for 3 secs.
hci_send_vs_cmd: Failed to get HCI-VS Event from SOC
Failed to attach the patch payload to the Controller!
qca_soc_init: Fail to get Rome Version (0xffffff92)
Can't initialize device: Success

There are no outputs on dmesg.

Editing tools/hciattach.c does not change the result for me. 

* Are there any guides available aside from "QCA6174A/QCA9377 WLAN and Bluetooth on Linux x86 Porting Guide"?

* Is there a way to use official bluez without patches?

* I have copied nvm_tlv_3.2.bin and rampatch_tlv_3.2.tlv to /lib/firmware/ar3k, is that correct? And is more firmware needed?

Have a nice day

  • Up0
  • Down0
matadeen
Join Date: 12 Oct 17
Posts: 29
Posted: Sun, 2020-04-26 01:05

Dear silvia,

You can refer the Doc#80-YC321-9. 

if you are getting still issue, please share the dmesg logs. 

Regards,

Matadeen Mishra

  • Up0
  • Down0
silvia.ritsch
Join Date: 31 Mar 20
Posts: 3
Posted: Sun, 2020-04-26 23:48

Dear Matadeen,

where can I find this document?
Attempting hciattach produces no output on dmesg.

Regards,

Silvia

  • Up0
  • Down0
matadeen
Join Date: 12 Oct 17
Posts: 29
Posted: Thu, 2020-04-30 02:00

It will be available on the createpoint (https://createpoint.qti.qualcomm.com/dashboard/public/productkit#public/product-kit/search)

if in dmesg you are not getting any logs, something going worng , please check it. 

  • Up0
  • Down0
abbaraju.manojsai
Join Date: 4 Apr 22
Posts: 3
Posted: Fri, 2022-04-08 08:32

 

    Had u able to port the 9377 driver to arm based board . currently im working on it . can u breifly elaborate the steps required for it

  • Up0
  • Down0
abbaraju.manojsai
Join Date: 4 Apr 22
Posts: 3
Posted: Mon, 2022-04-11 04:29

 

had u able to port the driver to arm based , can u elaborate or brief me the steps required for it 

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.