From: Marcel Holtmann <marcel@holtmann.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Pavel Machek <pavel@ucw.cz>,
"ksummit-discuss@lists.linuxfoundation.org"
<ksummit-discuss@lists.linuxfoundation.org>,
"riverful.kim@samsung.com" <riverful.kim@samsung.com>,
"kyungmin.park@samsung.com" <kyungmin.park@samsung.com>,
John Stultz <john.stultz@linaro.org>,
Bjorn Andersson <bjorn.andersson@sonymobile.com>,
Greg KH <gregkh@linuxfoundation.org>
Subject: Re: [Ksummit-discuss] [CORE TOPIC] Mainline kernel on a cellphone
Date: Wed, 5 Aug 2015 10:19:56 -0700 [thread overview]
Message-ID: <8DD2E411-D4F7-45C0-8BBA-9E418E9EB084@holtmann.org> (raw)
In-Reply-To: <CACRpkda=Pr3+2kGfH0Kc4eNw5yMOFHbbeyEJbeLApa-YzCsxsw@mail.gmail.com>
Hi Linus,
>>> There's been some work by Neil Brown to create a UART slave
>>> bus[1] (...)
>
>> The work on UART slaves (or whatever it will be called eventually) is important
>> for Bluetooth and most likely GPS and NFC in the future. It then allows to define
>> all the nasty behind the curtain details of that UART via DT or ACPI in vendor drivers.
>
> I agree 100%, and I think I have a simple enough in-kernel usecase so I can
> get testing these series.
>
> It seems GPS and NFC and other code is being kept out of the kernel
> because of the absense of a UART slave bus and all the hazzle of handling
> this.
we have NFC subsystem in the kernel with wide vendor support. We can discuss why Android is insisting on doing NFC in userspace, but that is a complete different off-topic ;)
GPS is a bit of a funky one. Historically the NMEA protocol is pretty much bound to an UART running at 4800 baud. So I can see a bit of reasoning behind it. These days NMEA is not the only protocol and a some GPS chip companies have developed their own ones.
Also GPS is found as Serial Port over Bluetooth, as USB-Serial, as actually serial port and so on. Then you have the really funky ones where it is hooked over a Bluetooth HCI interface, or as part a magic AT command port of a GSM modem. And if you want to get really funky then you have NMEA over Qualcomm QMI protocol.
These days LTE modems normally include the GPS and GLONASS chip. So you have to go through the LTE modem to access it.
With the oFono telephony stack, we actually added a location provider API for getting access to GPS. So you can request GPS access via D-Bus and it will then return you an fd. That fd might map to a physical TTY, or a virtual port on the GSM 07.11 multiplexer or via QMI.
And there are more odd ones out there.
>> In a perfect world I would prefer we are not using the Bluetooth HCI line discipline
>> at all. The problem right now is that everybody wants to enable the UART as
>> /dev/ttyFOO and then move on. However in reality they are not general purpose
>> TTY devices. The only thing you can ever do with them is tell the Bluetooth
>> subsystem that there is a TTY device and attach its line discipline to it.
>
> This is done from userspace right? I never managed to wrap my head around
> this because it seemed so odd and plainly hackish.
>
> In this ST-Ericsson driver for CG2900:
> http://marc.info/?l=linux-kernel&m=134873373526049&w=2
> the HCI link is used to tunnel things that are not Bluetooth, also
> GPS and FM radio is controlled over HCI. Yeah sorry, I didn't invent
> it... the HCI is then run over a UART.
Yes, pretty much. TI calls this shared transport aka TI-ST which is also pretty messy. It hacks around setup problems that should be solved a clean way.
For example one cumbersome details back in the days was that the Bluetooth chip comes without a persistent address in these embedded devices. So the address is stored in the host filesystem or in a dedicated one-time flash section.
Of course to program and address, you need HCI commands. For starting the Bluetooth stack, you need a valid address. We added support for handling this chicken and egg problem cleanly by abstracting the bringup into a setup stage. So you can start the HCI transport without starting the Bluetooth stack.
This in the end also resulted in the support of what is called HCI User Channel. Meaning you can drive a Bluetooth stack from userspace if you wanted to, but you would use the Bluetooth subsystem still for the transport abstraction to the hardware and the initial setup like firmware loading and address programming. This lead to the nice feature that we can run Android's Bluedroid stack on top of the Linux Bluetooth subsystem and avoid having to enable hardware for different stacks over and over again.
Regards
Marcel
next prev parent reply other threads:[~2015-08-05 17:20 UTC|newest]
Thread overview: 84+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-23 10:57 Pavel Machek
2015-07-23 11:21 ` Linus Walleij
2015-07-23 12:14 ` Pavel Machek
2015-07-23 12:42 ` Steven Rostedt
2015-07-23 15:40 ` Mark Brown
2015-07-28 22:09 ` Tim Bird
2015-07-28 23:07 ` Bjorn Andersson
2015-07-31 16:18 ` Rob Herring
2015-07-31 16:56 ` Bjorn Andersson
2015-08-11 9:34 ` Johannes Berg
2015-07-31 17:25 ` Tim Bird
2015-08-03 15:29 ` John W. Linville
2015-08-03 7:42 ` Linus Walleij
2015-08-03 21:34 ` Rob Herring
2015-08-03 22:36 ` Marcel Holtmann
2015-08-05 8:40 ` Linus Walleij
2015-08-05 8:46 ` Linus Walleij
2015-08-05 9:11 ` Samuel Ortiz
2015-08-05 11:54 ` Pavel Machek
2015-08-05 9:09 ` Samuel Ortiz
2015-08-05 17:19 ` Marcel Holtmann [this message]
2015-08-05 16:02 ` Rob Herring
2015-08-05 17:00 ` Marcel Holtmann
2015-08-07 12:40 ` Linus Walleij
2015-07-29 0:45 ` Krzysztof Kozlowski
2015-07-29 6:12 ` Laurent Pinchart
2015-07-29 7:40 ` Pavel Machek
2015-08-25 18:59 ` Tim Bird
2015-08-26 1:22 ` Krzysztof Kozlowski
2015-08-26 4:25 ` Sudip Mukherjee
2015-08-26 4:52 ` Krzysztof Kozlowski
2015-08-26 5:30 ` Laurent Pinchart
2015-08-26 5:33 ` Krzysztof Kozlowski
2015-08-26 6:15 ` Josh Triplett
2015-08-26 7:23 ` Heiko Stuebner
2015-08-26 8:05 ` Krzysztof Kozlowski
2015-08-28 8:20 ` Nicolas Ferre
2015-08-26 11:33 ` Mark Brown
2015-08-26 12:56 ` Jason Cooper
2015-08-26 13:35 ` Geert Uytterhoeven
2015-08-26 13:58 ` Sudip Mukherjee
2015-08-26 14:51 ` Jason Cooper
2015-08-26 17:13 ` Sudip Mukherjee
2015-08-26 20:09 ` Greg Kroah-Hartman
2015-08-28 7:44 ` Pavel Machek
2015-08-28 8:42 ` Heiko Stuebner
2015-08-29 15:47 ` Sudip Mukherjee
2015-07-29 8:18 ` Heiko Stübner
2015-07-29 0:56 ` Rafael J. Wysocki
2015-07-29 6:43 ` Daniel Vetter
2015-07-29 17:42 ` Tim Bird
2015-07-29 7:14 ` Bintian
2015-07-29 18:07 ` Tim Bird
2015-07-31 1:50 ` Bintian
2015-07-23 20:29 ` Pavel Machek
2015-07-23 20:34 ` Pavel Machek
2015-07-24 4:34 ` NeilBrown
2015-07-24 6:00 ` Tony Lindgren
2015-07-24 22:26 ` Rafael J. Wysocki
2015-07-28 22:03 ` NeilBrown
2015-07-29 0:51 ` Rafael J. Wysocki
2015-07-29 23:23 ` Rafael J. Wysocki
2015-07-29 23:59 ` NeilBrown
2015-07-30 0:57 ` Rafael J. Wysocki
2015-07-31 17:55 ` Mark Brown
2015-08-01 0:08 ` Rafael J. Wysocki
2015-07-23 21:00 ` josh
2015-07-23 21:29 ` Pavel Machek
2015-07-29 13:32 ` Mark Brown
2015-07-31 12:22 ` Pavel Machek
2015-07-31 17:52 ` Mark Brown
2015-07-31 22:03 ` Pavel Machek
2015-08-01 10:55 ` Mark Brown
2015-08-01 19:03 ` Pavel Machek
2015-08-04 17:17 ` Mark Brown
2015-08-03 5:33 ` Tony Lindgren
2015-07-23 13:23 ` Krzysztof Kozlowski
2015-07-23 21:56 ` Pavel Machek
2015-07-24 1:37 ` Krzysztof Kozlowski
2015-07-24 4:40 ` Kyungmin Park
2015-07-23 14:48 ` Shuah Khan
2015-07-23 15:08 ` Heiko Stübner
2015-08-04 19:39 ` Pavel Machek
2015-08-05 7:05 ` Bintian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8DD2E411-D4F7-45C0-8BBA-9E418E9EB084@holtmann.org \
--to=marcel@holtmann.org \
--cc=bjorn.andersson@sonymobile.com \
--cc=gregkh@linuxfoundation.org \
--cc=john.stultz@linaro.org \
--cc=ksummit-discuss@lists.linuxfoundation.org \
--cc=kyungmin.park@samsung.com \
--cc=linus.walleij@linaro.org \
--cc=pavel@ucw.cz \
--cc=riverful.kim@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox