[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <YLfL9Q+4860uqS8f@gerhold.net>
Date: Wed, 2 Jun 2021 20:20:37 +0200
From: Stephan Gerhold <stephan@...hold.net>
To: Loic Poulain <loic.poulain@...aro.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>
Cc: Aleksander Morgado <aleksander@...ksander.es>,
netdev@...r.kernel.org, linux-remoteproc@...r.kernel.org,
linux-arm-msm@...r.kernel.org,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Ohad Ben-Cohen <ohad@...ery.com>,
Mathieu Poirier <mathieu.poirier@...aro.org>
Subject: [RFC] Integrate RPMSG/SMD into WWAN subsystem
Hi Loic, Hi Bjorn,
I've been thinking about creating some sort of "RPMSG" driver for the
new WWAN subsystem; this would be used as a QMI/AT channel to the
integrated modem on some older Qualcomm SoCs such as MSM8916 and MSM8974.
It's easy to confuse all the different approaches that Qualcomm has to
talk to their modems, so I will first try to briefly give an overview
about those that I'm familiar with:
---
There is USB and MHI that are mainly used to talk to "external" modems.
For the integrated modems in many Qualcomm SoCs there is typically
a separate control and data path. They are not really related to each
other (e.g. currently no common parent device in sysfs).
For the data path (network interface) there is "IPA" (drivers/net/ipa)
on newer SoCs or "BAM-DMUX" on some older SoCs (e.g. MSM8916/MSM8974).
I have a driver for BAM-DMUX that I hope to finish up and submit soon.
The connection is set up via QMI. The messages are either sent via
a shared RPMSG channel (net/qrtr sockets in Linux) or via standalone
SMD/RPMSG channels (e.g. "DATA5_CNTL" for QMI and "DATA1" for AT).
This gives a lot of possible combinations like BAM-DMUX+RPMSG
(MSM8916, MSM8974), or IPA+QRTR (SDM845) but also other funny
combinations like IPA+RPMSG (MSM8994) or BAM-DMUX+QRTR (MSM8937).
Simply put, supporting all these in userspace like ModemManager
is a mess (Aleksander can probably confirm).
It would be nice if this could be simplified through the WWAN subsystem.
It's not clear to me if or how well QRTR sockets can be mapped to a char
device for the WWAN subsystem, so for now I'm trying to focus on the
standalone RPMSG approach (for MSM8916, MSM8974, ...).
---
Currently ModemManager uses the RPMSG channels via the rpmsg-chardev
(drivers/rpmsg/rpmsg_char.c). It wasn't my idea to use it like this,
I just took that over from someone else. Realistically speaking, the
current approach isn't too different from the UCI "backdoor interface"
approach that was rejected for MHI...
I kind of expected that I can just trivially copy some code from
rpmsg_char.c into a WWAN driver since they both end up as a simple char
device. But it looks like the abstractions in wwan_core are kind of
getting in the way here... As far as I can tell, they don't really fit
together with the RPMSG interface.
For example there is rpmsg_send(...) (blocking) and rpmsg_trysend(...)
(non-blocking) and even a rpmsg_poll(...) [1] but I don't see a way to
get notified when the TX queue is full or no longer full so I can call
wwan_port_txon/off().
Any suggestions or other thoughts?
Thanks in advance!
Stephan
[1]: https://elixir.bootlin.com/linux/latest/source/drivers/rpmsg/rpmsg_core.c#L151
Powered by blists - more mailing lists