Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1650456 > unrolled thread
| Started by | Rob Herring <robh+dt@kernel.org> |
|---|---|
| First post | 2017-05-25 14:50 +0200 |
| Last post | 2017-06-06 21:00 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [RFC 0/3] misc: new serdev based drivers for w2sg00x4 GPS module and w2cbw003 wifi/bluetooth Rob Herring <robh+dt@kernel.org> - 2017-05-25 14:50 +0200
Re: [RFC 0/3] misc: new serdev based drivers for w2sg00x4 GPS module and w2cbw003 wifi/bluetooth "H. Nikolaus Schaller" <hns@goldelico.com> - 2017-06-06 21:00 +0200
| From | Rob Herring <robh+dt@kernel.org> |
|---|---|
| Date | 2017-05-25 14:50 +0200 |
| Subject | Re: [RFC 0/3] misc: new serdev based drivers for w2sg00x4 GPS module and w2cbw003 wifi/bluetooth |
| Message-ID | <tL0ng-8hT-19@gated-at.bofh.it> |
On Tue, May 23, 2017 at 8:49 AM, H. Nikolaus Schaller <hns@goldelico.com> wrote: > Hi Rob, > >> Am 23.05.2017 um 15:10 schrieb Rob Herring <robh+dt@kernel.org>: >> >> +Marcel > > Good! > >> >> On Tue, May 23, 2017 at 7:48 AM, H. Nikolaus Schaller <hns@goldelico.com> wrote: >>> Hi Rob, >>> >>>> Am 23.05.2017 um 14:28 schrieb Rob Herring <robh+dt@kernel.org>: >>>> >>>> On Tue, May 23, 2017 at 12:43 AM, H. Nikolaus Schaller >>>> <hns@goldelico.com> wrote: >>>>> Hi Rob, >>>>> >>>>>> Am 23.05.2017 um 04:26 schrieb Rob Herring <robh+dt@kernel.org>: >>>>>> >>>>>> On Sun, May 21, 2017 at 5:44 AM, H. Nikolaus Schaller <hns@goldelico.com> wrote: >>>>>>> Since our proposed API was not acceptable and the new serdev API has arrived in 4.11 kernels, >>>>>>> we finally took the challenge to update the w2sg and w2cbw drivers to use the serdev API. >>>>>>> >>>>>>> The approach is to write a "man in the middle" driver which is on one side a serdev client >>>>>>> which directly controls the UART where the device is connected to and on the other side >>>>>>> presents a new tty port so that user-space software can talk to the chips as if they would >>>>>>> directly talk to the UART of the SoC (e.g. ttyO1). This is similar to connecting to a remote >>>>>>> serial device e.g. through USB (ttyACM) or Bluetooth UART profiles. >>>>>>> >>>>>>> For example gpsd or hciattach expect a /dev/tty they can control (flow control, baud rate >>>>>>> etc.). >>>>>> >>>>>> I understand from the prior discussion why you want to pass the data >>>>>> thru for gps, but why do you need to do that for BT? >>>>> >>>>> Because we otherwise can't turn on power when /dev/ttyBT0 is opened and turn off when it >>>>> is closed. I.e. it should not be powered unless someone does a hciattach /dev/ttyBT0. And it >>>>> should be turned off by a killall hciattach. >>>> >>>> Still, you can do power control within BT HCI drivers. >>> >>> We do not use any driver for bluetooth. We just start hciattach on demand. >>> And afaik there is no plugin mechanism for adding power control to hciattach. >> >> You don't need hciattach. All userspace has to do for kernel BT >> drivers is "hciconfig hci0 up|down". > > Hm. Well: > > root@letux:~# hciconfig hci0 up > Can't get device info: No such device > root@letux:~# > > I wonder how I can tell hciconfig about the UART port if not by running hciattach /dev/ttyBT0? You don't create a tty device. Instead you call hci_uart_register_device from the serdev probe. >>> Or do you have a link to what you think about? >> >> Look at the nokia BT or TI (HCI_LL) BT drivers. Those both have f/w >> downloading and some GPIO controls. Given that this module is based on >> Marvell chipset, I'd expect you need to add serdev support to >> hci_mrvl.c. > > The w2cb003 has a Marvell WiFi (libertas) but a CSR Bluetooth side. > > It has built-in firmware and already talks serial HCI over simple UART right > after power-on. This is why our serdev driver has no firmware download. Okay, then probably add serdev support to hci_bcsp. In any case, hci_uart_register_device just needs to register the correct protocol. Rob
[toc] | [next] | [standalone]
| From | "H. Nikolaus Schaller" <hns@goldelico.com> |
|---|---|
| Date | 2017-06-06 21:00 +0200 |
| Subject | Re: [RFC 0/3] misc: new serdev based drivers for w2sg00x4 GPS module and w2cbw003 wifi/bluetooth |
| Message-ID | <tPrRT-48M-15@gated-at.bofh.it> |
| In reply to | #1650456 |
Hi Rob, thanks for all the comments. > Am 25.05.2017 um 14:48 schrieb Rob Herring <robh+dt@kernel.org>: > > On Tue, May 23, 2017 at 8:49 AM, H. Nikolaus Schaller <hns@goldelico.com> wrote: >> Hi Rob, >> >>> Am 23.05.2017 um 15:10 schrieb Rob Herring <robh+dt@kernel.org>: >>> >>> +Marcel >> >> Good! >> >> Hm. Well: >> >> root@letux:~# hciconfig hci0 up >> Can't get device info: No such device >> root@letux:~# >> >> I wonder how I can tell hciconfig about the UART port if not by running hciattach /dev/ttyBT0? > > You don't create a tty device. Instead you call > hci_uart_register_device from the serdev probe. I see. That is also brand new API in 4.12. > >>>> Or do you have a link to what you think about? >>> >>> Look at the nokia BT or TI (HCI_LL) BT drivers. Those both have f/w >>> downloading and some GPIO controls. Given that this module is based on >>> Marvell chipset, I'd expect you need to add serdev support to >>> hci_mrvl.c. >> >> The w2cb003 has a Marvell WiFi (libertas) but a CSR Bluetooth side. >> >> It has built-in firmware and already talks serial HCI over simple UART right >> after power-on. This is why our serdev driver has no firmware download. > > Okay, then probably add serdev support to hci_bcsp. In any case, > hci_uart_register_device just needs to register the correct protocol. Hm. I have tried to understand the hci_bcsp stuff but I must admit that we lack quick enough understanding of such magic, to be able to add serdev support with reasonable efforts. Is there a good description how hci_bcsp it works? And I found: BCSP (BlueCore Serial Protocol) is serial protocol for communication between Bluetooth device and host. This protocol is required for non USB Bluetooth devices based on CSR BlueCore chip, including PCMCIA and CF cards. It appears as if the w2cbw003 bluetooth is really based on a BlueCore chip (there are 2 references in http://www.wi2wi.com/mgr/docs/W2CBW003_Datasheet_Rev1.8.pdf ). Therefore it might be possible to use BCSP but that are completely new horizons. But so far we have simply used "hciattach any" mode for years. We also know that the Gumstix Storm uses the same w2cbw wifi/bluetooth combo (omap3-overo-base.dtsi) but there also appears to be no BCSP support in the kernel. BTW: it looks as if they simply turn on bluetooth as soon as WiFi is configured up. So they could be interested in a more precise power management driver like what we propose. Maybe someone who owns an older Gumstix with the same chip (they were phased out in 2015 and replaced by TI modules) can help or jump into this discussion. Thanks and BR, Nikolaus
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web